petsc-3.14.6 2021-03-30
Report Typos and Errors

MatSetType

Builds matrix object for a particular matrix type

Synopsis

#include "petscmat.h" 
PetscErrorCode  MatSetType(Mat mat, MatType matype)
Collective on Mat

Input Parameters

mat - the matrix object
matype - matrix type

Options Database Key

-mat_type <method> - Sets the type; use -help for a list of available methods (for instance, seqaij)

Notes

See "${PETSC_DIR}/include/petscmat.h" for available methods

See Also

PCSetType(), VecSetType(), MatCreate(), MatType, Mat

Level

intermediate

Location

src/mat/interface/matreg.c

Examples

src/mat/tutorials/ex1.c.html
src/mat/tutorials/ex2.c.html
src/mat/tutorials/ex8.c.html
src/mat/tutorials/ex10.c.html
src/mat/tutorials/ex12.c.html
src/ksp/ksp/tutorials/ex27.c.html
src/ksp/ksp/tutorials/ex54.c.html
src/ksp/ksp/tutorials/ex55.c.html
src/ksp/ksp/tutorials/ex56.c.html
src/ksp/ksp/tutorials/ex59.c.html
src/ksp/ksp/tutorials/ex73.c.html

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