Trait alga::linear::FiniteDimVectorSpace
[−]
[src]
pub trait FiniteDimVectorSpace: VectorSpace { fn dimension() -> usize; fn canonical_basis<F: FnOnce(&[Self])>(f: F); fn component(&self, i: usize) -> Self::Field; unsafe fn component_unchecked(&self, i: usize) -> Self::Field; }
A finite-dimensional vector space.
Required Methods
fn dimension() -> usize
The vector space dimension.
fn canonical_basis<F: FnOnce(&[Self])>(f: F)
The vector space canonical basis.
fn component(&self, i: usize) -> Self::Field
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.
unsafe fn component_unchecked(&self, i: usize) -> Self::Field
Same as .component(i)
but without bound-checking.