Struct matrix::Compressed [] [src]

pub struct Compressed<T: Element> {
    pub rows: usize,
    pub columns: usize,
    pub nonzeros: usize,
    pub format: Major,
    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: Major

The storage format.

data: Vec<T>

The values of the nonzero elements.

indices: Vec<usize>

The indices of rows for Major::Column or columns for Major::Row of the nonzero elements.

offsets: Vec<usize>

The offsets of columns for Major::Column or rows for Major::Row such that the values and indices of the ith column for Major::Column or the ith row for Major::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.

Trait Implementations

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

fn eq(&self, __arg_0: &Compressed<T>) -> bool

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, __arg_0: &Compressed<T>) -> bool

This method tests for !=.

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.

impl<'l, T: Element> From<&'l Dense<T>> for Compressed<T>
[src]

fn from(dense: &'l Dense<T>) -> Compressed<T>

Performs the conversion.

impl<T: Element> From<Dense<T>> for Compressed<T>
[src]

fn from(dense: Dense<T>) -> Compressed<T>

Performs the conversion.