Trait vikos::linear_algebra::Vector [] [src]

pub trait Vector: Clone {
    type Scalar: Num + Zero + One + Copy + Encodable + Decodable + Default + Debug;
    fn dimension(&self) -> usize;
    fn at(&self, i: usize) -> Self::Scalar;
    fn mut_at(&mut self, i: usize) -> &mut Self::Scalar;

    fn dot(&self, other: &Self) -> Self::Scalar { ... }
}

Vector whose dimension is known at runtime

Assumes the Vector is represented as a tuple of numbers representing its projection along orthogonal base vectors

Associated Types

Underlying scalar type of Vector type

Required Methods

Maximum allowed index for at and mut_at

Length of projection along i-th base

Mutable access to length of projection along i-th base

Provided Methods

Scalar product

Default implementation using at and dimension is provided

Implementors