# TaoMatGetSubMat
Gets a submatrix using the IS 
## Synopsis
```
#include "petsctao.h" 
PetscErrorCode TaoMatGetSubMat(Mat M, IS is, Vec v1, TaoSubsetType subset_type, Mat *Msub)
```

## Input Parameters

- ***M -*** the full matrix (n x n)
- ***is -*** the index set for the submatrix (both row and column index sets need to be the same)
- ***v1 -*** work vector of dimension n, needed for TAO_SUBSET_MASK option
- ***subset_type <TAO_SUBSET_SUBVEC,TAO_SUBSET_MASK,TAO_SUBSET_MATRIXFREE> -*** the method TAO is using for subsetting



## Output Parameter

- ***Msub -*** the submatrix




## Level
developer

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/tao/bound/utils/isutil.c.html#TaoMatGetSubMat">src/tao/bound/utils/isutil.c</A>


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


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