array_matrix/vector/
div.rs1use std::ops::Div;
2
3use crate::Vector;
4
5pub trait VDiv<Rhs>: Vector
6where Self::Output: Vector
7{
8 type Output;
9
10 fn div(&self, rhs: Rhs) -> Self::Output;
27}
28
29impl<F, R, const N: usize> VDiv<R> for [F; N]
30where
31 Self: Vector,
32 [<F as Div<R>>::Output; N]: Vector,
33 F: Div<R> + Clone,
34 R: Clone
35{
36 type Output = [<F as Div<R>>::Output; N];
37 fn div(&self, rhs: R) -> Self::Output
38 {
39 array_init::array_init(|i| self[i].clone()/rhs.clone())
40 }
41}