use super::{Dot, NegInPlace, NormInfinity, NormSquared, ScaledAdd};
impl ScaledAdd for f64 {
fn scaled_add(&mut self, scalar: f64, other: &Self) {
*self += scalar * other;
}
}
impl NormSquared for f64 {
fn norm_squared(&self) -> f64 {
self * self
}
fn norm_l2(&self) -> f64 {
self.abs()
}
}
impl NormInfinity for f64 {
fn norm_infinity(&self) -> f64 {
self.abs()
}
}
impl Dot for f64 {
fn dot(&self, other: &Self) -> f64 {
self * other
}
}
impl NegInPlace for f64 {
fn neg_in_place(&mut self) {
*self = -*self;
}
}
impl super::VectorLen for f64 {
fn vec_len(&self) -> usize {
1
}
}
impl super::VectorLen for f32 {
fn vec_len(&self) -> usize {
1
}
}