pub enum Error {
InvalidInput(String),
Derivative(DerivativeError),
SpecialFunction(String),
NonFinite(String),
NotConverged(String),
Singular,
OutOfMemory(String),
}Expand description
A numerical failure, invalid physical input or refused memory.
The Python bindings raise OutOfMemory as MemoryError and
every other variant as ValueError, each with the displayed message.
Variants§
InvalidInput(String)
The operation does not accept the input, for example a negative degree or a non-finite wavenumber.
Derivative(DerivativeError)
A derivative is unavailable at the supplied inputs or weights.
SpecialFunction(String)
An AMOS Bessel, Legendre, Ferrers, Wigner, incomplete gamma or Kambe evaluation failed.
NonFinite(String)
A finite input produced a non-finite value, for example an overflowing phase.
NotConverged(String)
A sum, series, iteration or decomposition did not reach its tolerance, or cancellation lost the accuracy.
Singular
A linear system (an LU solve, a 2 x 2 Mie inverse or an S-matrix solve) is singular at the supplied parameters.
OutOfMemory(String)
The system refused memory for an output or workspace. The bindings raise it as
MemoryError.
Implementations§
Source§impl Error
impl Error
Sourcepub fn out_of_memory(count: usize, element_bytes: usize) -> Self
pub fn out_of_memory(count: usize, element_bytes: usize) -> Self
OutOfMemory for count elements of element_bytes bytes
each: “cannot allocate 4096 bytes”, or “cannot allocate more than
18446744073709551615 bytes” (usize::MAX on 64-bit targets) when the product
overflows.
Sourcepub(crate) const fn is_numerical(&self) -> bool
pub(crate) const fn is_numerical(&self) -> bool
Whether the evaluation failed numerically (SpecialFunction, NonFinite or
NotConverged) rather than on its input, a singular system or memory.
Another method may succeed where one fails numerically: the one-dimensional spherical lattice sums then fall back to their spectral series.
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
Auto Trait Implementations§
impl Freeze for Error
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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§impl<T> Pointable for T
impl<T> Pointable 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.