]> gitweb.michael.orlitzky.com - spline3.git/blob - src/Examples.hs
Move the three example 3x3x3 arrays to the Examples module.
[spline3.git] / src / Examples.hs
1 module Examples
2 where
3
4 -- | Values of the function f(x,y,z) = 1 + x + xy + xyz taken at nine
5 -- points (hi, hj, jk) with h = 1. From example one in the paper.
6 -- Used in the next bunch of tests.
7 trilinear :: [[[Double]]]
8 trilinear = [ [ [ 1, 2, 3 ],
9 [ 1, 3, 5 ],
10 [ 1, 4, 7 ] ],
11 [ [ 1, 2, 3 ],
12 [ 1, 4, 7 ],
13 [ 1, 6, 11 ] ],
14 [ [ 1, 2, 3 ],
15 [ 1, 5, 9 ],
16 [ 1, 8, 15 ]]]
17
18
19 -- | A 3x3x3 array of zeros.
20 zeros :: [[[Double]]]
21 zeros = [ [ [ 0, 0, 0 ],
22 [ 0, 0, 0 ],
23 [ 0, 0, 0 ] ],
24
25 [ [ 0, 0, 0 ],
26 [ 0, 0, 0 ],
27 [ 0, 0, 0 ] ],
28
29 [ [ 0, 0, 0 ],
30 [ 0, 0, 0 ],
31 [ 0, 0, 0 ]]]
32
33
34 -- | A 3x3x3 array of numbers, starting at (0,0,0) == 0 and counting
35 -- up to (2,2,2) == 26 in x,y,z order.
36 naturals :: [[[Double]]]
37 naturals = [ [ [ 0, 1, 2 ],
38 [ 3, 4, 5 ],
39 [ 6, 7, 8 ] ],
40
41 [ [ 9, 10, 11 ],
42 [ 12, 13, 14 ],
43 [ 15, 16, 17 ] ],
44
45 [ [ 18, 19, 20 ],
46 [ 21, 22, 23 ],
47 [ 24, 25, 26 ]]]