logo
pub trait Basis: FiniteDimensional + Sized {
    type Bases: IntoIterator<Item = Self>;

    fn canonical_basis() -> Self::Bases;

    fn canonical_basis_component(index: usize) -> Option<Self> { ... }
    fn i() -> Self
    where
        Self::N: Cmp<U0, Output = Greater>
, { ... } fn j() -> Self
    where
        Self::N: Cmp<U1, Output = Greater>
, { ... } fn k() -> Self
    where
        Self::N: Cmp<U2, Output = Greater>
, { ... } }
Expand description

Describes the basis of a vector space.

Required Associated Types

Required Methods

Gets a type that can be converted into an iterator over the canonical or standard basis vectors of the space.

Such basis vectors must only have one component set to the multiplicative identity and all other components set to the additive identity (one and zero in $\Reals$, respectively). Moreover, the set of basis vectors must contain ordered and unique elements and be of size equal to the dimensionality of the space.

For example, the set of canonical basis vectors for the real coordinate space $\Reals^3$ is:

$$ \{\hat{i},\hat{j},\hat{k}\}= \left\{ \begin{bmatrix}1\\0\\0\end{bmatrix}, \begin{bmatrix}0\\1\\0\end{bmatrix}, \begin{bmatrix}0\\0\\1\end{bmatrix} \right\} $$

Provided Methods

Gets the canonical basis vector $\hat{i}$ that describes the $x$ axis.

Gets the canonical basis vector $\hat{j}$ that describes the $y$ axis.

Gets the canonical basis vector $\hat{k}$ that describes the $z$ axis.

Implementations on Foreign Types

Implementors