Struct npyz::sparse::BsrBase[][src]

pub struct BsrBase<T, Data, Indices, Indptr> where
    Data: Deref<Target = [T]>,
    Indices: AsRef<[u64]>,
    Indptr: AsRef<[usize]>, 
{ pub shape: [u64; 2], pub blocksize: [usize; 2], pub data: Data, pub indices: Indices, pub indptr: Indptr, }
Expand description

Raw representation of a scipy.sparse.bsr_matrix.

In spirit, each field is simply a Vec. (see the type alias Bsr). This generic base class exists in order to allow you to use slices when writing.

Fields

shape: [u64; 2]

Dimensions of the matrix [nrow, ncol].

These dimensions must be divisible by the respective elements of blocksize.

blocksize: [usize; 2]

Size of the blocks in the matrix.

data: Data

Contains the C-order data of a shape [nnzb, block_nrow, block_ncol] ndarray.

(effectively concatenating the flattened data of all nonzero blocks, sorted by superrow)

indices: Indices

A vector of length nnzb indicating the supercolumn index of each block.

Beware: scipy does not require or guarantee that the column indices within each row are sorted.

indptr: Indptr

A vector of length (nrow / block_nrow) + 1 indicating the indices which partition Self::indices and the outermost axis of Self::data into data for each superrow.

Typically, the elements are nondecreasing, with the first equal to 0 and the final equal to nnzb (though the set of requirements that are actually validated by scipy are weaker and somewhat arbitrary).

Implementations

Read a sparse bsr_matrix saved by scipy.sparse.save_npz.

Write a sparse bsr_matrix matrix, like scipy.sparse.save_npz.

Panics

Panics if data.len() is not equal to indices.len() * blocksize[0] * blocksize[1].

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

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

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.