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_DECIDEto have calculated if- Mis given)
- n - number of local columns (or - PETSC_DECIDEto have calculated if- Nis given)
- M - number of global rows (or - PETSC_DECIDEto have calculated if- mis given)
- N - number of global columns (or - PETSC_DECIDEto have calculated if- nis 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