1 //! Implementation of the hat function |
1 //! Implementation of the hat function |
2 |
2 |
3 use numeric_literals::replace_float_literals; |
3 use numeric_literals::replace_float_literals; |
4 use serde::Serialize; |
4 use serde::{Serialize, Deserialize}; |
5 use alg_tools::types::*; |
5 use alg_tools::types::*; |
6 use alg_tools::norms::*; |
6 use alg_tools::norms::*; |
7 use alg_tools::loc::Loc; |
7 use alg_tools::loc::Loc; |
8 use alg_tools::sets::Cube; |
8 use alg_tools::sets::Cube; |
9 use alg_tools::bisection_tree::{ |
9 use alg_tools::bisection_tree::{ |
17 use alg_tools::mapping::{Mapping, Instance}; |
17 use alg_tools::mapping::{Mapping, Instance}; |
18 use alg_tools::maputil::array_init; |
18 use alg_tools::maputil::array_init; |
19 use crate::types::Lipschitz; |
19 use crate::types::Lipschitz; |
20 |
20 |
21 /// Representation of the hat function $f(x)=1-\\|x\\|\_1/ε$ of `width` $ε$ on $ℝ^N$. |
21 /// Representation of the hat function $f(x)=1-\\|x\\|\_1/ε$ of `width` $ε$ on $ℝ^N$. |
22 #[derive(Copy,Clone,Serialize,Debug,Eq,PartialEq)] |
22 #[derive(Copy,Clone,Serialize,Deserialize,Debug,Eq,PartialEq)] |
23 pub struct Hat<C : Constant, const N : usize> { |
23 pub struct Hat<C : Constant, const N : usize> { |
24 /// The parameter $ε>0$. |
24 /// The parameter $ε>0$. |
25 pub width : C, |
25 pub width : C, |
26 } |
26 } |
27 |
27 |