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

MatDuplicate

Duplicates a matrix including the non-zero structure.

Synopsis

#include "petscmat.h" 
PetscErrorCode MatDuplicate(Mat mat,MatDuplicateOption op,Mat *M)
Collective on Mat

Input Parameters

mat - the matrix
op - One of MAT_DO_NOT_COPY_VALUES, MAT_COPY_VALUES, or MAT_SHARE_NONZERO_PATTERN. See the manual page for MatDuplicateOption for an explanation of these options.

Output Parameter

M -pointer to place new matrix

Notes

You cannot change the nonzero pattern for the parent or child matrix if you use MAT_SHARE_NONZERO_PATTERN.

See Also

MatCopy(), MatConvert(), MatDuplicateOption

Level

intermediate

Location

src/mat/interface/matrix.c

Examples

src/mat/examples/tutorials/ex9.c.html
src/ksp/ksp/examples/tutorials/ex5.c.html
src/ksp/ksp/examples/tutorials/ex42.c.html
src/ksp/ksp/examples/tutorials/ex58.c.html
src/ts/examples/tutorials/ex3.c.html
src/ts/examples/tutorials/ex50.c.html
src/tao/unconstrained/examples/tutorials/spectraladjointassimilation.c.html
src/tao/pde_constrained/examples/tutorials/elliptic.c.html
src/tao/pde_constrained/examples/tutorials/parabolic.c.html
src/tao/pde_constrained/examples/tutorials/hyperbolic.c.html

Implementations

MatDuplicate_MPIAIJ in src/mat/impls/aij/mpi/mpiaij.c
MatDuplicate_MPIAIJ_MatMatMult in src/mat/impls/aij/mpi/mpimatmatmult.c
MatDuplicate_MPIAIJ_MatPtAP in src/mat/impls/aij/mpi/mpiptap.c
MatDuplicate_SeqAIJ in src/mat/impls/aij/seq/aij.c
MatDuplicate_SeqAIJMKL in src/mat/impls/aij/seq/aijmkl/aijmkl.c
MatDuplicate_SeqAIJPERM in src/mat/impls/aij/seq/aijperm/aijperm.c
MatDuplicate_SeqAIJSELL in src/mat/impls/aij/seq/aijsell/aijsell.c
MatDuplicate_AIJCRL in src/mat/impls/aij/seq/crl/crl.c
MatDuplicate_SeqAIJ_Inode in src/mat/impls/aij/seq/inode.c
MatDuplicate_SeqAIJCUSPARSE in src/mat/impls/aij/seq/seqcusparse/aijcusparse.cu
MatDuplicate_SeqAIJViennaCL in src/mat/impls/aij/seq/seqviennacl/aijviennacl.cxx
MatDuplicate_MPIBAIJ in src/mat/impls/baij/mpi/mpibaij.c
MatDuplicate_SeqBAIJ in src/mat/impls/baij/seq/baij.c
MatDuplicate_SeqBAIJMKL in src/mat/impls/baij/seq/baijmkl/baijmkl.c
MatDuplicate_MPIDense in src/mat/impls/dense/mpi/mpidense.c
MatDuplicate_SeqDense in src/mat/impls/dense/seq/dense.c
MatDuplicate_Elemental in src/mat/impls/elemental/matelem.cxx
MatDuplicate_IS in src/mat/impls/is/matis.c
MatDuplicate_Nest in src/mat/impls/nest/matnest.c
MatDuplicate_MPISBAIJ in src/mat/impls/sbaij/mpi/mpisbaij.c
MatDuplicate_SeqSBAIJ in src/mat/impls/sbaij/seq/sbaij.c
MatDuplicate_MPISELL in src/mat/impls/sell/mpi/mpisell.c
MatDuplicate_SeqSELL in src/mat/impls/sell/seq/sell.c
MatDuplicate_Shell in src/mat/impls/shell/shell.c
MatDuplicate_HT in src/mat/impls/transpose/htransm.c
MatDuplicate_Transpose in src/mat/impls/transpose/transm.c

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