pub struct LogCondition { /* private fields */ }Expand description
Conditioning information for logarithm computations.
The logarithm map on Lie groups becomes ill-conditioned near the cut locus (e.g., θ → π for SU(2), where the rotation axis becomes ambiguous). This structure provides quantitative information about the reliability of the computed logarithm.
§Condition Number Interpretation
The condition number κ measures how sensitive the output is to input
perturbations: |δ(log U)|/|log U| ≤ κ · |δU|/|U|
- κ ≈ 1: Well-conditioned, result is reliable
- κ ~ 10: Mildly ill-conditioned, expect ~1 digit loss of precision
- κ > 100: Severely ill-conditioned, result may be unreliable
- κ = ∞: At singularity (cut locus), axis is undefined
§Example
let (log_u, cond) = g.log_with_condition()?;
if cond.is_well_conditioned() {
// Safe to use log_u
} else if cond.is_usable() {
// Use with caution, reduced precision
eprintln!("Warning: log condition number = {:.1}", cond.condition_number());
} else {
// Result unreliable
return Err(...);
}Implementations§
Source§impl LogCondition
impl LogCondition
Sourcepub fn from_angle(angle: f64) -> Self
pub fn from_angle(angle: f64) -> Self
Create a new LogCondition from the rotation angle.
For SU(2)/SO(3), the condition number is approximately 1/sin(θ/2) where θ is the rotation angle.
Sourcepub fn condition_number(&self) -> f64
pub fn condition_number(&self) -> f64
Returns the condition number κ.
Sourcepub fn distance_to_cut_locus(&self) -> f64
pub fn distance_to_cut_locus(&self) -> f64
Returns the distance from the cut locus.
Sourcepub fn quality(&self) -> LogQuality
pub fn quality(&self) -> LogQuality
Returns the quality assessment.
Sourcepub fn is_well_conditioned(&self) -> bool
pub fn is_well_conditioned(&self) -> bool
Returns true if the result is well-conditioned (κ < 10).
Sourcepub fn is_singular(&self) -> bool
pub fn is_singular(&self) -> bool
Returns true if the result is at or near a singularity.
Trait Implementations§
Source§impl Clone for LogCondition
impl Clone for LogCondition
Source§fn clone(&self) -> LogCondition
fn clone(&self) -> LogCondition
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for LogCondition
impl RefUnwindSafe for LogCondition
impl Send for LogCondition
impl Sync for LogCondition
impl Unpin for LogCondition
impl UnsafeUnpin for LogCondition
impl UnwindSafe for LogCondition
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<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.