[−][src]Enum ndsparse::csl::CslError
Any error related to Csl operations
Variants
Data or indices length is greater than the product of all dimensions length
use ndsparse::csl::{CslError, CslVec}; let csl = CslVec::new([3], vec![8, 9, 9, 9, 9], vec![0, 5, 5, 5, 5], vec![0, 2]); assert_eq!(csl, Err(ndsparse::Error::Csl(CslError::DataIndcsLengthGreaterThanDimsLength)));
The data length is different than the indices length
use ndsparse::csl::{ CslError, CslVec}; let csl = CslVec::new([10], vec![8, 9], vec![0], vec![0, 2]); assert_eq!(csl, Err(ndsparse::Error::Csl(CslError::DiffDataIndcsLength)));
Duplicated indices in a line
use ndsparse::csl::{CslArray, CslError}; let csl = CslArray::new([10], [8, 9], [0, 0], [0, 2]); assert_eq!(csl, Err(ndsparse::Error::Csl(CslError::DuplicatedIndices)));
A index is greater or equal to the innermost dimension length
use ndsparse::csl::{CslArray, CslError}; let csl = CslArray::new([10], [8, 9], [0, 10], [0, 2]); assert_eq!(csl, Err(ndsparse::Error::Csl(CslError::IndcsGreaterThanEqualDimLength)));
Some innermost dimension length is equal to zero
use ndsparse::csl::{CslError, CslVec}; let csl: ndsparse::Result<CslVec<[usize; 5], i32>>; csl = CslVec::new([1, 2, 3, 0, 5], vec![], vec![], vec![]); assert_eq!(csl, Err(ndsparse::Error::Csl(CslError::InnermostDimsZero)));
Line iterator must deal with non-empty dimensions
use ndsparse::csl::{CslVec, CslError}; let csl = CslVec::<[usize; 0], i32>::default(); assert_eq!(csl.outermost_line_iter(), Err(ndsparse::Error::Csl(CslError::InvalidIterDim)));
Offsets length is different than the dimensions product (without the innermost dimension) plus one. This rule doesn't not apply to an empty dimension.
use ndsparse::csl::{CslError, CslVec}; let csl = CslVec::new([10], vec![8, 9], vec![0, 5], vec![0, 2, 4]); assert_eq!(csl, Err(ndsparse::Error::Csl(CslError::InvalidOffsetsLength)));
Offsets aren't in ascending order
use ndsparse::csl::{CslArray, CslError}; let csl = CslArray::new([10], [8, 9], [0, 5], [2, 0]); assert_eq!(csl, Err(ndsparse::Error::Csl(CslError::InvalidOffsetsOrder)));
Last offset is not equal to the nnz
use ndsparse::csl::{CslArray, CslError}; let csl = CslArray::new([10], [8, 9], [0, 5], [0, 4]); assert_eq!(csl, Err(ndsparse::Error::Csl(CslError::LastOffsetDifferentNnz)));
nnz is greater than the maximum permitted number of nnz
use ndsparse::csl::CslVec; use rand::{thread_rng, Rng}; let mut rng = thread_rng(); let dims = [1, 2, 3]; // Max of 6 elements (1 * 2 * 3) let csl: ndsparse::Result<CslVec<[usize; 3], i32>>; csl = CslVec::new_controlled_random_rand(dims, 7, &mut rng, |r, _| r.gen()); assert_eq!(csl, Err(ndsparse::Error::Csl(ndsparse::csl::CslError::NnzGreaterThanMaximumNnz)));
It isn't possible to have more lines than usize::MAX - 2
use ndsparse::csl::{CslArray, CslError}; let csl = CslArray::new([18446744073709551295, 255, 3026418949592973312], [0], [0], [0, 1]); assert_eq!(csl, Err(ndsparse::Error::Csl(CslError::OffsLengthOverflow)));
Trait Implementations
impl Debug for CslError
[src]
impl Display for CslError
[src]
impl Error for CslError
[src]
fn source(&self) -> Option<&(dyn Error + 'static)>
1.30.0[src]
fn backtrace(&self) -> Option<&Backtrace>
[src]
fn description(&self) -> &str
1.0.0[src]
fn cause(&self) -> Option<&dyn Error>
1.0.0[src]
impl From<CslError> for Error
[src]
impl PartialEq<CslError> for CslError
[src]
impl StructuralPartialEq for CslError
[src]
Auto Trait Implementations
impl RefUnwindSafe for CslError
impl Send for CslError
impl Sync for CslError
impl Unpin for CslError
impl UnwindSafe for CslError
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,