petsc-3.7.3 2016-07-24
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
Index of all Mat routines
Table of Contents for all manual pages
Index of all manual pages

### Examples

src/ksp/ksp/examples/tutorials/ex4.c.html
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/snes/examples/tutorials/ex7.c.html
src/snes/examples/tutorials/ex48.c.html
src/snes/examples/tutorials/ex58.c.html
src/ts/examples/tutorials/ex10.c.html
src/ts/examples/tutorials/ex14.c.html