Function russell_lab::inner[][src]

pub fn inner(u: &Vector, v: &Vector) -> f64
Expand description

Performs the inner (dot) product between two vectors resulting in a scalar value

 s := u dot v

Note

The lengths of both vectors may be different; the smallest length will be selected.

Example

use russell_lab::*;
let u = Vector::from(&[1.0, 2.0, 3.0]);
let v = Vector::from(&[5.0, -2.0, 0.0, 1.0]);
let s = inner(&u, &v);
assert_eq!(s, 1.0);