| 2 //! Implementation of the standard mollifier |
2 //! Implementation of the standard mollifier |
| 3 |
3 |
| 4 use rgsl::hypergeometric::hyperg_U; |
4 use rgsl::hypergeometric::hyperg_U; |
| 5 use float_extras::f64::tgamma as gamma; |
5 use float_extras::f64::tgamma as gamma; |
| 6 use numeric_literals::replace_float_literals; |
6 use numeric_literals::replace_float_literals; |
| 7 use serde::Serialize; |
7 use serde::{Serialize, Deserialize}; |
| 8 use alg_tools::types::*; |
8 use alg_tools::types::*; |
| 9 use alg_tools::euclidean::Euclidean; |
9 use alg_tools::euclidean::Euclidean; |
| 10 use alg_tools::norms::*; |
10 use alg_tools::norms::*; |
| 11 use alg_tools::loc::Loc; |
11 use alg_tools::loc::Loc; |
| 12 use alg_tools::sets::Cube; |
12 use alg_tools::sets::Cube; |
| 27 /// f(x)=\begin{cases} |
27 /// f(x)=\begin{cases} |
| 28 /// e^{\frac{ε^2}{\|x\|_2^2-ε^2}}, & \|x\|_2 < ε, \\ |
28 /// e^{\frac{ε^2}{\|x\|_2^2-ε^2}}, & \|x\|_2 < ε, \\ |
| 29 /// 0, & \text{otherwise}. |
29 /// 0, & \text{otherwise}. |
| 30 /// \end{cases} |
30 /// \end{cases} |
| 31 /// $$</div> |
31 /// $$</div> |
| 32 #[derive(Copy,Clone,Serialize,Debug,Eq,PartialEq)] |
32 #[derive(Copy,Clone,Serialize,Deserialize,Debug,Eq,PartialEq)] |
| 33 pub struct Mollifier<C : Constant, const N : usize> { |
33 pub struct Mollifier<C : Constant, const N : usize> { |
| 34 /// The parameter $ε$ of the mollifier. |
34 /// The parameter $ε$ of the mollifier. |
| 35 pub width : C, |
35 pub width : C, |
| 36 } |
36 } |
| 37 |
37 |