Trait sprs::indexing::SpIndex[][src]

pub trait SpIndex: Debug + PrimInt + AddAssign<Self> + Default + Send + Sync {
    fn index(self) -> usize;
fn try_index(self) -> Option<usize>;
fn index_unchecked(self) -> usize;
fn from_usize(ind: usize) -> Self;
fn try_from_usize(ind: usize) -> Option<Self>;
fn from_usize_unchecked(ind: usize) -> Self; }
Expand description

A sparse matrix index

This is a convenience trait to enable using various integer sizes for sparse matrix indices.

Required methods

Convert to usize.

Panics

If the integer cannot be represented as an usize, eg negative numbers.

Try convert to usize.

Convert to usize without checking for overflows.

Convert from usize.

Panics

If the input overflows the index type.

Try convert from usize.

Convert from usize without checking for overflows.

Implementations on Foreign Types

Implementors