]> gitweb.michael.orlitzky.com - spline3.git/blob - src/Cube.hs
7fce9754b539c37f1a34386caea1212fe181ae0e
[spline3.git] / src / Cube.hs
1 module Cube (
2 Cube(..),
3 cube_properties,
4 find_containing_tetrahedron,
5 tetrahedra,
6 tetrahedron
7 )
8 where
9
10 import Data.Maybe (fromJust)
11 import qualified Data.Vector as V (
12 Vector,
13 findIndex,
14 map,
15 minimum,
16 singleton,
17 snoc,
18 unsafeIndex
19 )
20
21 import Prelude hiding (LT)
22 import Test.Framework (Test, testGroup)
23 import Test.Framework.Providers.QuickCheck2 (testProperty)
24 import Test.QuickCheck (Arbitrary(..), Gen, Positive(..), choose)
25
26 import Cardinal
27 import Comparisons ((~=), (~~=))
28 import qualified Face (Face(..), center)
29 import FunctionValues (FunctionValues, eval, rotate)
30 import Misc (all_equal, disjoint)
31 import Point (Point(..), dot)
32 import Tetrahedron (Tetrahedron(..), barycenter, c, volume)
33
34 data Cube = Cube { i :: !Int,
35 j :: !Int,
36 k :: !Int,
37 fv :: !FunctionValues,
38 tetrahedra_volume :: !Double }
39 deriving (Eq)
40
41
42 instance Arbitrary Cube where
43 arbitrary = do
44 i' <- choose (coordmin, coordmax)
45 j' <- choose (coordmin, coordmax)
46 k' <- choose (coordmin, coordmax)
47 fv' <- arbitrary :: Gen FunctionValues
48 (Positive tet_vol) <- arbitrary :: Gen (Positive Double)
49 return (Cube i' j' k' fv' tet_vol)
50 where
51 -- The idea here is that, when cubed in the volume formula,
52 -- these numbers don't overflow 64 bits. This number is not
53 -- magic in any other sense than that it does not cause test
54 -- failures, while 2^23 does.
55 coordmax = 4194304 -- 2^22
56 coordmin = -coordmax
57
58
59 instance Show Cube where
60 show cube =
61 "Cube_" ++ subscript ++ "\n" ++
62 " Center: " ++ (show (center cube)) ++ "\n" ++
63 " xmin: " ++ (show (xmin cube)) ++ "\n" ++
64 " xmax: " ++ (show (xmax cube)) ++ "\n" ++
65 " ymin: " ++ (show (ymin cube)) ++ "\n" ++
66 " ymax: " ++ (show (ymax cube)) ++ "\n" ++
67 " zmin: " ++ (show (zmin cube)) ++ "\n" ++
68 " zmax: " ++ (show (zmax cube)) ++ "\n"
69 where
70 subscript =
71 (show (i cube)) ++ "," ++ (show (j cube)) ++ "," ++ (show (k cube))
72
73
74 -- | The left-side boundary of the cube. See Sorokina and Zeilfelder,
75 -- p. 76.
76 xmin :: Cube -> Double
77 xmin cube = (i' - 1/2)
78 where
79 i' = fromIntegral (i cube) :: Double
80
81 -- | The right-side boundary of the cube. See Sorokina and Zeilfelder,
82 -- p. 76.
83 xmax :: Cube -> Double
84 xmax cube = (i' + 1/2)
85 where
86 i' = fromIntegral (i cube) :: Double
87
88 -- | The front boundary of the cube. See Sorokina and Zeilfelder,
89 -- p. 76.
90 ymin :: Cube -> Double
91 ymin cube = (j' - 1/2)
92 where
93 j' = fromIntegral (j cube) :: Double
94
95 -- | The back boundary of the cube. See Sorokina and Zeilfelder,
96 -- p. 76.
97 ymax :: Cube -> Double
98 ymax cube = (j' + 1/2)
99 where
100 j' = fromIntegral (j cube) :: Double
101
102 -- | The bottom boundary of the cube. See Sorokina and Zeilfelder,
103 -- p. 76.
104 zmin :: Cube -> Double
105 zmin cube = (k' - 1/2)
106 where
107 k' = fromIntegral (k cube) :: Double
108
109 -- | The top boundary of the cube. See Sorokina and Zeilfelder,
110 -- p. 76.
111 zmax :: Cube -> Double
112 zmax cube = (k' + 1/2)
113 where
114 k' = fromIntegral (k cube) :: Double
115
116
117 -- | The center of Cube_ijk coincides with v_ijk at
118 -- (i, j, k). See Sorokina and Zeilfelder, p. 76.
119 center :: Cube -> Point
120 center cube =
121 Point x y z
122 where
123 x = fromIntegral (i cube) :: Double
124 y = fromIntegral (j cube) :: Double
125 z = fromIntegral (k cube) :: Double
126
127
128 -- Face stuff.
129
130 -- | The top (in the direction of z) face of the cube.
131 top_face :: Cube -> Face.Face
132 top_face cube = Face.Face v0' v1' v2' v3'
133 where
134 delta = 1/2
135 cc = center cube
136 v0' = cc + ( Point delta (-delta) delta )
137 v1' = cc + ( Point delta delta delta )
138 v2' = cc + ( Point (-delta) delta delta )
139 v3' = cc + ( Point (-delta) (-delta) delta )
140
141
142
143 -- | The back (in the direction of x) face of the cube.
144 back_face :: Cube -> Face.Face
145 back_face cube = Face.Face v0' v1' v2' v3'
146 where
147 delta = 1/2
148 cc = center cube
149 v0' = cc + ( Point delta (-delta) (-delta) )
150 v1' = cc + ( Point delta delta (-delta) )
151 v2' = cc + ( Point delta delta delta )
152 v3' = cc + ( Point delta (-delta) delta )
153
154
155 -- The bottom face (in the direction of -z) of the cube.
156 down_face :: Cube -> Face.Face
157 down_face cube = Face.Face v0' v1' v2' v3'
158 where
159 delta = 1/2
160 cc = center cube
161 v0' = cc + ( Point (-delta) (-delta) (-delta) )
162 v1' = cc + ( Point (-delta) delta (-delta) )
163 v2' = cc + ( Point delta delta (-delta) )
164 v3' = cc + ( Point delta (-delta) (-delta) )
165
166
167
168 -- | The front (in the direction of -x) face of the cube.
169 front_face :: Cube -> Face.Face
170 front_face cube = Face.Face v0' v1' v2' v3'
171 where
172 delta = 1/2
173 cc = center cube
174 v0' = cc + ( Point (-delta) (-delta) delta )
175 v1' = cc + ( Point (-delta) delta delta )
176 v2' = cc + ( Point (-delta) delta (-delta) )
177 v3' = cc + ( Point (-delta) (-delta) (-delta) )
178
179 -- | The left (in the direction of -y) face of the cube.
180 left_face :: Cube -> Face.Face
181 left_face cube = Face.Face v0' v1' v2' v3'
182 where
183 delta = 1/2
184 cc = center cube
185 v0' = cc + ( Point delta (-delta) delta )
186 v1' = cc + ( Point (-delta) (-delta) delta )
187 v2' = cc + ( Point (-delta) (-delta) (-delta) )
188 v3' = cc + ( Point delta (-delta) (-delta) )
189
190
191 -- | The right (in the direction of y) face of the cube.
192 right_face :: Cube -> Face.Face
193 right_face cube = Face.Face v0' v1' v2' v3'
194 where
195 delta = 1/2
196 cc = center cube
197 v0' = cc + ( Point (-delta) delta delta)
198 v1' = cc + ( Point delta delta delta )
199 v2' = cc + ( Point delta delta (-delta) )
200 v3' = cc + ( Point (-delta) delta (-delta) )
201
202
203 tetrahedron :: Cube -> Int -> Tetrahedron
204
205 tetrahedron cube 0 =
206 Tetrahedron (fv cube) v0' v1' v2' v3' vol
207 where
208 v0' = center cube
209 ff = front_face cube
210 v1' = Face.center ff
211 v2' = Face.v0 ff
212 v3' = Face.v1 ff
213 vol = tetrahedra_volume cube
214
215 tetrahedron cube 1 =
216 Tetrahedron fv' v0' v1' v2' v3' vol
217 where
218 v0' = center cube
219 ff = front_face cube
220 v1' = Face.center ff
221 v2' = Face.v1 ff
222 v3' = Face.v2 ff
223 fv' = rotate ccwx (fv cube)
224 vol = tetrahedra_volume cube
225
226 tetrahedron cube 2 =
227 Tetrahedron fv' v0' v1' v2' v3' vol
228 where
229 v0' = center cube
230 ff = front_face cube
231 v1' = Face.center ff
232 v2' = Face.v2 ff
233 v3' = Face.v3 ff
234 fv' = rotate ccwx $ rotate ccwx $ fv cube
235 vol = tetrahedra_volume cube
236
237 tetrahedron cube 3 =
238 Tetrahedron fv' v0' v1' v2' v3' vol
239 where
240 v0' = center cube
241 ff = front_face cube
242 v1' = Face.center ff
243 v2' = Face.v3 ff
244 v3' = Face.v0 ff
245 fv' = rotate cwx (fv cube)
246 vol = tetrahedra_volume cube
247
248 tetrahedron cube 4 =
249 Tetrahedron fv' v0' v1' v2' v3' vol
250 where
251 v0' = center cube
252 tf = top_face cube
253 v1' = Face.center tf
254 v2' = Face.v0 tf
255 v3' = Face.v1 tf
256 fv' = rotate cwy (fv cube)
257 vol = tetrahedra_volume cube
258
259 tetrahedron cube 5 =
260 Tetrahedron fv' v0' v1' v2' v3' vol
261 where
262 v0' = center cube
263 tf = top_face cube
264 v1' = Face.center tf
265 v2' = Face.v1 tf
266 v3' = Face.v2 tf
267 fv' = rotate cwy $ rotate cwz $ fv cube
268 vol = tetrahedra_volume cube
269
270 tetrahedron cube 6 =
271 Tetrahedron fv' v0' v1' v2' v3' vol
272 where
273 v0' = center cube
274 tf = top_face cube
275 v1' = Face.center tf
276 v2' = Face.v2 tf
277 v3' = Face.v3 tf
278 fv' = rotate cwy $ rotate cwz
279 $ rotate cwz
280 $ fv cube
281 vol = tetrahedra_volume cube
282
283 tetrahedron cube 7 =
284 Tetrahedron fv' v0' v1' v2' v3' vol
285 where
286 v0' = center cube
287 tf = top_face cube
288 v1' = Face.center tf
289 v2' = Face.v3 tf
290 v3' = Face.v0 tf
291 fv' = rotate cwy $ rotate ccwz $ fv cube
292 vol = tetrahedra_volume cube
293
294 tetrahedron cube 8 =
295 Tetrahedron fv' v0' v1' v2' v3' vol
296 where
297 v0' = center cube
298 bf = back_face cube
299 v1' = Face.center bf
300 v2' = Face.v0 bf
301 v3' = Face.v1 bf
302 fv' = rotate cwy $ rotate cwy $ fv cube
303 vol = tetrahedra_volume cube
304
305 tetrahedron cube 9 =
306 Tetrahedron fv' v0' v1' v2' v3' vol
307 where
308 v0' = center cube
309 bf = back_face cube
310 v1' = Face.center bf
311 v2' = Face.v1 bf
312 v3' = Face.v2 bf
313 fv' = rotate cwy $ rotate cwy
314 $ rotate cwx
315 $ fv cube
316 vol = tetrahedra_volume cube
317
318 tetrahedron cube 10 =
319 Tetrahedron fv' v0' v1' v2' v3' vol
320 where
321 v0' = center cube
322 bf = back_face cube
323 v1' = Face.center bf
324 v2' = Face.v2 bf
325 v3' = Face.v3 bf
326 fv' = rotate cwy $ rotate cwy
327 $ rotate cwx
328 $ rotate cwx
329 $ fv cube
330
331 vol = tetrahedra_volume cube
332
333 tetrahedron cube 11 =
334 Tetrahedron fv' v0' v1' v2' v3' vol
335 where
336 v0' = center cube
337 bf = back_face cube
338 v1' = Face.center bf
339 v2' = Face.v3 bf
340 v3' = Face.v0 bf
341 fv' = rotate cwy $ rotate cwy
342 $ rotate ccwx
343 $ fv cube
344 vol = tetrahedra_volume cube
345
346 tetrahedron cube 12 =
347 Tetrahedron fv' v0' v1' v2' v3' vol
348 where
349 v0' = center cube
350 df = down_face cube
351 v1' = Face.center df
352 v2' = Face.v0 df
353 v3' = Face.v1 df
354 fv' = rotate ccwy $ fv cube
355 vol = tetrahedra_volume cube
356
357 tetrahedron cube 13 =
358 Tetrahedron fv' v0' v1' v2' v3' vol
359 where
360 v0' = center cube
361 df = down_face cube
362 v1' = Face.center df
363 v2' = Face.v1 df
364 v3' = Face.v2 df
365 fv' = rotate ccwy $ rotate ccwz $ fv cube
366 vol = tetrahedra_volume cube
367
368 tetrahedron cube 14 =
369 Tetrahedron fv' v0' v1' v2' v3' vol
370 where
371 v0' = center cube
372 df = down_face cube
373 v1' = Face.center df
374 v2' = Face.v2 df
375 v3' = Face.v3 df
376 fv' = rotate ccwy $ rotate ccwz
377 $ rotate ccwz
378 $ fv cube
379 vol = tetrahedra_volume cube
380
381 tetrahedron cube 15 =
382 Tetrahedron fv' v0' v1' v2' v3' vol
383 where
384 v0' = center cube
385 df = down_face cube
386 v1' = Face.center df
387 v2' = Face.v3 df
388 v3' = Face.v0 df
389 fv' = rotate ccwy $ rotate cwz $ fv cube
390 vol = tetrahedra_volume cube
391
392 tetrahedron cube 16 =
393 Tetrahedron fv' v0' v1' v2' v3' vol
394 where
395 v0' = center cube
396 rf = right_face cube
397 v1' = Face.center rf
398 v2' = Face.v0 rf
399 v3' = Face.v1 rf
400 fv' = rotate ccwz $ fv cube
401 vol = tetrahedra_volume cube
402
403 tetrahedron cube 17 =
404 Tetrahedron fv' v0' v1' v2' v3' vol
405 where
406 v0' = center cube
407 rf = right_face cube
408 v1' = Face.center rf
409 v2' = Face.v1 rf
410 v3' = Face.v2 rf
411 fv' = rotate ccwz $ rotate cwy $ fv cube
412 vol = tetrahedra_volume cube
413
414 tetrahedron cube 18 =
415 Tetrahedron fv' v0' v1' v2' v3' vol
416 where
417 v0' = center cube
418 rf = right_face cube
419 v1' = Face.center rf
420 v2' = Face.v2 rf
421 v3' = Face.v3 rf
422 fv' = rotate ccwz $ rotate cwy
423 $ rotate cwy
424 $ fv cube
425 vol = tetrahedra_volume cube
426
427 tetrahedron cube 19 =
428 Tetrahedron fv' v0' v1' v2' v3' vol
429 where
430 v0' = center cube
431 rf = right_face cube
432 v1' = Face.center rf
433 v2' = Face.v3 rf
434 v3' = Face.v0 rf
435 fv' = rotate ccwz $ rotate ccwy
436 $ fv cube
437 vol = tetrahedra_volume cube
438
439 tetrahedron cube 20 =
440 Tetrahedron fv' v0' v1' v2' v3' vol
441 where
442 v0' = center cube
443 lf = left_face cube
444 v1' = Face.center lf
445 v2' = Face.v0 lf
446 v3' = Face.v1 lf
447 fv' = rotate cwz $ fv cube
448 vol = tetrahedra_volume cube
449
450 tetrahedron cube 21 =
451 Tetrahedron fv' v0' v1' v2' v3' vol
452 where
453 v0' = center cube
454 lf = left_face cube
455 v1' = Face.center lf
456 v2' = Face.v1 lf
457 v3' = Face.v2 lf
458 fv' = rotate cwz $ rotate ccwy $ fv cube
459 vol = tetrahedra_volume cube
460
461 tetrahedron cube 22 =
462 Tetrahedron fv' v0' v1' v2' v3' vol
463 where
464 v0' = center cube
465 lf = left_face cube
466 v1' = Face.center lf
467 v2' = Face.v2 lf
468 v3' = Face.v3 lf
469 fv' = rotate cwz $ rotate ccwy
470 $ rotate ccwy
471 $ fv cube
472 vol = tetrahedra_volume cube
473
474 tetrahedron cube 23 =
475 Tetrahedron fv' v0' v1' v2' v3' vol
476 where
477 v0' = center cube
478 lf = left_face cube
479 v1' = Face.center lf
480 v2' = Face.v3 lf
481 v3' = Face.v0 lf
482 fv' = rotate cwz $ rotate cwy
483 $ fv cube
484 vol = tetrahedra_volume cube
485
486
487 -- Only used in tests, so we don't need the added speed
488 -- of Data.Vector.
489 tetrahedra :: Cube -> [Tetrahedron]
490 tetrahedra cube = [ tetrahedron cube n | n <- [0..23] ]
491
492 front_left_top_tetrahedra :: Cube -> V.Vector Tetrahedron
493 front_left_top_tetrahedra cube =
494 V.singleton (tetrahedron cube 0) `V.snoc`
495 (tetrahedron cube 3) `V.snoc`
496 (tetrahedron cube 6) `V.snoc`
497 (tetrahedron cube 7) `V.snoc`
498 (tetrahedron cube 20) `V.snoc`
499 (tetrahedron cube 21)
500
501 front_left_down_tetrahedra :: Cube -> V.Vector Tetrahedron
502 front_left_down_tetrahedra cube =
503 V.singleton (tetrahedron cube 0) `V.snoc`
504 (tetrahedron cube 2) `V.snoc`
505 (tetrahedron cube 3) `V.snoc`
506 (tetrahedron cube 12) `V.snoc`
507 (tetrahedron cube 15) `V.snoc`
508 (tetrahedron cube 21)
509
510 front_right_top_tetrahedra :: Cube -> V.Vector Tetrahedron
511 front_right_top_tetrahedra cube =
512 V.singleton (tetrahedron cube 0) `V.snoc`
513 (tetrahedron cube 1) `V.snoc`
514 (tetrahedron cube 5) `V.snoc`
515 (tetrahedron cube 6) `V.snoc`
516 (tetrahedron cube 16) `V.snoc`
517 (tetrahedron cube 19)
518
519 front_right_down_tetrahedra :: Cube -> V.Vector Tetrahedron
520 front_right_down_tetrahedra cube =
521 V.singleton (tetrahedron cube 1) `V.snoc`
522 (tetrahedron cube 2) `V.snoc`
523 (tetrahedron cube 12) `V.snoc`
524 (tetrahedron cube 13) `V.snoc`
525 (tetrahedron cube 18) `V.snoc`
526 (tetrahedron cube 19)
527
528 back_left_top_tetrahedra :: Cube -> V.Vector Tetrahedron
529 back_left_top_tetrahedra cube =
530 V.singleton (tetrahedron cube 0) `V.snoc`
531 (tetrahedron cube 3) `V.snoc`
532 (tetrahedron cube 6) `V.snoc`
533 (tetrahedron cube 7) `V.snoc`
534 (tetrahedron cube 20) `V.snoc`
535 (tetrahedron cube 21)
536
537 back_left_down_tetrahedra :: Cube -> V.Vector Tetrahedron
538 back_left_down_tetrahedra cube =
539 V.singleton (tetrahedron cube 8) `V.snoc`
540 (tetrahedron cube 11) `V.snoc`
541 (tetrahedron cube 14) `V.snoc`
542 (tetrahedron cube 15) `V.snoc`
543 (tetrahedron cube 22) `V.snoc`
544 (tetrahedron cube 23)
545
546 back_right_top_tetrahedra :: Cube -> V.Vector Tetrahedron
547 back_right_top_tetrahedra cube =
548 V.singleton (tetrahedron cube 4) `V.snoc`
549 (tetrahedron cube 5) `V.snoc`
550 (tetrahedron cube 9) `V.snoc`
551 (tetrahedron cube 10) `V.snoc`
552 (tetrahedron cube 16) `V.snoc`
553 (tetrahedron cube 17)
554
555 back_right_down_tetrahedra :: Cube -> V.Vector Tetrahedron
556 back_right_down_tetrahedra cube =
557 V.singleton (tetrahedron cube 8) `V.snoc`
558 (tetrahedron cube 9) `V.snoc`
559 (tetrahedron cube 13) `V.snoc`
560 (tetrahedron cube 14) `V.snoc`
561 (tetrahedron cube 17) `V.snoc`
562 (tetrahedron cube 18)
563
564 in_top_half :: Cube -> Point -> Bool
565 in_top_half cube (Point _ _ z) =
566 distance_from_top <= distance_from_bottom
567 where
568 distance_from_top = abs $ (zmax cube) - z
569 distance_from_bottom = abs $ (zmin cube) - z
570
571 in_front_half :: Cube -> Point -> Bool
572 in_front_half cube (Point x _ _) =
573 distance_from_front <= distance_from_back
574 where
575 distance_from_front = abs $ (xmin cube) - x
576 distance_from_back = abs $ (xmax cube) - x
577
578
579 in_left_half :: Cube -> Point -> Bool
580 in_left_half cube (Point _ y _) =
581 distance_from_left <= distance_from_right
582 where
583 distance_from_left = abs $ (ymin cube) - y
584 distance_from_right = abs $ (ymax cube) - y
585
586
587 -- | Takes a 'Cube', and returns the Tetrahedra belonging to it that
588 -- contain the given 'Point'. This should be faster than checking
589 -- every tetrahedron individually, since we determine which half
590 -- (hemisphere?) of the cube the point lies in three times: once in
591 -- each dimension. This allows us to eliminate non-candidates
592 -- quickly.
593 --
594 -- This can throw an exception, but the use of 'head' might
595 -- save us some unnecessary computations.
596 --
597 {-# INLINE find_containing_tetrahedron #-}
598 find_containing_tetrahedron :: Cube -> Point -> Tetrahedron
599 find_containing_tetrahedron cube p =
600 candidates `V.unsafeIndex` (fromJust lucky_idx)
601 where
602 front_half = in_front_half cube p
603 top_half = in_top_half cube p
604 left_half = in_left_half cube p
605
606 candidates :: V.Vector Tetrahedron
607 candidates =
608 if front_half then
609
610 if left_half then
611 if top_half then
612 front_left_top_tetrahedra cube
613 else
614 front_left_down_tetrahedra cube
615 else
616 if top_half then
617 front_right_top_tetrahedra cube
618 else
619 front_right_down_tetrahedra cube
620
621 else -- bottom half
622
623 if left_half then
624 if top_half then
625 back_left_top_tetrahedra cube
626 else
627 back_left_down_tetrahedra cube
628 else
629 if top_half then
630 back_right_top_tetrahedra cube
631 else
632 back_right_down_tetrahedra cube
633
634 -- Use the dot product instead of Euclidean distance here to save
635 -- a sqrt(). So, "distances" below really means "distances
636 -- squared."
637 distances :: V.Vector Double
638 distances = V.map ((dot p) . barycenter) candidates
639
640 shortest_distance :: Double
641 shortest_distance = V.minimum distances
642
643 -- Compute the index of the tetrahedron with the center closest to
644 -- p. This is a bad algorithm, but don't change it! If you make it
645 -- smarter by finding the index of shortest_distance in distances
646 -- (this should give the same answer and avoids recomputing the
647 -- dot product), the program gets slower. Seriously!
648 lucky_idx :: Maybe Int
649 lucky_idx = V.findIndex
650 (\t -> (barycenter t) `dot` p == shortest_distance)
651 candidates
652
653
654
655
656
657
658 -- Tests
659
660 -- Quickcheck tests.
661
662 prop_opposite_octant_tetrahedra_disjoint1 :: Cube -> Bool
663 prop_opposite_octant_tetrahedra_disjoint1 cube =
664 disjoint (front_left_top_tetrahedra cube) (front_right_down_tetrahedra cube)
665
666 prop_opposite_octant_tetrahedra_disjoint2 :: Cube -> Bool
667 prop_opposite_octant_tetrahedra_disjoint2 cube =
668 disjoint (back_left_top_tetrahedra cube) (back_right_down_tetrahedra cube)
669
670 prop_opposite_octant_tetrahedra_disjoint3 :: Cube -> Bool
671 prop_opposite_octant_tetrahedra_disjoint3 cube =
672 disjoint (front_left_top_tetrahedra cube) (back_right_top_tetrahedra cube)
673
674 prop_opposite_octant_tetrahedra_disjoint4 :: Cube -> Bool
675 prop_opposite_octant_tetrahedra_disjoint4 cube =
676 disjoint (front_left_down_tetrahedra cube) (back_right_down_tetrahedra cube)
677
678 prop_opposite_octant_tetrahedra_disjoint5 :: Cube -> Bool
679 prop_opposite_octant_tetrahedra_disjoint5 cube =
680 disjoint (front_left_top_tetrahedra cube) (back_left_down_tetrahedra cube)
681
682 prop_opposite_octant_tetrahedra_disjoint6 :: Cube -> Bool
683 prop_opposite_octant_tetrahedra_disjoint6 cube =
684 disjoint (front_right_top_tetrahedra cube) (back_right_down_tetrahedra cube)
685
686
687 -- | Since the grid size is necessarily positive, all tetrahedra
688 -- (which comprise cubes of positive volume) must have positive
689 -- volume as well.
690 prop_all_volumes_positive :: Cube -> Bool
691 prop_all_volumes_positive cube =
692 all (>= 0) volumes
693 where
694 ts = tetrahedra cube
695 volumes = map volume ts
696
697
698 -- | In fact, since all of the tetrahedra are identical, we should
699 -- already know their volumes. There's 24 tetrahedra to a cube, so
700 -- we'd expect the volume of each one to be 1/24.
701 prop_all_volumes_exact :: Cube -> Bool
702 prop_all_volumes_exact cube =
703 and [volume t ~~= 1/24 | t <- tetrahedra cube]
704
705 -- | All tetrahedron should have their v0 located at the center of the
706 -- cube.
707 prop_v0_all_equal :: Cube -> Bool
708 prop_v0_all_equal cube = (v0 t0) == (v0 t1)
709 where
710 t0 = head (tetrahedra cube) -- Doesn't matter which two we choose.
711 t1 = head $ tail (tetrahedra cube)
712
713
714 -- | Given in Sorokina and Zeilfelder, p. 79, (2.6). Note that the
715 -- third and fourth indices of c-t3 have been switched. This is
716 -- because we store the triangles oriented such that their volume is
717 -- positive. If T and T-tilde share \<v0,v1,v2\> and v3,v3-tilde point
718 -- in opposite directions, one of them has to have negative volume!
719 prop_c0120_identity1 :: Cube -> Bool
720 prop_c0120_identity1 cube =
721 c t0 0 1 2 0 ~= (c t0 0 0 2 1 + c t3 0 0 1 2) / 2
722 where
723 t0 = tetrahedron cube 0
724 t3 = tetrahedron cube 3
725
726
727 -- | Given in Sorokina and Zeilfelder, p. 79, (2.6). Repeats
728 -- 'prop_c0120_identity1' with tetrahedrons 1 and 2.
729 prop_c0120_identity2 :: Cube -> Bool
730 prop_c0120_identity2 cube =
731 c t1 0 1 2 0 ~= (c t1 0 0 2 1 + c t0 0 0 1 2) / 2
732 where
733 t0 = tetrahedron cube 0
734 t1 = tetrahedron cube 1
735
736 -- | Given in Sorokina and Zeilfelder, p. 79, (2.6). Repeats
737 -- 'prop_c0120_identity1' with tetrahedrons 1 and 2.
738 prop_c0120_identity3 :: Cube -> Bool
739 prop_c0120_identity3 cube =
740 c t2 0 1 2 0 ~= (c t2 0 0 2 1 + c t1 0 0 1 2) / 2
741 where
742 t1 = tetrahedron cube 1
743 t2 = tetrahedron cube 2
744
745 -- | Given in Sorokina and Zeilfelder, p. 79, (2.6). Repeats
746 -- 'prop_c0120_identity1' with tetrahedrons 2 and 3.
747 prop_c0120_identity4 :: Cube -> Bool
748 prop_c0120_identity4 cube =
749 c t3 0 1 2 0 ~= (c t3 0 0 2 1 + c t2 0 0 1 2) / 2
750 where
751 t2 = tetrahedron cube 2
752 t3 = tetrahedron cube 3
753
754
755 -- | Given in Sorokina and Zeilfelder, p. 79, (2.6). Repeats
756 -- 'prop_c0120_identity1' with tetrahedrons 4 and 5.
757 prop_c0120_identity5 :: Cube -> Bool
758 prop_c0120_identity5 cube =
759 c t5 0 1 2 0 ~= (c t5 0 0 2 1 + c t4 0 0 1 2) / 2
760 where
761 t4 = tetrahedron cube 4
762 t5 = tetrahedron cube 5
763
764 -- | Given in Sorokina and Zeilfelder, p. 79, (2.6). Repeats
765 -- 'prop_c0120_identity1' with tetrahedrons 5 and 6.
766 prop_c0120_identity6 :: Cube -> Bool
767 prop_c0120_identity6 cube =
768 c t6 0 1 2 0 ~= (c t6 0 0 2 1 + c t5 0 0 1 2) / 2
769 where
770 t5 = tetrahedron cube 5
771 t6 = tetrahedron cube 6
772
773
774 -- | Given in Sorokina and Zeilfelder, p. 79, (2.6). Repeats
775 -- 'prop_c0120_identity1' with tetrahedrons 6 and 7.
776 prop_c0120_identity7 :: Cube -> Bool
777 prop_c0120_identity7 cube =
778 c t7 0 1 2 0 ~= (c t7 0 0 2 1 + c t6 0 0 1 2) / 2
779 where
780 t6 = tetrahedron cube 6
781 t7 = tetrahedron cube 7
782
783
784 -- | Given in Sorokina and Zeilfelder, p. 79, (2.6). See
785 -- 'prop_c0120_identity1'.
786 prop_c0210_identity1 :: Cube -> Bool
787 prop_c0210_identity1 cube =
788 c t0 0 2 1 0 ~= (c t0 0 1 1 1 + c t3 0 1 1 1) / 2
789 where
790 t0 = tetrahedron cube 0
791 t3 = tetrahedron cube 3
792
793
794 -- | Given in Sorokina and Zeilfelder, p. 79, (2.6). See
795 -- 'prop_c0120_identity1'.
796 prop_c0300_identity1 :: Cube -> Bool
797 prop_c0300_identity1 cube =
798 c t0 0 3 0 0 ~= (c t0 0 2 0 1 + c t3 0 2 1 0) / 2
799 where
800 t0 = tetrahedron cube 0
801 t3 = tetrahedron cube 3
802
803
804 -- | Given in Sorokina and Zeilfelder, p. 79, (2.6). See
805 -- 'prop_c0120_identity1'.
806 prop_c1110_identity :: Cube -> Bool
807 prop_c1110_identity cube =
808 c t0 1 1 1 0 ~= (c t0 1 0 1 1 + c t3 1 0 1 1) / 2
809 where
810 t0 = tetrahedron cube 0
811 t3 = tetrahedron cube 3
812
813
814 -- | Given in Sorokina and Zeilfelder, p. 79, (2.6). See
815 -- 'prop_c0120_identity1'.
816 prop_c1200_identity1 :: Cube -> Bool
817 prop_c1200_identity1 cube =
818 c t0 1 2 0 0 ~= (c t0 1 1 0 1 + c t3 1 1 1 0) / 2
819 where
820 t0 = tetrahedron cube 0
821 t3 = tetrahedron cube 3
822
823
824 -- | Given in Sorokina and Zeilfelder, p. 79, (2.6). See
825 -- 'prop_c0120_identity1'.
826 prop_c2100_identity1 :: Cube -> Bool
827 prop_c2100_identity1 cube =
828 c t0 2 1 0 0 ~= (c t0 2 0 0 1 + c t3 2 0 1 0) / 2
829 where
830 t0 = tetrahedron cube 0
831 t3 = tetrahedron cube 3
832
833
834
835 -- | Given in Sorokina and Zeilfelder, p. 79, (2.7). Note that the
836 -- third and fourth indices of c-t3 have been switched. This is
837 -- because we store the triangles oriented such that their volume is
838 -- positive. If T and T-tilde share \<v0,v1,v2\> and v3,v3-tilde
839 -- point in opposite directions, one of them has to have negative
840 -- volume!
841 prop_c0102_identity1 :: Cube -> Bool
842 prop_c0102_identity1 cube =
843 c t0 0 1 0 2 ~= (c t0 0 0 1 2 + c t1 0 0 2 1) / 2
844 where
845 t0 = tetrahedron cube 0
846 t1 = tetrahedron cube 1
847
848
849 -- | Given in Sorokina and Zeilfelder, p. 79, (2.7). See
850 -- 'prop_c0102_identity1'.
851 prop_c0201_identity1 :: Cube -> Bool
852 prop_c0201_identity1 cube =
853 c t0 0 2 0 1 ~= (c t0 0 1 1 1 + c t1 0 1 1 1) / 2
854 where
855 t0 = tetrahedron cube 0
856 t1 = tetrahedron cube 1
857
858
859 -- | Given in Sorokina and Zeilfelder, p. 79, (2.7). See
860 -- 'prop_c0102_identity1'.
861 prop_c0300_identity2 :: Cube -> Bool
862 prop_c0300_identity2 cube =
863 c t0 0 3 0 0 ~= (c t0 0 2 1 0 + c t1 0 2 0 1) / 2
864 where
865 t0 = tetrahedron cube 0
866 t1 = tetrahedron cube 1
867
868
869 -- | Given in Sorokina and Zeilfelder, p. 79, (2.7). See
870 -- 'prop_c0102_identity1'.
871 prop_c1101_identity :: Cube -> Bool
872 prop_c1101_identity cube =
873 c t0 1 1 0 1 ~= (c t0 1 0 1 1 + c t1 1 0 1 1) / 2
874 where
875 t0 = tetrahedron cube 0
876 t1 = tetrahedron cube 1
877
878
879 -- | Given in Sorokina and Zeilfelder, p. 79, (2.7). See
880 -- 'prop_c0102_identity1'.
881 prop_c1200_identity2 :: Cube -> Bool
882 prop_c1200_identity2 cube =
883 c t0 1 2 0 0 ~= (c t0 1 1 1 0 + c t1 1 1 0 1) / 2
884 where
885 t0 = tetrahedron cube 0
886 t1 = tetrahedron cube 1
887
888
889 -- | Given in Sorokina and Zeilfelder, p. 79, (2.7). See
890 -- 'prop_c0102_identity1'.
891 prop_c2100_identity2 :: Cube -> Bool
892 prop_c2100_identity2 cube =
893 c t0 2 1 0 0 ~= (c t0 2 0 1 0 + c t1 2 0 0 1) / 2
894 where
895 t0 = tetrahedron cube 0
896 t1 = tetrahedron cube 1
897
898
899 -- | Given in Sorokina and Zeilfelder, p. 79, (2.8). The third and
900 -- fourth indices of c-t6 have been switched. This is because we
901 -- store the triangles oriented such that their volume is
902 -- positive. If T and T-tilde share \<v0,v1,v2\> and v3,v3-tilde
903 -- point in opposite directions, one of them has to have negative
904 -- volume!
905 prop_c3000_identity :: Cube -> Bool
906 prop_c3000_identity cube =
907 c t0 3 0 0 0 ~= c t0 2 1 0 0 + c t6 2 1 0 0
908 - ((c t0 2 0 1 0 + c t0 2 0 0 1)/ 2)
909 where
910 t0 = tetrahedron cube 0
911 t6 = tetrahedron cube 6
912
913
914 -- | Given in Sorokina and Zeilfelder, p. 79, (2.8). See
915 -- 'prop_c3000_identity'.
916 prop_c2010_identity :: Cube -> Bool
917 prop_c2010_identity cube =
918 c t0 2 0 1 0 ~= c t0 1 1 1 0 + c t6 1 1 0 1
919 - ((c t0 1 0 2 0 + c t0 1 0 1 1)/ 2)
920 where
921 t0 = tetrahedron cube 0
922 t6 = tetrahedron cube 6
923
924
925 -- | Given in Sorokina and Zeilfelder, p. 79, (2.8). See
926 -- 'prop_c3000_identity'.
927 prop_c2001_identity :: Cube -> Bool
928 prop_c2001_identity cube =
929 c t0 2 0 0 1 ~= c t0 1 1 0 1 + c t6 1 1 1 0
930 - ((c t0 1 0 0 2 + c t0 1 0 1 1)/ 2)
931 where
932 t0 = tetrahedron cube 0
933 t6 = tetrahedron cube 6
934
935
936 -- | Given in Sorokina and Zeilfelder, p. 79, (2.8). See
937 -- 'prop_c3000_identity'.
938 prop_c1020_identity :: Cube -> Bool
939 prop_c1020_identity cube =
940 c t0 1 0 2 0 ~= c t0 0 1 2 0 + c t6 0 1 0 2
941 - ((c t0 0 0 3 0 + c t0 0 0 2 1)/ 2)
942 where
943 t0 = tetrahedron cube 0
944 t6 = tetrahedron cube 6
945
946
947 -- | Given in Sorokina and Zeilfelder, p. 79, (2.8). See
948 -- 'prop_c3000_identity'.
949 prop_c1002_identity :: Cube -> Bool
950 prop_c1002_identity cube =
951 c t0 1 0 0 2 ~= c t0 0 1 0 2 + c t6 0 1 2 0
952 - ((c t0 0 0 0 3 + c t0 0 0 1 2)/ 2)
953 where
954 t0 = tetrahedron cube 0
955 t6 = tetrahedron cube 6
956
957
958 -- | Given in Sorokina and Zeilfelder, p. 79, (2.8). See
959 -- 'prop_c3000_identity'.
960 prop_c1011_identity :: Cube -> Bool
961 prop_c1011_identity cube =
962 c t0 1 0 1 1 ~= c t0 0 1 1 1 + c t6 0 1 1 1 -
963 ((c t0 0 0 1 2 + c t0 0 0 2 1)/ 2)
964 where
965 t0 = tetrahedron cube 0
966 t6 = tetrahedron cube 6
967
968
969 -- | The function values at the interior should be the same for all
970 -- tetrahedra.
971 prop_interior_values_all_identical :: Cube -> Bool
972 prop_interior_values_all_identical cube =
973 all_equal [ eval (function_values tet) I | tet <- tetrahedra cube ]
974
975
976 -- | We know what (c t6 2 1 0 0) should be from Sorokina and Zeilfelder, p. 87.
977 -- This test checks the rotation works as expected.
978 prop_c_tilde_2100_rotation_correct :: Cube -> Bool
979 prop_c_tilde_2100_rotation_correct cube =
980 expr1 ~= expr2
981 where
982 t0 = tetrahedron cube 0
983 t6 = tetrahedron cube 6
984
985 -- What gets computed for c2100 of t6.
986 expr1 = eval (function_values t6) $
987 (3/8)*I +
988 (1/12)*(T + R + L + D) +
989 (1/64)*(FT + FR + FL + FD) +
990 (7/48)*F +
991 (1/48)*B +
992 (1/96)*(RT + LD + LT + RD) +
993 (1/192)*(BT + BR + BL + BD)
994
995 -- What should be computed for c2100 of t6.
996 expr2 = eval (function_values t0) $
997 (3/8)*I +
998 (1/12)*(F + R + L + B) +
999 (1/64)*(FT + RT + LT + BT) +
1000 (7/48)*T +
1001 (1/48)*D +
1002 (1/96)*(FR + FL + BR + BL) +
1003 (1/192)*(FD + RD + LD + BD)
1004
1005
1006 -- | We know what (c t6 2 1 0 0) should be from Sorokina and
1007 -- Zeilfelder, p. 87. This test checks the actual value based on
1008 -- the FunctionValues of the cube.
1009 --
1010 -- If 'prop_c_tilde_2100_rotation_correct' passes, then this test is
1011 -- even meaningful!
1012 prop_c_tilde_2100_correct :: Cube -> Bool
1013 prop_c_tilde_2100_correct cube =
1014 c t6 2 1 0 0 ~= expected
1015 where
1016 t0 = tetrahedron cube 0
1017 t6 = tetrahedron cube 6
1018 fvs = function_values t0
1019 expected = eval fvs $
1020 (3/8)*I +
1021 (1/12)*(F + R + L + B) +
1022 (1/64)*(FT + RT + LT + BT) +
1023 (7/48)*T +
1024 (1/48)*D +
1025 (1/96)*(FR + FL + BR + BL) +
1026 (1/192)*(FD + RD + LD + BD)
1027
1028
1029 -- Tests to check that the correct edges are incidental.
1030 prop_t0_shares_edge_with_t1 :: Cube -> Bool
1031 prop_t0_shares_edge_with_t1 cube =
1032 (v1 t0) == (v1 t1) && (v3 t0) == (v2 t1)
1033 where
1034 t0 = tetrahedron cube 0
1035 t1 = tetrahedron cube 1
1036
1037 prop_t0_shares_edge_with_t3 :: Cube -> Bool
1038 prop_t0_shares_edge_with_t3 cube =
1039 (v1 t0) == (v1 t3) && (v2 t0) == (v3 t3)
1040 where
1041 t0 = tetrahedron cube 0
1042 t3 = tetrahedron cube 3
1043
1044 prop_t0_shares_edge_with_t6 :: Cube -> Bool
1045 prop_t0_shares_edge_with_t6 cube =
1046 (v2 t0) == (v3 t6) && (v3 t0) == (v2 t6)
1047 where
1048 t0 = tetrahedron cube 0
1049 t6 = tetrahedron cube 6
1050
1051 prop_t1_shares_edge_with_t2 :: Cube -> Bool
1052 prop_t1_shares_edge_with_t2 cube =
1053 (v1 t1) == (v1 t2) && (v3 t1) == (v2 t2)
1054 where
1055 t1 = tetrahedron cube 1
1056 t2 = tetrahedron cube 2
1057
1058 prop_t1_shares_edge_with_t19 :: Cube -> Bool
1059 prop_t1_shares_edge_with_t19 cube =
1060 (v2 t1) == (v3 t19) && (v3 t1) == (v2 t19)
1061 where
1062 t1 = tetrahedron cube 1
1063 t19 = tetrahedron cube 19
1064
1065 prop_t2_shares_edge_with_t3 :: Cube -> Bool
1066 prop_t2_shares_edge_with_t3 cube =
1067 (v1 t1) == (v1 t2) && (v3 t1) == (v2 t2)
1068 where
1069 t1 = tetrahedron cube 1
1070 t2 = tetrahedron cube 2
1071
1072 prop_t2_shares_edge_with_t12 :: Cube -> Bool
1073 prop_t2_shares_edge_with_t12 cube =
1074 (v2 t2) == (v3 t12) && (v3 t2) == (v2 t12)
1075 where
1076 t2 = tetrahedron cube 2
1077 t12 = tetrahedron cube 12
1078
1079 prop_t3_shares_edge_with_t21 :: Cube -> Bool
1080 prop_t3_shares_edge_with_t21 cube =
1081 (v2 t3) == (v3 t21) && (v3 t3) == (v2 t21)
1082 where
1083 t3 = tetrahedron cube 3
1084 t21 = tetrahedron cube 21
1085
1086 prop_t4_shares_edge_with_t5 :: Cube -> Bool
1087 prop_t4_shares_edge_with_t5 cube =
1088 (v1 t4) == (v1 t5) && (v3 t4) == (v2 t5)
1089 where
1090 t4 = tetrahedron cube 4
1091 t5 = tetrahedron cube 5
1092
1093 prop_t4_shares_edge_with_t7 :: Cube -> Bool
1094 prop_t4_shares_edge_with_t7 cube =
1095 (v1 t4) == (v1 t7) && (v2 t4) == (v3 t7)
1096 where
1097 t4 = tetrahedron cube 4
1098 t7 = tetrahedron cube 7
1099
1100 prop_t4_shares_edge_with_t10 :: Cube -> Bool
1101 prop_t4_shares_edge_with_t10 cube =
1102 (v2 t4) == (v3 t10) && (v3 t4) == (v2 t10)
1103 where
1104 t4 = tetrahedron cube 4
1105 t10 = tetrahedron cube 10
1106
1107 prop_t5_shares_edge_with_t6 :: Cube -> Bool
1108 prop_t5_shares_edge_with_t6 cube =
1109 (v1 t5) == (v1 t6) && (v3 t5) == (v2 t6)
1110 where
1111 t5 = tetrahedron cube 5
1112 t6 = tetrahedron cube 6
1113
1114 prop_t5_shares_edge_with_t16 :: Cube -> Bool
1115 prop_t5_shares_edge_with_t16 cube =
1116 (v2 t5) == (v3 t16) && (v3 t5) == (v2 t16)
1117 where
1118 t5 = tetrahedron cube 5
1119 t16 = tetrahedron cube 16
1120
1121 prop_t6_shares_edge_with_t7 :: Cube -> Bool
1122 prop_t6_shares_edge_with_t7 cube =
1123 (v1 t6) == (v1 t7) && (v3 t6) == (v2 t7)
1124 where
1125 t6 = tetrahedron cube 6
1126 t7 = tetrahedron cube 7
1127
1128 prop_t7_shares_edge_with_t20 :: Cube -> Bool
1129 prop_t7_shares_edge_with_t20 cube =
1130 (v2 t7) == (v3 t20) && (v2 t7) == (v3 t20)
1131 where
1132 t7 = tetrahedron cube 7
1133 t20 = tetrahedron cube 20
1134
1135
1136 p79_26_properties :: Test.Framework.Test
1137 p79_26_properties =
1138 testGroup "p. 79, Section (2.6) Properties" [
1139 testProperty "c0120 identity1" prop_c0120_identity1,
1140 testProperty "c0120 identity2" prop_c0120_identity2,
1141 testProperty "c0120 identity3" prop_c0120_identity3,
1142 testProperty "c0120 identity4" prop_c0120_identity4,
1143 testProperty "c0120 identity5" prop_c0120_identity5,
1144 testProperty "c0120 identity6" prop_c0120_identity6,
1145 testProperty "c0120 identity7" prop_c0120_identity7,
1146 testProperty "c0210 identity1" prop_c0210_identity1,
1147 testProperty "c0300 identity1" prop_c0300_identity1,
1148 testProperty "c1110 identity" prop_c1110_identity,
1149 testProperty "c1200 identity1" prop_c1200_identity1,
1150 testProperty "c2100 identity1" prop_c2100_identity1]
1151
1152 p79_27_properties :: Test.Framework.Test
1153 p79_27_properties =
1154 testGroup "p. 79, Section (2.7) Properties" [
1155 testProperty "c0102 identity1" prop_c0102_identity1,
1156 testProperty "c0201 identity1" prop_c0201_identity1,
1157 testProperty "c0300 identity2" prop_c0300_identity2,
1158 testProperty "c1101 identity" prop_c1101_identity,
1159 testProperty "c1200 identity2" prop_c1200_identity2,
1160 testProperty "c2100 identity2" prop_c2100_identity2 ]
1161
1162
1163 p79_28_properties :: Test.Framework.Test
1164 p79_28_properties =
1165 testGroup "p. 79, Section (2.8) Properties" [
1166 testProperty "c3000 identity" prop_c3000_identity,
1167 testProperty "c2010 identity" prop_c2010_identity,
1168 testProperty "c2001 identity" prop_c2001_identity,
1169 testProperty "c1020 identity" prop_c1020_identity,
1170 testProperty "c1002 identity" prop_c1002_identity,
1171 testProperty "c1011 identity" prop_c1011_identity ]
1172
1173
1174 edge_incidence_tests :: Test.Framework.Test
1175 edge_incidence_tests =
1176 testGroup "Edge Incidence Tests" [
1177 testProperty "t0 shares edge with t6" prop_t0_shares_edge_with_t6,
1178 testProperty "t0 shares edge with t1" prop_t0_shares_edge_with_t1,
1179 testProperty "t0 shares edge with t3" prop_t0_shares_edge_with_t3,
1180 testProperty "t1 shares edge with t2" prop_t1_shares_edge_with_t2,
1181 testProperty "t1 shares edge with t19" prop_t1_shares_edge_with_t19,
1182 testProperty "t2 shares edge with t3" prop_t2_shares_edge_with_t3,
1183 testProperty "t2 shares edge with t12" prop_t2_shares_edge_with_t12,
1184 testProperty "t3 shares edge with t21" prop_t3_shares_edge_with_t21,
1185 testProperty "t4 shares edge with t5" prop_t4_shares_edge_with_t5,
1186 testProperty "t4 shares edge with t7" prop_t4_shares_edge_with_t7,
1187 testProperty "t4 shares edge with t10" prop_t4_shares_edge_with_t10,
1188 testProperty "t5 shares edge with t6" prop_t5_shares_edge_with_t6,
1189 testProperty "t5 shares edge with t16" prop_t5_shares_edge_with_t16,
1190 testProperty "t6 shares edge with t7" prop_t6_shares_edge_with_t7,
1191 testProperty "t7 shares edge with t20" prop_t7_shares_edge_with_t20 ]
1192
1193 cube_properties :: Test.Framework.Test
1194 cube_properties =
1195 testGroup "Cube Properties" [
1196 p79_26_properties,
1197 p79_27_properties,
1198 p79_28_properties,
1199 edge_incidence_tests,
1200 testProperty "opposite octant tetrahedra are disjoint (1)"
1201 prop_opposite_octant_tetrahedra_disjoint1,
1202 testProperty "opposite octant tetrahedra are disjoint (2)"
1203 prop_opposite_octant_tetrahedra_disjoint2,
1204 testProperty "opposite octant tetrahedra are disjoint (3)"
1205 prop_opposite_octant_tetrahedra_disjoint3,
1206 testProperty "opposite octant tetrahedra are disjoint (4)"
1207 prop_opposite_octant_tetrahedra_disjoint4,
1208 testProperty "opposite octant tetrahedra are disjoint (5)"
1209 prop_opposite_octant_tetrahedra_disjoint5,
1210 testProperty "opposite octant tetrahedra are disjoint (6)"
1211 prop_opposite_octant_tetrahedra_disjoint6,
1212 testProperty "all volumes positive" prop_all_volumes_positive,
1213 testProperty "all volumes exact" prop_all_volumes_exact,
1214 testProperty "v0 all equal" prop_v0_all_equal,
1215 testProperty "interior values all identical"
1216 prop_interior_values_all_identical,
1217 testProperty "c-tilde_2100 rotation correct"
1218 prop_c_tilde_2100_rotation_correct,
1219 testProperty "c-tilde_2100 correct"
1220 prop_c_tilde_2100_correct ]