Trait Dot

Source
pub trait Dot<Rhs: Vector>: Vector {
    type Output;

    // Required method
    fn dot(self, rhs: Rhs) -> Self::Output;
}

Required Associated Types§

Required Methods§

Source

fn dot(self, rhs: Rhs) -> Self::Output

Returns the scalar dot product of two vector-arrays

u ⋅ v

§Arguments
  • rhs - A vector of same length
§Examples
let u = [1.0, 2.0, 3.0];
let v = [1.0, 2.0, 3.0];
let uv = 1.0 + 4.0 + 9.0;
 
assert_eq!(u.dot(v), uv);

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<F, const L: usize> Dot<[F; L]> for [F; L]
where Self: Vector, F: Mul<F, Output = F> + Add<F, Output = F> + Zero + Clone,

Source§

type Output = F

Source§

fn dot(self, rhs: [F; L]) -> Self::Output

Implementors§