# MatHasOperation
Determines whether the given matrix supports the particular operation. 
## Synopsis
```
#include "petscmat.h" 
PetscErrorCode MatHasOperation(Mat mat, MatOperation op, PetscBool *has)
```
Not Collective


## Input Parameters

- ***mat -*** the matrix
- ***op -*** the operation, for example, `MATOP_GET_DIAGONAL`



## Output Parameter

- ***has -*** either `PETSC_TRUE` or `PETSC_FALSE`





## Note
See the file include/petscmat.h for a complete list of matrix
operations, which all have the form MATOP_<OPERATION>, where
<OPERATION> is the name (in all capital letters) of the
user-level routine.  E.g., `MatNorm()` -> `MATOP_NORM`.


## See Also
 `MatCreateShell()`, `MatGetOperation()`, `MatSetOperation()`

## Level
advanced

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

## Implementations

<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/impls/is/matis.c.html#MatHasOperation_IS">MatHasOperation_IS in src/mat/impls/is/matis.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/impls/nest/matnest.c.html#MatHasOperation_Nest">MatHasOperation_Nest in src/mat/impls/nest/matnest.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/impls/transpose/transm.c.html#MatHasOperation_Transpose">MatHasOperation_Transpose in src/mat/impls/transpose/transm.c</A><BR>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/mat/interface/matrix.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)  
