pub use num::{Num, Integer, Unsigned, Signed, Float};
use super::{Vector, VecItem};
pub trait VecNum: Vector where Self::Item: VecItem + Num {
fn sum(&self) -> Self::Item;
fn product(&self) -> Self::Item;
}
pub trait VecDot: Vector where Self::Item: VecItem + Num {
fn dot(&self, other: Self) -> Self::Item;
}
impl<V> VecDot for V where V: Sized + Copy + VecNum + ::core::ops::Mul<Output=V>, V::Item: VecItem + Num {
fn dot(&self, other: Self) -> Self::Item {
(*self * other).sum()
}
}
pub trait VecInt: Vector where Self::Item: VecItem + Integer {
fn div_euc(&self, other: Self) -> Self;
}
pub trait VecUnsigned: Vector where Self::Item: VecItem + Unsigned {}
pub trait VecSigned: Vector where Self::Item: VecItem + Signed {
fn snake_length(&self) -> Self::Item;
}
pub trait VecFloat: Vector where Self::Item: VecItem + Float {
fn length(&self) -> Self::Item;
fn norm(&self) -> Self;
fn floor(&self) -> Self;
fn ceil(&self) -> Self;
fn round(&self) -> Self;
}