MatCreateDenseFromVecType#
Create a matrix that matches the type of a Vec.
Synopsis#
PetscErrorCode MatCreateDenseFromVecType(MPI_Comm comm, VecType vtype, PetscInt m, PetscInt n, PetscInt M, PetscInt N, PetscInt lda, PetscScalar *data, Mat *A)
Collective
Input Parameters#
comm - the communicator
vtype - the vector type
m - number of local rows (or
PETSC_DECIDEto have calculated ifMis given)n - number of local columns (or
PETSC_DECIDEto have calculated ifNis given)M - number of global rows (or
PETSC_DECIDEto have calculated ifmis given)N - number of global columns (or
PETSC_DECIDEto have calculated ifnis given)lda - optional leading dimension. Pass any non-positive number to use the default.
data - optional location of matrix data, which should have the same memory type as the vector. Pass
NULLto have PETSc take care of matrix memory allocation.
Output Parameter#
A - the dense matrix
See Also#
Matrices, Mat, MatCreateDense()', MatCreateDenseCUDA(), MatCreateDenseHIP(), PetscMemType
Level#
advanced
Location#
Examples#
Index of all Mat routines
Table of Contents for all manual pages
Index of all manual pages