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
impl<M, D> Debug for ModelError<M, D> where
M: Model<D>,
D: Dim,
DefaultAllocator: Allocator<f64, D>,
DefaultAllocator: Allocator<f64, D, D>,
impl<M, D> Debug for ModelError<M, D> where
M: Model<D>,
D: Dim,
DefaultAllocator: Allocator<f64, D>,
DefaultAllocator: Allocator<f64, D, D>,
impl<M, D> Display for ModelError<M, D> where
M: Model<D>,
D: Dim,
DefaultAllocator: Allocator<f64, D>,
DefaultAllocator: Allocator<f64, D, D>,
impl<M, D> Display for ModelError<M, D> where
M: Model<D>,
D: Dim,
DefaultAllocator: Allocator<f64, D>,
DefaultAllocator: Allocator<f64, D, D>,
impl<M, D> Error for ModelError<M, D> where
M: Model<D>,
D: Dim,
DefaultAllocator: Allocator<f64, D>,
DefaultAllocator: Allocator<f64, D, D>,
impl<M, D> Error for ModelError<M, D> where
M: Model<D>,
D: Dim,
DefaultAllocator: Allocator<f64, D>,
DefaultAllocator: Allocator<f64, D, D>,
Auto Trait Implementations
impl<M, D> RefUnwindSafe for ModelError<M, D> where
<M as Model<D>>::InaccurateValuesError: RefUnwindSafe,
<M as Model<D>>::UnusableValuesError: RefUnwindSafe,
impl<M, D> Send for ModelError<M, D> where
<M as Model<D>>::InaccurateValuesError: Send,
<M as Model<D>>::UnusableValuesError: Send,
impl<M, D> Sync for ModelError<M, D> where
<M as Model<D>>::InaccurateValuesError: Sync,
<M as Model<D>>::UnusableValuesError: Sync,
impl<M, D> Unpin for ModelError<M, D> where
<M as Model<D>>::InaccurateValuesError: Unpin,
<M as Model<D>>::UnusableValuesError: Unpin,
impl<M, D> UnwindSafe for ModelError<M, D> where
<M as Model<D>>::InaccurateValuesError: UnwindSafe,
<M as Model<D>>::UnusableValuesError: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
The inverse inclusion map: attempts to construct self
from the equivalent element of its
superset. Read more
pub fn is_in_subset(&self) -> bool
pub fn is_in_subset(&self) -> bool
Checks if self
is actually part of its subset T
(and can be converted to it).
pub fn to_subset_unchecked(&self) -> SS
pub fn to_subset_unchecked(&self) -> SS
Use with care! Same as self.to_subset
but without any property checks. Always succeeds.
pub fn from_subset(element: &SS) -> SP
pub fn from_subset(element: &SS) -> SP
The inclusion map: converts self
to the equivalent element of its superset.