use crate::algebra::{
abstr::{Field, Scalar},
linear::vector::Vector,
};
use std::ops::Div;
impl<T> Div<T> for Vector<T>
where
T: Field + Scalar,
{
type Output = Vector<T>;
fn div(self, rhs: T) -> Self::Output {
Vector {
data: &self.data / (&rhs),
}
}
}
impl<T> Div<&T> for &Vector<T>
where
T: Field + Scalar,
{
type Output = Vector<T>;
fn div(self, rhs: &T) -> Self::Output {
Vector {
data: (&self.data).div(rhs),
}
}
}