Skip to main content

CartanError

Enum CartanError 

Source
pub enum CartanError {
    CutLocus {
        message: String,
    },
    NumericalFailure {
        operation: String,
        message: String,
    },
    NotOnManifold {
        constraint: String,
        violation: Real,
    },
    NotInTangentSpace {
        constraint: String,
        violation: Real,
    },
    LineSearchFailed {
        steps_tried: usize,
    },
    ConvergenceFailure {
        iterations: usize,
        gradient_norm: Real,
    },
}
Expand description

The unified error type for all cartan operations.

Each variant captures a specific class of failure with enough context to diagnose the problem. Mathematical operations that can fail (log map, parallel transport across cut locus, Cholesky of near-singular matrix) return Result<T, CartanError>.

Under no_alloc, message fields are &'static str (no heap). Under alloc or std, message fields are String (rich formatting).

Variants§

§

CutLocus

Log map failed: point is on or near the cut locus.

On the sphere, this means the two points are nearly antipodal. On SO(n), this means the rotation angle is near pi. On Cartan-Hadamard manifolds (SPD, Hyperbolic), this should never occur since the cut locus is empty.

Fields

§message: String
§

NumericalFailure

A matrix decomposition or numerical computation failed.

Examples: Cholesky on a matrix that lost positive-definiteness due to roundoff, SVD that did not converge, matrix logarithm of a matrix with negative eigenvalues.

Fields

§operation: String
§message: String
§

NotOnManifold

Point does not satisfy the manifold constraint.

The constraint field describes what was checked (e.g., “||p|| = 1” for the sphere), and violation gives the magnitude of the deviation.

Fields

§constraint: String
§violation: Real
§

NotInTangentSpace

Tangent vector is not in the tangent space at the given point.

The constraint field describes the tangent space condition (e.g., “p^T v = 0” for the sphere).

Fields

§constraint: String
§violation: Real
§

LineSearchFailed

Line search failed to find a step size satisfying the Armijo condition.

Fields

§steps_tried: usize
§

ConvergenceFailure

Optimizer did not converge within the maximum number of iterations.

Fields

§iterations: usize
§gradient_norm: Real

Trait Implementations§

Source§

impl Clone for CartanError

Source§

fn clone(&self) -> CartanError

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CartanError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for CartanError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for CartanError

Available on crate feature std only.
1.30.0 · Source§

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

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.