4 import Prelude hiding (LT)
11 import Tests.FunctionValues ()
12 import Tetrahedron (b0, b1, b2, b3, c, fv,
13 v0, v1, v2, v3, volume)
15 instance Arbitrary Cube where
17 (Positive h') <- arbitrary :: Gen (Positive Double)
18 i' <- choose (coordmin, coordmax)
19 j' <- choose (coordmin, coordmax)
20 k' <- choose (coordmin, coordmax)
21 fv' <- arbitrary :: Gen FunctionValues
22 return (Cube h' i' j' k' fv')
24 coordmin = -268435456 -- -(2^29 / 2)
25 coordmax = 268435456 -- +(2^29 / 2)
30 -- | Since the grid size is necessarily positive, all tetrahedrons
31 -- (which comprise cubes of positive volume) must have positive volume
33 prop_all_volumes_positive :: Cube -> Bool
34 prop_all_volumes_positive cube =
35 null nonpositive_volumes
37 ts = tetrahedrons cube
38 volumes = map volume ts
39 nonpositive_volumes = filter (<= 0) volumes
41 -- | In fact, since all of the tetrahedra are identical, we should
42 -- already know their volumes. There's 24 tetrahedra to a cube, so
43 -- we'd expect the volume of each one to be (1/24)*h^3.
44 prop_tetrahedron0_volumes_exact :: Cube -> Bool
45 prop_tetrahedron0_volumes_exact cube =
46 volume (tetrahedron0 cube) ~= (1/24)*(delta^(3::Int))
50 -- | In fact, since all of the tetrahedra are identical, we should
51 -- already know their volumes. There's 24 tetrahedra to a cube, so
52 -- we'd expect the volume of each one to be (1/24)*h^3.
53 prop_tetrahedron1_volumes_exact :: Cube -> Bool
54 prop_tetrahedron1_volumes_exact cube =
55 volume (tetrahedron1 cube) ~= (1/24)*(delta^(3::Int))
59 -- | In fact, since all of the tetrahedra are identical, we should
60 -- already know their volumes. There's 24 tetrahedra to a cube, so
61 -- we'd expect the volume of each one to be (1/24)*h^3.
62 prop_tetrahedron2_volumes_exact :: Cube -> Bool
63 prop_tetrahedron2_volumes_exact cube =
64 volume (tetrahedron2 cube) ~= (1/24)*(delta^(3::Int))
68 -- | In fact, since all of the tetrahedra are identical, we should
69 -- already know their volumes. There's 24 tetrahedra to a cube, so
70 -- we'd expect the volume of each one to be (1/24)*h^3.
71 prop_tetrahedron3_volumes_exact :: Cube -> Bool
72 prop_tetrahedron3_volumes_exact cube =
73 volume (tetrahedron3 cube) ~= (1/24)*(delta^(3::Int))
77 -- | In fact, since all of the tetrahedra are identical, we should
78 -- already know their volumes. There's 24 tetrahedra to a cube, so
79 -- we'd expect the volume of each one to be (1/24)*h^3.
80 prop_tetrahedron4_volumes_exact :: Cube -> Bool
81 prop_tetrahedron4_volumes_exact cube =
82 volume (tetrahedron4 cube) ~= (1/24)*(delta^(3::Int))
86 -- | In fact, since all of the tetrahedra are identical, we should
87 -- already know their volumes. There's 24 tetrahedra to a cube, so
88 -- we'd expect the volume of each one to be (1/24)*h^3.
89 prop_tetrahedron5_volumes_exact :: Cube -> Bool
90 prop_tetrahedron5_volumes_exact cube =
91 volume (tetrahedron5 cube) ~= (1/24)*(delta^(3::Int))
95 -- | In fact, since all of the tetrahedra are identical, we should
96 -- already know their volumes. There's 24 tetrahedra to a cube, so
97 -- we'd expect the volume of each one to be (1/24)*h^3.
98 prop_tetrahedron6_volumes_exact :: Cube -> Bool
99 prop_tetrahedron6_volumes_exact cube =
100 volume (tetrahedron6 cube) ~= (1/24)*(delta^(3::Int))
104 -- | In fact, since all of the tetrahedra are identical, we should
105 -- already know their volumes. There's 24 tetrahedra to a cube, so
106 -- we'd expect the volume of each one to be (1/24)*h^3.
107 prop_tetrahedron7_volumes_exact :: Cube -> Bool
108 prop_tetrahedron7_volumes_exact cube =
109 volume (tetrahedron7 cube) ~= (1/24)*(delta^(3::Int))
113 -- | All tetrahedron should have their v0 located at the center of the cube.
114 prop_v0_all_equal :: Cube -> Bool
115 prop_v0_all_equal cube = (v0 t0) == (v0 t1)
117 t0 = head (tetrahedrons cube) -- Doesn't matter which two we choose.
118 t1 = head $ tail (tetrahedrons cube)
121 -- | This pretty much repeats the prop_all_volumes_positive property,
122 -- but will let me know which tetrahedrons's vertices are disoriented.
123 prop_tetrahedron0_volumes_positive :: Cube -> Bool
124 prop_tetrahedron0_volumes_positive cube =
125 volume (tetrahedron0 cube) > 0
127 -- | This pretty much repeats the prop_all_volumes_positive property,
128 -- but will let me know which tetrahedrons's vertices are disoriented.
129 prop_tetrahedron1_volumes_positive :: Cube -> Bool
130 prop_tetrahedron1_volumes_positive cube =
131 volume (tetrahedron1 cube) > 0
133 -- | This pretty much repeats the prop_all_volumes_positive property,
134 -- but will let me know which tetrahedrons's vertices are disoriented.
135 prop_tetrahedron2_volumes_positive :: Cube -> Bool
136 prop_tetrahedron2_volumes_positive cube =
137 volume (tetrahedron2 cube) > 0
139 -- | This pretty much repeats the prop_all_volumes_positive property,
140 -- but will let me know which tetrahedrons's vertices are disoriented.
141 prop_tetrahedron3_volumes_positive :: Cube -> Bool
142 prop_tetrahedron3_volumes_positive cube =
143 volume (tetrahedron3 cube) > 0
145 -- | This pretty much repeats the prop_all_volumes_positive property,
146 -- but will let me know which tetrahedrons's vertices are disoriented.
147 prop_tetrahedron4_volumes_positive :: Cube -> Bool
148 prop_tetrahedron4_volumes_positive cube =
149 volume (tetrahedron4 cube) > 0
151 -- | This pretty much repeats the prop_all_volumes_positive property,
152 -- but will let me know which tetrahedrons's vertices are disoriented.
153 prop_tetrahedron5_volumes_positive :: Cube -> Bool
154 prop_tetrahedron5_volumes_positive cube =
155 volume (tetrahedron5 cube) > 0
157 -- | This pretty much repeats the prop_all_volumes_positive property,
158 -- but will let me know which tetrahedrons's vertices are disoriented.
159 prop_tetrahedron6_volumes_positive :: Cube -> Bool
160 prop_tetrahedron6_volumes_positive cube =
161 volume (tetrahedron6 cube) > 0
163 -- | This pretty much repeats the prop_all_volumes_positive property,
164 -- but will let me know which tetrahedrons's vertices are disoriented.
165 prop_tetrahedron7_volumes_positive :: Cube -> Bool
166 prop_tetrahedron7_volumes_positive cube =
167 volume (tetrahedron7 cube) > 0
169 -- | This pretty much repeats the prop_all_volumes_positive property,
170 -- but will let me know which tetrahedrons's vertices are disoriented.
171 prop_tetrahedron8_volumes_positive :: Cube -> Bool
172 prop_tetrahedron8_volumes_positive cube =
173 volume (tetrahedron8 cube) > 0
175 -- | This pretty much repeats the prop_all_volumes_positive property,
176 -- but will let me know which tetrahedrons's vertices are disoriented.
177 prop_tetrahedron9_volumes_positive :: Cube -> Bool
178 prop_tetrahedron9_volumes_positive cube =
179 volume (tetrahedron9 cube) > 0
181 -- | This pretty much repeats the prop_all_volumes_positive property,
182 -- but will let me know which tetrahedrons's vertices are disoriented.
183 prop_tetrahedron10_volumes_positive :: Cube -> Bool
184 prop_tetrahedron10_volumes_positive cube =
185 volume (tetrahedron10 cube) > 0
187 -- | This pretty much repeats the prop_all_volumes_positive property,
188 -- but will let me know which tetrahedrons's vertices are disoriented.
189 prop_tetrahedron11_volumes_positive :: Cube -> Bool
190 prop_tetrahedron11_volumes_positive cube =
191 volume (tetrahedron11 cube) > 0
193 -- | This pretty much repeats the prop_all_volumes_positive property,
194 -- but will let me know which tetrahedrons's vertices are disoriented.
195 prop_tetrahedron12_volumes_positive :: Cube -> Bool
196 prop_tetrahedron12_volumes_positive cube =
197 volume (tetrahedron12 cube) > 0
199 -- | This pretty much repeats the prop_all_volumes_positive property,
200 -- but will let me know which tetrahedrons's vertices are disoriented.
201 prop_tetrahedron13_volumes_positive :: Cube -> Bool
202 prop_tetrahedron13_volumes_positive cube =
203 volume (tetrahedron13 cube) > 0
205 -- | This pretty much repeats the prop_all_volumes_positive property,
206 -- but will let me know which tetrahedrons's vertices are disoriented.
207 prop_tetrahedron14_volumes_positive :: Cube -> Bool
208 prop_tetrahedron14_volumes_positive cube =
209 volume (tetrahedron14 cube) > 0
211 -- | This pretty much repeats the prop_all_volumes_positive property,
212 -- but will let me know which tetrahedrons's vertices are disoriented.
213 prop_tetrahedron15_volumes_positive :: Cube -> Bool
214 prop_tetrahedron15_volumes_positive cube =
215 volume (tetrahedron15 cube) > 0
217 -- | This pretty much repeats the prop_all_volumes_positive property,
218 -- but will let me know which tetrahedrons's vertices are disoriented.
219 prop_tetrahedron16_volumes_positive :: Cube -> Bool
220 prop_tetrahedron16_volumes_positive cube =
221 volume (tetrahedron16 cube) > 0
223 -- | This pretty much repeats the prop_all_volumes_positive property,
224 -- but will let me know which tetrahedrons's vertices are disoriented.
225 prop_tetrahedron17_volumes_positive :: Cube -> Bool
226 prop_tetrahedron17_volumes_positive cube =
227 volume (tetrahedron17 cube) > 0
229 -- | This pretty much repeats the prop_all_volumes_positive property,
230 -- but will let me know which tetrahedrons's vertices are disoriented.
231 prop_tetrahedron18_volumes_positive :: Cube -> Bool
232 prop_tetrahedron18_volumes_positive cube =
233 volume (tetrahedron18 cube) > 0
235 -- | This pretty much repeats the prop_all_volumes_positive property,
236 -- but will let me know which tetrahedrons's vertices are disoriented.
237 prop_tetrahedron19_volumes_positive :: Cube -> Bool
238 prop_tetrahedron19_volumes_positive cube =
239 volume (tetrahedron19 cube) > 0
241 -- | This pretty much repeats the prop_all_volumes_positive property,
242 -- but will let me know which tetrahedrons's vertices are disoriented.
243 prop_tetrahedron20_volumes_positive :: Cube -> Bool
244 prop_tetrahedron20_volumes_positive cube =
245 volume (tetrahedron20 cube) > 0
247 -- | This pretty much repeats the prop_all_volumes_positive property,
248 -- but will let me know which tetrahedrons's vertices are disoriented.
249 prop_tetrahedron21_volumes_positive :: Cube -> Bool
250 prop_tetrahedron21_volumes_positive cube =
251 volume (tetrahedron21 cube) > 0
253 -- | This pretty much repeats the prop_all_volumes_positive property,
254 -- but will let me know which tetrahedrons's vertices are disoriented.
255 prop_tetrahedron22_volumes_positive :: Cube -> Bool
256 prop_tetrahedron22_volumes_positive cube =
257 volume (tetrahedron22 cube) > 0
259 -- | This pretty much repeats the prop_all_volumes_positive property,
260 -- but will let me know which tetrahedrons's vertices are disoriented.
261 prop_tetrahedron23_volumes_positive :: Cube -> Bool
262 prop_tetrahedron23_volumes_positive cube =
263 volume (tetrahedron23 cube) > 0
266 -- | Given in Sorokina and Zeilfelder, p. 79. Note that the third and
267 -- fourth indices of c-t3 have been switched. This is because we
268 -- store the triangles oriented such that their volume is
269 -- positive. If T and T-tilde share \<v0,v1,v2\> and v3,v3-tilde point
270 -- in opposite directions, one of them has to have negative volume!
271 prop_c0120_identity1 :: Cube -> Bool
272 prop_c0120_identity1 cube =
273 c t0 0 1 2 0 ~= (c t0 0 0 2 1 + c t3 0 0 1 2) / 2
275 t0 = tetrahedron0 cube
276 t3 = tetrahedron3 cube
279 -- | Given in Sorokina and Zeilfelder, p. 79. Repeats
280 -- prop_c0120_identity2 with tetrahedrons 3 and 2.
281 prop_c0120_identity2 :: Cube -> Bool
282 prop_c0120_identity2 cube =
283 c t3 0 1 2 0 ~= (c t3 0 0 2 1 + c t2 0 0 1 2) / 2
285 t3 = tetrahedron3 cube
286 t2 = tetrahedron2 cube
288 -- | Given in Sorokina and Zeilfelder, p. 79. Repeats
289 -- prop_c0120_identity1 with tetrahedrons 2 and 1.
290 prop_c0120_identity3 :: Cube -> Bool
291 prop_c0120_identity3 cube =
292 c t2 0 1 2 0 ~= (c t2 0 0 2 1 + c t1 0 0 1 2) / 2
294 t2 = tetrahedron2 cube
295 t1 = tetrahedron1 cube
298 -- | Given in Sorokina and Zeilfelder, p. 79. Repeats
299 -- prop_c0120_identity1 with tetrahedrons 4 and 7.
300 prop_c0120_identity4 :: Cube -> Bool
301 prop_c0120_identity4 cube =
302 c t4 0 1 2 0 ~= (c t4 0 0 2 1 + c t7 0 0 1 2) / 2
304 t4 = tetrahedron4 cube
305 t7 = tetrahedron7 cube
308 -- | Given in Sorokina and Zeilfelder, p. 79. Repeats
309 -- prop_c0120_identity1 with tetrahedrons 7 and 6.
310 prop_c0120_identity5 :: Cube -> Bool
311 prop_c0120_identity5 cube =
312 c t7 0 1 2 0 ~= (c t7 0 0 2 1 + c t6 0 0 1 2) / 2
314 t7 = tetrahedron7 cube
315 t6 = tetrahedron6 cube
318 -- | Given in Sorokina and Zeilfelder, p. 79. Repeats
319 -- prop_c0120_identity1 with tetrahedrons 6 and 5.
320 prop_c0120_identity6 :: Cube -> Bool
321 prop_c0120_identity6 cube =
322 c t6 0 1 2 0 ~= (c t6 0 0 2 1 + c t5 0 0 1 2) / 2
324 t6 = tetrahedron6 cube
325 t5 = tetrahedron5 cube
328 -- | Given in Sorokina and Zeilfelder, p. 79. Note that the third and
329 -- fourth indices of c-t3 have been switched. This is because we
330 -- store the triangles oriented such that their volume is
331 -- positive. If T and T-tilde share \<v0,v1,v2\> and v3,v3-tilde point
332 -- in opposite directions, one of them has to have negative volume!
333 prop_c0210_identity1 :: Cube -> Bool
334 prop_c0210_identity1 cube =
335 c t0 0 2 1 0 ~= (c t0 0 1 1 1 + c t3 0 1 1 1) / 2
337 t0 = tetrahedron0 cube
338 t3 = tetrahedron3 cube
341 -- | Given in Sorokina and Zeilfelder, p. 79. Note that the third and
342 -- fourth indices of c-t3 have been switched. This is because we
343 -- store the triangles oriented such that their volume is
344 -- positive. If T and T-tilde share \<v0,v1,v2\> and v3,v3-tilde point
345 -- in opposite directions, one of them has to have negative volume!
346 prop_c0300_identity1 :: Cube -> Bool
347 prop_c0300_identity1 cube =
348 c t0 0 3 0 0 ~= (c t0 0 2 0 1 + c t3 0 2 1 0) / 2
350 t0 = tetrahedron0 cube
351 t3 = tetrahedron3 cube
354 -- | Given in Sorokina and Zeilfelder, p. 79. Note that the third and
355 -- fourth indices of c-t3 have been switched. This is because we
356 -- store the triangles oriented such that their volume is
357 -- positive. If T and T-tilde share \<v0,v1,v2\> and v3,v3-tilde point
358 -- in opposite directions, one of them has to have negative volume!
359 prop_c1110_identity :: Cube -> Bool
360 prop_c1110_identity cube =
361 c t0 1 1 1 0 ~= (c t0 1 0 1 1 + c t3 1 0 1 1) / 2
363 t0 = tetrahedron0 cube
364 t3 = tetrahedron3 cube
367 -- | Given in Sorokina and Zeilfelder, p. 79. Note that the third and
368 -- fourth indices of c-t3 have been switched. This is because we
369 -- store the triangles oriented such that their volume is
370 -- positive. If T and T-tilde share \<v0,v1,v2\> and v3,v3-tilde point
371 -- in opposite directions, one of them has to have negative volume!
372 prop_c1200_identity1 :: Cube -> Bool
373 prop_c1200_identity1 cube =
374 c t0 1 2 0 0 ~= (c t0 1 1 0 1 + c t3 1 1 1 0) / 2
376 t0 = tetrahedron0 cube
377 t3 = tetrahedron3 cube
380 -- | Given in Sorokina and Zeilfelder, p. 79. Note that the third and
381 -- fourth indices of c-t3 have been switched. This is because we
382 -- store the triangles oriented such that their volume is
383 -- positive. If T and T-tilde share \<v0,v1,v2\> and v3,v3-tilde point
384 -- in opposite directions, one of them has to have negative volume!
385 prop_c2100_identity1 :: Cube -> Bool
386 prop_c2100_identity1 cube =
387 c t0 2 1 0 0 ~= (c t0 2 0 0 1 + c t3 2 0 1 0) / 2
389 t0 = tetrahedron0 cube
390 t3 = tetrahedron3 cube
394 -- | Given in Sorokina and Zeilfelder, p. 79. Note that the third and
395 -- fourth indices of c-t1 have been switched. This is because we
396 -- store the triangles oriented such that their volume is
397 -- positive. If T and T-tilde share \<v0,v1,v3\> and v2,v2-tilde point
398 -- in opposite directions, one of them has to have negative volume!
399 prop_c0102_identity1 :: Cube -> Bool
400 prop_c0102_identity1 cube =
401 c t0 0 1 0 2 ~= (c t0 0 0 1 2 + c t1 0 0 2 1) / 2
403 t0 = tetrahedron0 cube
404 t1 = tetrahedron1 cube
407 -- | Given in Sorokina and Zeilfelder, p. 79. Note that the third and
408 -- fourth indices of c-t1 have been switched. This is because we
409 -- store the triangles oriented such that their volume is
410 -- positive. If T and T-tilde share \<v0,v1,v3\> and v2,v2-tilde point
411 -- in opposite directions, one of them has to have negative volume!
412 prop_c0201_identity1 :: Cube -> Bool
413 prop_c0201_identity1 cube =
414 c t0 0 2 0 1 ~= (c t0 0 1 1 1 + c t1 0 1 1 1) / 2
416 t0 = tetrahedron0 cube
417 t1 = tetrahedron1 cube
420 -- | Given in Sorokina and Zeilfelder, p. 79. Note that the third and
421 -- fourth indices of c-t1 have been switched. This is because we
422 -- store the triangles oriented such that their volume is
423 -- positive. If T and T-tilde share \<v0,v1,v3\> and v2,v2-tilde point
424 -- in opposite directions, one of them has to have negative volume!
425 prop_c0300_identity2 :: Cube -> Bool
426 prop_c0300_identity2 cube =
427 c t0 0 3 0 0 ~= (c t0 0 2 1 0 + c t1 0 2 0 1) / 2
429 t0 = tetrahedron0 cube
430 t1 = tetrahedron1 cube
433 -- | Given in Sorokina and Zeilfelder, p. 79. Note that the third and
434 -- fourth indices of c-t1 have been switched. This is because we
435 -- store the triangles oriented such that their volume is
436 -- positive. If T and T-tilde share \<v0,v1,v3\> and v2,v2-tilde point
437 -- in opposite directions, one of them has to have negative volume!
438 prop_c1101_identity :: Cube -> Bool
439 prop_c1101_identity cube =
440 c t0 1 1 0 1 ~= (c t0 1 0 1 1 + c t1 1 0 1 1) / 2
442 t0 = tetrahedron0 cube
443 t1 = tetrahedron1 cube
446 -- | Given in Sorokina and Zeilfelder, p. 79. Note that the third and
447 -- fourth indices of c-t1 have been switched. This is because we
448 -- store the triangles oriented such that their volume is
449 -- positive. If T and T-tilde share \<v0,v1,v3\> and v2,v2-tilde point
450 -- in opposite directions, one of them has to have negative volume!
451 prop_c1200_identity2 :: Cube -> Bool
452 prop_c1200_identity2 cube =
453 c t0 1 2 0 0 ~= (c t0 1 1 1 0 + c t1 1 1 0 1) / 2
455 t0 = tetrahedron0 cube
456 t1 = tetrahedron1 cube
459 -- | Given in Sorokina and Zeilfelder, p. 79. Note that the third and
460 -- fourth indices of c-t1 have been switched. This is because we
461 -- store the triangles oriented such that their volume is
462 -- positive. If T and T-tilde share \<v0,v1,v3\> and v2,v2-tilde point
463 -- in opposite directions, one of them has to have negative volume!
464 prop_c2100_identity2 :: Cube -> Bool
465 prop_c2100_identity2 cube =
466 c t0 2 1 0 0 ~= (c t0 2 0 1 0 + c t1 2 0 0 1) / 2
468 t0 = tetrahedron0 cube
469 t1 = tetrahedron1 cube
472 -- | Given in Sorokina and Zeilfelder, p. 79.
473 prop_c3000_identity :: Cube -> Bool
474 prop_c3000_identity cube =
475 c t0 3 0 0 0 ~= c t0 2 1 0 0 + c t6 2 1 0 0 - ((c t0 2 0 1 0 + c t0 2 0 0 1)/ 2)
477 t0 = tetrahedron0 cube
478 t6 = (tetrahedron6 cube) { v2 = (v3 t6), v3 = (v2 t6) }
481 -- | Given in Sorokina and Zeilfelder, p. 79.
482 prop_c2010_identity :: Cube -> Bool
483 prop_c2010_identity cube =
484 c t0 2 0 1 0 ~= c t0 1 1 1 0 + c t6 1 1 1 0 - ((c t0 1 0 2 0 + c t0 1 0 1 1)/ 2)
486 t0 = tetrahedron0 cube
487 t6 = tetrahedron6 cube
490 -- | Given in Sorokina and Zeilfelder, p. 79.
491 prop_c2001_identity :: Cube -> Bool
492 prop_c2001_identity cube =
493 c t0 2 0 0 1 ~= c t0 1 1 0 1 + c t6 1 1 0 1 - ((c t0 1 0 0 2 + c t0 1 0 1 1)/ 2)
495 t0 = tetrahedron0 cube
496 t6 = tetrahedron6 cube
498 -- | Given in Sorokina and Zeilfelder, p. 79.
499 prop_c1020_identity :: Cube -> Bool
500 prop_c1020_identity cube =
501 c t0 1 0 2 0 ~= c t0 0 1 2 0 + c t6 0 1 2 0 - ((c t0 0 0 3 0 + c t0 0 0 2 1)/ 2)
503 t0 = tetrahedron0 cube
504 t6 = tetrahedron6 cube
507 -- | Given in Sorokina and Zeilfelder, p. 79.
508 prop_c1002_identity :: Cube -> Bool
509 prop_c1002_identity cube =
510 c t0 1 0 0 2 ~= c t0 0 1 0 2 + c t6 0 1 0 2 - ((c t0 0 0 0 3 + c t0 0 0 1 2)/ 2)
512 t0 = tetrahedron0 cube
513 t6 = tetrahedron6 cube
516 -- | Given in Sorokina and Zeilfelder, p. 79.
517 prop_c1011_identity :: Cube -> Bool
518 prop_c1011_identity cube =
519 c t0 1 0 1 1 ~= c t0 0 1 1 1 + c t6 0 1 1 1 - ((c t0 0 0 1 2 + c t0 0 0 2 1)/ 2)
521 t0 = tetrahedron0 cube
522 t6 = tetrahedron6 cube
526 -- | Given in Sorokina and Zeilfelder, p. 78.
527 -- prop_cijk1_identity :: Cube -> Bool
528 -- prop_cijk1_identity cube =
529 -- and [ c t0 i j k 1 ~=
530 -- (c t1 (i+1) j k 0) * ((b0 t0) (v3 t1)) +
531 -- (c t1 i (j+1) k 0) * ((b1 t0) (v3 t1)) +
532 -- (c t1 i j (k+1) 0) * ((b2 t0) (v3 t1)) +
533 -- (c t1 i j k 1) * ((b3 t0) (v3 t1)) | i <- [0..2],
538 -- t0 = tetrahedron0 cube
539 -- t1 = tetrahedron1 cube
543 -- | We know what (c t6 2 1 0 0) should be from Sorokina and Zeilfelder, p. 87.
544 -- This test checks the rotation works as expected.
545 prop_c_tilde_2100_rotation_correct :: Cube -> Bool
546 prop_c_tilde_2100_rotation_correct cube =
549 t0 = tetrahedron0 cube
550 t6 = tetrahedron6 cube
552 -- What gets computed for c2100 of t6.
553 expr1 = eval (Tetrahedron.fv t6) $
555 (1/12)*(T + R + L + D) +
556 (1/64)*(FT + FR + FL + FD) +
559 (1/96)*(RT + LD + LT + RD) +
560 (1/192)*(BT + BR + BL + BD)
562 -- What should be computed for c2100 of t6.
563 expr2 = eval (Tetrahedron.fv t0) $
565 (1/12)*(F + R + L + B) +
566 (1/64)*(FT + RT + LT + BT) +
569 (1/96)*(FR + FL + BR + BL) +
570 (1/192)*(FD + RD + LD + BD)
573 -- | We know what (c t6 2 1 0 0) should be from Sorokina and Zeilfelder, p. 87.
574 -- This test checks the actual value based on the FunctionValues of the cube.
575 prop_c_tilde_2100_correct :: Cube -> Bool
576 prop_c_tilde_2100_correct cube =
577 c t6 2 1 0 0 == (3/8)*int + (1/12)*(f + r + l + b) + (1/64)*(ft + rt + lt + bt)
578 + (7/48)*t + (1/48)*d + (1/96)*(fr + fl + br + bl)
579 + (1/192)*(fd + rd + ld + bd)
581 t0 = tetrahedron0 cube
582 t6 = tetrahedron6 cube
583 fvs = Tetrahedron.fv t0
604 -- Tests to check that the correct edges are incidental.
605 prop_t0_shares_edge_with_t1 :: Cube -> Bool
606 prop_t0_shares_edge_with_t1 cube =
607 (v1 t0) == (v1 t1) && (v3 t0) == (v2 t1)
609 t0 = tetrahedron0 cube
610 t1 = tetrahedron1 cube
612 prop_t0_shares_edge_with_t3 :: Cube -> Bool
613 prop_t0_shares_edge_with_t3 cube =
614 (v1 t0) == (v1 t3) && (v2 t0) == (v3 t3)
616 t0 = tetrahedron0 cube
617 t3 = tetrahedron3 cube
619 prop_t0_shares_edge_with_t6 :: Cube -> Bool
620 prop_t0_shares_edge_with_t6 cube =
621 (v2 t0) == (v3 t6) && (v3 t0) == (v2 t6)
623 t0 = tetrahedron0 cube
624 t6 = tetrahedron6 cube
626 prop_t1_shares_edge_with_t2 :: Cube -> Bool
627 prop_t1_shares_edge_with_t2 cube =
628 (v1 t1) == (v1 t2) && (v3 t1) == (v2 t2)
630 t1 = tetrahedron1 cube
631 t2 = tetrahedron2 cube
633 prop_t1_shares_edge_with_t19 :: Cube -> Bool
634 prop_t1_shares_edge_with_t19 cube =
635 (v2 t1) == (v3 t19) && (v3 t1) == (v2 t19)
637 t1 = tetrahedron1 cube
638 t19 = tetrahedron19 cube
640 prop_t2_shares_edge_with_t3 :: Cube -> Bool
641 prop_t2_shares_edge_with_t3 cube =
642 (v1 t1) == (v1 t2) && (v3 t1) == (v2 t2)
644 t1 = tetrahedron1 cube
645 t2 = tetrahedron2 cube
647 prop_t2_shares_edge_with_t12 :: Cube -> Bool
648 prop_t2_shares_edge_with_t12 cube =
649 (v2 t2) == (v3 t12) && (v3 t2) == (v2 t12)
651 t2 = tetrahedron2 cube
652 t12 = tetrahedron12 cube
654 prop_t3_shares_edge_with_t21 :: Cube -> Bool
655 prop_t3_shares_edge_with_t21 cube =
656 (v2 t3) == (v3 t21) && (v3 t3) == (v2 t21)
658 t3 = tetrahedron3 cube
659 t21 = tetrahedron21 cube
661 prop_t4_shares_edge_with_t5 :: Cube -> Bool
662 prop_t4_shares_edge_with_t5 cube =
663 (v1 t4) == (v1 t5) && (v3 t4) == (v2 t5)
665 t4 = tetrahedron4 cube
666 t5 = tetrahedron5 cube
668 prop_t4_shares_edge_with_t7 :: Cube -> Bool
669 prop_t4_shares_edge_with_t7 cube =
670 (v1 t4) == (v1 t7) && (v2 t4) == (v3 t7)
672 t4 = tetrahedron4 cube
673 t7 = tetrahedron7 cube
675 prop_t4_shares_edge_with_t10 :: Cube -> Bool
676 prop_t4_shares_edge_with_t10 cube =
677 (v2 t4) == (v3 t10) && (v3 t4) == (v2 t10)
679 t4 = tetrahedron4 cube
680 t10 = tetrahedron10 cube
682 prop_t5_shares_edge_with_t6 :: Cube -> Bool
683 prop_t5_shares_edge_with_t6 cube =
684 (v1 t5) == (v1 t6) && (v3 t5) == (v2 t6)
686 t5 = tetrahedron5 cube
687 t6 = tetrahedron6 cube
689 prop_t5_shares_edge_with_t16 :: Cube -> Bool
690 prop_t5_shares_edge_with_t16 cube =
691 (v2 t5) == (v3 t16) && (v3 t5) == (v2 t16)
693 t5 = tetrahedron5 cube
694 t16 = tetrahedron16 cube
696 prop_t6_shares_edge_with_t7 :: Cube -> Bool
697 prop_t6_shares_edge_with_t7 cube =
698 (v1 t6) == (v1 t7) && (v3 t6) == (v2 t7)
700 t6 = tetrahedron6 cube
701 t7 = tetrahedron7 cube
703 prop_t7_shares_edge_with_t20 :: Cube -> Bool
704 prop_t7_shares_edge_with_t20 cube =
705 (v2 t7) == (v3 t20) && (v2 t7) == (v3 t20)
707 t7 = tetrahedron7 cube
708 t20 = tetrahedron20 cube