Skip to main content

ChainCompressionError

Enum ChainCompressionError 

Source
#[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
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

CoreRank

A core has a rank other than three.

Fields

§site: usize

Zero-based site of the invalid core.

§rank: usize

Number of axes of the supplied core.

§

BondMismatch

The right bond of a site disagrees with the next site’s left bond.

Fields

§site: usize

Zero-based site to the left of the mismatched bond.

§right: usize

Dimension of the bond at site.

§next_left: usize

Dimension of the same bond at site + 1.

§

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

§len: usize

Length of the supplied buffer.

§block: usize

Element count of one block, or zero when a block dimension is zero.

§

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

§direction: &'static str

Sweep direction in which the multiplication failed.

§source: MatrixMulError

Underlying backend multiplication failure.

Trait Implementations§

Source§

impl Debug for ChainCompressionError

Source§

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

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

impl Display for ChainCompressionError

Source§

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

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

impl Error for ChainCompressionError

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
Source§

impl From<ColMajorArrayError> for ChainCompressionError

Source§

fn from(source: ColMajorArrayError) -> Self

Converts to this type from the input type.
Source§

impl From<MatrixCIError> for ChainCompressionError

Source§

fn from(source: MatrixCIError) -> Self

Converts to this type from the input type.
Source§

impl From<MatrixShapeError> for ChainCompressionError

Source§

fn from(source: MatrixShapeError) -> Self

Converts to this type from the input type.
Source§

impl From<TryReserveError> for ChainCompressionError

Source§

fn from(source: TryReserveError) -> Self

Converts to this type from the input type.

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
§

impl<U> As for U

§

fn as_<T>(self) -> T
where T: CastFrom<U>, U: Sized,

Casts 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 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
§

impl<T> ByRef<T> for T

§

fn by_ref(&self) -> &T

§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Imply<T> for U
where T: ?Sized, U: ?Sized,

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

§

impl<T, S> SimdFrom<T, S> for T
where S: Simd,

§

fn simd_from(_simd: S, value: T) -> T

§

impl<F, T, S> SimdInto<T, S> for F
where T: SimdFrom<F, S>, S: Simd,

§

fn simd_into(self, simd: S) -> T

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V