From: Michael Orlitzky Date: Mon, 22 Aug 2011 19:06:38 +0000 (-0400) Subject: Rename "trilinearx2" to "trilinear9x9x9". X-Git-Tag: 0.0.1~239 X-Git-Url: https://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=3e25ac7f9fffaabdc5e62f4b973f3d38be60cf4d;p=spline3.git Rename "trilinearx2" to "trilinear9x9x9". --- diff --git a/src/Examples.hs b/src/Examples.hs index 9ed50b2..03db51c 100644 --- a/src/Examples.hs +++ b/src/Examples.hs @@ -19,8 +19,8 @@ trilinear = [ [ [ 1, 2, 3 ], -- | 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]]] +trilinear9x9x9 :: [[[Double]]] +trilinear9x9x9 = [[[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. diff --git a/src/Tests/Grid.hs b/src/Tests/Grid.hs index 6da0e09..6a30cc5 100644 --- a/src/Tests/Grid.hs +++ b/src/Tests/Grid.hs @@ -336,13 +336,15 @@ test_zeros_reproduced = -- | Make sure we can reproduce a 9x9x9 trilinear from the 3x3x3 one. -test_trilinearx2_reproduced_t0 :: Assertion -test_trilinearx2_reproduced_t0 = - assertTrue "trilinearx2 is reproduced correctly" $ - and [p (i', j', k') ~= value_at trilinearx2 i j k +test_trilinear9x9x9_reproduced :: Assertion +test_trilinear9x9x9_reproduced = + assertTrue "trilinear 9x9x9 is reproduced correctly" $ + and [p (i', j', k') ~= value_at trilinear9x9x9 i j k | i <- [0..8], j <- [0..8], k <- [0..8], + t <- tetrahedra c0, + let p = polynomial t, let i' = (fromIntegral i) * 0.5, let j' = (fromIntegral j) * 0.5, let k' = (fromIntegral k) * 0.5] diff --git a/test/TestSuite.hs b/test/TestSuite.hs index 0748d36..23bc603 100644 --- a/test/TestSuite.hs +++ b/test/TestSuite.hs @@ -63,7 +63,7 @@ grid_tests = tc "trilinear f0_t0_v3" test_trilinear_f0_t0_v3, tc "trilinear reproduced" test_trilinear_reproduced, tc "zeros reproduced" test_zeros_reproduced, - tc "trilinearx2 reproduced (t0)" test_trilinearx2_reproduced_t0 ] + tc "trilinear9x9x9 reproduced" test_trilinear9x9x9_reproduced ] misc_tests :: Test.Framework.Test