Trait VAdd

Source
pub trait VAdd<Rhs: Vector>: Vector
where Self::Output: Vector,
{ type Output; // Required method fn add(self, rhs: Rhs) -> Self::Output; }

Required Associated Types§

Required Methods§

Source

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

Adds two vector-arrays of equal dimensions

u + v

§Arguments
  • rhs - The addend vector
§Examples
let u = [1.0, 2.0];
let v = [3.0, 4.0];
let w = [u[0] + v[0], u[1] + v[1]];
assert_eq!(u.add(v), w);

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<T1, T2, const L: usize> VAdd<[T2; L]> for [T1; L]
where Self: Vector, [T2; L]: Vector, [<T1 as Add<T2>>::Output; L]: Vector, T1: Add<T2> + Clone, T2: Clone,

Source§

type Output = [<T1 as Add<T2>>::Output; L]

Source§

fn add(self, rhs: [T2; L]) -> Self::Output

Implementors§