use super::Scalar;
pub trait ColumnStats<F: Scalar> {
fn col_means(&self) -> Vec<F>;
fn col_sds(&self) -> Vec<F>;
fn col_mins(&self) -> Vec<F>;
fn col_ranges(&self) -> Vec<F>;
fn col_maxabs(&self) -> Vec<F>;
fn col_l1(&self) -> Vec<F>;
fn col_l2(&self) -> Vec<F>;
fn col_l2_centered(&self, centers: &[F]) -> Vec<F>;
fn col_l1_centered(&self, centers: &[F]) -> Vec<F>;
fn col_maxabs_centered(&self, centers: &[F]) -> Vec<F>;
}
impl<M, F> ColumnStats<F> for &M
where
M: ColumnStats<F> + ?Sized,
F: Scalar,
{
fn col_means(&self) -> Vec<F> {
(**self).col_means()
}
fn col_sds(&self) -> Vec<F> {
(**self).col_sds()
}
fn col_mins(&self) -> Vec<F> {
(**self).col_mins()
}
fn col_ranges(&self) -> Vec<F> {
(**self).col_ranges()
}
fn col_maxabs(&self) -> Vec<F> {
(**self).col_maxabs()
}
fn col_l1(&self) -> Vec<F> {
(**self).col_l1()
}
fn col_l2(&self) -> Vec<F> {
(**self).col_l2()
}
fn col_l2_centered(&self, centers: &[F]) -> Vec<F> {
(**self).col_l2_centered(centers)
}
fn col_l1_centered(&self, centers: &[F]) -> Vec<F> {
(**self).col_l1_centered(centers)
}
fn col_maxabs_centered(&self, centers: &[F]) -> Vec<F> {
(**self).col_maxabs_centered(centers)
}
}