#[non_exhaustive]pub enum Error {
Show 13 variants
InvalidParameter {
name: &'static str,
value: String,
reason: String,
},
OutOfDomain {
name: &'static str,
value: f64,
domain: (f64, f64),
},
InvalidMatsubaraIndex {
n: i64,
statistics: Statistics,
},
EmptyInput {
name: &'static str,
},
NonFiniteInput {
name: &'static str,
index: Vec<usize>,
value: f64,
},
KernelStatisticsMismatch,
InsufficientDefaultPoles {
basis_size: usize,
n_poles: usize,
},
AxisOutOfRange {
axis: usize,
rank: usize,
},
ShapeMismatch {
which: ArrayRole,
expected: Vec<usize>,
actual: Vec<usize>,
},
NotSupported {
what: String,
},
DecompositionFailed {
reason: String,
},
Gemm(GemmError),
Tensor {
reason: String,
},
}Expand description
Error returned by the fallible public functions of this crate
More variants may be added without a major version bump. To handle a category of
errors rather than one variant, match on Error::kind.
Errors compare equal when all their fields do. An error that holds a NaN value is therefore not equal to itself; match on the variant instead.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
InvalidParameter
A parameter is outside its valid range.
Fields
OutOfDomain
A point lies outside the domain of a function, e.g. τ outside [-β, β] or x outside the knots of a polynomial. NaN lies outside every domain.
Fields
InvalidMatsubaraIndex
A Matsubara frequency index is not allowed: n must be odd for
fermionic and even for bosonic statistics, and non-negative for a
positive-only sampling. The message says which: a wrong parity, or a
negative n of the right parity.
EmptyInput
An input that must not be empty is empty.
NonFiniteInput
An input contains NaN or an infinity.
Fields
KernelStatisticsMismatch
The kernel does not support the requested statistics, e.g.
RegularizedBoseKernel with fermionic statistics.
InsufficientDefaultPoles
The basis has fewer default poles than functions, so its default poles
cannot define a DLR. This can happen with certain kernels (e.g.
RegularizedBoseKernel) because of the limited precision of the root
finding.
AxisOutOfRange
An axis argument is not an axis of the array, e.g. dim of
evaluate_nd for an array of rank dim or less.
ShapeMismatch
An array has the wrong shape. For a slice, the shapes have one entry, its length.
Fields
NotSupported
The operation is not defined for this input, e.g. default Matsubara sampling points for basis functions without a definite parity (#183).
DecompositionFailed
A matrix decomposition failed, e.g. the SVD iteration did not converge.
Gemm(GemmError)
The GEMM backend rejected a call, e.g. a dimension exceeds the integer range of an injected BLAS.
Tensor
A tenferro tensor operation failed.
Implementations§
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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()
impl StructuralPartialEq for Error
Auto Trait Implementations§
impl Freeze for Error
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
impl UnwindSafe for Error
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
fn rand<T>(&self, rng: &mut (impl Rng + ?Sized)) -> Twhere
Self: Distribution<T>,
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 moreimpl<T> MaybeSend for Twhere
T: Send,
impl<T> MaybeSendSync for T
impl<T> MaybeSync for Twhere
T: Sync,
§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
impl<T> Scalar for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read more§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).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.