Skip to main content

Error

Enum Error 

Source
#[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
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.
§

InvalidParameter

A parameter is outside its valid range.

Fields

§name: &'static str

Name of the parameter, as in the documentation of the function

§value: String

The rejected value, formatted for the message

§reason: String

The condition that the value violates, e.g. “must be in (0, 1)”

§

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

§name: &'static str

Name of the argument, as in the documentation of the function

§value: f64

The rejected point

§domain: (f64, f64)

The closed interval (lower, upper) of valid points

§

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.

Fields

§n: i64

The rejected index

§statistics: Statistics

The statistics that n was checked against

§

EmptyInput

An input that must not be empty is empty.

Fields

§name: &'static str

Name of the input, as in the documentation of the function

§

NonFiniteInput

An input contains NaN or an infinity.

Fields

§name: &'static str

Name of the input, as in the documentation of the function

§index: Vec<usize>

Index of the first non-finite entry ([row, column] for a matrix)

§value: f64

That entry, converted to f64

§

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.

Fields

§basis_size: usize

Basis size

§n_poles: usize

Number of default poles found

§

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.

Fields

§axis: usize

The rejected axis

§rank: usize

The rank of the array

§

ShapeMismatch

An array has the wrong shape. For a slice, the shapes have one entry, its length.

Fields

§which: ArrayRole

Which array: an input, or the output

§expected: Vec<usize>

The shape the operation needs

§actual: Vec<usize>

The shape of the array

§

NotSupported

The operation is not defined for this input, e.g. default Matsubara sampling points for basis functions without a definite parity (#183).

Fields

§what: String

What is not supported, and why

§

DecompositionFailed

A matrix decomposition failed, e.g. the SVD iteration did not converge.

Fields

§reason: String

What failed, with the values involved

§

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.

Fields

§reason: String

The message of the tenferro error

Implementations§

Source§

impl Error

Source

pub fn kind(&self) -> ErrorKind

Category of the error

Trait Implementations§

Source§

impl Clone for Error

Source§

fn clone(&self) -> Error

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Error

Source§

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

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

impl Display for Error

Source§

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

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

impl Error for Error

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<Error> for Error

Source§

fn from(e: Error) -> Self

Converts to this type from the input type.
Source§

impl From<GemmError> for Error

Source§

fn from(source: GemmError) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for Error

Source§

fn eq(&self, other: &Error) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. 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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<T> DistributionExt for T
where T: ?Sized,

§

fn rand<T>(&self, rng: &mut (impl Rng + ?Sized)) -> T
where Self: Distribution<T>,

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> MaybeSend for T
where T: Send,

§

impl<T> MaybeSendSync for T
where T: Send + Sync,

§

impl<T> MaybeSync for T
where T: Sync,

§

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,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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