MatProductCreate#

create a matrix to hold the result of a matrix-matrix product operation

Synopsis#

#include "petscmat.h" 
PetscErrorCode MatProductCreate(Mat A, Mat B, Mat C, Mat *D)

Collective

Input Parameters#

  • A - the first matrix

  • B - the second matrix

  • C - the third matrix (or NULL)

Output Parameter#

  • D - the matrix whose values are to be computed via a matrix-matrix product operation

Example#

Notes#

Use MatProductCreateWithMat() if the matrix you wish computed, the D matrix, already exists.

The information computed during the symbolic stage can be reused for new numerical computations with the same non-zero structure

Developer Notes#

It is undocumented what happens if the nonzero structure of the input matrices changes. Is the symbolic stage automatically redone? Does it crash? Is there error checking for it?

See Also#

Matrices, MatProduct, Mat, MatProductCreateWithMat(), MatProductSetType(), MatProductSetAlgorithm(), MatProductClear()

Level#

intermediate

Location#

src/mat/interface/matproduct.c

Examples#

src/tao/pde_constrained/tutorials/parabolic.c


Index of all Mat routines
Table of Contents for all manual pages
Index of all manual pages