#[non_exhaustive]pub enum ChainCompressionError {
Show 13 variants
CoreRank {
site: usize,
rank: usize,
},
BondMismatch {
site: usize,
right: usize,
next_left: usize,
},
LeftBoundary,
RightBoundary,
InvalidTolerance(f64),
ZeroBondCap,
ShapeOverflow([usize; 3]),
BufferLength {
len: usize,
block: usize,
},
Allocation(TryReserveError),
Array(ColMajorArrayError),
MatrixShape(MatrixShapeError),
Factorization(MatrixCIError),
Multiply {
direction: &'static str,
source: MatrixMulError,
},
}Expand description
Failure to validate or compress a chain of rank-3 cores.
§Examples
use tensor4all_core::{compress_chain_lu_mut, ChainCompressionError, ChainLuOptions, ColMajorArray};
let core = ColMajorArray::new(vec![1.0_f64], vec![1, 1])?;
let error = compress_chain_lu_mut(&mut [core], &ChainLuOptions::default()).unwrap_err();
assert!(matches!(error, ChainCompressionError::CoreRank { site: 0, rank: 2 }));Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
CoreRank
A core has a rank other than three.
Fields
BondMismatch
The right bond of a site disagrees with the next site’s left bond.
Fields
LeftBoundary
The left boundary bond must have dimension one.
RightBoundary
The right boundary bond must have dimension one.
InvalidTolerance(f64)
The pivot tolerance must be finite and nonnegative.
ZeroBondCap
A rank cap of zero would discard every bond.
ShapeOverflow([usize; 3])
Fusing two core axes would overflow usize.
BufferLength
A flat buffer does not hold a whole number of unfolding blocks.
Fields
Allocation(TryReserveError)
The flat buffer could not be allocated.
Array(ColMajorArrayError)
A column-major array could not be constructed.
MatrixShape(MatrixShapeError)
An unfolding or factor had incompatible matrix dimensions.
Factorization(MatrixCIError)
A matrix factorization failed.
Multiply
A matrix factor could not be absorbed into the adjacent core.
Fields
source: MatrixMulErrorUnderlying backend multiplication failure.
Trait Implementations§
Source§impl Debug for ChainCompressionError
impl Debug for ChainCompressionError
Source§impl Display for ChainCompressionError
impl Display for ChainCompressionError
Source§impl Error for ChainCompressionError
impl Error for ChainCompressionError
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<ColMajorArrayError> for ChainCompressionError
impl From<ColMajorArrayError> for ChainCompressionError
Source§fn from(source: ColMajorArrayError) -> Self
fn from(source: ColMajorArrayError) -> Self
Source§impl From<MatrixCIError> for ChainCompressionError
impl From<MatrixCIError> for ChainCompressionError
Source§fn from(source: MatrixCIError) -> Self
fn from(source: MatrixCIError) -> Self
Source§impl From<MatrixShapeError> for ChainCompressionError
impl From<MatrixShapeError> for ChainCompressionError
Source§fn from(source: MatrixShapeError) -> Self
fn from(source: MatrixShapeError) -> Self
Source§impl From<TryReserveError> for ChainCompressionError
impl From<TryReserveError> for ChainCompressionError
Source§fn from(source: TryReserveError) -> Self
fn from(source: TryReserveError) -> Self
Auto Trait Implementations§
impl Freeze for ChainCompressionError
impl RefUnwindSafe for ChainCompressionError
impl Send for ChainCompressionError
impl Sync for ChainCompressionError
impl Unpin for ChainCompressionError
impl UnsafeUnpin for ChainCompressionError
impl UnwindSafe for ChainCompressionError
Blanket Implementations§
§impl<U> As for U
impl<U> As for U
§fn as_<T>(self) -> Twhere
T: CastFrom<U>,
U: Sized,
fn as_<T>(self) -> Twhere
T: CastFrom<U>,
U: Sized,
self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read moreSource§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
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 more