---
title: "Accessing or Modifying Entries"
canonical: "https://docs.magma-maths.org/v2.30-1/MatricesLinearAlgebra/SparseMatrices/entries.html"
source: "https://docs.magma-maths.org/v2.30-1/MatricesLinearAlgebra/SparseMatrices/entries.md"
part: "Matrices and Linear Algebra"
chapter: "Sparse Matrices"
breadcrumbs:
  - {"title": "Magma Handbook", "source": "https://docs.magma-maths.org/v2.30-1/index.md"}
  - {"title": "Matrices and Linear Algebra", "source": "https://docs.magma-maths.org/v2.30-1/MatricesLinearAlgebra/index-matrices-linear-algebra.md"}
  - {"title": "Sparse Matrices", "source": "https://docs.magma-maths.org/v2.30-1/MatricesLinearAlgebra/SparseMatrices/index-sparse-matrices.md"}
prev: {"title": "Accessing Sparse Matrices", "source": "https://docs.magma-maths.org/v2.30-1/MatricesLinearAlgebra/SparseMatrices/access.md"}
next: {"title": "Building Block Matrices", "source": "https://docs.magma-maths.org/v2.30-1/MatricesLinearAlgebra/SparseMatrices/join.md"}
intrinsics:
  - {"name": "A", "signature": "A[i]: MtrxSprs, RngIntElt -> ModTupRngElt"}
  - {"name": "A", "signature": "A[i, j]: MtrxSprs, RngIntElt, RngIntElt -> RngElt"}
  - {"name": "A[i, j] := x", "signature": "A[i, j] := x: MtrxSprs, RngIntElt, RngIntElt, RngElt"}
  - {"name": "SetEntry", "signature": "SetEntry(~A, i, j, x): MtrxSprs, RngIntElt, RngIntElt, RngElt"}
  - {"name": "Submatrix", "signature": "Submatrix(A, i, j, p, q): MtrxSprs, RngIntElt, RngIntElt, RngIntElt, RngIntElt -> MtrxSprs"}
  - {"name": "ExtractBlock", "signature": "ExtractBlock(A, i, j, p, q): MtrxSprs, RngIntElt, RngIntElt, RngIntElt, RngIntElt -> MtrxSprs"}
  - {"name": "SubmatrixRange", "signature": "SubmatrixRange(A, i, j, r, s): MtrxSprs, RngIntElt, RngIntElt, RngIntElt, RngIntElt -> MtrxSprs"}
  - {"name": "ExtractBlockRange", "signature": "ExtractBlockRange(A, i, j, r, s): MtrxSprs, RngIntElt, RngIntElt, RngIntElt, RngIntElt -> MtrxSprs"}
  - {"name": "Submatrix", "signature": "Submatrix(A, I, J): MtrxSprs, [RngIntElt], [RngIntElt] -> MtrxSprs"}
  - {"name": "InsertBlock", "signature": "InsertBlock(A, B, i, j): MtrxSprs, MtrxSprs, RngIntElt, RngIntElt -> MtrxSprs"}
  - {"name": "InsertBlock", "signature": "InsertBlock(~A, B, i, j): MtrxSprs, MtrxSprs, RngIntElt, RngIntElt -> MtrxSprs"}
  - {"name": "RowSubmatrix", "signature": "RowSubmatrix(A, i, k): MtrxSprs, RngIntElt, RngIntElt -> MtrxSprs"}
  - {"name": "RowSubmatrix", "signature": "RowSubmatrix(A, i): MtrxSprs, RngIntElt -> MtrxSprs"}
  - {"name": "RowSubmatrixRange", "signature": "RowSubmatrixRange(A, i, j): MtrxSprs, RngIntElt, RngIntElt -> MtrxSprs"}
  - {"name": "ColumnSubmatrix", "signature": "ColumnSubmatrix(A, i, k): MtrxSprs, RngIntElt, RngIntElt -> MtrxSprs"}
  - {"name": "ColumnSubmatrix", "signature": "ColumnSubmatrix(A, i): MtrxSprs, RngIntElt -> MtrxSprs"}
  - {"name": "ColumnSubmatrixRange", "signature": "ColumnSubmatrixRange(A, i, j): MtrxSprs, RngIntElt, RngIntElt -> MtrxSprs"}
  - {"name": "SwapRows", "signature": "SwapRows(A, i, j): MtrxSprs, RngIntElt, RngIntElt -> MtrxSprs"}
  - {"name": "SwapRows", "signature": "SwapRows(~A, i, j): MtrxSprs, RngIntElt, RngIntElt"}
  - {"name": "SwapColumns", "signature": "SwapColumns(A, i, j): MtrxSprs, RngIntElt, RngIntElt -> MtrxSprs"}
  - {"name": "SwapColumns", "signature": "SwapColumns(~A, i, j): MtrxSprs, RngIntElt, RngIntElt"}
  - {"name": "ReverseRows", "signature": "ReverseRows(A): MtrxSprs -> MtrxSprs"}
  - {"name": "ReverseRows", "signature": "ReverseRows(~A): MtrxSprs"}
  - {"name": "ReverseColumns", "signature": "ReverseColumns(A): MtrxSprs -> MtrxSprs"}
  - {"name": "ReverseColumns", "signature": "ReverseColumns(~A): MtrxSprs"}
  - {"name": "AddRow", "signature": "AddRow(A, c, i, j): MtrxSprs, RngElt, RngIntElt, RngIntElt -> MtrxSprs"}
  - {"name": "AddRow", "signature": "AddRow(~A, c, i, j): MtrxSprs, RngElt, RngIntElt, RngIntElt"}
  - {"name": "AddColumn", "signature": "AddColumn(A, c, i, j): MtrxSprs, RngElt, RngIntElt, RngIntElt -> MtrxSprs"}
  - {"name": "AddColumn", "signature": "AddColumn(~A, c, i, j): MtrxSprs, RngElt, RngIntElt, RngIntElt"}
  - {"name": "MultiplyRow", "signature": "MultiplyRow(A, c, i): MtrxSprs, RngElt, RngIntElt -> MtrxSprs"}
  - {"name": "MultiplyRow", "signature": "MultiplyRow(~A, c, i): MtrxSprs, RngElt, RngIntElt"}
  - {"name": "MultiplyColumn", "signature": "MultiplyColumn(A, c, i): MtrxSprs, RngElt, RngIntElt -> MtrxSprs"}
  - {"name": "MultiplyColumn", "signature": "MultiplyColumn(~A, c, i): MtrxSprs, RngElt, RngIntElt"}
  - {"name": "RemoveRow", "signature": "RemoveRow(A, i): MtrxSprs, RngIntElt -> MtrxSprs"}
  - {"name": "RemoveRow", "signature": "RemoveRow(~A, i): MtrxSprs, RngIntElt"}
  - {"name": "RemoveColumn", "signature": "RemoveColumn(A, j): MtrxSprs, RngIntElt -> MtrxSprs"}
  - {"name": "RemoveColumn", "signature": "RemoveColumn(~A, j): MtrxSprs, RngIntElt"}
  - {"name": "RemoveRowColumn", "signature": "RemoveRowColumn(A, i, j): MtrxSprs, RngIntElt -> MtrxSprs"}
  - {"name": "RemoveRowColumn", "signature": "RemoveRowColumn(~A, i, j): MtrxSprs, RngIntElt"}
  - {"name": "RemoveZeroRows", "signature": "RemoveZeroRows(A): MtrxSprs -> MtrxSprs"}
  - {"name": "RemoveZeroRows", "signature": "RemoveZeroRows(~A): MtrxSprs"}
