Trait alga::linear::FiniteDimVectorSpace [] [src]

pub trait FiniteDimVectorSpace: VectorSpace {
    fn dimension() -> usize;
    fn canonical_basis_element(i: usize) -> Self;
    fn component(&self, i: usize) -> Self::Field;
    fn dot(&self, other: &Self) -> Self::Field;
    unsafe fn component_unchecked(&self, i: usize) -> Self::Field;

    fn canonical_basis<F: FnMut(&Self) -> bool>(f: F) { ... }
}

A finite-dimensional vector space.

Required Methods

The vector space dimension.

The i-the canonical basis element.

Retrieves the i-th component of Self wrt. some basis.

As usual, indexing starts with 0. The actual choice of basis is usually context-dependent and is not specified to this method. It is up to the user to assume the provided component will by wrt. the suitable basis for his application.

The dot product between two vectors.

Same as .component(i) but without bound-checking.

Provided Methods

Applies the given closule to each element of this vector space's canonical basis. Stops if f returns false.

Implementors