MatCreateProd

Creates a matrix as the implicit product of zero or more matrices. This class is an adoption of MATCOMPOSITE type in PETSc.

Synopsis

PetscErrorCode  MatCreateProd(MPI_Comm comm,PetscInt nmat,const Mat *mats,Mat *mat)
Collective on MPI_Comm

Input Parameters

comm - MPI communicator
nmat - number of matrices to put in
mats - the matrices

Output Parameter

A -the matrix

Notes

Alternative construction
      MatCreate(comm,&mat);
      MatSetType(mat,MATPROD);
      MatCompositeAddMat(mat,mats[0]);
      ....
      MatCompositeAddMat(mat,mats[nmat-1]);
      MatAssemblyBegin(mat,MAT_FINAL_ASSEMBLY);
      MatAssemblyEnd(mat,MAT_FINAL_ASSEMBLY);

For the multiplicative form the product is mat[nmat-1]*mat[nmat-2]*....*mat[0]

See Also

MatDestroy(), MatMult(), MatCompositeAddMat(), MatCompositeMerge(), MatCompositeSetType(), MatCompositeType

Level:advanced
Location:
src/mat/impls/composite/matprod.c
Index of all Mat routines
Table of Contents for all manual pages
Index of all manual pages