# MatIsLinear
Check if a shell matrix A is a linear operator. 
## Synopsis
```
#include "petscmat.h"  
PetscErrorCode MatIsLinear(Mat A, PetscInt n, PetscBool *flg)
```
Collective on Mat


## Input Parameters

- ***A -*** the shell matrix
- ***n -*** number of random vectors to be tested



## Output Parameter

- ***flg -*** PETSC_TRUE if the shell matrix is linear; PETSC_FALSE otherwise.




## Level
intermediate

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

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/tutorials/ex14f.F90.html">src/ksp/ksp/tutorials/ex14f.F90.html</A><BR>


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