KVector

Struct KVector 

Source
pub struct KVector<T, const K: usize, const P: usize, const Q: usize, const R: usize>
where T: Float + Zero + One,
{ /* private fields */ }
Expand description

Type-safe k-vector (homogeneous grade element)

This type guarantees at compile-time that the multivector contains only elements of grade K

Implementations§

Source§

impl<T, const K: usize, const P: usize, const Q: usize, const R: usize> KVector<T, K, P, Q, R>
where T: Float + Zero + One,

Source

pub fn from_multivector(mv: VerifiedMultivector<T, P, Q, R>) -> Self

Create a k-vector from a general multivector by grade projection

Source

pub const fn grade(&self) -> usize

Get the grade (always returns K due to type constraint)

Source

pub fn inner_product(&self, other: &Self) -> T

Inner product with another k-vector (produces a scalar)

Trait Implementations§

Source§

impl<T, const P: usize, const Q: usize, const R: usize> OuterProduct<T, 1, P, Q, R> for KVector<T, 1, P, Q, R>
where T: Float + Zero + One,

Source§

type Output = KVector<T, 2, P, Q, R>

Source§

fn outer_product(&self, other: &KVector<T, 1, P, Q, R>) -> Self::Output

Source§

impl<T, const P: usize, const Q: usize, const R: usize> OuterProduct<T, 1, P, Q, R> for KVector<T, 2, P, Q, R>
where T: Float + Zero + One,

Source§

type Output = KVector<T, 3, P, Q, R>

Source§

fn outer_product(&self, _other: &KVector<T, 1, P, Q, R>) -> Self::Output

Source§

impl<T, const P: usize, const Q: usize, const R: usize> OuterProduct<T, 2, P, Q, R> for KVector<T, 1, P, Q, R>
where T: Float + Zero + One,

Source§

type Output = KVector<T, 3, P, Q, R>

Source§

fn outer_product(&self, _other: &KVector<T, 2, P, Q, R>) -> Self::Output

Auto Trait Implementations§

§

impl<T, const K: usize, const P: usize, const Q: usize, const R: usize> Freeze for KVector<T, K, P, Q, R>

§

impl<T, const K: usize, const P: usize, const Q: usize, const R: usize> RefUnwindSafe for KVector<T, K, P, Q, R>
where T: RefUnwindSafe,

§

impl<T, const K: usize, const P: usize, const Q: usize, const R: usize> Send for KVector<T, K, P, Q, R>
where T: Send,

§

impl<T, const K: usize, const P: usize, const Q: usize, const R: usize> Sync for KVector<T, K, P, Q, R>
where T: Sync,

§

impl<T, const K: usize, const P: usize, const Q: usize, const R: usize> Unpin for KVector<T, K, P, Q, R>
where T: Unpin,

§

impl<T, const K: usize, const P: usize, const Q: usize, const R: usize> UnwindSafe for KVector<T, K, P, Q, R>
where T: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.