Skip to main content

Vector

Trait Vector 

Source
pub trait Vector {
    // Required methods
    fn dimension(&self) -> usize;
    fn add(&self, other: &Self) -> Self;
    fn sub(&self, other: &Self) -> Self;
    fn init(dimension: usize) -> Self;
    fn basis_vector(&self, position: usize) -> Self;
}
Expand description

The Vector trait describes the general properties of an element in a vector space.

Required Methods§

Source

fn dimension(&self) -> usize

Returns the vector’s dimension

Source

fn add(&self, other: &Self) -> Self

Add two vectors together

Source

fn sub(&self, other: &Self) -> Self

Substract two vectors

Source

fn init(dimension: usize) -> Self

Initialise vector type

Source

fn basis_vector(&self, position: usize) -> Self

Basis vector

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§