:orphan:
# MatProductSetAlgorithm
Requests a particular algorithm for a matrix-matrix product operation that will perform to compute the given matrix 
## Synopsis
```
#include "petscmat.h" 
PetscErrorCode MatProductSetAlgorithm(Mat mat, MatProductAlgorithm alg)
```
Collective


## Input Parameters

- ***mat -*** the matrix whose values are computed via a matrix-matrix product operation
- ***alg -*** particular implementation algorithm of the matrix product, e.g., `MATPRODUCTALGORITHMDEFAULT`.



## Options Database Key

- ***-mat_product_algorithm <algorithm> -*** Sets the algorithm, see `MatProductAlgorithm`





## See Also
 [](ch_matrices), `MatProduct`, `Mat`, `MatProductClear()`, `MatProductSetType()`, `MatProductSetFill()`, `MatProductCreate()`, `MatProductAlgorithm`, `MatProductType`

## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/interface/matproduct.c.html#MatProductSetAlgorithm">src/mat/interface/matproduct.c</A>

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/tao/pde_constrained/tutorials/parabolic.c.html">src/tao/pde_constrained/tutorials/parabolic.c</A><BR>


---
[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)  
