#[non_exhaustive]pub enum NumraError {
Show 18 variants
Linalg(LinalgError),
Convergence(ConvergenceError),
InvalidInput(String),
StepSizeTooSmall {
h: f64,
h_min: f64,
},
MaxIterations {
iterations: usize,
max: usize,
},
Stiffness {
t: f64,
message: String,
},
EventTermination {
t: f64,
event_index: usize,
},
NumericalOptim(OptimizationError),
Ode(String),
Optim(String),
Ocp(String),
Fit(String),
Signal(String),
LineSearch(String),
Interp(String),
Integrate(String),
Special(String),
Stats(String),
}Expand description
Errors that can occur in Numra operations.
NumraError is the workspace-wide error type into which every fallible
crate’s error converts via a From<…> for NumraError impl. This lets a
user write solve_ode(...)?.integrate(...)?.fit(...)? and have ? work
uniformly across crate boundaries.
Variants fall into two tiers:
- Low-level numerics-failure modes from
numra-core(structurally preserved):Linalg,Convergence,NumericalOptim. - Crate-level user-facing errors (stringified, tagged by source crate):
Ode,Optim,Ocp,Fit,Signal,LineSearch,Interp,Integrate,Special,Stats.
The NumericalOptim variant wraps numra-core’s
OptimizationError (line-search / descent / convergence failures that
happen inside algorithms regardless of which crate hosts them); the
Optim variant carries numra-optim::OptimError (the optimization
crate’s API-level failures: missing objective, infeasibility, unbounded,
etc.). The two are distinct concerns; do not confuse them.
NumraError is #[non_exhaustive]; new variants may be added in minor
releases. Match arms must include a _ => … catch-all.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Linalg(LinalgError)
Linear algebra error from numra-linalg / numra-core.
Convergence(ConvergenceError)
Convergence failure from a Newton or fixed-point iteration.
InvalidInput(String)
Invalid input that doesn’t fit a more specific variant.
StepSizeTooSmall
Step size became too small.
MaxIterations
Maximum iterations exceeded.
Stiffness
Integration reached a singularity or stiffness.
EventTermination
Event caused termination.
NumericalOptim(OptimizationError)
Numerical-optimization failure from inside an algorithm
(line search, descent, convergence). See OptimizationError.
Ode(String)
ODE solver error from numra-ode.
Optim(String)
Optimization error from numra-optim (API-level failures).
Ocp(String)
ODE-constrained-optimization error from numra-ocp.
Fit(String)
Curve-fitting error from numra-fit.
Signal(String)
Signal-processing error from numra-signal.
LineSearch(String)
Line-search error from numra-nonlinear.
Interp(String)
Interpolation error from numra-interp.
Integrate(String)
Numerical-integration (quadrature) error from numra-integrate.
Special(String)
Special-function evaluation error from numra-special.
Stats(String)
Statistics error from numra-stats.
Trait Implementations§
Source§impl Clone for NumraError
impl Clone for NumraError
Source§fn clone(&self) -> NumraError
fn clone(&self) -> NumraError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for NumraError
impl Debug for NumraError
Source§impl Display for NumraError
impl Display for NumraError
Source§impl Error for NumraError
Available on crate feature std only.
impl Error for NumraError
std only.1.30.0 · 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
use the Display impl or to_string()
Source§impl From<ConvergenceError> for NumraError
impl From<ConvergenceError> for NumraError
Source§fn from(e: ConvergenceError) -> Self
fn from(e: ConvergenceError) -> Self
Source§impl From<LinalgError> for NumraError
impl From<LinalgError> for NumraError
Source§fn from(e: LinalgError) -> Self
fn from(e: LinalgError) -> Self
Source§impl From<OptimizationError> for NumraError
impl From<OptimizationError> for NumraError
Source§fn from(e: OptimizationError) -> Self
fn from(e: OptimizationError) -> Self
Source§impl PartialEq for NumraError
impl PartialEq for NumraError
Source§fn eq(&self, other: &NumraError) -> bool
fn eq(&self, other: &NumraError) -> bool
self and other values to be equal, and is used by ==.