Skip to main content

SparseError

Enum SparseError 

Source
pub enum SparseError {
    InvalidOffsetsLength {
        actual: usize,
        expected: usize,
    },
    NonMonotonicOffsets {
        index: usize,
        value: u32,
        next_index: usize,
        next_value: u32,
    },
    NonZeroFirstOffset {
        value: u32,
    },
    OffsetNnzMismatch {
        offset_last: u32,
        nnz: usize,
    },
    ColumnOutOfBounds {
        col: u32,
        cols: usize,
        position: usize,
    },
    LengthMismatch {
        col_len: usize,
        val_len: usize,
    },
    CooLengthMismatch {
        row_len: usize,
        col_len: usize,
        val_len: usize,
    },
    RowOutOfBounds {
        row: u32,
        rows: usize,
        position: usize,
    },
    SpMVDimensionMismatch {
        matrix_cols: usize,
        x_len: usize,
    },
    SpMVOutputDimensionMismatch {
        matrix_rows: usize,
        y_len: usize,
    },
}
Expand description

Errors that can occur during sparse matrix construction or operations.

Variants§

§

InvalidOffsetsLength

CSR offsets array has wrong length (expected rows + 1).

Fields

§actual: usize

Actual length of offsets array.

§expected: usize

Expected length (rows + 1).

§

NonMonotonicOffsets

CSR offsets are not monotonically non-decreasing.

Fields

§index: usize

Index where violation occurs.

§value: u32

Value at the violating index.

§next_index: usize

Next index.

§next_value: u32

Value at next index.

§

NonZeroFirstOffset

CSR offsets[0] must be 0.

Fields

§value: u32

Actual value of offsets[0].

§

OffsetNnzMismatch

CSR offsets[rows] must equal nnz.

Fields

§offset_last: u32

Value of offsets[rows].

§nnz: usize

Expected nnz (length of values/col_indices).

§

ColumnOutOfBounds

Column index out of bounds.

Fields

§col: u32

The out-of-bounds column index.

§cols: usize

Number of columns.

§position: usize

Position in col_indices array.

§

LengthMismatch

col_indices and values length mismatch.

Fields

§col_len: usize

Length of col_indices.

§val_len: usize

Length of values.

§

CooLengthMismatch

COO arrays have mismatched lengths.

Fields

§row_len: usize

Length of row_indices.

§col_len: usize

Length of col_indices.

§val_len: usize

Length of values.

§

RowOutOfBounds

COO row index out of bounds.

Fields

§row: u32

The out-of-bounds row index.

§rows: usize

Number of rows.

§position: usize

Position in row_indices array.

§

SpMVDimensionMismatch

Dimension mismatch in SpMV.

Fields

§matrix_cols: usize

Number of columns in the matrix.

§x_len: usize

Length of x vector.

§

SpMVOutputDimensionMismatch

Output dimension mismatch in SpMV.

Fields

§matrix_rows: usize

Number of rows in the matrix.

§y_len: usize

Length of y vector.

Trait Implementations§

Source§

impl Clone for SparseError

Source§

fn clone(&self) -> SparseError

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for SparseError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for SparseError

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for SparseError

1.30.0 · Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.