module Tests.Cube
where
+import Debug.Trace (trace)
import Test.QuickCheck
import Comparisons
import Cube
import FunctionValues (FunctionValues)
import Tests.FunctionValues ()
-import Tetrahedron (v0, volume)
+import Tetrahedron (b0, b1, b2, b3, c,
+ Tetrahedron(Tetrahedron),
+ v0, v1, v2, v3, volume)
instance Arbitrary Cube where
arbitrary = do
prop_tetrahedron23_volumes_positive :: Cube -> Bool
prop_tetrahedron23_volumes_positive c =
volume (tetrahedron23 c) > 0
+
+
+-- | Given in Sorokina and Zeilfelder, p. 79.
+--prop_c0120_identity1 :: Cube -> Bool
+--prop_c0120_identity1 cube =
+-- c0 ~= (c1 + c2) / 2
+-- where
+-- c0 = trace ("c0 :" ++ (show (c t0 0 1 2 0))) (c t0 0 1 2 0)
+-- c1 = trace ("c1 :" ++ (show (c t0 0 0 2 1))) (c t0 0 0 2 1)
+-- c2 = trace ("c2 :" ++ (show (c t1 0 0 2 1))) (c t1 0 0 2 1)
+-- t0 = tetrahedron0 cube
+-- t1 = tetrahedron1 cube
+
+
+-- | Given in Sorokina and Zeilfelder, p. 78.
+-- prop_cijk1_identity :: Cube -> Bool
+-- prop_cijk1_identity cube =
+-- and [ c t0 i j k 1 ~=
+-- (c t1 (i+1) j k 0) * ((b0 t0) (v3 t1)) +
+-- (c t1 i (j+1) k 0) * ((b1 t0) (v3 t1)) +
+-- (c t1 i j (k+1) 0) * ((b2 t0) (v3 t1)) +
+-- (c t1 i j k 1) * ((b3 t0) (v3 t1)) | i <- [0..2],
+-- j <- [0..2],
+-- k <- [0..2],
+-- i + j + k == 2]
+-- where
+-- t0 = tetrahedron0 cube
+-- t1 = tetrahedron1 cube
module Tests.Face
where
--- -- | Given in Sorokina and Zeilfelder, p. 78.
--- prop_cijk1_identity :: Cube -> Bool
--- prop_cijk1_identity cube =
--- and [ c t0' i j k 1 ~= (c t1' (i+1) j k 0) * ((b0 t0') (v3 t1')) +
--- (c t1' i (j+1) k 0) * ((b1 t0') (v3 t1')) +
--- (c t1' i j (k+1) 0) * ((b2 t0') (v3 t1')) +
--- (c t1' i j k 1) * ((b3 t0') (v3 t1')) | i <- [0..2],
--- j <- [0..2],
--- k <- [0..2],
--- i + j + k == 2]
--- where
--- t0 = tetrahedron0 (face0 cube)
--- t1 = tetrahedron1 (face0 cube)
--- t0' = Tetrahedron cube (v3 t0) (v2 t0) (v1 t0) (v0 t0)
--- t1' = Tetrahedron cube (v3 t1) (v2 t1) (v0 t1) (v1 t1)
-
--- -- | Given in Sorokina and Zeilfelder, p. 79.
--- prop_c0120_identity1 :: Cube -> Bool
--- prop_c0120_identity1 cube =
--- c t0' 0 1 2 0 ~= (c t0' 0 0 2 1 + c t1' 0 0 2 1) / 2
--- where
--- t0 = tetrahedron0 (face0 cube)
--- t1 = tetrahedron1 (face0 cube)
--- t0' = Tetrahedron cube (v3 t0) (v2 t0) (v1 t0) (v0 t0)
--- t1' = Tetrahedron cube (v3 t1) (v2 t1) (v0 t1) (v1 t1)
-
-
-- -- | Given in Sorokina and Zeilfelder, p. 79.
-- prop_c0210_identity1 :: Cube -> Bool
-- prop_c0210_identity1 cube =
import Tests.Cardinal
import Tests.Cube
-import Tests.Face as TF
-import Tests.Grid as TG
+import Tests.Grid
import Tests.Misc
import Tests.Tetrahedron as TT
-- The list of HUnit tests.
-test_suite = TestList (concat [face_tests,
- grid_tests,
+test_suite = TestList (concat [grid_tests,
misc_tests,
tetrahedron_tests])
putStrLn "\nCube Tests\n"
+ -- putStr "prop_c0120_identity1... "
+ -- quickCheckWith qc_args prop_c0120_identity1
+
putStr "prop_all_volumes_positive... "
quickCheckWith qc_args prop_all_volumes_positive
putStr "prop_v0_all_equal... "
quickCheckWith qc_args prop_v0_all_equal
+-- putStrLn "\np. 78, (2.5)\n"
+
+-- putStr "prop_cijk1_identity... "
+-- quickCheckWith qc_args prop_cijk1_identity
+
+
putStrLn "\nMisc Tests\n"
putStr "prop_factorial_greater... "
putStr "prop_b3_v2_always_zero... "
quickCheckWith qc_args prop_b3_v2_always_zero
- -- putStrLn "\np. 78, (2.4)\n"
+ putStrLn "\np. 78, (2.4)\n"
- -- putStr "prop_c3000_identity... "
- -- quickCheckWith qc_args TT.prop_c3000_identity
-
- -- putStr "prop_c2100_identity... "
- -- quickCheckWith qc_args TT.prop_c2100_identity
+ putStr "prop_c3000_identity... "
+ quickCheckWith qc_args TT.prop_c3000_identity
- -- putStr "prop_c1110_identity... "
- -- quickCheckWith qc_args TT.prop_c1110_identity
+ putStr "prop_c2100_identity... "
+ quickCheckWith qc_args TT.prop_c2100_identity
- -- putStrLn "\np. 78, (2.5)\n"
+ putStr "prop_c1110_identity... "
+ quickCheckWith qc_args TT.prop_c1110_identity
- -- putStr "prop_cijk1_identity... "
- -- quickCheckWith qc_args prop_cijk1_identity
-- putStrLn "\np. 79, (2.6)\n"
- -- putStr "prop_c0120_identity1... "
- -- quickCheckWith qc_args TF.prop_c0120_identity1
-
-- putStr "prop_c0210_identity1... "
-- quickCheckWith qc_args TF.prop_c0210_identity1