MatMultAdd#

Computes \(v3 = v2 + A * v1\).

Synopsis#

#include "petscmat.h" 
PetscErrorCode MatMultAdd(Mat mat, Vec v1, Vec v2, Vec v3)

Neighbor-wise Collective

Input Parameters#

  • mat - the matrix

  • v1 - the vector to be multiplied by mat

  • v2 - the vector to be added to the result

Output Parameter#

  • v3 - the result

Note#

The vectors v1 and v3 cannot be the same. I.e., one cannot call MatMultAdd(A,v1,v2,v1).

See Also#

Matrices, Mat, MatMultTranspose(), MatMult(), MatMultTransposeAdd()

Level#

beginner

Location#

src/mat/interface/matrix.c

Examples#

src/snes/tutorials/ex73f90t.F90
src/mat/tutorials/ex9.c
src/ksp/ksp/tutorials/ex74.c
src/ts/tutorials/ex50.c
src/mat/tutorials/ex2.c
src/tao/unconstrained/tutorials/burgers_spectral.c
src/snes/tutorials/ex70.c

Implementations#

MatMultAdd_MPIAIJKokkos() in src/mat/impls/aij/mpi/kokkos/mpiaijkok.kokkos.cxx
MatMultAdd_MPIAIJ() in src/mat/impls/aij/mpi/mpiaij.c
MatMultAdd_MPIAIJCUSPARSE() in src/mat/impls/aij/mpi/mpicusparse/mpiaijcusparse.cu
MatMultAdd_MPIAIJHIPSPARSE() in src/mat/impls/aij/mpi/mpihipsparse/mpiaijhipsparse.hip.c
MatMultAdd_SeqAIJ() in src/mat/impls/aij/seq/aij.c
MatMultAdd_SeqAIJMKL() in src/mat/impls/aij/seq/aijmkl/aijmkl.c
MatMultAdd_SeqAIJPERM() in src/mat/impls/aij/seq/aijperm/aijperm.c
MatMultAdd_SeqAIJSELL() in src/mat/impls/aij/seq/aijsell/aijsell.c
MatMultAdd_SeqAIJKokkos() in src/mat/impls/aij/seq/kokkos/aijkok.kokkos.cxx
MatMultAdd_SeqAIJCUSPARSE() in src/mat/impls/aij/seq/seqcusparse/aijcusparse.cu
MatMultAdd_SeqAIJHIPSPARSE() in src/mat/impls/aij/seq/seqhipsparse/aijhipsparse.hip.c
MatMultAdd_SeqAIJViennaCL() in src/mat/impls/aij/seq/seqviennacl/aijviennacl.cxx
MatMultAdd_MPIBAIJ() in src/mat/impls/baij/mpi/mpibaij.c
MatMultAdd_BlockMat() in src/mat/impls/blockmat/seq/blockmat.c
MatMultAdd_ConstantDiagonal() in src/mat/impls/cdiagonal/cdiagonal.c
MatMultAdd_MPIDense() in src/mat/impls/dense/mpi/mpidense.c
MatMultAdd_SeqDense() in src/mat/impls/dense/seq/dense.c
MatMultAdd_Diagonal() in src/mat/impls/diagonal/diagonal.c
MatMultAdd_Elemental() in src/mat/impls/elemental/matelem.cxx
MatMultAdd_H2OPUS() in src/mat/impls/h2opus/cuda/math2opus.cu
MatMultAdd_Htool() in src/mat/impls/htool/htool.cxx
MatMultAdd_HYPRE() in src/mat/impls/hypre/mhypre.c
MatMultAdd_IS() in src/mat/impls/is/matis.c
MatMultAdd_SeqKAIJ() in src/mat/impls/kaij/kaij.c
MatMultAdd_MPIKAIJ() in src/mat/impls/kaij/kaij.c
MatMultAdd_Nest() in src/mat/impls/nest/matnest.c
MatMultAdd_MPISBAIJ() in src/mat/impls/sbaij/mpi/mpisbaij.c
MatMultAdd_ScaLAPACK() in src/mat/impls/scalapack/matscalapack.c
MatMultAdd_Scatter() in src/mat/impls/scatter/mscatter.c
MatMultAdd_MPISELL() in src/mat/impls/sell/mpi/mpisell.c
MatMultAdd_SeqSELL() in src/mat/impls/sell/seq/sell.c
MatMultAdd_SeqSELLCUDA() in src/mat/impls/sell/seq/seqcuda/sellcuda.cu
MatMultAdd_SeqSELLHIP() in src/mat/impls/sell/seq/seqhip/sellhip.hip.c
MatMultAdd_Shell() in src/mat/impls/shell/shell.c
MatMultAdd_SubMatrix() in src/mat/impls/submat/submat.c


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