petsc-3.10.5 2019-03-28
Report Typos and Errors

# MatZeroEntries

Zeros all entries of a matrix. For sparse matrices this routine retains the old nonzero structure.

### Synopsis

    #include "petscmat.h"
    PetscErrorCode MatZeroEntries(Mat mat)

Logically Collective on Mat

### Input Parameters

mat -the matrix

### Notes

If the matrix was not preallocated then a default, likely poor preallocation will be set in the matrix, so this should be called after the preallocation phase. See the Performance chapter of the users manual for information on preallocating matrices.

### See Also

MatZeroRows()

### Level

intermediate

### Location

src/mat/interface/matrix.c

### Examples

src/ksp/ksp/examples/tutorials/ex5.c.html
src/ksp/ksp/examples/tutorials/ex9.c.html
src/ksp/ksp/examples/tutorials/ex42.c.html
src/ksp/ksp/examples/tutorials/ex43.c.html
src/ksp/ksp/examples/tutorials/ex49.c.html
src/ksp/ksp/examples/tutorials/ex67.c.html
src/ksp/ksp/examples/tutorials/ex70.c.html
src/snes/examples/tutorials/ex48.c.html
src/snes/examples/tutorials/ex58.c.html
src/snes/examples/tutorials/ex78.c.html
src/ts/examples/tutorials/ex10.c.html

### Implementations

MatZeroEntries_HYPREStruct_3d in src/dm/impls/da/hypre/mhyp.c
MatZeroEntries_HYPREStruct in src/dm/impls/da/hypre/mhyp.c
MatZeroEntries_HYPRESStruct_3d in src/dm/impls/da/hypre/mhyp.c
MatZeroEntries_HYPRESStruct in src/dm/impls/da/hypre/mhyp.c
MatZeroEntries_MPIAIJ in src/mat/impls/aij/mpi/mpiaij.c
MatZeroEntries_SeqAIJ in src/mat/impls/aij/seq/aij.c
MatZeroEntries_MPIBAIJ in src/mat/impls/baij/mpi/mpibaij.c
MatZeroEntries_SeqBAIJ in src/mat/impls/baij/seq/baij2.c
MatZeroEntries_MPIDense in src/mat/impls/dense/mpi/mpidense.c
MatZeroEntries_SeqDense in src/mat/impls/dense/seq/dense.c
MatZeroEntries_Elemental in src/mat/impls/elemental/matelem.cxx
MatZeroEntries_HYPRE_CSRMatrix in src/mat/impls/hypre/mhypre.c
MatZeroEntries_HYPRE in src/mat/impls/hypre/mhypre.c
MatZeroEntries_IS in src/mat/impls/is/matis.c
MatZeroEntries_Nest in src/mat/impls/nest/matnest.c
MatZeroEntries_MPISBAIJ in src/mat/impls/sbaij/mpi/mpisbaij.c
MatZeroEntries_SeqSBAIJ in src/mat/impls/sbaij/seq/sbaij2.c
MatZeroEntries_MPISELL in src/mat/impls/sell/mpi/mpisell.c
MatZeroEntries_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