petsc-master 2018-07-19
Report Typos and Errors

MatCreateVecs

Get vector(s) compatible with the matrix, i.e. with the same parallel layout

Synopsis

#include "petscmat.h" 
PetscErrorCode MatCreateVecs(Mat mat,Vec *right,Vec *left)
Collective on Mat

Input Parameter

mat -the matrix

Output Parameter

right - (optional) vector that the matrix can be multiplied against
left - (optional) vector that the matrix vector product can be stored in

Notes

The blocksize of the returned vectors is determined by the row and column block sizes set with MatSetBlockSizes() or the single blocksize (same for both) set by MatSetBlockSize().

Notes

These are new vectors which are not owned by the Mat, they should be destroyed in VecDestroy() when no longer needed

See Also

MatCreate(), VecDestroy()

Level

advanced

Location

src/mat/interface/matrix.c

Examples

src/mat/examples/tutorials/ex9.c.html
src/ksp/ksp/examples/tutorials/ex42.c.html
src/ksp/ksp/examples/tutorials/ex49.c.html
src/ksp/ksp/examples/tutorials/ex54.c.html
src/ksp/ksp/examples/tutorials/ex56.c.html
src/ksp/ksp/examples/tutorials/ex63.cxx.html
src/ksp/ksp/examples/tutorials/ex64.c.html
src/ksp/ksp/examples/tutorials/ex68.c.html
src/ksp/ksp/examples/tutorials/ex69.c.html
src/ksp/ksp/examples/tutorials/ex72.c.html
src/ksp/ksp/examples/tutorials/ex100.c.html

Implementations

MatCreateVecs_MPIAIJCUSPARSE in src/mat/impls/aij/mpi/mpicusparse/mpiaijcusparse.cu
MatCreateVecs_MPIAIJViennaCL in src/mat/impls/aij/mpi/mpiviennacl/mpiaijviennacl.cxx
MatCreateVecs_SeqAIJCUSPARSE in src/mat/impls/aij/seq/seqcusparse/aijcusparse.cu
MatCreateVecs_SeqAIJViennaCL in src/mat/impls/aij/seq/seqviennacl/aijviennacl.cxx
MatCreateVecs_Nest in src/mat/impls/nest/matnest.c

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