From: Michael Orlitzky Date: Wed, 17 Aug 2011 22:29:16 +0000 (-0400) Subject: Add the trilinearx2 example. X-Git-Tag: 0.0.1~245 X-Git-Url: https://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=f52ef8067717367eb85393cedbfdd4c0dc9909e5;p=spline3.git Add the trilinearx2 example. --- diff --git a/src/Examples.hs b/src/Examples.hs index 8dc59cf..9ed50b2 100644 --- a/src/Examples.hs +++ b/src/Examples.hs @@ -16,6 +16,13 @@ trilinear = [ [ [ 1, 2, 3 ], [ 1, 8, 15 ]]] +-- | Values of the function f(x,y,z) = 1 + x + xy + xyz taken at nine +-- points (hi, hj, jk) with h = 0.5. We should be able to reproduce +-- this from splines based on the 3x3x3 trilinear. +trilinearx2 :: [[[Double]]] +trilinearx2 = [[[1, 1.5, 2, 2.5, 3, 3.5, 4, 4.5, 5], [1, 1.75, 2.5, 3.25, 4, 4.75, 5.5, 6.25, 7], [1, 2, 3, 4, 5, 6, 7, 8, 9], [1, 2.25, 3.5, 4.75, 6, 7.25, 8.5, 9.75, 11], [1, 2.5, 4, 5.5, 7, 8.5, 10, 11.5, 13], [1, 2.75, 4.5, 6.25, 8, 9.75, 11.5, 13.25, 15], [1, 3, 5, 7, 9, 11, 13, 15, 17], [1, 3.25, 5.5, 7.75, 10, 12.25, 14.5, 16.75, 19], [1, 3.5, 6, 8.5, 11, 13.5, 16, 18.5, 21]], [[1, 1.5, 2, 2.5, 3, 3.5, 4, 4.5, 5], [1, 1.875, 2.75, 3.625, 4.5, 5.375, 6.25, 7.125, 8], [1, 2.25, 3.5, 4.75, 6, 7.25, 8.5, 9.75, 11], [1, 2.625, 4.25, 5.875, 7.5, 9.125, 10.75, 12.375, 14], [1, 3, 5, 7, 9, 11, 13, 15, 17], [1, 3.375, 5.75, 8.125, 10.5, 12.875, 15.25, 17.625, 20], [1, 3.75, 6.5, 9.25, 12, 14.75, 17.5, 20.25, 23], [1, 4.125, 7.25, 10.375, 13.5, 16.625, 19.75, 22.875, 26], [1, 4.5, 8, 11.5, 15, 18.5, 22, 25.5, 29]], [[1, 1.5, 2, 2.5, 3, 3.5, 4, 4.5, 5], [1, 2, 3, 4, 5, 6, 7, 8, 9], [1, 2.5, 4, 5.5, 7, 8.5, 10, 11.5, 13], [1, 3, 5, 7, 9, 11, 13, 15, 17], [1, 3.5, 6, 8.5, 11, 13.5, 16, 18.5, 21], [1, 4, 7, 10, 13, 16, 19, 22, 25], [1, 4.5, 8, 11.5, 15, 18.5, 22, 25.5, 29], [1, 5, 9, 13, 17, 21, 25, 29, 33], [1, 5.5, 10, 14.5, 19, 23.5, 28, 32.5, 37]], [[1, 1.5, 2, 2.5, 3, 3.5, 4, 4.5, 5], [1, 2.125, 3.25, 4.375, 5.5, 6.625, 7.75, 8.875, 10], [1, 2.75, 4.5, 6.25, 8, 9.75, 11.5, 13.25, 15], [1, 3.375, 5.75, 8.125, 10.5, 12.875, 15.25, 17.625, 20], [1, 4, 7, 10, 13, 16, 19, 22, 25], [1, 4.625, 8.25, 11.875, 15.5, 19.125, 22.75, 26.375, 30], [1, 5.25, 9.5, 13.75, 18, 22.25, 26.5, 30.75, 35], [1, 5.875, 10.75, 15.625, 20.5, 25.375, 30.25, 35.125, 40], [1, 6.5, 12, 17.5, 23, 28.5, 34, 39.5, 45]], [[1, 1.5, 2, 2.5, 3, 3.5, 4, 4.5, 5], [1, 2.25, 3.5, 4.75, 6, 7.25, 8.5, 9.75, 11], [1, 3, 5, 7, 9, 11, 13, 15, 17], [1, 3.75, 6.5, 9.25, 12, 14.75, 17.5, 20.25, 23], [1, 4.5, 8, 11.5, 15, 18.5, 22, 25.5, 29], [1, 5.25, 9.5, 13.75, 18, 22.25, 26.5, 30.75, 35], [1, 6, 11, 16, 21, 26, 31, 36, 41], [1, 6.75, 12.5, 18.25, 24, 29.75, 35.5, 41.25, 47], [1, 7.5, 14, 20.5, 27, 33.5, 40, 46.5, 53]], [[1, 1.5, 2, 2.5, 3, 3.5, 4, 4.5, 5], [1, 2.375, 3.75, 5.125, 6.5, 7.875, 9.25, 10.625, 12], [1, 3.25, 5.5, 7.75, 10, 12.25, 14.5, 16.75, 19], [1, 4.125, 7.25, 10.375, 13.5, 16.625, 19.75, 22.875, 26], [1, 5, 9, 13, 17, 21, 25, 29, 33], [1, 5.875, 10.75, 15.625, 20.5, 25.375, 30.25, 35.125, 40], [1, 6.75, 12.5, 18.25, 24, 29.75, 35.5, 41.25, 47], [1, 7.625, 14.25, 20.875, 27.5, 34.125, 40.75, 47.375, 54], [1, 8.5, 16, 23.5, 31, 38.5, 46, 53.5, 61]], [[1, 1.5, 2, 2.5, 3, 3.5, 4, 4.5, 5], [1, 2.5, 4, 5.5, 7, 8.5, 10, 11.5, 13], [1, 3.5, 6, 8.5, 11, 13.5, 16, 18.5, 21], [1, 4.5, 8, 11.5, 15, 18.5, 22, 25.5, 29], [1, 5.5, 10, 14.5, 19, 23.5, 28, 32.5, 37], [1, 6.5, 12, 17.5, 23, 28.5, 34, 39.5, 45], [1, 7.5, 14, 20.5, 27, 33.5, 40, 46.5, 53], [1, 8.5, 16, 23.5, 31, 38.5, 46, 53.5, 61], [1, 9.5, 18, 26.5, 35, 43.5, 52, 60.5, 69]], [[1, 1.5, 2, 2.5, 3, 3.5, 4, 4.5, 5], [1, 2.625, 4.25, 5.875, 7.5, 9.125, 10.75, 12.375, 14], [1, 3.75, 6.5, 9.25, 12, 14.75, 17.5, 20.25, 23], [1, 4.875, 8.75, 12.625, 16.5, 20.375, 24.25, 28.125, 32], [1, 6, 11, 16, 21, 26, 31, 36, 41], [1, 7.125, 13.25, 19.375, 25.5, 31.625, 37.75, 43.875, 50], [1, 8.25, 15.5, 22.75, 30, 37.25, 44.5, 51.75, 59], [1, 9.375, 17.75, 26.125, 34.5, 42.875, 51.25, 59.625, 68], [1, 10.5, 20, 29.5, 39, 48.5, 58, 67.5, 77]], [[1, 1.5, 2, 2.5, 3, 3.5, 4, 4.5, 5], [1, 2.75, 4.5, 6.25, 8, 9.75, 11.5, 13.25, 15], [1, 4, 7, 10, 13, 16, 19, 22, 25], [1, 5.25, 9.5, 13.75, 18, 22.25, 26.5, 30.75, 35], [1, 6.5, 12, 17.5, 23, 28.5, 34, 39.5, 45], [1, 7.75, 14.5, 21.25, 28, 34.75, 41.5, 48.25, 55], [1, 9, 17, 25, 33, 41, 49, 57, 65], [1, 10.25, 19.5, 28.75, 38, 47.25, 56.5, 65.75, 75], [1, 11.5, 22, 32.5, 43, 53.5, 64, 74.5, 85]]] + + -- | A 3x3x3 array of zeros. zeros :: [[[Double]]] zeros = [ [ [ 0, 0, 0 ],