MatCreate

Creates a matrix where the type is determined from the options database. Generates a parallel MPI matrix if the communicator has more than one processor. The default matrix type is AIJ, using the routines MatCreateSeqAIJ() and MatCreateMPIAIJ().

Synopsis

int MatCreate(MPI_Comm comm,int m,int n,Mat *A)
Collective on MPI_Comm

Input Parameters

m - number of global rows
n - number of global columns
comm - MPI communicator Output Parameter:
A -the matrix

Basic Options Database Keys

These options use MatCreateSeqXXX or MatCreateMPIXXX, depending on the communicator, comm.
-mat_aij - AIJ type
-mat_baij - block AIJ type
-mat_dense - dense type
-mat_bdiag - block diagonal type

More Options Database Keys

-mat_seqaij - AIJ type, uses MatCreateSeqAIJ()
-mat_mpiaij - AIJ type, uses MatCreateMPIAIJ()
-mat_seqbdiag - block diagonal type, uses MatCreateSeqBDiag()
-mat_mpibdiag - block diagonal type, uses MatCreateMPIBDiag()
-mat_mpirowbs - rowbs type, uses MatCreateMPIRowbs()
-mat_seqdense - dense type, uses MatCreateSeqDense()
-mat_mpidense - dense type, uses MatCreateMPIDense()
-mat_seqbaij - block AIJ type, uses MatCreateSeqBAIJ()
-mat_mpibaij - block AIJ type, uses MatCreateMPIBAIJ()

Even More Options Database Keys

See the manpages for particular formats (e.g., MatCreateSeqAIJ()) for additional format-specific options.

Notes

This routine calls MatGetTypeFromOptions() to determine the matrix type.

Keywords

matrix, create

See Also

MatCreateSeqAIJ((), MatCreateMPIAIJ(),
MatCreateSeqBDiag(),MatCreateMPIBDiag(), MatCreateSeqDense(), MatCreateMPIDense(), MatCreateMPIRowbs(), MatCreateSeqBAIJ(), MatCreateMPIBAIJ() MatConvert(), MatGetTypeFromOptions()

Location: src/mat/utils/gcreate.c
Matrix Index
Table of Contents