Struct matrix::format::compressed::Compressed [] [src]

pub struct Compressed<T: Element> {
    pub rows: usize,
    pub columns: usize,
    pub nonzeros: usize,
    pub variant: Variant,
    pub values: Vec<T>,
    pub indices: Vec<usize>,
    pub offsets: Vec<usize>,
}

A compressed matrix.

Fields

The number of rows.

The number of columns.

The number of nonzero elements.

The format variant.

The values of the nonzero elements.

The indices of rows when variant = Column or columns when variant = Row of the nonzero elements.

The offsets of columns when variant = Column or rows when variant = Row such that the values and indices of the ith column when variant = Column or the ith row when variant = Row are stored starting from values[j] and indices[j], respectively, where j = offsets[i]. The vector has one additional element, which is always equal to nonzeros.

Methods

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

Create a zero matrix.

Create a zero matrix with a specific capacity.

Read an element.

Assign a value to an element.

Note that the function treats zero values as any other.

Return a sparse iterator.

Return a sparse iterator allowing mutation.

Resize the matrix.

Retain the elements that satisfy a condition and discard the rest.

Trait Implementations

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

Performs the conversion.

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

Performs the conversion.

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

Performs the conversion.

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

Performs the conversion.

impl<T> Multiply<Diagonal<T>, Compressed<T>> for Compressed<T> where T: Element + Number
[src]

Perform the multiplication.

impl<'l, T> MultiplyInto<[T][T]> for Compressed<T> where T: Element + Number
[src]

Perform the multiplication.

impl<T> MultiplySelf<Diagonal<T>> for Compressed<T> where T: Element + Number
[src]

Perform the multiplication.

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

Perform the transpose.

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

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

This method tests for !=.

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

Formats the value using the given formatter.

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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

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

Return the number of rows.

Return the number of columns.

Return the number of rows and columns.

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

The element type.

Count nonzero elements.

Create a zero matrix.