pub trait FiniteDimVectorSpace:
VectorSpace
+ Index<usize, Output = <Self as VectorSpace>::Field>
+ IndexMut<usize, Output = <Self as VectorSpace>::Field> {
// Required methods
fn dimension() -> usize;
fn canonical_basis_element(i: usize) -> Self;
fn dot(&self, other: &Self) -> Self::Field;
unsafe fn component_unchecked(&self, i: usize) -> &Self::Field;
unsafe fn component_unchecked_mut(&mut self, i: usize) -> &mut Self::Field;
// Provided method
fn canonical_basis<F: FnMut(&Self) -> bool>(f: F) { ... }
}Expand description
A finite-dimensional vector space.
Required Methods§
Sourcefn canonical_basis_element(i: usize) -> Self
fn canonical_basis_element(i: usize) -> Self
The i-the canonical basis element.
Sourceunsafe fn component_unchecked(&self, i: usize) -> &Self::Field
unsafe fn component_unchecked(&self, i: usize) -> &Self::Field
Same as &self[i] but without bound-checking.
Sourceunsafe fn component_unchecked_mut(&mut self, i: usize) -> &mut Self::Field
unsafe fn component_unchecked_mut(&mut self, i: usize) -> &mut Self::Field
Same as &mut self[i] but without bound-checking.
Provided Methods§
Sourcefn canonical_basis<F: FnMut(&Self) -> bool>(f: F)
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.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.