petsc-3.9.4 2018-09-11
MatMatMultSymbolic
Performs construction, preallocation, and computes the ij structure of the matrix-matrix product C=A*B. Call this routine before calling MatMatMultNumeric().
Synopsis
#include "petscmat.h"
PetscErrorCode MatMatMultSymbolic(Mat A,Mat B,PetscReal fill,Mat *C)
Neighbor-wise Collective on Mat
Input Parameters
| A | - the left matrix
|
| B | - the right matrix
|
| fill | - expected fill as ratio of nnz(C)/(nnz(A) + nnz(B)), use PETSC_DEFAULT if you do not have a good estimate,
if C is a dense matrix this is irrelevent
|
Output Parameters
C -the product matrix
Notes
Unless scall is MAT_REUSE_MATRIX C will be created.
To determine the correct fill value, run with -info and search for the string "Fill ratio" to see the value
actually needed.
This routine is currently implemented for
- pairs of AIJ matrices and classes which inherit from AIJ, C will be of type AIJ
- pairs of AIJ (A) and Dense (B) matrix, C will be of type Dense.
- pairs of Dense (A) and AIJ (B) matrix, C will be of type Dense.
Developers Note: There are ways to estimate the number of nonzeros in the resulting product, see for example, http://arxiv.org/abs/1006.4173
We should incorporate them into PETSc.
See Also
MatMatMult(), MatMatMultNumeric()
Level
intermediate
Location
src/mat/interface/matrix.c
Examples
src/tao/pde_constrained/examples/tutorials/elliptic.c.html
src/tao/pde_constrained/examples/tutorials/parabolic.c.html
Implementations
MatMatMultSymbolic_MPIDense_MPIAIJ in src/mat/impls/aij/mpi/mpiaij.c
MatMatMultSymbolic_MPIAIJ_MPIAIJ_nonscalable in src/mat/impls/aij/mpi/mpimatmatmult.c
MatMatMultSymbolic_MPIAIJ_MPIDense in src/mat/impls/aij/mpi/mpimatmatmult.c
MatMatMultSymbolic_MPIAIJ_MPIAIJ in src/mat/impls/aij/mpi/mpimatmatmult.c
MatMatMultSymbolic_SeqDense_SeqAIJ in src/mat/impls/aij/seq/aij.c
MatMatMultSymbolic_SeqAIJ_SeqAIJ_LLCondensed in src/mat/impls/aij/seq/matmatmult.c
MatMatMultSymbolic_SeqAIJ_SeqAIJ_Scalable_fast in src/mat/impls/aij/seq/matmatmult.c
MatMatMultSymbolic_SeqAIJ_SeqAIJ_Scalable in src/mat/impls/aij/seq/matmatmult.c
MatMatMultSymbolic_SeqAIJ_SeqAIJ_Heap in src/mat/impls/aij/seq/matmatmult.c
MatMatMultSymbolic_SeqAIJ_SeqAIJ_BTHeap in src/mat/impls/aij/seq/matmatmult.c
MatMatMultSymbolic_SeqAIJ_SeqAIJ in src/mat/impls/aij/seq/matmatmult.c
MatMatMultSymbolic_SeqAIJ_SeqDense in src/mat/impls/aij/seq/matmatmult.c
MatMatMultSymbolic_MPIDense_MPIDense in src/mat/impls/dense/mpi/mpidense.c
MatMatMultSymbolic_SeqDense_SeqDense in src/mat/impls/dense/seq/dense.c
MatMatMultSymbolic_Elemental in src/mat/impls/elemental/matelem.cxx
MatMatMultSymbolic_AIJ_AIJ_wHYPRE in src/mat/impls/hypre/mhypre.c
Index of all Mat routines
Table of Contents for all manual pages
Index of all manual pages