Skip to main content

Algebra

Trait Algebra 

Source
pub trait Algebra
where Self: Copy + Clone + Eq + PartialEq + Ord + PartialOrd + Default + Into<Symbol> + TryFrom<Symbol, Error = Symbol> + Debug + Display + Mul<Output = (i8, Self)> + Not<Output = (i8, Self)>,
{ const N: u32; // Required methods fn basis( ) -> impl ExactSizeIterator<Item = Self> + DoubleEndedIterator<Item = Self>; fn scalar() -> Self; fn pseudoscalar() -> Self; fn grade(&self) -> u32; fn blade_len(&self) -> usize; // Provided method fn rev(self) -> (i8, Self) { ... } }
Expand description

A geometric algebra defined by a flavor’s basis (i.e., all its basis blades).

Implementations for this trait (e.g., pga::Pga) define the basis of a particular flavor from which the Cayley table can be constructed. The generators of a basis (i.e., the basis blades of Self::grade() == 1) define the whole algebra whereas the required Mul operator implements the signature-aware anti-commutative multiplication for the chosen storage.

Required Associated Constants§

Source

const N: u32

The embedded dimension.

Not to be confused with the embedding dimension, e.g., N + 1 is the embedding dimension for one-up flavors of embedded dimension N.

Required Methods§

Source

fn basis() -> impl ExactSizeIterator<Item = Self> + DoubleEndedIterator<Item = Self>

The ordered basis (i.e., all basis blades).

Source

fn scalar() -> Self

The scalar.

Source

fn pseudoscalar() -> Self

The pseudoscalar.

Source

fn grade(&self) -> u32

The grade.

Source

fn blade_len(&self) -> usize

The number $n$ of basis blades with the same grade $g$ of this basis blade.

n = { N + 1  \choose g }

Provided Methods§

Source

fn rev(self) -> (i8, Self)

The reverse.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<const M: i8, const N: u32> Algebra for Pga<M, N>

Source§

const N: u32 = N