pub enum OptimizerError {
Show 16 variants
LinearSolveFailed(String),
MaxIterationsReached {
max_iters: usize,
},
TrustRegionFailure {
radius: f64,
min_radius: f64,
},
DampingFailure {
damping: f64,
max_damping: f64,
},
CostIncrease {
old_cost: f64,
new_cost: f64,
},
JacobianFailed(String),
InvalidParameters(String),
NumericalInstability(String),
LinAlg(LinAlgError),
Core(CoreError),
Linearizer(LinearizerError),
EmptyProblem,
NoResidualBlocks,
JacobiScalingCreation(String),
JacobiScalingNotInitialized,
UnknownLinearSolver(String),
}Expand description
Optimizer-specific error types for apex-solver
Variants§
LinearSolveFailed(String)
Linear system solve failed during optimization
MaxIterationsReached
Maximum iterations reached without achieving convergence
TrustRegionFailure
Trust region radius became too small
DampingFailure
Damping parameter became too large (LM-specific)
CostIncrease
Cost increased unexpectedly when it should decrease
JacobianFailed(String)
Jacobian computation failed
InvalidParameters(String)
Invalid optimization parameters provided
NumericalInstability(String)
Numerical instability detected (NaN, Inf in cost, gradient, or parameters)
LinAlg(LinAlgError)
Linear algebra operation failed
Convention: When a LinAlgError occurs during optimization, it wraps
here via ? to preserve optimizer context. This ensures the error
propagates as ApexSolverError::Optimizer(OptimizerError::LinAlg(...))
at the API level, not ApexSolverError::LinearAlgebra(...).
Core(CoreError)
Core module error (problem construction, factor linearization)
Wraps errors from the core module that occur during optimization, such as symbolic structure failures or parallel computation errors.
Linearizer(LinearizerError)
Linearizer error (Jacobian assembly, symbolic structure)
Wraps errors from the linearizer module that occur during optimization, such as symbolic structure failures or variable mapping errors.
EmptyProblem
Problem has no variables to optimize
NoResidualBlocks
Problem has no residual blocks
JacobiScalingCreation(String)
Jacobi scaling matrix creation failed
JacobiScalingNotInitialized
Jacobi scaling not initialized when expected
UnknownLinearSolver(String)
Unknown or unsupported linear solver type
Trait Implementations§
Source§impl Clone for OptimizerError
impl Clone for OptimizerError
Source§fn clone(&self) -> OptimizerError
fn clone(&self) -> OptimizerError
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 OptimizerError
impl Debug for OptimizerError
Source§impl Display for OptimizerError
impl Display for OptimizerError
Source§impl Error for OptimizerError
impl Error for OptimizerError
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<CoreError> for OptimizerError
impl From<CoreError> for OptimizerError
Source§impl From<LinAlgError> for OptimizerError
impl From<LinAlgError> for OptimizerError
Source§fn from(source: LinAlgError) -> Self
fn from(source: LinAlgError) -> Self
Source§impl From<LinearizerError> for OptimizerError
impl From<LinearizerError> for OptimizerError
Source§fn from(source: LinearizerError) -> Self
fn from(source: LinearizerError) -> Self
Source§impl From<OptimizerError> for ApexSolverError
impl From<OptimizerError> for ApexSolverError
Source§fn from(source: OptimizerError) -> Self
fn from(source: OptimizerError) -> Self
Auto Trait Implementations§
impl Freeze for OptimizerError
impl RefUnwindSafe for OptimizerError
impl Send for OptimizerError
impl Sync for OptimizerError
impl Unpin for OptimizerError
impl UnsafeUnpin for OptimizerError
impl UnwindSafe for OptimizerError
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> CustomError for T
impl<T> CustomError for T
Source§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
Source§impl<T> ErrorLogging for Twhere
T: Display,
impl<T> ErrorLogging for Twhere
T: Display,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§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).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.