pub enum ContractionError {
InvalidNotation(String),
LabelMismatch {
expected: usize,
actual: usize,
tensor: String,
},
DimensionMismatch {
label: String,
lhs_dim: usize,
rhs_dim: usize,
},
LabelNotFound {
label: String,
tensor: String,
},
DuplicateOutputLabel {
label: String,
},
}Expand description
Error raised while parsing or validating an Einstein-notation contraction.
Every variant fully describes its own failure; none wraps a structured
inner error. ContractionError is therefore a leaf in the error chain —
its source() is always None.
Variants§
InvalidNotation(String)
The notation string could not be parsed as valid Einstein notation.
LabelMismatch
A tensor’s label count does not match its rank.
Fields
DimensionMismatch
A shared label is bound to different extents on the two operands.
Fields
LabelNotFound
A referenced label is absent from the named tensor.
DuplicateOutputLabel
The output specification repeats a label.
Trait Implementations§
Source§impl Clone for ContractionError
impl Clone for ContractionError
Source§fn clone(&self) -> ContractionError
fn clone(&self) -> ContractionError
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ContractionError
impl Debug for ContractionError
Source§impl Display for ContractionError
impl Display for ContractionError
Source§impl Error for ContractionError
impl Error for ContractionError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
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
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl PartialEq for ContractionError
impl PartialEq for ContractionError
Source§fn eq(&self, other: &ContractionError) -> bool
fn eq(&self, other: &ContractionError) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for ContractionError
Auto Trait Implementations§
impl Freeze for ContractionError
impl RefUnwindSafe for ContractionError
impl Send for ContractionError
impl Sync for ContractionError
impl Unpin for ContractionError
impl UnsafeUnpin for ContractionError
impl UnwindSafe for ContractionError
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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 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>
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