From: Michael Orlitzky Date: Mon, 2 May 2011 01:14:00 +0000 (-0400) Subject: Added more coefficient tests. X-Git-Tag: 0.0.1~350 X-Git-Url: https://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=99fc70230714680fa2eac87ec23793b3dcfd0e68;p=spline3.git Added more coefficient tests. --- diff --git a/src/Tests/Face.hs b/src/Tests/Face.hs index 8c28a05..fb02539 100644 --- a/src/Tests/Face.hs +++ b/src/Tests/Face.hs @@ -104,12 +104,90 @@ test_trilinear_c0120 = t = head (tetrahedrons cube) -- Any one will do. +-- | Check the value of c0102 for any tetrahedron belonging to the +-- cube centered on (1,1,1) with a grid constructed from the +-- trilinear values. See example one in the paper. +test_trilinear_c0102 :: Test +test_trilinear_c0102 = + TestCase $ assertAlmostEqual "c0102 is correct" (c t 0 1 0 2) (73/24) + where + g = make_grid 1 trilinear + cube = cube_at g 1 1 1 + t = head (tetrahedrons cube) -- Any one will do. + + +-- | Check the value of c0111 for any tetrahedron belonging to the +-- cube centered on (1,1,1) with a grid constructed from the +-- trilinear values. See example one in the paper. +test_trilinear_c0111 :: Test +test_trilinear_c0111 = + TestCase $ assertAlmostEqual "c0111 is correct" (c t 0 1 1 1) (8/3) + where + g = make_grid 1 trilinear + cube = cube_at g 1 1 1 + t = head (tetrahedrons cube) -- Any one will do. + + +-- | Check the value of c0210 for any tetrahedron belonging to the +-- cube centered on (1,1,1) with a grid constructed from the +-- trilinear values. See example one in the paper. +test_trilinear_c0210 :: Test +test_trilinear_c0210 = + TestCase $ assertAlmostEqual "c0210 is correct" (c t 0 2 1 0) (29/12) + where + g = make_grid 1 trilinear + cube = cube_at g 1 1 1 + t = head (tetrahedrons cube) -- Any one will do. + + +-- | Check the value of c0201 for any tetrahedron belonging to the +-- cube centered on (1,1,1) with a grid constructed from the +-- trilinear values. See example one in the paper. +test_trilinear_c0201 :: Test +test_trilinear_c0201 = + TestCase $ assertAlmostEqual "c0201 is correct" (c t 0 2 0 1) (11/4) + where + g = make_grid 1 trilinear + cube = cube_at g 1 1 1 + t = head (tetrahedrons cube) -- Any one will do. + + +-- | Check the value of c0300 for any tetrahedron belonging to the +-- cube centered on (1,1,1) with a grid constructed from the +-- trilinear values. See example one in the paper. +test_trilinear_c0300 :: Test +test_trilinear_c0300 = + TestCase $ assertAlmostEqual "c0300 is correct" (c t 0 3 0 0) (5/2) + where + g = make_grid 1 trilinear + cube = cube_at g 1 1 1 + t = head (tetrahedrons cube) -- Any one will do. + + +-- | Check the value of c1020 for any tetrahedron belonging to the +-- cube centered on (1,1,1) with a grid constructed from the +-- trilinear values. See example one in the paper. +test_trilinear_c1020 :: Test +test_trilinear_c1020 = + TestCase $ assertAlmostEqual "c1020 is correct" (c t 1 0 2 0) (8/3) + where + g = make_grid 1 trilinear + cube = cube_at g 1 1 1 + t = head (tetrahedrons cube) -- Any one will do. + + face_tests :: [Test] face_tests = [test_trilinear_c0030, test_trilinear_c0003, test_trilinear_c0021, test_trilinear_c0012, - test_trilinear_c0120] + test_trilinear_c0120, + test_trilinear_c0102, + test_trilinear_c0111, + test_trilinear_c0210, + test_trilinear_c0201, + test_trilinear_c0300, + test_trilinear_c1020] -- QuickCheck Tests.