examples:
  - "ex-167588"
---

# Accessing or Modifying Entries

The following functions and procedures enable the user to access or set individual entries of sparse matrices.

<a id="indexed-indexed-a-mtrxsprs-rngintelt-modtuprngelt"></a>
## `A[i]: MtrxSprs, RngIntElt -> ModTupRngElt`

Given a sparse matrix $A$ over a ring $R$ having $m$ rows and $n$ columns, and an integer $i$ such that $1 \leq i \leq m$, return the $i$-th row of $A$, as a dense vector of length $n$ (lying in $R^n$).

<a id="indexed-indexed-a-mtrxsprs-rngintelt-rngintelt-rngelt"></a>
## `A[i, j]: MtrxSprs, RngIntElt, RngIntElt -> RngElt`

Given a sparse matrix $A$ over a ring $R$ having $m$ rows and $n$ columns, integers $i$ and $j$ such that $1 \leq i \leq m$ and $1 \leq j \leq n$, return the $(i,j)$-th entry of $A$, as an element of the ring $R$.

<a id="literal-literal-a-i-j-x-mtrxsprs-rngintelt-rngintelt-rngelt"></a>
## `A[i, j] := x: MtrxSprs, RngIntElt, RngIntElt, RngElt`

Given a sparse matrix $A$ over a ring $R$ having $m$ rows and $n$ columns, integers $i$ and $j$ such that $1 \leq i \leq m$ and $1 \leq j \leq n$, and a ring element $x$ coercible into $R$, modify the $(i,j)$-th entry of $A$ to be $x$. Here $i$ and $j$ must be within the ranges given by the current dimensions of $A$; see [`SetEntry`](https://docs.magma-maths.org/v2.30-1/MatricesLinearAlgebra/SparseMatrices/entries.md#procedure-smat-setentry) below for a procedure to automatically extend $A$ if necessary.

<a id="procedure-smat-setentry"></a>
## `SetEntry(~A, i, j, x): MtrxSprs, RngIntElt, RngIntElt, RngElt`

(Procedure.) Given a sparse matrix $A$ over a ring $R$, integers $i,j\geq 1$, and a ring element $x$ coercible into $R$, modify the $(i,j)$-th entry of $A$ to be $x$. The entry specified by $i$ and $j$ is allowed to be beyond the current dimensions of $A$; if so, $A$ is automatically extended to have at least $i$ rows and $j$ columns.

This procedure will be commonly used in situations where the final size of the matrix is not known as an algorithm proceeds (e.g., in index-calculus methods). One can create the $0\times 0$ sparse matrix over ${\mathbb{Z}}$, say, and then call `SetEntry` to build up the matrix dynamically. See the example [Discrete Logarithms by Linear Sieve](https://docs.magma-maths.org/v2.30-1/MatricesLinearAlgebra/SparseMatrices/solution.md#example-ex-a75220) below, which uses this technique.

Note that extending the dimensions of $A$ with a very large $i$ or $j$ will not in itself consume much memory, but if $A$ then becomes dense or is passed to some algorithm, then the memory needed may of course be proportional to the dimensions of $A$.

<a id="example-ex-167588"></a>
## `Example: Accessing Sparse Matrix Entries (ex-167588)`

This example demonstrates simple ways of accessing the entries of sparse matrices.

```magma
> A := SparseMatrix(2, 3, [<1,2,3>, <2,3,-1>]);
> A;
Sparse matrix with 2 rows and 3 columns over Integer Ring
> Matrix(A);
[ 0  3  0]
[ 0  0 -1]
> A[1];
(0 3 0)
> A[1, 3]:=5;
> A[1];
(0 3 5)
```

We next extend $A$ using the procedure `SetEntry`.

```magma
> SetEntry(~A, 1, 5, -7);
> A;
Sparse matrix with 2 rows and 5 columns over Integer Ring
> Matrix(A);
[ 0  3  5  0 -7]
[ 0  0 -1  0  0]
```

A common situation is to start with the empty $0\times 0$ matrix over ${\mathbb{Z}}$ and then to extend it dynamically.

```magma
> A := SparseMatrix();
> A;
Sparse matrix with 0 rows and 0 columns over Integer Ring
> SetEntry(~A, 1, 4, -2);
> A;
Sparse matrix with 1 row and 4 columns over Integer Ring
> SetEntry(~A, 2, 3, 8);
> A;
Sparse matrix with 2 rows and 4 columns over Integer Ring
> Matrix(A);
[ 0  0  0 -2]
[ 0  0  8  0]
> SetEntry(~A, 200, 319, 1);
> SetEntry(~A, 200, 3876, 1);
> A;
Sparse matrix with 200 rows and 3876 columns over Integer Ring
> Nrows(A);
200
> Ncols(A);
3876
> NNZEntries(A);
4
> Density(A);
0.000005159958720330237358101135190
> Support(A, 200);
[ 319, 3876 ]
```

## Extracting and Inserting Blocks

The following functions enable the extraction of certain rows, columns, or general submatrices, or the replacement of a block by another sparse matrix.

<a id="function-submatrix-mtrxsprs-rngintelt-rngintelt-rngintelt-rngintelt"></a>
### `Submatrix(A, i, j, p, q): MtrxSprs, RngIntElt, RngIntElt, RngIntElt, RngIntElt -> MtrxSprs`

<a id="function-extractblock-mtrxsprs-rngintelt-rngintelt-rngintelt-rngintelt"></a>
### `ExtractBlock(A, i, j, p, q): MtrxSprs, RngIntElt, RngIntElt, RngIntElt, RngIntElt -> MtrxSprs`

Given an $m \times n$ sparse matrix $A$ and integers $i$, $j$, $p$, and $q$ such that $1\leq i \leq i + p \leq m+1$, and $1 \leq j \leq j + q \leq n+1$, return the $p \times q$ submatrix of $A$ rooted at $(i, j)$. Either or both of $p$ and $q$ may be zero, while $i$ may be $m+1$ if $p$ is zero and $j$ may be $n+1$ if $q$ is zero.

<a id="function-submatrixrange-mtrxsprs-rngintelt-rngintelt-rngintelt-rngintelt"></a>
### `SubmatrixRange(A, i, j, r, s): MtrxSprs, RngIntElt, RngIntElt, RngIntElt, RngIntElt -> MtrxSprs`

<a id="function-extractblockrange-mtrxsprs-rngintelt-rngintelt-rngintelt-rngintelt"></a>
### `ExtractBlockRange(A, i, j, r, s): MtrxSprs, RngIntElt, RngIntElt, RngIntElt, RngIntElt -> MtrxSprs`

Given an $m \times n$ sparse matrix $A$ and integers $i$, $j$, $r$, and $s$ such that $1\leq i$, $i-1 \leq r \leq m$, $1 \leq j$, and $j-1 \leq s \leq n$, return the $r-i+1\times s-j+1$ submatrix of $A$ rooted at the $(i, j)$-th entry and extending to the $(r, s)$-th entry, inclusive. $r$ may equal $i-1$ or $s$ may equal $j-1$, in which case a sparse matrix with zero rows or zero columns, respectively, will be returned.

<a id="function-submatrix-mtrxsprs-rngintelt-rngintelt"></a>
### `Submatrix(A, I, J): MtrxSprs, [RngIntElt], [RngIntElt] -> MtrxSprs`

Given an $m \times n$ sparse matrix $A$ and integer sequences $I$ and $J$, return the submatrix of $A$ given by the row indices in $I$ and the column indices in $J$.

<a id="function-insertblock-mtrxsprs-mtrxsprs-rngintelt-rngintelt"></a>
### `InsertBlock(A, B, i, j): MtrxSprs, MtrxSprs, RngIntElt, RngIntElt -> MtrxSprs`

<a id="function-insertblock-mtrxsprs-mtrxsprs-rngintelt-rngintelt-ref"></a>
### `InsertBlock(~A, B, i, j): MtrxSprs, MtrxSprs, RngIntElt, RngIntElt -> MtrxSprs`

Given an $m \times n$ sparse matrix $A$ over a ring $R$, a $p \times q$ sparse matrix $B$ over $R$, and integers $i$ and $j$ such that $1\leq i \leq i + p \leq m+1$ and $1 \leq j \leq j + q \leq n+1$, insert $B$ at position $(i,j)$ in $A$. In the functional version ($A$ is a value argument), this function returns the new sparse matrix and leaves $A$ untouched, while in the procedural version ($\sim A$ is a reference argument), $A$ is modified in place so that the $p \times q$ submatrix of $A$ rooted at $(i, j)$ is now equal to $B$.

<a id="function-rowsubmatrix-mtrxsprs-rngintelt-rngintelt"></a>
### `RowSubmatrix(A, i, k): MtrxSprs, RngIntElt, RngIntElt -> MtrxSprs`

Given an $m \times n$ sparse matrix $A$ and integers $i$ and $k$ such that $1 \le i \leq i + k \leq m+1$, return the $k \times n$ submatrix of $X$ consisting of rows $[i \ldots i + k - 1]$ inclusive. The integer $k$ may be zero and $i$ may also be $m+1$ if $k$ is zero, but the result will always have $n$ columns.

<a id="function-rowsubmatrix-mtrxsprs-rngintelt"></a>
### `RowSubmatrix(A, i): MtrxSprs, RngIntElt -> MtrxSprs`

Given an $m \times n$ sparse matrix $A$ and an integer $i$ such that $0 \le i \leq m$, return the $i\times n$ submatrix of $X$ consisting of the first $i$ rows. The integer $i$ may be $0$, but the result will always have $n$ columns.

<a id="function-rowsubmatrixrange-mtrxsprs-rngintelt-rngintelt"></a>
### `RowSubmatrixRange(A, i, j): MtrxSprs, RngIntElt, RngIntElt -> MtrxSprs`

Given an $m \times n$ sparse matrix $A$ and integers $i$ and $j$ such that $1 \le i$ and $i-1 \leq j \leq m$, return the $j-i+1 \times n$ submatrix of $X$ consisting of rows $[i \ldots j]$ inclusive. The integer $j$ may equal $i-1$, in which case a sparse matrix with zero rows and $n$ columns will be returned.

<a id="function-columnsubmatrix-mtrxsprs-rngintelt-rngintelt"></a>
### `ColumnSubmatrix(A, i, k): MtrxSprs, RngIntElt, RngIntElt -> MtrxSprs`

Given an $m \times n$ sparse matrix $A$ and integers $i$ and $k$ such that $1 \le i \leq i + k \leq n+1$, return the $m \times k$ submatrix of $X$ consisting of columns $[i \ldots i + k - 1]$ inclusive. The integer $k$ may be zero and $i$ may also be $n+1$ if $k$ is zero, but the result will always have $m$ rows.

<a id="function-columnsubmatrix-mtrxsprs-rngintelt"></a>
### `ColumnSubmatrix(A, i): MtrxSprs, RngIntElt -> MtrxSprs`

Given an $m \times n$ sparse matrix $A$ and an integer $i$ such that $0 \le i \leq n$, return the $m\times i$ submatrix of $X$ consisting of the first $i$ columns. The integer $i$ may be $0$, but the result will always have $m$ rows.

<a id="function-columnsubmatrixrange-mtrxsprs-rngintelt-rngintelt"></a>
### `ColumnSubmatrixRange(A, i, j): MtrxSprs, RngIntElt, RngIntElt -> MtrxSprs`

Given an $m \times n$ sparse matrix $A$ and integers $i$ and $j$ such that $1 \le i$ and $i-1 \leq j \leq n$, return the $m\times j-i+1$ submatrix of $X$ consisting of columns $[i \ldots j]$ inclusive. The integer $j$ may equal $i-1$, in which case a sparse matrix with zero columns and $n$ rows will be returned.

## Row and Column Operations

The following functions and procedures provide elementary row or column operations on sparse matrices. For each operation, there is a corresponding function which creates a new sparse matrix for the result (leaving the input sparse matrix unchanged), and a corresponding procedure which modifies the input sparse matrix in place.

<a id="function-swaprows-mtrxsprs-rngintelt-rngintelt"></a>
### `SwapRows(A, i, j): MtrxSprs, RngIntElt, RngIntElt -> MtrxSprs`

<a id="procedure-swaprows-mtrxsprs-rngintelt-rngintelt-ref"></a>
### `SwapRows(~A, i, j): MtrxSprs, RngIntElt, RngIntElt`

Given an $m \times n$ sparse matrix $A$ and integers $i$ and $j$ such that $1 \le i\le m$ and $1 \leq j \leq m$, swap the $i$-th and $j$-th rows of $A$.

<a id="function-swapcolumns-mtrxsprs-rngintelt-rngintelt"></a>
### `SwapColumns(A, i, j): MtrxSprs, RngIntElt, RngIntElt -> MtrxSprs`

<a id="procedure-swapcolumns-mtrxsprs-rngintelt-rngintelt-ref"></a>
### `SwapColumns(~A, i, j): MtrxSprs, RngIntElt, RngIntElt`

Given an $m \times n$ sparse matrix $A$ and integers $i$ and $j$ such that $1 \le i\le n$ and $1 \leq j \leq n$, swap the $i$-th and $j$-th columns of $A$.

<a id="function-reverserows-mtrxsprs"></a>
### `ReverseRows(A): MtrxSprs -> MtrxSprs`

<a id="procedure-reverserows-mtrxsprs-ref"></a>
### `ReverseRows(~A): MtrxSprs`

Given a sparse matrix $A$, reverse all the rows of $A$.

<a id="function-reversecolumns-mtrxsprs"></a>
### `ReverseColumns(A): MtrxSprs -> MtrxSprs`

<a id="procedure-reversecolumns-mtrxsprs-ref"></a>
### `ReverseColumns(~A): MtrxSprs`

Given a sparse matrix $A$, reverse all the columns of $A$.

<a id="function-addrow-mtrxsprs-rngelt-rngintelt-rngintelt"></a>
### `AddRow(A, c, i, j): MtrxSprs, RngElt, RngIntElt, RngIntElt -> MtrxSprs`

<a id="procedure-addrow-mtrxsprs-rngelt-rngintelt-rngintelt-ref"></a>
### `AddRow(~A, c, i, j): MtrxSprs, RngElt, RngIntElt, RngIntElt`

Given an $m \times n$ sparse matrix $A$ over a ring $R$, a ring element $c$ coercible into $R$, and integers $i$ and $j$ such that $1 \le i\le m$ and $1 \leq j \leq m$, add $c$ times row $i$ of $A$ to row $j$ of $A$.

<a id="function-addcolumn-mtrxsprs-rngelt-rngintelt-rngintelt"></a>
### `AddColumn(A, c, i, j): MtrxSprs, RngElt, RngIntElt, RngIntElt -> MtrxSprs`

<a id="procedure-addcolumn-mtrxsprs-rngelt-rngintelt-rngintelt-ref"></a>
### `AddColumn(~A, c, i, j): MtrxSprs, RngElt, RngIntElt, RngIntElt`

Given an $m \times n$ sparse matrix $A$ over a ring $R$, a ring element $c$ coercible into $R$, and integers $i$ and $j$ such that $1 \le i\le n$ and $1 \leq j \leq n$, add $c$ times column $i$ of $A$ to column $j$.

<a id="function-multiplyrow-mtrxsprs-rngelt-rngintelt"></a>
### `MultiplyRow(A, c, i): MtrxSprs, RngElt, RngIntElt -> MtrxSprs`

<a id="procedure-multiplyrow-mtrxsprs-rngelt-rngintelt-ref"></a>
### `MultiplyRow(~A, c, i): MtrxSprs, RngElt, RngIntElt`

Given an $m \times n$ sparse matrix $A$ over a ring $R$, a ring element $c$ coercible into $R$, and an integer $i$ such that $1 \le i\le m$, multiply row $i$ of $A$ by $c$ (on the left).

<a id="function-multiplycolumn-mtrxsprs-rngelt-rngintelt"></a>
### `MultiplyColumn(A, c, i): MtrxSprs, RngElt, RngIntElt -> MtrxSprs`

<a id="procedure-multiplycolumn-mtrxsprs-rngelt-rngintelt-ref"></a>
### `MultiplyColumn(~A, c, i): MtrxSprs, RngElt, RngIntElt`

Given an $m \times n$ sparse matrix $A$ over a ring $R$, a ring element $c$ coercible into $R$, and an integer $i$ such that $1 \le i\le n$, multiply column $i$ of $A$ by $c$ (on the left).

<a id="function-removerow-mtrxsprs-rngintelt"></a>
### `RemoveRow(A, i): MtrxSprs, RngIntElt -> MtrxSprs`

<a id="procedure-removerow-mtrxsprs-rngintelt-ref"></a>
### `RemoveRow(~A, i): MtrxSprs, RngIntElt`

Given an $m \times n$ sparse matrix $A$ and an integer $i$ such that $1 \le i\le m$, remove row $i$ from $A$ (leaving an $(m-1) \times n$ sparse matrix).

<a id="function-removecolumn-mtrxsprs-rngintelt"></a>
### `RemoveColumn(A, j): MtrxSprs, RngIntElt -> MtrxSprs`

<a id="procedure-removecolumn-mtrxsprs-rngintelt-ref"></a>
### `RemoveColumn(~A, j): MtrxSprs, RngIntElt`

Given an $m \times n$ sparse matrix $A$ and an integer $j$ such that $1 \le j\le n$, remove column $j$ from $A$ (leaving an $m \times (n-1)$ sparse matrix).

<a id="function-removerowcolumn-mtrxsprs-rngintelt"></a>
### `RemoveRowColumn(A, i, j): MtrxSprs, RngIntElt -> MtrxSprs`

<a id="procedure-removerowcolumn-mtrxsprs-rngintelt-ref"></a>
### `RemoveRowColumn(~A, i, j): MtrxSprs, RngIntElt`

Given an $m \times n$ sparse matrix $A$ and integers $i$ and $j$ such that $1 \le i\le m$ and $1 \le j\le n$, remove row $i$ and column $j$ from $A$ (leaving an $(m-1) \times (n-1)$ sparse matrix).

<a id="function-removezerorows-mtrxsprs"></a>
### `RemoveZeroRows(A): MtrxSprs -> MtrxSprs`

<a id="procedure-removezerorows-mtrxsprs-ref"></a>
### `RemoveZeroRows(~A): MtrxSprs`

Given a sparse matrix $A$, remove all the zero rows of $A$.
