petsc-3.8.4 2018-03-24
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/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