[][src]Trait vecfx::VecFloatExt

pub trait VecFloatExt {
    fn vecadd(&mut self, x: &[f64], c: f64);
fn vecdot(&self, other: &[f64]) -> f64;
fn veccpy(&mut self, x: &[f64]);
fn vecncpy(&mut self, x: &[f64]);
fn vecdiff(&mut self, x: &[f64], y: &[f64]);
fn vecscale(&mut self, c: f64);
fn vec2norm(&self) -> f64;
fn vec2norminv(&self) -> f64;
fn vecdist_squared(&self, other: &[f64]) -> f64; fn vecdist(&self, other: &[f64]) -> f64 { ... } }

Abstracting simple vector based math operations

Required methods

fn vecadd(&mut self, x: &[f64], c: f64)

y += c*x

fn vecdot(&self, other: &[f64]) -> f64

vector dot product s = x.dot(y)

fn veccpy(&mut self, x: &[f64])

y = z

fn vecncpy(&mut self, x: &[f64])

y = -x

fn vecdiff(&mut self, x: &[f64], y: &[f64])

z = x - y

fn vecscale(&mut self, c: f64)

y *= c

fn vec2norm(&self) -> f64

||x||

fn vec2norminv(&self) -> f64

1 / ||x||

fn vecdist_squared(&self, other: &[f64]) -> f64

d = ||a-b||^2

Loading content...

Provided methods

fn vecdist(&self, other: &[f64]) -> f64

d = ||a-b||

Loading content...

Implementations on Foreign Types

impl VecFloatExt for [f64][src]

fn vecadd(&mut self, x: &[f64], c: f64)[src]

y += c*x

fn vecdot(&self, other: &[f64]) -> f64[src]

s = y.dot(x)

fn vecscale(&mut self, c: f64)[src]

y *= c

fn veccpy(&mut self, x: &[f64])[src]

y = x

fn vecncpy(&mut self, x: &[f64])[src]

y = -x

fn vecdiff(&mut self, x: &[f64], y: &[f64])[src]

z = x - y

fn vec2norm(&self) -> f64[src]

||x||

fn vec2norminv(&self) -> f64[src]

1/||x||

fn vecdist_squared(&self, other: &[f64]) -> f64[src]

d = ||a-b||^2

Loading content...

Implementors

Loading content...