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