pub struct GeometricError {
pub distance: f64,
pub gradient: [f64; 3],
pub correction: [f64; 8],
pub description: String,
}Expand description
Geometric error information for test failures
Unlike boolean test failures, geometric errors tell you:
- How far the state is from being valid (distance)
- Which direction to move to become valid (gradient)
- What the nearest valid state would be (correction)
Fields§
§distance: f64Distance from expected manifold (scalar)
gradient: [f64; 3]Gradient pointing toward valid states
This is the direction of steepest descent toward the manifold. Stored as coefficients [e1, e2, e3] for the vector part.
correction: [f64; 8]Projected correction to nearest valid state
If you add this to the invalid state, you get the nearest valid state. Stored as full multivector coefficients.
description: StringHuman-readable description of the error
Implementations§
Source§impl GeometricError
impl GeometricError
Sourcepub fn with_gradient(self, gradient: [f64; 3]) -> Self
pub fn with_gradient(self, gradient: [f64; 3]) -> Self
Create error with gradient information
Sourcepub fn with_correction(self, correction: [f64; 8]) -> Self
pub fn with_correction(self, correction: [f64; 8]) -> Self
Create error with correction information
Sourcepub fn from_multivector(error_mv: &GA3, description: impl Into<String>) -> Self
pub fn from_multivector(error_mv: &GA3, description: impl Into<String>) -> Self
Create error from a GA3 multivector representing the error
Note: In GA3, basis blade indices use binary representation:
- 0 = scalar, 1 = e1, 2 = e2, 3 = e12, 4 = e3, 5 = e13, 6 = e23, 7 = e123
Sourcepub fn is_within_tolerance(&self, epsilon: f64) -> bool
pub fn is_within_tolerance(&self, epsilon: f64) -> bool
Check if this error is within tolerance
Sourcepub fn gradient_as_ga3(&self) -> GA3
pub fn gradient_as_ga3(&self) -> GA3
Get the gradient as a GA3 vector
Sourcepub fn correction_as_ga3(&self) -> GA3
pub fn correction_as_ga3(&self) -> GA3
Get the correction as a GA3 multivector
Trait Implementations§
Source§impl Clone for GeometricError
impl Clone for GeometricError
Source§fn clone(&self) -> GeometricError
fn clone(&self) -> GeometricError
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for GeometricError
impl Debug for GeometricError
Source§impl<'de> Deserialize<'de> for GeometricError
impl<'de> Deserialize<'de> for GeometricError
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Display for GeometricError
impl Display for GeometricError
Source§impl Error for GeometricError
impl Error for GeometricError
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
Auto Trait Implementations§
impl Freeze for GeometricError
impl RefUnwindSafe for GeometricError
impl Send for GeometricError
impl Sync for GeometricError
impl Unpin for GeometricError
impl UnsafeUnpin for GeometricError
impl UnwindSafe for GeometricError
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<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more