MatCreateDenseFromVecType#
Create a matrix that matches the type of a Vec.
Synopsis#
#include "petscmat.h"
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_DECIDE
to have calculated ifM
is given)n - number of local columns (or
PETSC_DECIDE
to have calculated ifN
is given)M - number of global rows (or
PETSC_DECIDE
to have calculated ifm
is given)N - number of global columns (or
PETSC_DECIDE
to have calculated ifn
is 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
NULL
to 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