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

Input Parameter#

  • mat - the matrix

Note#

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. For matrices with the MAT_STRUCTURE_ONLY option set to true, this routine leaves the structure and object state unchanged because no numerical values are stored.

See Also#

Matrices, Mat, MatZeroRows(), MatZeroRowsColumns()

Level#

intermediate

Location#

src/mat/interface/matrix.c

Examples#

src/mat/tutorials/ex18.c
src/mat/tests/ex252.c
src/mat/tests/ex4.c
src/mat/tests/ex5.c
src/mat/impls/diagonal/tests/ex1.c
src/mat/tests/ex109.c
src/mat/tests/ex129.c
src/mat/tests/ex139.c
src/mat/tests/ex16.c
src/mat/tests/ex19.c

Implementations#

MatZeroEntries_HYPREStruct() 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_MPIAIJCUSPARSE() in src/mat/impls/aij/mpi/mpicusparse/mpiaijcusparse.cu
MatZeroEntries_MPIAIJHIPSPARSE() in src/mat/impls/aij/mpi/mpihipsparse/mpiaijhipsparse.hip.cxx
MatZeroEntries_SeqAIJ() in src/mat/impls/aij/seq/aij.c
MatZeroEntries_SeqAIJKokkos() in src/mat/impls/aij/seq/kokkos/aijkok.kokkos.cxx
MatZeroEntries_SeqAIJCUSPARSE() in src/mat/impls/aij/seq/seqcusparse/aijcusparse.cu
MatZeroEntries_SeqAIJHIPSPARSE() in src/mat/impls/aij/seq/seqhipsparse/aijhipsparse.hip.cxx
MatZeroEntries_MPIBAIJ() in src/mat/impls/baij/mpi/mpibaij.c
MatZeroEntries_SeqBAIJ() in src/mat/impls/baij/seq/baij2.c
MatZeroEntries_ConstantDiagonal() in src/mat/impls/cdiagonal/cdiagonal.c
MatZeroEntries_MPIDense() in src/mat/impls/dense/mpi/mpidense.c
MatZeroEntries_SeqDense() in src/mat/impls/dense/seq/dense.c
MatZeroEntries_Diagonal() in src/mat/impls/diagonal/diagonal.c
MatZeroEntries_Elemental() in src/mat/impls/elemental/matelem.cxx
MatZeroEntries_H2OPUS() in src/mat/impls/h2opus/cuda/math2opus.cu
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_ScaLAPACK() in src/mat/impls/scalapack/matscalapack.c
MatZeroEntries_MPISELL() in src/mat/impls/sell/mpi/mpisell.c
MatZeroEntries_SeqSELL() in src/mat/impls/sell/seq/sell.c
MatZeroEntries_SeqSELLCUDA() in src/mat/impls/sell/seq/seqcuda/sellcuda.cu
MatZeroEntries_SeqSELLHIP() in src/mat/impls/sell/seq/seqhip/sellhip.hip.cxx


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