1 //! Implementation of the linear function |
1 //! Implementation of the linear 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::{ |
16 use alg_tools::mapping::{Mapping, Instance}; |
16 use alg_tools::mapping::{Mapping, Instance}; |
17 use alg_tools::maputil::array_init; |
17 use alg_tools::maputil::array_init; |
18 use alg_tools::euclidean::Euclidean; |
18 use alg_tools::euclidean::Euclidean; |
19 |
19 |
20 /// Representation of the hat function $f(x)=1-\\|x\\|\_1/ε$ of `width` $ε$ on $ℝ^N$. |
20 /// Representation of the hat function $f(x)=1-\\|x\\|\_1/ε$ of `width` $ε$ on $ℝ^N$. |
21 #[derive(Copy,Clone,Serialize,Debug,Eq,PartialEq)] |
21 #[derive(Copy,Clone,Serialize,Deserialize,Debug,Eq,PartialEq)] |
|
22 #[serde(bound = "Loc<F, N> : Serialize + for<'a> Deserialize<'a>")] |
22 pub struct Linear<F : Float, const N : usize> { |
23 pub struct Linear<F : Float, const N : usize> { |
23 /// The parameter $ε>0$. |
24 /// The parameter $ε>0$. |
24 pub v : Loc<F, N>, |
25 pub v : Loc<F, N>, |
25 } |
26 } |
26 |
27 |