Enum newton_rootfinder::model::ModelError[][src]

pub enum ModelError<M, D> where
    M: Model<D>,
    D: Dim,
    DefaultAllocator: Allocator<f64, D>,
    DefaultAllocator: Allocator<f64, D, D>, 
{ InaccurateValuesError(M::InaccurateValuesError), UnusableValuesError(M::UnusableValuesError), }
Expand description

User model error definition

If the user model raise an error, depending of the phase during which it happens, it can be recoverable or not.

From the algorithms point of view, there are three phases:

  • initialization
  • iterations
  • final evaluation

User error are categorized as the following:

  • numerical values exist but are inaccurate:
    • recoverable except if it happens in the final evaluation, in this case the algorithm can continue with hope it will recover before the final evaluation
    • the source of such an error could be an out of validity range on a component of the user model
  • unusable numerical values such as NaN, None, defaults values or random values.
    • recoverable if it happens during the iterations phase, the algorithm will forget this iteration and try to perform a new one with slightly changed inputs

The ModelError enum is wrapping the Error trait from the standard library, so that the user can sub-classify its error, such as:

  • InaccurateValuesError(Box<OutOfValidityRangeError>)
  • InaccurateValuesError(Box<ExtrapolationError>)

The rootfinder algorithm will not act on the subclassification, but the information can be reported in errors logs.

Variants

InaccurateValuesError(M::InaccurateValuesError)

Tuple Fields of InaccurateValuesError

0: M::InaccurateValuesError
UnusableValuesError(M::UnusableValuesError)

Tuple Fields of UnusableValuesError

0: M::UnusableValuesError

Trait Implementations

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

The lower-level source of this error, if any. Read more

🔬 This is a nightly-only experimental API. (backtrace)

Returns a stack backtrace, if available, of where this error occurred. Read more

👎 Deprecated since 1.42.0:

use the Display impl or to_string()

👎 Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Should always be Self

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more

Checks if self is actually part of its subset T (and can be converted to it).

Use with care! Same as self.to_subset but without any property checks. Always succeeds.

The inclusion map: converts self to the equivalent element of its superset.

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.