pub struct VerifiedMultivector<T, const P: usize, const Q: usize, const R: usize>{ /* private fields */ }Expand description
A verified multivector with compile-time signature guarantees
This structure ensures at the type level that:
- The signature is fixed and consistent
- Operations preserve algebraic laws
- Dimension bounds are respected
Implementations§
Source§impl<T, const P: usize, const Q: usize, const R: usize> VerifiedMultivector<T, P, Q, R>
impl<T, const P: usize, const Q: usize, const R: usize> VerifiedMultivector<T, P, Q, R>
Sourcepub const BASIS_SIZE: usize
pub const BASIS_SIZE: usize
The number of basis blades (2^n)
Sourcepub fn new(coefficients: Vec<T>) -> Result<Self, &'static str>
pub fn new(coefficients: Vec<T>) -> Result<Self, &'static str>
Create a new verified multivector from coefficients
§Type Invariants
- Coefficients array must have exactly 2^(P+Q+R) elements
- Signature is encoded at type level and cannot be violated
Sourcepub fn basis_vector(index: usize) -> Result<Self, &'static str>
pub fn basis_vector(index: usize) -> Result<Self, &'static str>
Sourcepub fn add(&self, other: &Self) -> Self
pub fn add(&self, other: &Self) -> Self
Addition of multivectors (same signature enforced by types)
Sourcepub fn geometric_product(&self, other: &Self) -> Self
pub fn geometric_product(&self, other: &Self) -> Self
Geometric product with compile-time signature matching
§Mathematical Properties (verified by Creusot when enabled)
- Associativity: (AB)C = A(BC)
- Distributivity: A(B+C) = AB + AC
- Identity: 1A = A1 = A
Trait Implementations§
Source§impl<T, const P: usize, const Q: usize, const R: usize> Clone for VerifiedMultivector<T, P, Q, R>
impl<T, const P: usize, const Q: usize, const R: usize> Clone for VerifiedMultivector<T, P, Q, R>
Source§fn clone(&self) -> VerifiedMultivector<T, P, Q, R>
fn clone(&self) -> VerifiedMultivector<T, P, Q, R>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<T, const P: usize, const Q: usize, const R: usize> Freeze for VerifiedMultivector<T, P, Q, R>
impl<T, const P: usize, const Q: usize, const R: usize> RefUnwindSafe for VerifiedMultivector<T, P, Q, R>where
T: RefUnwindSafe,
impl<T, const P: usize, const Q: usize, const R: usize> Send for VerifiedMultivector<T, P, Q, R>where
T: Send,
impl<T, const P: usize, const Q: usize, const R: usize> Sync for VerifiedMultivector<T, P, Q, R>where
T: Sync,
impl<T, const P: usize, const Q: usize, const R: usize> Unpin for VerifiedMultivector<T, P, Q, R>where
T: Unpin,
impl<T, const P: usize, const Q: usize, const R: usize> UnwindSafe for VerifiedMultivector<T, P, Q, R>where
T: UnwindSafe,
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
Mutably borrows from an owned value. Read more