# MatGetRowUpperTriangular
Sets a flag to enable calls to `MatGetRow()` for matrix in `MATSBAIJ` format. You should call `MatRestoreRowUpperTriangular()` after calling` MatGetRow()` and `MatRestoreRow()` to disable the flag. 
## Synopsis
```
#include "petscmat.h" 
PetscErrorCode MatGetRowUpperTriangular(Mat mat)
```
Not Collective


## Input Parameters

- ***mat -*** the matrix





## Note
The flag is to ensure that users are aware that `MatGetRow()` only provides the upper triangular part of the row for the matrices in `MATSBAIJ` format.


## See Also
 `Mat`, `MATSBAIJ`, `MatRestoreRowUpperTriangular()`

## Level
advanced

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

## Implementations

<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/impls/sbaij/mpi/mpisbaij.c.html#MatGetRowUpperTriangular_MPISBAIJ">MatGetRowUpperTriangular_MPISBAIJ in src/mat/impls/sbaij/mpi/mpisbaij.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/impls/sbaij/seq/sbaij.c.html#MatGetRowUpperTriangular_SeqSBAIJ">MatGetRowUpperTriangular_SeqSBAIJ in src/mat/impls/sbaij/seq/sbaij.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)  
