Trait VectorExt

Source
pub trait VectorExt {
    // Required methods
    fn zero(n: usize) -> Vec<f64>;
    fn nan(n: usize) -> Vec<f64>;
    fn is_finite(&self) -> bool;
    fn dot(&self, a: &Self) -> f64;
    fn norm_max(&self) -> f64;
    fn norm_l2(&self) -> f64;
    fn add_vec(&self, b: &Self) -> Vec<f64>;
    fn sub_vec(&self, b: &Self) -> Vec<f64>;
    fn dist_l2(&self, b: &Self) -> f64;
    fn dist_max(&self, b: &Self) -> f64;
    fn display(&self) -> impl Display;
}
Expand description

Basic linear algebra functions.

Required Methods§

Source

fn zero(n: usize) -> Vec<f64>

Source

fn nan(n: usize) -> Vec<f64>

Source

fn is_finite(&self) -> bool

Source

fn dot(&self, a: &Self) -> f64

Source

fn norm_max(&self) -> f64

Source

fn norm_l2(&self) -> f64

Source

fn add_vec(&self, b: &Self) -> Vec<f64>

Source

fn sub_vec(&self, b: &Self) -> Vec<f64>

Source

fn dist_l2(&self, b: &Self) -> f64

Source

fn dist_max(&self, b: &Self) -> f64

Source

fn display(&self) -> impl Display

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.

Implementations on Foreign Types§

Source§

impl VectorExt for [f64]

Source§

fn zero(n: usize) -> Vec<f64>

Source§

fn nan(n: usize) -> Vec<f64>

Source§

fn is_finite(&self) -> bool

Source§

fn dot(&self, b: &Self) -> f64

Source§

fn norm_max(&self) -> f64

Source§

fn norm_l2(&self) -> f64

Source§

fn dist_l2(&self, b: &Self) -> f64

Source§

fn dist_max(&self, b: &Self) -> f64

Source§

fn add_vec(&self, b: &Self) -> Vec<f64>

Source§

fn sub_vec(&self, b: &Self) -> Vec<f64>

Source§

fn display(&self) -> impl Display

Implementors§