:orphan: # MatProductReplaceMats Replace the input matrices for the matrix-matrix product operation inside the computed matrix ## Synopsis ``` #include "petscmat.h" PetscErrorCode MatProductReplaceMats(Mat A, Mat B, Mat C, Mat D) ``` Collective ## Input Parameters - ***A -*** the matrix or `NULL` if not being replaced - ***B -*** the matrix or `NULL` if not being replaced - ***C -*** the matrix or `NULL` if not being replaced - ***D -*** the matrix whose values are computed via a matrix-matrix product operation ## Note To reuse the symbolic phase, the input matrices must have exactly the same data structure as the replaced one. If the type of any of the input matrices is different than what was previously used, or their symmetry flag changed but the symbolic phase took advantage of their symmetry, the product is cleared and `MatProductSetFromOptions()` and `MatProductSymbolic()` are invoked again. ## See Also [](ch_matrices), `MatProduct`, `Mat`, `MatProductCreate()`, `MatProductSetFromOptions()`, `MatProductSymbolic().` `MatProductClear()` ## Level intermediate ## Location src/mat/interface/matproduct.c --- [Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/mat/interface/matproduct.c) [Index of all Mat routines](index.md) [Table of Contents for all manual pages](/manualpages/index.md) [Index of all manual pages](/manualpages/singleindex.md)