MatScale#

Scales all elements of a matrix by a given number.

Synopsis#

#include "petscmat.h" 
PetscErrorCode MatScale(Mat mat, PetscScalar a)

Logically Collective

Input Parameters#

  • mat - the matrix to be scaled

  • a - the scaling value

Output Parameter#

  • mat - the scaled matrix

See Also#

Mat, MatDiagonalScale()

Level#

intermediate

Location#

src/mat/interface/matrix.c

Examples#

src/mat/tutorials/ex8.c.html
src/ksp/ksp/tutorials/ex56.c.html
src/ksp/ksp/tutorials/ex59.c.html
src/snes/tutorials/ex16.c.html
src/snes/tutorials/ex70.c.html
src/ts/tutorials/ex3.c.html
src/ts/tutorials/ex50.c.html
src/tao/unconstrained/tutorials/burgers_spectral.c.html
src/tao/unconstrained/tutorials/eptorsion2.c.html
src/tao/constrained/tutorials/tomographyADMM.c.html
src/tao/pde_constrained/tutorials/elliptic.c.html

Implementations#

MatScale_MPIAIJ in src/mat/impls/aij/mpi/mpiaij.c
MatScale_SeqAIJ in src/mat/impls/aij/seq/aij.c
MatScale_SeqAIJKokkos in src/mat/impls/aij/seq/kokkos/aijkok.kokkos.cxx
MatScale_SeqAIJCUSPARSE in src/mat/impls/aij/seq/seqcusparse/aijcusparse.cu
MatScale_SeqAIJHIPSPARSE in src/mat/impls/aij/seq/seqhipsparse/aijhipsparse.hip.c
MatScale_MPIBAIJ in src/mat/impls/baij/mpi/mpibaij.c
MatScale_SeqBAIJ in src/mat/impls/baij/seq/baij2.c
MatScale_SeqBAIJMKL in src/mat/impls/baij/seq/baijmkl/baijmkl.c
MatScale_ConstantDiagonal in src/mat/impls/cdiagonal/cdiagonal.c
MatScale_Composite in src/mat/impls/composite/mcomposite.c
MatScale_MPIDense in src/mat/impls/dense/mpi/mmdense.c
MatScale_SeqDenseCUDA in src/mat/impls/dense/seq/cuda/densecuda.cu
MatScale_SeqDense in src/mat/impls/dense/seq/dense.c
MatScale_SeqDenseHIP in src/mat/impls/dense/seq/hip/densehip.hip.c
MatScale_Elemental in src/mat/impls/elemental/matelem.cxx
MatScale_H2OPUS in src/mat/impls/h2opus/cuda/math2opus.cu
MatScale_Htool in src/mat/impls/htool/htool.cxx
MatScale_HYPRE in src/mat/impls/hypre/mhypre.c
MatScale_IS in src/mat/impls/is/matis.c
MatScale_Nest in src/mat/impls/nest/matnest.c
MatScale_Normal in src/mat/impls/normal/normm.c
MatScale_NormalHermitian in src/mat/impls/normal/normmh.c
MatScale_MPISBAIJ in src/mat/impls/sbaij/mpi/mpisbaij.c
MatScale_SeqSBAIJ in src/mat/impls/sbaij/seq/sbaij2.c
MatScale_ScaLAPACK in src/mat/impls/scalapack/matscalapack.c
MatScale_MPISELL in src/mat/impls/sell/mpi/mpisell.c
MatScale_SeqSELL in src/mat/impls/sell/seq/sell.c
MatScale_Shell in src/mat/impls/shell/shell.c
MatScale_SubMatrix in src/mat/impls/submat/submat.c


Edit on GitLab

Index of all Mat routines
Table of Contents for all manual pages
Index of all manual pages