pub struct SignatureSpec {
pub basis: Vec<BasisVector>,
pub p: usize,
pub q: usize,
pub r: usize,
}Expand description
Metric signature specification.
Defines the basis vectors and their metric (how they square).
Fields§
§basis: Vec<BasisVector>All basis vectors with their properties.
p: usizeNumber of positive-square basis vectors.
q: usizeNumber of negative-square basis vectors.
r: usizeNumber of zero-square (degenerate) basis vectors.
Implementations§
Source§impl SignatureSpec
impl SignatureSpec
Sourcepub fn num_blades(&self) -> usize
pub fn num_blades(&self) -> usize
Total number of blades (2^dim).
Sourcepub fn positive_indices(&self) -> impl Iterator<Item = usize> + '_
pub fn positive_indices(&self) -> impl Iterator<Item = usize> + '_
Returns indices of basis vectors that square to +1 (positive metric).
Sourcepub fn metrics_by_index(&self) -> Vec<i8>
pub fn metrics_by_index(&self) -> Vec<i8>
Returns a vector of metric values indexed by basis index.
This is useful for creating an Algebra with the correct per-basis metrics:
let metrics = signature.metrics_by_index();
let algebra = Algebra::from_metrics(metrics);Sourcepub fn negative_indices(&self) -> impl Iterator<Item = usize> + '_
pub fn negative_indices(&self) -> impl Iterator<Item = usize> + '_
Returns indices of basis vectors that square to -1 (negative metric).
Sourcepub fn degenerate_indices(&self) -> impl Iterator<Item = usize> + '_
pub fn degenerate_indices(&self) -> impl Iterator<Item = usize> + '_
Returns indices of basis vectors that square to 0 (degenerate/null).
In PGA, this is typically the e0 basis (projective origin).
Sourcepub fn is_degenerate(&self) -> bool
pub fn is_degenerate(&self) -> bool
Returns true if this algebra has a degenerate metric (r > 0).
Algebras with degenerate metrics (like PGA) have different normalization behavior and require bulk/weight decomposition.
Sourcepub fn is_indefinite(&self) -> bool
pub fn is_indefinite(&self) -> bool
Returns true if this algebra has an indefinite metric (q > 0).
Algebras with indefinite metrics (like Minkowski) can have timelike, spacelike, and lightlike vectors.
Sourcepub fn signature_type_name(&self) -> String
pub fn signature_type_name(&self) -> String
Returns the signature type name derived from (p, q, r).
This generates a generic name like Cl3_0_1 instead of algebra-specific
names like “Projective3”.
Trait Implementations§
Source§impl Clone for SignatureSpec
impl Clone for SignatureSpec
Source§fn clone(&self) -> SignatureSpec
fn clone(&self) -> SignatureSpec
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 SignatureSpec
impl RefUnwindSafe for SignatureSpec
impl Send for SignatureSpec
impl Sync for SignatureSpec
impl Unpin for SignatureSpec
impl UnwindSafe for SignatureSpec
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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