use crate::rho::RhoFunction;
#[derive(Debug, Clone, Copy, Default)]
pub struct LeastSquares;
impl RhoFunction for LeastSquares {
fn rho(&self, r: f64) -> f64 {
r.powi(2) / 2.0
}
fn psi(&self, r: f64) -> f64 {
r
}
fn weight(&self, _r: f64) -> f64 {
1.0
}
fn psi_prime(&self, _r: f64) -> f64 {
1.0
}
fn tuning(&self) -> f64 {
f64::NAN
}
fn is_redescending(&self) -> bool {
false
}
fn rho_sup(&self) -> Option<f64> {
None
}
}