File tree Expand file tree Collapse file tree 5 files changed +24
-52
lines changed Expand file tree Collapse file tree 5 files changed +24
-52
lines changed Original file line number Diff line number Diff line change @@ -30,5 +30,4 @@ name = "benchmark"
30
30
harness = false
31
31
32
32
[features ]
33
- default = [" serde" ]
34
33
serde = [" dep:serde" , " ndarray/serde" ]
Original file line number Diff line number Diff line change @@ -187,6 +187,27 @@ impl<T> Interpolator<T> for Box<dyn Interpolator<T>> {
187
187
}
188
188
}
189
189
190
+ #[ derive( Debug ) ]
191
+ #[ cfg_attr( feature = "serde" , derive( Deserialize , Serialize ) ) ]
192
+ #[ cfg_attr(
193
+ feature = "serde" ,
194
+ serde( bound = "
195
+ D: DataOwned,
196
+ D::Elem: Serialize + DeserializeOwned,
197
+ Dim<[usize; N]>: Serialize + DeserializeOwned,
198
+ [ArrayBase<D, Ix1>; N]: Serialize + DeserializeOwned,
199
+ " )
200
+ ) ]
201
+ pub struct InterpData < D , const N : usize >
202
+ where
203
+ Dim < [ Ix ; N ] > : Dimension ,
204
+ D : Data ,
205
+ D :: Elem : Num + PartialOrd + Copy + Debug ,
206
+ {
207
+ pub grid : [ ArrayBase < D , Ix1 > ; N ] ,
208
+ pub values : ArrayBase < D , Dim < [ Ix ; N ] > > ,
209
+ }
210
+
190
211
/// Extrapolation strategy
191
212
///
192
213
/// Controls what happens if supplied interpolant point
Original file line number Diff line number Diff line change @@ -6,23 +6,7 @@ mod strategies;
6
6
7
7
const N : usize = 1 ;
8
8
9
- #[ derive( Debug ) ]
10
- #[ cfg_attr( feature = "serde" , derive( Deserialize , Serialize ) ) ]
11
- #[ cfg_attr(
12
- feature = "serde" ,
13
- serde( bound = "
14
- D: DataOwned,
15
- D::Elem: Serialize + DeserializeOwned,
16
- " )
17
- ) ]
18
- pub struct InterpData1D < D >
19
- where
20
- D : Data ,
21
- D :: Elem : Num + PartialOrd + Copy + Debug ,
22
- {
23
- pub grid : [ ArrayBase < D , Ix1 > ; N ] ,
24
- pub values : ArrayBase < D , Ix1 > ,
25
- }
9
+ pub type InterpData1D < D > = InterpData < D , N > ;
26
10
validate_impl ! ( InterpData1D <D >) ;
27
11
impl < D > InterpData1D < D >
28
12
where
Original file line number Diff line number Diff line change @@ -6,23 +6,7 @@ mod strategies;
6
6
7
7
const N : usize = 3 ;
8
8
9
- #[ derive( Debug ) ]
10
- #[ cfg_attr( feature = "serde" , derive( Deserialize , Serialize ) ) ]
11
- #[ cfg_attr(
12
- feature = "serde" ,
13
- serde( bound = "
14
- D: DataOwned,
15
- D::Elem: Serialize + DeserializeOwned,
16
- " )
17
- ) ]
18
- pub struct InterpData3D < D >
19
- where
20
- D : Data ,
21
- D :: Elem : Num + PartialOrd + Copy + Debug ,
22
- {
23
- pub grid : [ ArrayBase < D , Ix1 > ; N ] ,
24
- pub values : ArrayBase < D , Dim < [ Ix ; N ] > > ,
25
- }
9
+ pub type InterpData3D < D > = InterpData < D , N > ;
26
10
validate_impl ! ( InterpData3D <D >) ;
27
11
impl < D > InterpData3D < D >
28
12
where
Original file line number Diff line number Diff line change @@ -6,23 +6,7 @@ mod strategies;
6
6
7
7
const N : usize = 2 ;
8
8
9
- #[ derive( Debug ) ]
10
- #[ cfg_attr( feature = "serde" , derive( Deserialize , Serialize ) ) ]
11
- #[ cfg_attr(
12
- feature = "serde" ,
13
- serde( bound = "
14
- D: DataOwned,
15
- D::Elem: Serialize + DeserializeOwned,
16
- " )
17
- ) ]
18
- pub struct InterpData2D < D >
19
- where
20
- D : Data ,
21
- D :: Elem : Num + PartialOrd + Copy + Debug ,
22
- {
23
- pub grid : [ ArrayBase < D , Ix1 > ; N ] ,
24
- pub values : ArrayBase < D , Ix2 > ,
25
- }
9
+ pub type InterpData2D < D > = InterpData < D , N > ;
26
10
validate_impl ! ( InterpData2D <D >) ;
27
11
impl < D > InterpData2D < D >
28
12
where
You can’t perform that action at this time.
0 commit comments