pub enum SparseErrors {
Show 16 variants
Data2NotAvailable,
SliceIndexOutOfBounds {
index: usize,
len: usize,
},
DuplicateSliceIndex(usize),
SparseMatrixMultiplication {
n_col_a: usize,
n_row_b: usize,
},
DimensionMisMatchSparse {
indices_len: usize,
data_len: usize,
},
SparseIndptrInvalid {
detail: &'static str,
expected: usize,
got: usize,
},
ShapeMismatchSparse,
SparseMatrixMustBeCsr,
SparseMatrixIsolatedRow {
row: usize,
row_sum: f64,
},
MalformedCsr(&'static str),
SparseMatrixMustBeCsc,
ShapeMismatch {
expected: (usize, usize),
got: (usize, usize),
},
NotSerialised(&'static str),
SerialisedVersionMismatch {
found: u32,
supported: u32,
},
SerialisedWidthMismatch {
expected: [u8; 2],
found: [u8; 2],
},
SerialisationFailed(String),
}Expand description
Error variants raised by the sparse structures and operations.
bixverse-core converts these into the identically named CoreErrors
variants, so callers of the core crate keep matching on CoreErrors.
Variants§
Data2NotAvailable
Error in situations were data_2 in
CompressedSparseData2 is
asked for but not available
SliceIndexOutOfBounds
Error if the slice index is out of bounds
DuplicateSliceIndex(usize)
Error if the slice index is duplicated
SparseMatrixMultiplication
Error for sparse multiplication dimension mismatches
DimensionMisMatchSparse
Dimension mismatch error during construction
SparseIndptrInvalid
Error if the indptr is inconsistent with the shape it declares or
with the stored values.
Raised by
CompressedSparseData2::validate
on input that crossed an FFI boundary, where the struct’s public fields
could have been populated with anything.
Fields
ShapeMismatchSparse
Error if there is a dimension mismatch in terms of the two matrices
SparseMatrixMustBeCsr
Error if the sparse matrix is not in CSR.
SparseMatrixIsolatedRow
A row summed to (effectively) zero where a row-stochastic normalisation was asked for.
On a kNN-derived affinity matrix every node has k out-edges, so a zero
row means the kernel weights underflowed rather than that the graph is
legitimately disconnected. Anything built on top of the operator would
be meaningless, hence an error rather than leaving the row at zero.
MalformedCsr(&'static str)
A CSR matrix failed one of its structural invariants.
Raised by validate_square_csr.
The static string names the invariant, because “the graph is malformed”
alone leaves the caller to bisect their own input.
SparseMatrixMustBeCsc
Error if the sparse matrix is not in CSC.
ShapeMismatch
Shape mismatch problem for matrices
NotSerialised(&'static str)
The bytes do not open with the magic of the requested structure.
SerialisedVersionMismatch
The bytes were written by a different version of the byte layout.
SerialisedWidthMismatch
The bytes were written for different element types, e.g. an f64
structure read back as f32.
SerialisationFailed(String)
Encoding failed, or the payload behind a valid header did not decode.
Trait Implementations§
Source§impl Debug for SparseErrors
impl Debug for SparseErrors
Source§impl Display for SparseErrors
impl Display for SparseErrors
Source§impl Error for SparseErrors
impl Error for SparseErrors
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Auto Trait Implementations§
impl Freeze for SparseErrors
impl RefUnwindSafe for SparseErrors
impl Send for SparseErrors
impl Sync for SparseErrors
impl Unpin for SparseErrors
impl UnsafeUnpin for SparseErrors
impl UnwindSafe for SparseErrors
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more