diff -r efa60bc4f743 -r b087e3eab191 src/kernels/mollifier.rs --- a/src/kernels/mollifier.rs Thu Aug 29 00:00:00 2024 -0500 +++ b/src/kernels/mollifier.rs Tue Dec 31 09:25:45 2024 -0500 @@ -2,7 +2,7 @@ //! Implementation of the standard mollifier use rgsl::hypergeometric::hyperg_U; -use float_extras::f64::{tgamma as gamma}; +use float_extras::f64::tgamma as gamma; use numeric_literals::replace_float_literals; use serde::Serialize; use alg_tools::types::*; @@ -17,7 +17,7 @@ LocalAnalysis, GlobalAnalysis }; -use alg_tools::mapping::Apply; +use alg_tools::mapping::{Mapping, Instance}; use alg_tools::maputil::array_init; /// Reresentation of the (unnormalised) standard mollifier. @@ -36,13 +36,14 @@ } #[replace_float_literals(C::Type::cast_from(literal))] -impl<'a, C : Constant, const N : usize> Apply<&'a Loc> for Mollifier { - type Output = C::Type; +impl Mapping> for Mollifier { + type Codomain = C::Type; + #[inline] - fn apply(&self, x : &'a Loc) -> Self::Output { + fn apply>>(&self, x : I) -> Self::Codomain { let ε = self.width.value(); let ε2 = ε*ε; - let n2 = x.norm2_squared(); + let n2 = x.eval(|x| x.norm2_squared()); if n2 < ε2 { (n2 / (n2 - ε2)).exp() } else { @@ -51,13 +52,6 @@ } } -impl Apply> for Mollifier { - type Output = C::Type; - #[inline] - fn apply(&self, x : Loc) -> Self::Output { - self.apply(&x) - } -} impl<'a, C : Constant, const N : usize> Support for Mollifier { #[inline]