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