# MatComputeOperator
Computes the explicit matrix 
## Synopsis
```
#include "petscmat.h"  
PetscErrorCode MatComputeOperator(Mat inmat, MatType mattype, Mat *mat)
```
Collective


## Input Parameters

- ***inmat -*** the matrix
- ***mattype -*** the matrix type for the explicit operator



## Output Parameter

- ***mat -*** the explicit  operator



## Note
This computation is done by applying the operators to columns of the identity matrix.
This routine is costly in general, and is recommended for use only with relatively small systems.
Currently, this routine uses a dense matrix format if mattype == NULL.




## Level
advanced

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/utils/axpy.c.html#MatComputeOperator">src/mat/utils/axpy.c</A>

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/tutorials/ex21.c.html">src/ksp/ksp/tutorials/ex21.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/tutorials/ex34.c.html">src/ksp/ksp/tutorials/ex34.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/tutorials/ex4.c.html">src/ksp/ksp/tutorials/ex4.c.html</A><BR>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/mat/utils/axpy.c)


[Index of all Mat routines](index.md)  
[Table of Contents for all manual pages](/docs/manualpages/index.md)  
[Index of all manual pages](/docs/manualpages/singleindex.md)  
