MatSetUp#

Sets up the internal matrix data structures for later use.

Synopsis#

#include "petscmat.h"
PetscErrorCode MatSetUp(Mat A)


Collective on A

Input Parameters#

• A - the matrix

Notes#

If the user has not set preallocation for this matrix then a default preallocation that is likely to be inefficient is used.

If a suitable preallocation routine is used, this function does not need to be called.

See the Performance chapter of the PETSc users manual for how to preallocate matrices

This routine is called internally by other matrix functions when needed so rarely needs to be called by users

Mat, MatMult(), MatCreate(), MatDestroy()

intermediate

Location#

src/mat/interface/matrix.c

Edit on GitLab