We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c1c8f4a commit d64e9d5Copy full SHA for d64e9d5
tests/ndg_evaluate.rs
@@ -23,3 +23,35 @@ fn test_make_surface() {
23
24
assert_abs_diff_eq!(yi, y);
25
}
26
+
27
28
+#[test]
29
+fn test_make_surface_1() {
30
+ let x0 = array![1., 2., 3.];
31
+ let x1 = array![1., 2., 3., 4.];
32
+ let x = vec![x0.view(), x1.view()];
33
34
+ let xi0 = array![1., 1.5, 2., 2.5, 3.];
35
+ let xi1 = array![1., 1.5, 2., 2.5, 3., 3.5, 4.];
36
+ let xi = vec![xi0.view(), xi1.view()];
37
38
+ let y = array![
39
+ [1., 2., 3., 4.],
40
+ [5., 6., 7., 8.],
41
+ [9., 10., 11., 12.],
42
+ ];
43
44
+ let yi_expected = array![
45
+ [1., 1.5, 2., 2.5, 3., 3.5, 4.],
46
+ [3., 3.5, 4., 4.5, 5., 5.5, 6.],
47
+ [5., 5.5, 6., 6.5, 7., 7.5, 8.],
48
+ [7., 7.5, 8., 8.5, 9., 9.5, 10.],
49
+ [9., 9.5, 10., 10.5, 11., 11.5, 12.],
50
51
52
+ let yi = GridCubicSmoothingSpline::new(&x, &y)
53
+ .make().unwrap()
54
+ .evaluate(&xi).unwrap();
55
56
+ assert_abs_diff_eq!(yi, yi_expected);
57
+}
0 commit comments