pub struct LogCondition {
pub condition_number: f64,
pub angle: f64,
pub distance_to_cut_locus: f64,
pub quality: LogQuality,
}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(...);
}Fields§
§condition_number: f64Condition number for the logarithm computation.
For SU(2), this is approximately 1/sin(θ/2) for rotation angle θ, which diverges as θ → π (approaching the cut locus at -I).
angle: f64Rotation angle (for SO(3)/SU(2)) or equivalent metric.
Useful for understanding why conditioning is poor.
distance_to_cut_locus: f64Distance from the cut locus (θ = 2π for SU(2), θ = π for SO(3)).
Values close to 0 indicate the element is near the cut locus where the logarithm is ill-defined or ill-conditioned.
quality: LogQualityQuality assessment of the logarithm computation.
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 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.