Struct matrix::CompressedMatrix
[−]
[src]
pub struct CompressedMatrix<T> { pub rows: usize, pub columns: usize, pub nonzeros: usize, pub format: CompressedFormat, pub data: Vec<T>, pub indices: Vec<usize>, pub offsets: Vec<usize>, }
A compressed matrix.
Data are stored in one of the following formats:
- the compressed-row format or
- the compressed-column format.
Fields
rows: usize
The number of rows.
columns: usize
The number of columns.
nonzeros: usize
The number of nonzero elements.
format: CompressedFormat
The storage format.
data: Vec<T>
The values of the nonzero elements.
indices: Vec<usize>
The indices of columns (rows) the nonzero elements.
offsets: Vec<usize>
The offsets of columns (rows) such that the values and indices of the i
th column (row)
are stored starting from data[j]
and indices[j]
, respectively, where j = offsets[i]
.
The vector has one additional element, which is always equal to nonzeros
, that is,
offsets[columns] = nonzeros
(offsets[rows] = nonzeros
).