xref: /petsc/doc/overview/matrix_table.md (revision 174dc0c8cee294b82b85e4dd3b331b29396264fc)
1(doc_matrix)=
2
3# Summary of Matrix Types Available In PETSc
4
5```{eval-rst}
6.. list-table::
7   :widths: auto
8   :align: center
9   :header-rows: 1
10
11   * - Format
12     - Matrix Types
13     - Constructor
14     - External Packages
15     - Details
16   * - CSR
17     - ``MATAIJ``
18     - ``MatCreateAIJ()``
19     -
20     - Compressed sparse row
21   * -
22     - ``MATAIJMKL``
23     - ``MatCreateMPIAIJMKL()``
24     - Intel oneAPI MKL
25     - OpenMP support
26   * -
27     - ``MATAIJSELL``
28     - ``MatCreateMPIAIJSELL()``
29     -
30     - SIMD acceleration
31   * -
32     - ``MATAIJPERM``
33     - ``MatCreateMPIAIJPERM()``
34     -
35     - Vectorized version
36   * -
37     - ``MATAIJCUSPARSE``
38     - ``MatCreateAIJCUSPARSE()``
39     - NVIDIA cuSPARSE library
40     - NVIDIA GPU acceleration
41   * -
42     - ``MATAIJKOKKOS``
43     - ``MatCreateAIJKokkos()``
44     - Kokkos
45     - GPU acceleration
46   * - Constant row length
47     - ``MATAIJCRL``
48     - ``MatCreateMPIAIJCRL()``
49     -
50     - Vectorized version
51   * - Multiple applications of single ``MATAIJ``
52     - ``MATMAIJ``
53     - ``MatCreateMAIJ()``
54     -
55     - Commonly used for identical interpolations on each component of a multi-component vector
56   * - Kronecker product of sparse matrix :math:`A`; :math:`I \otimes S + A \otimes T`
57     - ``MATKAIJ``
58     - ``MatCreateKAIJ()``
59     -
60     -
61   * - Sliced Ellpack
62     - ``MATSELL``
63     - ``MatCreateSELL()``
64     -
65     - SIMD and GPU acceleration
66   * - Block CSR
67     - ``MATBAIJ``
68     - ``MatCreateBAIJ()``
69     -
70     - Block compressed sparse row
71   * - Symmetric Block CSR
72     - ``MATSBAIJ``
73     - ``MatCreateSBAIJ()``
74     -
75     - Upper triangular compressed sparse row
76   * - Dense
77     - ``MATDENSE``
78     - ``MatCreateDense()``
79     -
80     - Row oriented storage
81   * -
82     - ``MATELEMENTAL``
83     - ``MatCreateElemental()``
84     - Elemental by Jack Poulson
85     - Block cyclic storage
86   * -
87     - ``MATSCALAPACK``
88     - ``MatCreateScaLAPACK()``
89     - ScaLAPACK
90     - Block cyclic storage
91   * -
92     - ``MATDENSECUDA``
93     - ``MatCreateDenseCUDA()``
94     -
95     - NVIDIA GPU Acceleration
96   * - ``MatMult()`` via finite differencing of a function
97     - ``MATMFFD``, see :any:`sec_nlmatrixfree`
98     - ``MatCreateMFFD()``, see also ``MatCreateSNESMF()``
99     -
100     - Provides only matrix-vector products
101   * - User-provided operations
102     - ``MATSHELL``, see also :any:`sec_matrixfree`
103     - ``MatCreateShell()``
104     -
105     -
106   * - Low-rank updates
107     - ``MATLMVM``, ``MATLMVMDFP``, ``MATLMVMBFGS``, ``MATLMVMSR1``, ...
108     - ``MatCreateLMVM()``
109     -
110     -  limited-memory BFGS style matrices
111   * -
112     - ``MATLRC``
113     - ``MatCreateLRC()``
114     -
115     - :math:`A + UCV^T`
116   * - FFT
117     - ``MATFFTW``
118     - ``MatCreateFFT()``
119     - FFTW
120     -
121   * -
122     - ``MATSEQCUFFT``
123     - ``MatCreateSeqCUFFT()``
124     - NVIDIA's CuFFT
125     - NVIDIA GPUs
126   * - Hierarchical
127     - ``MATHTOOL``
128     - ``MatCreateHtoolFromKernel()``
129     - Htool
130     -
131   * -
132     - ``MATH2OPUS``
133     - ``MatCreateH2OpusFromMat()``
134     - :math:`\mathcal H^2` matrices
135     -
136   * - Transpose, :math:`A^T`, virtual
137     - ``MATTRANSPOSEVIRTUAL``
138     - ``MatCreateTranspose()``
139     -
140     -
141   * - Hermitian Transpose, :math:`A^H`, virtual
142     - ``MATHERMITIANTRANSPOSEVIRTUAL``
143     - ``MatCreateHermitianTranspose()``
144     -
145     -
146   * - Normal, :math:`A^TA`, virtual
147     - ``MATNORMAL``
148     - ``MatCreateNormal()``
149     -
150     -
151   * - Hermitian Normal, :math:`A^HA`, virtual
152     - ``MATNORMALHERMITIAN``
153     - ``MatCreateNormalHermitian()``
154     -
155     -
156   * - Schur complement
157     - ``MATSCHURCOMPLEMENT``
158     - ``MatCreateSchurComplement()``, ``MatGetSchurComplement()``
159     -
160     -
161   * - Sub-matrix, virtual
162     - ``MATSUBMATRIX``
163     - ``MatCreateSubMatrixVirtual()``
164     -
165     - Provides ``MatMult()`` and similar operations
166   * -
167     - ``MATLOCALREF``
168     - ``MatCreateLocalRef()``
169     -
170     - For use in matrix assembly
171   * - Nested matrix
172     - ``MATNEST``
173     - ``MatCreateNest()``
174     -
175     -
176   * - Scatter operator
177     - ``MATSCATTER``
178     - ``MatCreateScatter()``
179     -
180     -
181   * - Centering operator
182     - ``MATCENTERING``
183     - ``MatCreateCentering()``
184     -
185     - :math:`I - \frac{1}{N}e e^T`, :math:`e=[1,\dots,1]^T`
186   * - Block matrix
187     - ``MATBLOCKMAT``
188     - ``MatCreateBlockMat()``
189     -
190     -
191
192```
193