# MatIsTranspose
Test whether a matrix is another one's transpose, or its own, in which case it tests symmetry. 
## Synopsis
```
#include "petscmat.h" 
PetscErrorCode MatIsTranspose(Mat A, Mat B, PetscReal tol, PetscBool *flg)
```
Collective


## Input Parameters

- ***A -*** the matrix to test
- ***B -*** the matrix to test against, this can equal the first parameter



## Output Parameters

- ***flg -*** the result





## Notes
Only available for `MATAIJ` matrices.

The sequential algorithm has a running time of the order of the number of nonzeros; the parallel
test involves parallel copies of the block-offdiagonal parts of the matrix.


## See Also
 `Mat`, `MatTranspose()`, `MatIsSymmetric()`, `MatIsHermitian()`

## Level
intermediate

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

## Implementations

<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/impls/aij/mpi/mpiaij.c.html#MatIsTranspose_MPIAIJ">MatIsTranspose_MPIAIJ in src/mat/impls/aij/mpi/mpiaij.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/impls/aij/seq/aij.c.html#MatIsTranspose_SeqAIJ">MatIsTranspose_SeqAIJ in src/mat/impls/aij/seq/aij.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/impls/baij/seq/baij.c.html#MatIsTranspose_SeqBAIJ">MatIsTranspose_SeqBAIJ in src/mat/impls/baij/seq/baij.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/impls/sell/mpi/mpisell.c.html#MatIsTranspose_MPISELL">MatIsTranspose_MPISELL in src/mat/impls/sell/mpi/mpisell.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)  
