VectorSpace

Trait VectorSpace 

Source
pub trait VectorSpace<V, S = f64> {
    // Required methods
    fn add(&self, x: &V, y: &V) -> V;
    fn sub(&self, x: &V, y: &V) -> V;
    fn scale(&self, scalar: S, x: &V) -> V;
    fn zero(&self) -> V;
    fn dimension(&self) -> Option<usize>;
}
Expand description

A vector space over a scalar field.

This is the most fundamental algebraic structure, providing addition and scalar multiplication.

§Type Parameters

  • V - The type of vectors in the space
  • S - The scalar field (typically f64 or Complex<f64>)

Required Methods§

Source

fn add(&self, x: &V, y: &V) -> V

Add two vectors.

Source

fn sub(&self, x: &V, y: &V) -> V

Subtract two vectors.

Source

fn scale(&self, scalar: S, x: &V) -> V

Multiply a vector by a scalar.

Source

fn zero(&self) -> V

Return the zero vector.

Source

fn dimension(&self) -> Option<usize>

Return the dimension of the space (may be infinite).

Implementors§

Source§

impl<const P: usize, const Q: usize, const R: usize> VectorSpace<Multivector<P, Q, R>> for MultivectorHilbertSpace<P, Q, R>

Source§

impl<const P: usize, const Q: usize, const R: usize> VectorSpace<L2Function<P, Q, R>> for MultivectorL2<P, Q, R>