Struct matrix::Compressed [] [src]

pub struct Compressed<T: Element> {
    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.

The storage is suitable for generic sparse matrices. Data are stored in one of the following formats:

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) of the nonzero elements.

offsets: Vec<usize>

The offsets of columns (rows) such that the values and indices of the ith 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).

Trait Implementations

impl<T: Debug + Element> Debug for Compressed<T>
[src]

fn fmt(&self, __arg_0: &mut Formatter) -> Result

Formats the value using the given formatter.

impl<T: Clone + Element> Clone for Compressed<T>
[src]

fn clone(&self) -> Compressed<T>

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)
1.0.0

Performs copy-assignment from source. Read more

impl<T: Element> Matrix for Compressed<T>
[src]

type Element = T

The element type.

fn rows(&self) -> usize

Return the number of rows.

fn columns(&self) -> usize

Return the number of columns.

impl<T: Element> Sparse for Compressed<T>
[src]

fn nonzeros(&self) -> usize

Return the number of nonzero elements.