pub struct ConstraintDeriver<'a> { /* private fields */ }Expand description
Derives constraint expressions from algebra structure.
Implementations§
Source§impl<'a> ConstraintDeriver<'a>
impl<'a> ConstraintDeriver<'a>
Sourcepub fn new(algebra: &'a Algebra, involution: InvolutionKind) -> Self
pub fn new(algebra: &'a Algebra, involution: InvolutionKind) -> Self
Creates a new constraint deriver with the specified involution.
Sourcepub fn derive_geometric_constraint(
&self,
ty: &TypeSpec,
field_prefix: &str,
) -> Option<DerivedConstraint>
pub fn derive_geometric_constraint( &self, ty: &TypeSpec, field_prefix: &str, ) -> Option<DerivedConstraint>
Derives the geometric constraint for a type.
Computes u * involution(u) symbolically and returns the non-scalar
terms that must equal zero. The involution used is determined by
the algebra’s configuration (reverse, grade involution, or Clifford conjugate).
§Returns
Some(constraint)if the type has non-trivial constraintsNoneifu * reverse(u)is purely scalar (no constraints needed)
Sourcepub fn derive_antiproduct_constraint(
&self,
ty: &TypeSpec,
field_prefix: &str,
) -> Option<DerivedConstraint>
pub fn derive_antiproduct_constraint( &self, ty: &TypeSpec, field_prefix: &str, ) -> Option<DerivedConstraint>
Derives the antiproduct constraint for a type.
Computes u ⊟ antireverse(u) symbolically and returns the non-pseudoscalar
terms that must equal zero.
The antiproduct is defined as: a ⊟ b = dual(dual(a) * dual(b))
where dual(x) = x * I⁻¹ (right complement with pseudoscalar).
§Returns
Some(constraint)if the type has non-trivial antiproduct constraintsNoneifu ⊟ antireverse(u)is purely pseudoscalar (no constraints needed)
Sourcepub fn derive_all_constraints(
&self,
ty: &TypeSpec,
field_prefix: &str,
) -> Option<DerivedConstraint>
pub fn derive_all_constraints( &self, ty: &TypeSpec, field_prefix: &str, ) -> Option<DerivedConstraint>
Derives all constraints for a type (both geometric and antiproduct).
Returns the combined set of constraint expressions that must equal zero. Symbolically equivalent expressions are deduplicated using Symbolica.
Sourcepub fn derive_norm_squared(&self, ty: &TypeSpec, field_prefix: &str) -> Atom
pub fn derive_norm_squared(&self, ty: &TypeSpec, field_prefix: &str) -> Atom
Derives the scalar norm expression (scalar part of u * reverse(u)).
This is useful for generating norm_squared() implementations.
Sourcepub fn derive_antinorm_squared(&self, ty: &TypeSpec, field_prefix: &str) -> Atom
pub fn derive_antinorm_squared(&self, ty: &TypeSpec, field_prefix: &str) -> Atom
Derives the antiscalar norm expression (pseudoscalar part of u ⊟ antireverse(u)).
This is useful for generating weight norm implementations in PGA.
Sourcepub fn derive_weight_norm_squared(
&self,
ty: &TypeSpec,
field_prefix: &str,
) -> Atom
pub fn derive_weight_norm_squared( &self, ty: &TypeSpec, field_prefix: &str, ) -> Atom
Derives the weight norm squared expression for PGA types.
In PGA, the weight norm is the degenerate part of the element. For points, this is the w coordinate. For planes, it’s the d coefficient. The weight norm squared is the sum of squares of all weight (degenerate) fields.
Weight fields are those whose blade contains the degenerate basis vector (e0).
Sourcepub fn derive_bulk_norm_squared(
&self,
ty: &TypeSpec,
field_prefix: &str,
) -> Atom
pub fn derive_bulk_norm_squared( &self, ty: &TypeSpec, field_prefix: &str, ) -> Atom
Derives the bulk norm squared expression for PGA types.
In PGA, the bulk norm is the non-degenerate part of the element. The bulk norm squared is the sum of squares of all bulk (non-degenerate) fields.
Bulk fields are those whose blade does NOT contain the degenerate basis vector (e0).
Sourcepub fn derive_weight_components(
&self,
ty: &TypeSpec,
field_prefix: &str,
) -> Vec<Atom>
pub fn derive_weight_components( &self, ty: &TypeSpec, field_prefix: &str, ) -> Vec<Atom>
Derives individual weight component expressions for the Ideal wrapper.
For Ideal elements (elements at infinity in PGA), all weight components must be zero. This returns a list of the symbolic expressions for each weight field, which can be used as constraints in Groebner simplification.
Auto Trait Implementations§
impl<'a> Freeze for ConstraintDeriver<'a>
impl<'a> RefUnwindSafe for ConstraintDeriver<'a>
impl<'a> Send for ConstraintDeriver<'a>
impl<'a> Sync for ConstraintDeriver<'a>
impl<'a> Unpin for ConstraintDeriver<'a>
impl<'a> UnwindSafe for ConstraintDeriver<'a>
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> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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