Skip to main content

NumericError

Enum NumericError 

Source
#[non_exhaustive]
pub enum NumericError { NonFiniteInput { name: &'static str, }, NonFiniteEvaluation { name: &'static str, at: Option<f64>, }, InvalidArgument { name: &'static str, reason: &'static str, }, DimensionMismatch { name: &'static str, expected: usize, found: usize, }, NoSignChange { f_lower: f64, f_upper: f64, }, ZeroPolynomial, Singular { name: &'static str, }, RankDeficient { name: &'static str, rank: usize, required: usize, }, NotSymmetric { row: usize, column: usize, }, NotPositiveDefinite { pivot: usize, }, NotConverged { name: &'static str, error_estimate: f64, }, }
Expand description

Why a numeric routine refused its input or could not produce a value.

Every variant names the offending argument or condition. A routine never substitutes a default, clamps silently, or returns NaN in place of one of these.

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

NonFiniteInput

An input value was NaN or infinite. name is the argument.

Fields

§name: &'static str

The argument that was not finite, such as "lower bound".

§

NonFiniteEvaluation

A caller-supplied function returned NaN or infinity.

Fields

§name: &'static str

Which function, such as "integrand" or "residuals".

§at: Option<f64>

The scalar argument it was evaluated at, when it has one.

§

InvalidArgument

An argument was finite but outside its valid range.

Fields

§name: &'static str

The argument, such as "x tolerance".

§reason: &'static str

What it must satisfy.

§

DimensionMismatch

Sizes of two arguments disagree.

Fields

§name: &'static str

The argument whose size is wrong.

§expected: usize

The size it must have.

§found: usize

The size it has.

§

NoSignChange

The function has the same sign at both ends of the bracket, so a root is not guaranteed between them.

Fields

§f_lower: f64

Value at the lower end.

§f_upper: f64

Value at the upper end.

§

ZeroPolynomial

Every coefficient of the polynomial is zero: every point is a root.

§

Singular

A square matrix is singular to working precision.

Fields

§name: &'static str

Which matrix, such as "system matrix".

§

RankDeficient

A least-squares matrix has fewer independent columns than unknowns, so the solution is not unique.

Fields

§name: &'static str

Which matrix.

§rank: usize

Numerical rank found.

§required: usize

Rank required (the number of unknowns or constraints).

§

NotSymmetric

A matrix given to a symmetric solver is not symmetric.

Fields

§row: usize

Row of the first asymmetric pair found.

§column: usize

Column of the first asymmetric pair found.

§

NotPositiveDefinite

A symmetric matrix is not positive definite to working precision.

Fields

§pivot: usize

Index of the first non-positive pivot.

§

NotConverged

An iterative routine stopped without meeting its tolerance. Returned only by the converged() accessors; the routines themselves report this case in their result’s status with the estimate they reached.

Fields

§name: &'static str

Which routine.

§error_estimate: f64

The error estimate it reached.

Trait Implementations§

Source§

impl Clone for NumericError

Source§

fn clone(&self) -> Self

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 NumericError

Source§

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

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

impl Display for NumericError

Source§

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

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

impl Error for NumericError

1.30.0 · 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 PartialEq for NumericError

Source§

fn eq(&self, other: &Self) -> 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 NumericError

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

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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

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.