Skip to main content
`Ctrl`+`K`

# MatCreateSubMatrixVirtual

Creates a virtual matrix `MATSUBMATRIX` that acts as a submatrix

## Synopsis

    #include "petscmat.h"
    PetscErrorCode MatCreateSubMatrixVirtual(Mat A, IS isrow, IS iscol, Mat *newmat)

Collective

## Input Parameters

- A - matrix that we will extract a submatrix of

- isrow - rows to be present in the submatrix

- iscol - columns to be present in the submatrix

## Output Parameter

- newmat - new matrix

## Note

Most will use `MatCreateSubMatrix()` which provides a more efficient representation if it is available.

## See Also

Matrices, `Mat`, `MATSUBMATRIX`, `MATLOCALREF`, `MatCreateLocalRef()`, `MatCreateSubMatrix()`, `MatSubMatrixVirtualUpdate()`

## Level

developer

## Location

src/mat/impls/submat/submat.c

Index of all Mat routines
Table of Contents for all manual pages
Index of all manual pages