petsc-master 2018-01-17
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
Index of all Mat routines
Table of Contents for all manual pages
Index of all manual pages

Examples

src/mat/examples/tutorials/ex9.c.html
src/ksp/ksp/examples/tutorials/ex5.c.html
src/ksp/ksp/examples/tutorials/ex58.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_SeqAIJ in src/mat/impls/aij/seq/aij.c
MatDuplicate_SeqAIJMKL in src/mat/impls/aij/seq/aijmkl/aijmkl.c
MatDuplicate_AIJCRL in src/mat/impls/aij/seq/crl/crl.c
MatDuplicate_SeqAIJPERM in src/mat/impls/aij/seq/csrperm/csrperm.c
MatDuplicate_SeqAIJCUSPARSE in src/mat/impls/aij/seq/seqcusparse/aijcusparse.c
MatDuplicate_SeqAIJViennaCL in src/mat/impls/aij/seq/seqviennacl/aijviennacl.c
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.c
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_HT in src/mat/impls/transpose/htransm.c
MatDuplicate_Transpose in src/mat/impls/transpose/transm.c