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.
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.
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.
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).
LineSearchFailed
Line search failed to find a step size satisfying the Armijo condition.
ConvergenceFailure
Optimizer did not converge within the maximum number of iterations.
Trait Implementations§
Source§impl Clone for CartanError
impl Clone for CartanError
Source§fn clone(&self) -> CartanError
fn clone(&self) -> CartanError
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CartanError
impl Debug for CartanError
Source§impl Display for CartanError
impl Display for CartanError
Source§impl Error for CartanError
Available on crate feature std only.
impl Error for CartanError
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()