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()
Source§impl From<SparseErrors> for CoreErrors
Maps each SparseErrors variant onto the identically named CoreErrors
variant, so callers keep matching on CoreErrors after the sparse structures
moved to bixverse-sparse.
impl From<SparseErrors> for CoreErrors
Maps each SparseErrors variant onto the identically named CoreErrors
variant, so callers keep matching on CoreErrors after the sparse structures
moved to bixverse-sparse.
Source§fn from(err: SparseErrors) -> CoreErrors
fn from(err: SparseErrors) -> CoreErrors
Source§impl From<SparseErrors> for MethodsErrors
Sparse structure errors surface through the core variant, as before the
sparse structures moved to bixverse-sparse.
impl From<SparseErrors> for MethodsErrors
Sparse structure errors surface through the core variant, as before the
sparse structures moved to bixverse-sparse.
Source§fn from(err: SparseErrors) -> Self
fn from(err: SparseErrors) -> Self
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T, U> Imply<T> for U
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> Separable for Twhere
T: Display,
impl<T> Separable for Twhere
T: Display,
Source§fn separate_by_policy(&self, policy: SeparatorPolicy<'_>) -> String
fn separate_by_policy(&self, policy: SeparatorPolicy<'_>) -> String
SeparatorPolicy. Read moreSource§fn separate_with_commas(&self) -> String
fn separate_with_commas(&self) -> String
Source§fn separate_with_spaces(&self) -> String
fn separate_with_spaces(&self) -> String
Source§fn separate_with_dots(&self) -> String
fn separate_with_dots(&self) -> String
Source§fn separate_with_underscores(&self) -> String
fn separate_with_underscores(&self) -> String
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.