# Module extendr_api::prelude::sparse

## Expand description

Sparse data structures and algorithms. Sparse matrix data structures.

Most sparse matrix algorithms accept matrices in sparse column-oriented format. This format represents each column of the matrix by storing the row indices of its non-zero elements, as well as their values.

The indices and the values are each stored in a contiguous slice (or group of slices for
arbitrary values). In order to specify where each column starts and ends, a slice of size
`ncols + 1`

stores the start of each column, with the last element being equal to the total
number of non-zeros (or the capacity in uncompressed mode).

## §Example

Consider the 4-by-5 matrix:

```
[[10.0, 0.0, 12.0, -1.0, 13.0]
[ 0.0, 0.0, 25.0, -2.0, 0.0]
[ 1.0, 0.0, 0.0, 0.0, 0.0]
[ 4.0, 0.0, 0.0, 0.0, 5.0]]
```

The matrix is stored as follows:

```
column pointers: 0 | 3 | 3 | 5 | 7 | 9
row indices: 0 | 2 | 3 | 0 | 1 | 0 | 1 | 0 | 3
values : 10.0 | 1.0 | 4.0 | 12.0 | 25.0 | -1.0 | -2.0 | 13.0 | 5.0
```

## Modules§

- Sparse linear algebra module.

Contains low level routines and the implementation of their corresponding high level wrappers. - Sparse matrix binary and ternary operation implementations.
- solvers
Deprecated Sparse solvers. - Useful sparse matrix primitives.

## Structs§

- Sparse matrix in column-major format, either compressed or uncompressed.
- Sparse matrix view in column-major format, either compressed or uncompressed.
- Sparse matrix view in column-major format, either compressed or uncompressed.
- Sparse matrix in column-major format, either compressed or uncompressed.
- Sparse matrix view in column-major format, either compressed or uncompressed.
- Sparse matrix view in column-major format, either compressed or uncompressed.
- Symbolic structure of sparse matrix in column format, either compressed or uncompressed.
- Symbolic view structure of sparse matrix in column format, either compressed or uncompressed.
- Symbolic structure of sparse matrix in row format, either compressed or uncompressed.
- Symbolic view structure of sparse matrix in row format, either compressed or uncompressed.
- The order values should be read in, when constructing/filling from indices and values.

## Enums§

- Sparse Cholesky error.
- Errors that can occur in sparse algorithms.
- Errors that can occur in sparse algorithms.
- Whether the filled values should replace the current matrix values or be added to them.
- Sparse LU error.

## Traits§

- Trait for unsigned integers that can be indexed with.