pub enum MathError {
Singular,
NotSpd,
DimensionMismatch,
NoConvergence,
BracketNotStraddling,
}Expand description
Errors raised by the numerical primitives in math.
These are domain errors — every routine is a pure function and never panics on the inputs it accepts; “domain” means the input violates the algorithm’s preconditions (singular matrix, non-SPD matrix, bracket fails to straddle a root, etc.).
§Examples
use regit_curves::math::MathError;
let err = MathError::Singular;
assert_eq!(format!("{err}"), "matrix is singular");Variants§
Singular
A pivot collapsed below tolerance during elimination — the matrix is singular (up to round-off).
NotSpd
Cholesky decomposition encountered a non-positive pivot — the matrix is not symmetric positive-definite.
DimensionMismatch
Inputs to a solver have inconsistent dimensions.
NoConvergence
Iterative algorithm did not converge to the requested tolerance within the iteration cap.
BracketNotStraddling
f(a) and f(b) do not straddle zero, so a bracketed root-finder
cannot make progress.
Trait Implementations§
impl Copy for MathError
impl Eq for MathError
Source§impl Error for MathError
impl Error for MathError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
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
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl From<MathError> for CurveError
impl From<MathError> for CurveError
impl StructuralPartialEq for MathError
Auto Trait Implementations§
impl Freeze for MathError
impl RefUnwindSafe for MathError
impl Send for MathError
impl Sync for MathError
impl Unpin for MathError
impl UnsafeUnpin for MathError
impl UnwindSafe for MathError
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
Mutably borrows from an owned value. Read more