use std::ops::Mul;
use crate::Vector;
pub trait VMul<Rhs>: Vector
where Self::Output: Vector
{
type Output;
fn mul(&self, rhs: Rhs) -> Self::Output;
}
impl<F, R, const N: usize> VMul<R> for [F; N]
where
Self: Vector,
[<F as Mul<R>>::Output; N]: Vector,
F: Mul<R> + Clone,
R: Clone
{
type Output = [<F as Mul<R>>::Output; N];
fn mul(&self, rhs: R) -> Self::Output
{
array_init::array_init(|i| self[i].clone()*rhs.clone())
}
}