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
fn dimension() -> usize
The vector space dimension.
fn canonical_basis_element(i: usize) -> Self
The i-the canonical basis element.
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.
fn dot(&self, other: &Self) -> Self::Field
The dot product between two vectors.
unsafe fn component_unchecked(&self, i: usize) -> Self::Field
Same as .component(i)
but without bound-checking.
Provided Methods
fn canonical_basis<F: FnMut(&Self) -> bool>(f: F)
Applies the given closule to each element of this vector space's canonical basis. Stops if
f
returns false
.