]> gitweb.michael.orlitzky.com - spline3.git/blobdiff - src/Examples.hs
Move the three example 3x3x3 arrays to the Examples module.
[spline3.git] / src / Examples.hs
diff --git a/src/Examples.hs b/src/Examples.hs
new file mode 100644 (file)
index 0000000..8dc59cf
--- /dev/null
@@ -0,0 +1,47 @@
+module Examples
+where
+
+-- | Values of the function f(x,y,z) = 1 + x + xy + xyz taken at nine
+--   points (hi, hj, jk) with h = 1. From example one in the paper.
+--   Used in the next bunch of tests.
+trilinear :: [[[Double]]]
+trilinear = [ [ [ 1, 2, 3 ],
+                [ 1, 3, 5 ],
+                [ 1, 4, 7 ] ],
+              [ [ 1, 2, 3 ],
+                [ 1, 4, 7 ],
+                [ 1, 6, 11 ] ],
+              [ [ 1, 2, 3 ],
+                [ 1, 5, 9 ],
+                [ 1, 8, 15 ]]]
+
+
+-- | A 3x3x3 array of zeros.
+zeros :: [[[Double]]]
+zeros = [ [ [ 0, 0, 0 ],
+            [ 0, 0, 0 ],
+            [ 0, 0, 0 ] ],
+
+          [ [ 0, 0, 0 ],
+            [ 0, 0, 0 ],
+            [ 0, 0, 0 ] ],
+
+          [ [ 0, 0, 0 ],
+            [ 0, 0, 0 ],
+            [ 0, 0, 0 ]]]
+
+
+-- | A 3x3x3 array of numbers, starting at (0,0,0) == 0 and counting
+--   up to (2,2,2) == 26 in x,y,z order.
+naturals :: [[[Double]]]
+naturals = [ [ [ 0, 1, 2 ],
+               [ 3, 4, 5 ],
+               [ 6, 7, 8 ] ],
+
+             [ [ 9, 10, 11 ],
+               [ 12, 13, 14 ],
+               [ 15, 16, 17 ] ],
+
+             [ [ 18, 19, 20 ],
+               [ 21, 22, 23 ],
+               [ 24, 25, 26 ]]]