MatSetUp#
Sets up the internal matrix data structures for later use by the matrix
Synopsis#
#include "petscmat.h"
PetscErrorCode MatSetUp(Mat A)
Collective
Input Parameter#
A - the matrix
Notes#
If no preallocation has been provided for a MATAIJ, MATBAIJ, or MATSBAIJ matrix, MatSetUp() makes it record the
values given to MatSetValues() in a hash table, and the first assembly determines the nonzero pattern from it. Providing
preallocation instead, for example with MatXAIJSetPreallocation() or MatSetPreallocationCOO(), disables hash-table mode.
This routine is called internally by other Mat functions when needed so rarely needs to be called by users
See Also#
Matrices, Mat, MatMult(), MatCreate(), MatDestroy(), MatXAIJSetPreallocation()
Level#
advanced
Location#
Examples#
src/mat/tutorials/ex4.c
src/mat/tutorials/ex4f.F90
src/mat/tutorials/ex8.c
src/mat/tests/ex1.c
src/mat/tests/ex10.c
src/mat/tests/ex101.c
src/mat/tests/ex102.c
src/mat/tests/ex103.c
src/mat/tests/ex104.c
src/mat/tests/ex107.c
Implementations#
MatSetUp_HYPREStruct() in src/dm/impls/da/hypre/mhyp.c
MatSetUp_HYPRESStruct() in src/dm/impls/da/hypre/mhyp.c
MatSetUp_MPIDense() in src/mat/impls/dense/mpi/mpidense.c
MatSetUp_SeqDense() in src/mat/impls/dense/seq/dense.c
MatSetUp_Diagonal() in src/mat/impls/diagonal/diagonal.c
MatSetUp_Elemental() in src/mat/impls/elemental/matelem.cxx
MatSetUp_HYPRE() in src/mat/impls/hypre/mhypre.c
MatSetUp_IS() in src/mat/impls/is/matis.c
MatSetUp_KAIJ() in src/mat/impls/kaij/kaij.c
MatSetUp_LRC() in src/mat/impls/lrc/lrc.c
MatSetUp_MAIJ() in src/mat/impls/maij/maij.c
MatSetUp_Preallocator() in src/mat/impls/preallocator/matpreallocator.c
MatSetUp_ScaLAPACK() in src/mat/impls/scalapack/matscalapack.c
MatSetUp_MPISELL() in src/mat/impls/sell/mpi/mpisell.c
MatSetUp_SeqSELL() in src/mat/impls/sell/seq/sell.c
Index of all Mat routines
Table of Contents for all manual pages
Index of all manual pages