regina 7.3.1.1__cp311-cp311-macosx_10_9_x86_64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of regina might be problematic. Click here for more details.

Files changed (162) hide show
  1. regina/.dylibs/libgmp.10.dylib +0 -0
  2. regina/.dylibs/libgmpxx.4.dylib +0 -0
  3. regina/__init__.py +203 -0
  4. regina/engine.cpython-311-darwin.so +0 -0
  5. regina/plainCompleter.py +221 -0
  6. regina/pyCensus/__init__.py +14 -0
  7. regina/pyCensus/christy-knots-links.tdb +0 -0
  8. regina/pyCensus/closed-hyp-census-full.tdb +0 -0
  9. regina/pyCensus/closed-nor-census-11.tdb +0 -0
  10. regina/pyCensus/closed-or-census-11.tdb +0 -0
  11. regina/pyCensus/cusped-hyp-nor-census-9.tdb +0 -0
  12. regina/pyCensus/cusped-hyp-or-census-9.tdb +0 -0
  13. regina/sageRegina/__init__.py +2 -0
  14. regina/sageRegina/config.py +9 -0
  15. regina/sageRegina/test.py +132 -0
  16. regina/sageRegina/testsuite/CMakeLists.txt +60 -0
  17. regina/sageRegina/testsuite/O2_1.rga +15 -0
  18. regina/sageRegina/testsuite/O2_1.tri +28 -0
  19. regina/sageRegina/testsuite/README.txt +20 -0
  20. regina/sageRegina/testsuite/alltypes.out +1551 -0
  21. regina/sageRegina/testsuite/alltypes.test +88 -0
  22. regina/sageRegina/testsuite/angles.out +102 -0
  23. regina/sageRegina/testsuite/angles.test +72 -0
  24. regina/sageRegina/testsuite/basic_callback.out +124 -0
  25. regina/sageRegina/testsuite/basic_sub.out +7 -0
  26. regina/sageRegina/testsuite/bool.out +6 -0
  27. regina/sageRegina/testsuite/bool.test +64 -0
  28. regina/sageRegina/testsuite/bytes.out +17 -0
  29. regina/sageRegina/testsuite/bytes.test +78 -0
  30. regina/sageRegina/testsuite/callbacks.out +515 -0
  31. regina/sageRegina/testsuite/callbacks.test +281 -0
  32. regina/sageRegina/testsuite/census.out +120 -0
  33. regina/sageRegina/testsuite/census.test +157 -0
  34. regina/sageRegina/testsuite/clone.out +18 -0
  35. regina/sageRegina/testsuite/clone.test +101 -0
  36. regina/sageRegina/testsuite/constructors.out +14 -0
  37. regina/sageRegina/testsuite/constructors.test +97 -0
  38. regina/sageRegina/testsuite/cube.orb +87 -0
  39. regina/sageRegina/testsuite/discs.out +3 -0
  40. regina/sageRegina/testsuite/discs.test +40 -0
  41. regina/sageRegina/testsuite/docstrings.filter +19 -0
  42. regina/sageRegina/testsuite/docstrings.out +808 -0
  43. regina/sageRegina/testsuite/docstrings.out.v3 +808 -0
  44. regina/sageRegina/testsuite/docstrings.test +57 -0
  45. regina/sageRegina/testsuite/dodec.orb +309 -0
  46. regina/sageRegina/testsuite/embeddings.out +23 -0
  47. regina/sageRegina/testsuite/embeddings.test +89 -0
  48. regina/sageRegina/testsuite/enumerate.out +62 -0
  49. regina/sageRegina/testsuite/enumerate.test +82 -0
  50. regina/sageRegina/testsuite/equality.out +112 -0
  51. regina/sageRegina/testsuite/equality.test +310 -0
  52. regina/sageRegina/testsuite/euler.out +15 -0
  53. regina/sageRegina/testsuite/euler.test +95 -0
  54. regina/sageRegina/testsuite/exception.out +7 -0
  55. regina/sageRegina/testsuite/exception.test +100 -0
  56. regina/sageRegina/testsuite/facenumbering.out +546 -0
  57. regina/sageRegina/testsuite/facenumbering.test +74 -0
  58. regina/sageRegina/testsuite/faces.out +40 -0
  59. regina/sageRegina/testsuite/faces.test +72 -0
  60. regina/sageRegina/testsuite/file.out +1229 -0
  61. regina/sageRegina/testsuite/file.test +70 -0
  62. regina/sageRegina/testsuite/file1.rga +0 -0
  63. regina/sageRegina/testsuite/file2.rga +0 -0
  64. regina/sageRegina/testsuite/file3.rga +119 -0
  65. regina/sageRegina/testsuite/flype.out +37 -0
  66. regina/sageRegina/testsuite/flype.test +50 -0
  67. regina/sageRegina/testsuite/generic.out +116 -0
  68. regina/sageRegina/testsuite/generic.test +76 -0
  69. regina/sageRegina/testsuite/groups.out +70 -0
  70. regina/sageRegina/testsuite/groups.test +117 -0
  71. regina/sageRegina/testsuite/hypersurfaces.out +681 -0
  72. regina/sageRegina/testsuite/hypersurfaces.test +90 -0
  73. regina/sageRegina/testsuite/i18n-latin1.rga +8 -0
  74. regina/sageRegina/testsuite/i18n-utf8.rga +8 -0
  75. regina/sageRegina/testsuite/i18n.out +6 -0
  76. regina/sageRegina/testsuite/i18n.test +91 -0
  77. regina/sageRegina/testsuite/id.out +2 -0
  78. regina/sageRegina/testsuite/id.test +47 -0
  79. regina/sageRegina/testsuite/index.out +2 -0
  80. regina/sageRegina/testsuite/index.test +43 -0
  81. regina/sageRegina/testsuite/integer.out +74 -0
  82. regina/sageRegina/testsuite/integer.test +56 -0
  83. regina/sageRegina/testsuite/italian.orb +90 -0
  84. regina/sageRegina/testsuite/iterators.out +118 -0
  85. regina/sageRegina/testsuite/iterators.test +128 -0
  86. regina/sageRegina/testsuite/knotted-Y.orb +47 -0
  87. regina/sageRegina/testsuite/listener.out +43 -0
  88. regina/sageRegina/testsuite/listener.test +101 -0
  89. regina/sageRegina/testsuite/listview.out +416 -0
  90. regina/sageRegina/testsuite/listview.test +253 -0
  91. regina/sageRegina/testsuite/lookup.out +13 -0
  92. regina/sageRegina/testsuite/lookup.test +44 -0
  93. regina/sageRegina/testsuite/memory1.out +62 -0
  94. regina/sageRegina/testsuite/memory1.test +154 -0
  95. regina/sageRegina/testsuite/memory2.out +62 -0
  96. regina/sageRegina/testsuite/memory2.test +124 -0
  97. regina/sageRegina/testsuite/memory3.out +92 -0
  98. regina/sageRegina/testsuite/memory3.test +216 -0
  99. regina/sageRegina/testsuite/misc.out +7 -0
  100. regina/sageRegina/testsuite/misc.test +56 -0
  101. regina/sageRegina/testsuite/operators.out +129 -0
  102. regina/sageRegina/testsuite/operators.test +61 -0
  103. regina/sageRegina/testsuite/orb.out +441 -0
  104. regina/sageRegina/testsuite/orb.test +49 -0
  105. regina/sageRegina/testsuite/pdf.out +4 -0
  106. regina/sageRegina/testsuite/pdf.test +49 -0
  107. regina/sageRegina/testsuite/perm.out +55 -0
  108. regina/sageRegina/testsuite/perm.test +96 -0
  109. regina/sageRegina/testsuite/plantri.out +12 -0
  110. regina/sageRegina/testsuite/plantri.test +60 -0
  111. regina/sageRegina/testsuite/presentations.out +11 -0
  112. regina/sageRegina/testsuite/presentations.test +61 -0
  113. regina/sageRegina/testsuite/refs.out +51 -0
  114. regina/sageRegina/testsuite/refs.test +128 -0
  115. regina/sageRegina/testsuite/repr.out +951 -0
  116. regina/sageRegina/testsuite/repr.out.v3 +951 -0
  117. regina/sageRegina/testsuite/repr.test +548 -0
  118. regina/sageRegina/testsuite/safeheldtype_basic.out +17 -0
  119. regina/sageRegina/testsuite/safeheldtype_basic.test +113 -0
  120. regina/sageRegina/testsuite/safeheldtype_packet.out +58 -0
  121. regina/sageRegina/testsuite/safeheldtype_packet.test +181 -0
  122. regina/sageRegina/testsuite/sample.pdf +0 -0
  123. regina/sageRegina/testsuite/sets.out +7 -0
  124. regina/sageRegina/testsuite/sets.test +44 -0
  125. regina/sageRegina/testsuite/skeleton.out +308 -0
  126. regina/sageRegina/testsuite/skeleton.test +54 -0
  127. regina/sageRegina/testsuite/snappea.out +82 -0
  128. regina/sageRegina/testsuite/snappea.test +107 -0
  129. regina/sageRegina/testsuite/snapshot.out +15 -0
  130. regina/sageRegina/testsuite/snapshot.test +78 -0
  131. regina/sageRegina/testsuite/sort.out +57 -0
  132. regina/sageRegina/testsuite/sort.test +53 -0
  133. regina/sageRegina/testsuite/special.out +4 -0
  134. regina/sageRegina/testsuite/special.test +47 -0
  135. regina/sageRegina/testsuite/standardtri.out +12101 -0
  136. regina/sageRegina/testsuite/standardtri.test +455 -0
  137. regina/sageRegina/testsuite/surfaces.out +2133 -0
  138. regina/sageRegina/testsuite/surfaces.test +114 -0
  139. regina/sageRegina/testsuite/swapping.out +25 -0
  140. regina/sageRegina/testsuite/swapping.test +88 -0
  141. regina/sageRegina/testsuite/testall.in +176 -0
  142. regina/sageRegina/testsuite/testbasic.in +279 -0
  143. regina/sageRegina/testsuite/testcallback.in +150 -0
  144. regina/sageRegina/testsuite/testsub.in +150 -0
  145. regina/sageRegina/testsuite/theta_in_solid_torus.orb +65 -0
  146. regina/sageRegina/testsuite/tightencode.out +40 -0
  147. regina/sageRegina/testsuite/tightencode.test +108 -0
  148. regina/sageRegina/testsuite/treedecomp.out +135 -0
  149. regina/sageRegina/testsuite/treedecomp.test +66 -0
  150. regina/sageRegina/testsuite/treetraversal.out +52 -0
  151. regina/sageRegina/testsuite/treetraversal.test +190 -0
  152. regina/sageRegina/testsuite/trigeneral.out +1251 -0
  153. regina/sageRegina/testsuite/trigeneral.test +155 -0
  154. regina/sageRegina/testsuite/utf8.out +42 -0
  155. regina/sageRegina/testsuite/utf8.test +94 -0
  156. regina/sageRegina/version.py +5 -0
  157. regina/sageSetup.py +41 -0
  158. regina/test.py +6 -0
  159. regina-7.3.1.1.dist-info/METADATA +109 -0
  160. regina-7.3.1.1.dist-info/RECORD +162 -0
  161. regina-7.3.1.1.dist-info/WHEEL +6 -0
  162. regina-7.3.1.1.dist-info/top_level.txt +4 -0
@@ -0,0 +1,112 @@
1
+ EqualityType.BY_VALUE
2
+ EqualityType.BY_REFERENCE
3
+ EqualityType.BY_VALUE
4
+ EqualityType.NEVER_INSTANTIATED
5
+ EqualityType.DISABLED
6
+ EqualityType.DISABLED
7
+
8
+ Integer : ==, not !=
9
+ Integer : not ==, !=
10
+ AbelianGroup : ==, not !=
11
+ AbelianGroup : not ==, !=
12
+ GroupPresentation : ==, not !=
13
+ GroupPresentation : not ==, !=
14
+ Link : ==, not !=
15
+ Link : not ==, !=
16
+ Link : ==, not !=
17
+ Link : not ==, !=
18
+ Link + Packet : ==, not !=, throws on samePacket()
19
+ Link + Packet : ==, not !=, throws on samePacket()
20
+ PacketOfLink : ==, not !=, different packets
21
+ PacketOfLink : ==, not !=, same packet
22
+ Tangle : ==, not !=
23
+ Tangle : not ==, !=
24
+ Tangle : not ==, !=
25
+ ModelLinkGraph : ==, not !=
26
+ ModelLinkGraph : not ==, !=
27
+ ModelLinkGraphCells : ==, not !=
28
+ ModelLinkGraphCells : not ==, !=
29
+ Triangulation3 : ==, not !=
30
+ Triangulation3 : not ==, !=
31
+ Triangulation3 + Packet : ==, not !=, throws on samePacket()
32
+ Triangulation3 + Packet : ==, not !=, throws on samePacket()
33
+ PacketOfTriangulation3 : ==, not !=, different packets
34
+ PacketOfTriangulation3 : ==, not !=, same packet
35
+ SnapPeaTriangulation : ==, not !=
36
+ SnapPeaTriangulation : not ==, !=
37
+ SnapPeaTriangulation : not ==, !=
38
+ SnapPeaTriangulation : not ==, !=
39
+ FacetPairing2 : ==, not !=
40
+ FacetPairing2 : not ==, !=
41
+ Attachment : ==, not !=, different packets
42
+ Attachment : not ==, !=, different packets
43
+ Attachment : not ==, !=, different packets
44
+ Attachment : not ==, !=, different packets
45
+ Text : ==, not !=, different packets
46
+ Text : not ==, !=, different packets
47
+ Script : not ==, !=
48
+ Script : ==, not !=
49
+ Script : ==, not !=
50
+ GluingPerms2 : ==, not !=
51
+ GluingPerms2 : not ==, !=
52
+ GluingPerms2 : not ==, !=
53
+ NormalSurfaces : not ==, !=
54
+ NormalSurfaces : ==, not !=
55
+ NormalSurfaces : ==, not !=
56
+ NormalHypersurfaces : not ==, !=
57
+ NormalHypersurfaces : ==, not !=
58
+ NormalHypersurfaces : ==, not !=
59
+ AngleStructures : not ==, !=
60
+ AngleStructures : ==, not !=
61
+ TypeTrie : ==, not !=
62
+ TypeTrie : not ==, !=
63
+ TypeTrie : not ==, !=
64
+ TrieSet : ==, not !=
65
+ TrieSet : not ==, !=
66
+ TrieSet : not ==, !=
67
+ LPMatrix : ==, not !=
68
+ LPMatrix : ==, not !=
69
+ LPMatrix : not ==, !=
70
+ ValidityConstraints : ==, not !=
71
+ ValidityConstraints : not ==, !=
72
+ Signature : ==, not !=
73
+ Signature : not ==, !=
74
+ SFSAlt : ==, not !=
75
+ SFSAlt : not ==, !=
76
+ DiscSetTet : ==, not !=
77
+ DiscSetTet : not ==, !=
78
+ DiscSetSurface : ==, not !=
79
+ DiscSetSurface : not ==, !=
80
+ DiscSetSurface : not ==, !=
81
+ TreeDecomposition : ==, not !=
82
+ TreeDecomposition : not ==, !=
83
+ SatBlockSpec : ==, not !=
84
+ SatBlockSpec : not ==, !=
85
+ SatBlockSpec : ==, not !=
86
+ SatBlockSpec : not ==, !=
87
+ SatBlockSpec : ==, not !=
88
+ SatBlockSpec : not ==, !=
89
+ SatBlock : ==, not !=
90
+ SatBlock : not ==, !=
91
+ SatBlock : ==, not !=
92
+ SatBlock : not ==, !=
93
+ SatBlock : ==, not !=
94
+ SatBlock : not ==, !=
95
+ TxICore : ==, not !=
96
+ TxICore : not ==, !=
97
+ TxICore : not ==, !=
98
+ TxICore : ==, not !=
99
+ BlockedSFSTriple : ==, not !=
100
+ BlockedSFSTriple : not ==, !=
101
+ BlockedSFSTriple.manifold() : ==, not !=
102
+ Tetrahedron3 : ==, not !=
103
+ Tetrahedron3 : not ==, !=
104
+ Container : throws on ==, throws on !=, same packet
105
+ Text : ==, not !=, same packet
106
+ Different Packets : throws on ==, throws on !=, different packets
107
+ Different Packets : throws on ==, throws on !=, different packets
108
+ Different Packets : throws on ==, throws on !=, different packets
109
+ Different Packets : throws on ==, throws on !=, different packets
110
+ Different Packets : throws on ==, throws on !=, throws on samePacket()
111
+ Different Packets : throws on ==, throws on !=, throws on samePacket()
112
+ HomologicalData : throws on ==, throws on !=
@@ -0,0 +1,310 @@
1
+ # Regina - A Normal Surface Theory Calculator
2
+ # Python Test Suite Component
3
+ #
4
+ # Copyright (c) 2015-2023, Ben Burton
5
+ # For further details contact Ben Burton (bab@debian.org).
6
+ #
7
+ # Tests that == and != behave as expected for Regina's python bindings.
8
+ #
9
+ # This file is a single component of Regina's python test suite. To run
10
+ # the python test suite, move to the main python directory in the source
11
+ # tree and run "make check".
12
+ #
13
+ # This program is free software; you can redistribute it and/or
14
+ # modify it under the terms of the GNU General Public License as
15
+ # published by the Free Software Foundation; either version 2 of the
16
+ # License, or (at your option) any later version.
17
+ #
18
+ # As an exception, when this program is distributed through (i) the
19
+ # App Store by Apple Inc.; (ii) the Mac App Store by Apple Inc.; or
20
+ # (iii) Google Play by Google Inc., then that store may impose any
21
+ # digital rights management, device limits and/or redistribution
22
+ # restrictions that are required by its terms of service.
23
+ #
24
+ # This program is distributed in the hope that it will be useful, but
25
+ # WITHOUT ANY WARRANTY; without even the implied warranty of
26
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
27
+ # General Public License for more details.
28
+ #
29
+ # You should have received a copy of the GNU General Public
30
+ # License along with this program; if not, write to the Free
31
+ # Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
32
+ # MA 02110-1301, USA.
33
+
34
+ print(AbelianGroup.equalityType)
35
+ print(GluingPermSearcher2.equalityType)
36
+ print(Integer.equalityType)
37
+ print(SigCensus.equalityType)
38
+ print(HomologicalData.equalityType)
39
+ print(Container.equalityType)
40
+
41
+ print()
42
+
43
+ def cmp(name, a, b, packet = False):
44
+ ans = ''
45
+ try:
46
+ if a == b:
47
+ ans += '=='
48
+ else:
49
+ ans += 'not =='
50
+ except:
51
+ ans += 'throws on =='
52
+ ans += ', '
53
+ try:
54
+ if a != b:
55
+ ans += '!='
56
+ else:
57
+ ans += 'not !='
58
+ except:
59
+ ans += 'throws on !='
60
+ if packet:
61
+ ans += ', '
62
+ try:
63
+ if a.samePacket(b):
64
+ ans += 'same packet'
65
+ else:
66
+ ans += 'different packets'
67
+ except:
68
+ ans += 'throws on samePacket()'
69
+ print(name, ':', ans)
70
+
71
+ # ----------------------------------------------------------------------
72
+ # Classes that compare by value:
73
+ # ----------------------------------------------------------------------
74
+
75
+ cmp('Integer', Integer(3), Integer(3))
76
+ cmp('Integer', Integer(3), Integer(4))
77
+
78
+ cmp('AbelianGroup', AbelianGroup(), AbelianGroup())
79
+ cmp('AbelianGroup', AbelianGroup(), AbelianGroup(1))
80
+
81
+ cmp('GroupPresentation', GroupPresentation(), GroupPresentation())
82
+ cmp('GroupPresentation', GroupPresentation(), GroupPresentation(1))
83
+
84
+ cmp('Link', ExampleLink.trefoil(), ExampleLink.trefoilRight())
85
+ cmp('Link', ExampleLink.trefoilLeft(), ExampleLink.trefoilRight())
86
+ cmp('Link', Link(3), Link(3))
87
+ cmp('Link', Link(3), Link(2))
88
+ cmp('Link + Packet', Link(2), PacketOfLink(2), True)
89
+ cmp('Link + Packet', PacketOfLink(2), Link(2), True)
90
+ cmp('PacketOfLink', PacketOfLink(2), PacketOfLink(2), True)
91
+ p = PacketOfLink(3)
92
+ cmp('PacketOfLink', p, p.root(), True)
93
+
94
+ cmp('Tangle', Tangle(3,2), Tangle(3,2))
95
+ cmp('Tangle', Tangle(3,2), Tangle(3,-2))
96
+ cmp('Tangle', Tangle(1,0), Tangle(0,1))
97
+
98
+ g1 = ModelLinkGraph.fromPlantri('bcdd,aeec,abfd,acfa,bffb,ceed')
99
+ g2 = ModelLinkGraph.fromPlantri('bcdd,aeec,abfd,acfa,bffb,eedc')
100
+ cmp('ModelLinkGraph', g1, ModelLinkGraph(g1))
101
+ cmp('ModelLinkGraph', g1, g2)
102
+ cmp('ModelLinkGraphCells', g1.cells(), ModelLinkGraph(g1).cells())
103
+ cmp('ModelLinkGraphCells', g1.cells(), g2.cells())
104
+
105
+ cmp('Triangulation3', Triangulation3(), Triangulation3())
106
+ cmp('Triangulation3', Example3.figureEight(), Example3.whiteheadLink())
107
+ cmp('Triangulation3 + Packet', Triangulation3(), PacketOfTriangulation3(), True)
108
+ cmp('Triangulation3 + Packet', PacketOfTriangulation3(), Triangulation3(), True)
109
+ cmp('PacketOfTriangulation3', PacketOfTriangulation3(), PacketOfTriangulation3(), True)
110
+ p = PacketOfTriangulation3()
111
+ cmp('PacketOfTriangulation3', p, p.root(), True)
112
+
113
+ w = ExampleSnapPea.whiteheadLink()
114
+ cmp('SnapPeaTriangulation', w, ExampleSnapPea.whiteheadLink())
115
+ dummy = w.fill(3,4,0)
116
+ cmp('SnapPeaTriangulation', w, ExampleSnapPea.whiteheadLink())
117
+ cmp('SnapPeaTriangulation', ExampleSnapPea.whiteheadLink(), w)
118
+ cmp('SnapPeaTriangulation', ExampleSnapPea.figureEight(), w)
119
+
120
+ cmp('FacetPairing2', FacetPairing2(Example2.kb()), FacetPairing2(Example2.kb()))
121
+ cmp('FacetPairing2', FacetPairing2(Example2.mobius()), FacetPairing2(Example2.annulus()))
122
+
123
+ cmp('Attachment', Attachment(b'foo', 'x'), Attachment(b'foo', 'y'), True)
124
+ cmp('Attachment', Attachment(b'foo', 'x'), Attachment(), True)
125
+ cmp('Attachment', Attachment(), Attachment(b'foo', 'x'), True)
126
+ cmp('Attachment', Attachment(b'foof', 'x'), Attachment(b'foo', 'x'), True)
127
+ cmp('Text', Text('foo'), Text('foo'), True)
128
+ cmp('Text', Text('foo'), Text('foof'), True)
129
+
130
+ s = Script()
131
+ s.setText('print("Hello world!")')
132
+ dummy = s.addVariable('foo', None)
133
+ dummy = s.addVariable('bar', s)
134
+ t = Script()
135
+ t.setText('print("Hello world!")')
136
+ dummy = t.addVariable('foo', None)
137
+ dummy = t.addVariable('bar', t)
138
+ cmp('Script', s, t)
139
+ t.removeVariable('bar')
140
+ dummy = t.addVariable('bar', s)
141
+ cmp('Script', s, t)
142
+ cmp('Script', s, Script(s))
143
+
144
+ x = None
145
+
146
+ def foundGluings2(g):
147
+ global x
148
+ if not x:
149
+ x = GluingPerms2(g)
150
+ cmp('GluingPerms2', x, g)
151
+
152
+ def foundPairing2(p, isos):
153
+ GluingPermSearcher2.findAllPerms(p, isos, True, foundGluings2)
154
+
155
+ FacetPairing2.findAllPairings(2, False, 0, foundPairing2)
156
+
157
+ a = NormalSurfaces(Example3.poincare(), NS_STANDARD)
158
+ b = NormalSurfaces(Example3.poincare(), NS_QUAD)
159
+ c = NormalSurfaces(Example3.poincare(), NS_STANDARD)
160
+ cmp('NormalSurfaces', a, b)
161
+ cmp('NormalSurfaces', a, c)
162
+ a.sort(lambda x,y: x.eulerChar() > y.eulerChar())
163
+ c.sort(lambda x,y: x.eulerChar() < y.eulerChar())
164
+ cmp('NormalSurfaces', a, c)
165
+
166
+ a = NormalHypersurfaces(Example4.s3xs1(), HS_STANDARD)
167
+ b = NormalHypersurfaces(Example4.s3xs1(), HS_PRISM)
168
+ c = NormalHypersurfaces(Example4.s3xs1(), HS_STANDARD)
169
+ cmp('NormalHypersurfaces', a, b)
170
+ cmp('NormalHypersurfaces', a, c)
171
+ a.sort(lambda x,y: x.homology().str() > y.homology().str())
172
+ c.sort(lambda x,y: x.homology().str() < y.homology().str())
173
+ cmp('NormalHypersurfaces', a, c)
174
+
175
+ a = AngleStructures(Example3.figureEight())
176
+ b = AngleStructures(Example3.figureEight(), True)
177
+ c = AngleStructures(Example3.figureEight())
178
+ cmp('AngleStructures', a, b)
179
+ cmp('AngleStructures', a, c)
180
+
181
+ t = TypeTrie4()
182
+ t.insert([1,0,3])
183
+ t.insert([0,0,2])
184
+ u = TypeTrie4(t)
185
+ cmp('TypeTrie', t, u)
186
+ u.insert([0,1,1])
187
+ cmp('TypeTrie', t, u)
188
+ cmp('TypeTrie', u, t)
189
+
190
+ t = TrieSet()
191
+ b = Bitmask8(); b.set([1,2,4], True); t.insert(b)
192
+ b = Bitmask8(); b.set([1,4,5], True); t.insert(b)
193
+ u = TrieSet(t)
194
+ cmp('TrieSet', t, u)
195
+ b = Bitmask8(); b.set([0,4], True); t.insert(b)
196
+ cmp('TrieSet', t, u)
197
+ cmp('TrieSet', u, t)
198
+
199
+ t = Example3.figureEight()
200
+ tab = LPInitialTableaux(t, NS_QUAD)
201
+ m1 = LPMatrix(tab.rank(), tab.columns()); tab.fillInitialTableaux(m1)
202
+ m2 = LPMatrix(tab.rank(), tab.columns()); tab.fillInitialTableaux(m2)
203
+ cmp('LPMatrix', LPMatrix(), LPMatrix())
204
+ cmp('LPMatrix', m1, m2)
205
+ t = Example3.s2xs1()
206
+ tab = LPInitialTableaux(t, NS_QUAD)
207
+ m3 = LPMatrix(tab.rank(), tab.columns()); tab.fillInitialTableaux(m3)
208
+ cmp('LPMatrix', m1, m3)
209
+
210
+ v1 = ValidityConstraints(10, 4)
211
+ v1.addLocal([4,5,6]); v1.addLocal([7,8,9]); v1.addGlobal([0])
212
+ v2 = ValidityConstraints(10, 4)
213
+ v2.addLocal([9,8,7]); v2.addLocal([6,5,4]); v2.addGlobal([0])
214
+ v3 = ValidityConstraints(10, 4)
215
+ v3.addLocal([9,8,7]); v3.addLocal([6,5,4]); v3.addGlobal([1])
216
+ cmp('ValidityConstraints', v1, v2)
217
+ cmp('ValidityConstraints', v1, v3)
218
+
219
+ cmp('Signature', Signature('(aba)(b)'), Signature('aba.b'))
220
+ cmp('Signature', Signature('(aba)(b)'), Signature('(ab)(a)(b)'))
221
+
222
+ sfsDisc = SFSpace(SFSpace.o2, 0, 1)
223
+ s1 = SFSAlt.altSet(sfsDisc)
224
+ s2 = SFSAlt.altSet(sfsDisc)
225
+ cmp('SFSAlt', s1[0], s2[0])
226
+ cmp('SFSAlt', s1[0], s1[1])
227
+
228
+ t = Example3.poincare()
229
+ st = NormalSurfaces(t, NS_QUAD)
230
+ dt = DiscSetSurface(st.surface(0))
231
+ u = Example3.s2xs1()
232
+ su = NormalSurfaces(u, NS_QUAD)
233
+ du = DiscSetSurface(su.surface(0))
234
+ cmp('DiscSetTet', du.tetDiscs(0), du.tetDiscs(1)) # should be equal
235
+ cmp('DiscSetTet', dt.tetDiscs(0), dt.tetDiscs(1)) # should be different
236
+ cmp('DiscSetSurface', dt, DiscSetSurface(st.surface(0)))
237
+ cmp('DiscSetSurface', dt, DiscSetSurface(st.surface(1)))
238
+ cmp('DiscSetSurface', dt, du)
239
+
240
+ t1 = TreeDecomposition(ExampleLink.conway())
241
+ t2 = TreeDecomposition(ExampleLink.conway())
242
+ cmp('TreeDecomposition', t1, t2)
243
+ t2.reroot(t2.bag(3))
244
+ cmp('TreeDecomposition', t1, t2)
245
+
246
+ t = Triangulation3('kLALALMkbccfefihijjlpkusuueotr')
247
+ b = BlockedSFSTriple.recognise(t)
248
+ # [ Tri, Mob(v), LST(1,2,3) | Tri, Mob(v) | Tri, Mob(v), Mob(v) ]
249
+ cmp('SatBlockSpec', b.end(0).block(0), b.centre().block(0))
250
+ cmp('SatBlockSpec', b.end(0).block(0), b.centre().block(1))
251
+ cmp('SatBlockSpec', b.end(0).block(1), b.centre().block(1))
252
+ cmp('SatBlockSpec', b.end(0).block(1), b.centre().block(0))
253
+ cmp('SatBlockSpec', b.end(0).block(2), b.end(0).block(2))
254
+ cmp('SatBlockSpec', b.end(0).block(2), b.end(1).block(2))
255
+ cmp('SatBlock', b.end(0).block(0).block(), b.centre().block(0).block())
256
+ cmp('SatBlock', b.end(0).block(0).block(), b.centre().block(1).block())
257
+ cmp('SatBlock', b.end(0).block(1).block(), b.centre().block(1).block())
258
+ cmp('SatBlock', b.end(0).block(1).block(), b.centre().block(0).block())
259
+ cmp('SatBlock', b.end(0).block(2).block(), b.end(0).block(2).block())
260
+ cmp('SatBlock', b.end(0).block(2).block(), b.end(1).block(2).block())
261
+
262
+ cmp('TxICore', TxIDiagonalCore(6, 1), TxIDiagonalCore(6, 1))
263
+ cmp('TxICore', TxIDiagonalCore(7, 1), TxIDiagonalCore(7, 2))
264
+ cmp('TxICore', TxIDiagonalCore(6, 1), TxIParallelCore())
265
+ cmp('TxICore', TxIParallelCore(), TxIParallelCore())
266
+
267
+ t = Triangulation3('kLALALMkbccfefihijjlpkusuueotr')
268
+ b1 = BlockedSFSTriple.recognise(t)
269
+ b2 = BlockedSFSTriple.recognise(t)
270
+ cmp('BlockedSFSTriple', b1, b2)
271
+ iso = Isomorphism3(t.size())
272
+ for i in range(t.size()):
273
+ iso.setSimpImage(i, t.size() - i - 1)
274
+ iso.setFacetPerm(i, Perm4(3,2,1,0))
275
+
276
+ t2 = iso.apply(t)
277
+ b3 = BlockedSFSTriple.recognise(t2)
278
+ cmp('BlockedSFSTriple', b1, b3)
279
+ cmp('BlockedSFSTriple.manifold()', b1.manifold(), b3.manifold())
280
+
281
+ # ----------------------------------------------------------------------
282
+ # Classes that compare by reference:
283
+ # ----------------------------------------------------------------------
284
+
285
+ t = Triangulation3()
286
+ (a,b) = t.newTetrahedra(2)
287
+ cmp('Tetrahedron3', a, t.tetrahedron(0))
288
+ cmp('Tetrahedron3', a, t.tetrahedron(1))
289
+
290
+ # ----------------------------------------------------------------------
291
+ # More tests with packets:
292
+ # ----------------------------------------------------------------------
293
+
294
+ a = Container()
295
+ cmp('Container', a, a.root(), True)
296
+ t = Text()
297
+ cmp('Text', t, t.root(), True)
298
+ cmp('Different Packets', Container(), Text(), True)
299
+ cmp('Different Packets', Text(), Container(), True)
300
+ cmp('Different Packets', PacketOfLink(), Text(), True)
301
+ cmp('Different Packets', Text(), PacketOfLink(), True)
302
+ cmp('Different Packets', Text(), Link(), True)
303
+ cmp('Different Packets', Link(), Text(), True)
304
+
305
+ # ----------------------------------------------------------------------
306
+ # Classes that cannot be compared:
307
+ # ----------------------------------------------------------------------
308
+
309
+ t = Example3.poincare()
310
+ cmp('HomologicalData', HomologicalData(t), HomologicalData(t))
@@ -0,0 +1,15 @@
1
+ Euler characteristics for triangulation vs compact manifold:
2
+ 0 0 --- Empty triangulation
3
+ 0 0 --- L(8,3)
4
+ 0 0 --- RP2 x S1
5
+ 0 0 --- Solid Klein bottle
6
+ 0 0 --- LST(3,4,7)
7
+ 1 1 --- Solid ball
8
+ 1 0 --- Figure eight knot complement
9
+ 2 0 --- Whitehead link complement
10
+ 1 0 --- Gieseking manifold
11
+ 2 -1 --- Cusped genus two torus
12
+ -1 1 --- Invalid edge
13
+ 1 1 --- Two projective plane cusps
14
+ 1 0 --- Pinched solid torus
15
+ 1 0 --- Pinched solid Klein bottle
@@ -0,0 +1,95 @@
1
+ # Regina - A Normal Surface Theory Calculator
2
+ # Python Test Suite Component
3
+ #
4
+ # Copyright (c) 2007-2023, Ben Burton
5
+ # For further details contact Ben Burton (bab@debian.org).
6
+ #
7
+ # Tests different Euler characteristic calculations.
8
+ #
9
+ # This file is a single component of Regina's python test suite. To run
10
+ # the python test suite, move to the main python directory in the source
11
+ # tree and run "make check".
12
+ #
13
+ # This program is free software; you can redistribute it and/or
14
+ # modify it under the terms of the GNU General Public License as
15
+ # published by the Free Software Foundation; either version 2 of the
16
+ # License, or (at your option) any later version.
17
+ #
18
+ # As an exception, when this program is distributed through (i) the
19
+ # App Store by Apple Inc.; (ii) the Mac App Store by Apple Inc.; or
20
+ # (iii) Google Play by Google Inc., then that store may impose any
21
+ # digital rights management, device limits and/or redistribution
22
+ # restrictions that are required by its terms of service.
23
+ #
24
+ # This program is distributed in the hope that it will be useful, but
25
+ # WITHOUT ANY WARRANTY; without even the implied warranty of
26
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
27
+ # General Public License for more details.
28
+ #
29
+ # You should have received a copy of the GNU General Public
30
+ # License along with this program; if not, write to the Free
31
+ # Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
32
+ # MA 02110-1301, USA.
33
+
34
+ def printEuler(t, name):
35
+ print(t.eulerCharTri(), t.eulerCharManifold(), \
36
+ '---', name)
37
+
38
+ # Consistency check, while we're here.
39
+ eHom = regina.HomologicalData(t).eulerChar()
40
+ if eHom != t.eulerCharManifold():
41
+ print('ERROR: Triangulation3::eulerCharManifold() and')
42
+ print(' HomologicalData.eulerChar() disagree!')
43
+
44
+ print('Euler characteristics for triangulation vs compact manifold:')
45
+
46
+ # Empty:
47
+ printEuler(regina.Triangulation3(), "Empty triangulation")
48
+
49
+ # Closed:
50
+ printEuler(regina.Example3.lens(8,3), "L(8,3)")
51
+ printEuler(regina.Example3.rp2xs1(), "RP2 x S1")
52
+
53
+ # Bounded:
54
+ printEuler(regina.Example3.solidKleinBottle(),
55
+ "Solid Klein bottle")
56
+ printEuler(regina.Example3.lst(3,4), "LST(3,4,7)")
57
+
58
+ tri = regina.Triangulation3()
59
+ dummy = tri.newTetrahedron()
60
+ printEuler(tri, "Solid ball")
61
+
62
+ # Ideal:
63
+ printEuler(regina.Example3.figureEight(),
64
+ "Figure eight knot complement")
65
+ printEuler(regina.Example3.whiteheadLink(),
66
+ "Whitehead link complement")
67
+ printEuler(regina.Example3.gieseking(),
68
+ "Gieseking manifold")
69
+ printEuler(regina.Example3.cuspedGenusTwoTorus(),
70
+ "Cusped genus two torus")
71
+
72
+ # Edge joined to itself:
73
+ tri = regina.Triangulation3()
74
+ t = tri.newTetrahedron()
75
+ t.join(0, t, regina.Perm4(1,0,3,2))
76
+ t.join(2, t, regina.Perm4(1,0,3,2))
77
+ printEuler(tri, "Invalid edge")
78
+
79
+ # Subdivide to obtain a valid triangulation:
80
+ tri.subdivide()
81
+ printEuler(tri, "Two projective plane cusps")
82
+
83
+ # Invalid boundary vertex links:
84
+ tri = regina.Triangulation3()
85
+ (t, s) = tri.newTetrahedra(2)
86
+ t.join(3, s, regina.Perm4(0,1,2,3))
87
+ t.join(2, s, regina.Perm4(0,3,1,2))
88
+ printEuler(tri, "Pinched solid torus")
89
+
90
+ tri = regina.Triangulation3()
91
+ (t, s) = tri.newTetrahedra(2)
92
+ t.join(3, s, regina.Perm4(0,1,2,3))
93
+ t.join(2, s, regina.Perm4(0,2,1,3))
94
+ printEuler(tri, "Pinched solid Klein bottle")
95
+
@@ -0,0 +1,7 @@
1
+ 10
2
+ Z_55
3
+ 0.5
4
+ Z
5
+ 7 embedded, vertex surfaces (Standard normal (tri-quad))
6
+ True
7
+ All done!
@@ -0,0 +1,100 @@
1
+ # Regina - A Normal Surface Theory Calculator
2
+ # Python Test Suite Component
3
+ #
4
+ # Copyright (c) 2015-2023, Ben Burton
5
+ # For further details contact Ben Burton (bab@debian.org).
6
+ #
7
+ # Tests throwing and catching Regina's exception types.
8
+ #
9
+ # This file is a single component of Regina's python test suite. To run
10
+ # the python test suite, move to the main python directory in the source
11
+ # tree and run "make check".
12
+ #
13
+ # This program is free software; you can redistribute it and/or
14
+ # modify it under the terms of the GNU General Public License as
15
+ # published by the Free Software Foundation; either version 2 of the
16
+ # License, or (at your option) any later version.
17
+ #
18
+ # As an exception, when this program is distributed through (i) the
19
+ # App Store by Apple Inc.; (ii) the Mac App Store by Apple Inc.; or
20
+ # (iii) Google Play by Google Inc., then that store may impose any
21
+ # digital rights management, device limits and/or redistribution
22
+ # restrictions that are required by its terms of service.
23
+ #
24
+ # This program is distributed in the hope that it will be useful, but
25
+ # WITHOUT ANY WARRANTY; without even the implied warranty of
26
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
27
+ # General Public License for more details.
28
+ #
29
+ # You should have received a copy of the GNU General Public
30
+ # License along with this program; if not, write to the Free
31
+ # Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
32
+ # MA 02110-1301, USA.
33
+
34
+ t = Example3.poincare()
35
+
36
+ print(t.faces(2).size())
37
+ try:
38
+ print(t.faces(3).size())
39
+ print('ERROR: Did not throw exception')
40
+ except InvalidArgument:
41
+ pass
42
+
43
+ try:
44
+ print(t.faces(-1).size())
45
+ print('ERROR: Did not throw exception')
46
+ except InvalidArgument:
47
+ pass
48
+
49
+ t = ExampleSnapPea.whiteheadLink()
50
+ try:
51
+ print(t.filledAll())
52
+ print('ERROR: Did not throw exception')
53
+ except FailedPrecondition:
54
+ pass
55
+
56
+ dummy = t.fill(1,2,0)
57
+ dummy = t.fill(3,4,1)
58
+ print(t.filledAll().homology())
59
+ dummy = t.pachner(t.triangle(0))
60
+ try:
61
+ print(t.filledAll())
62
+ print('ERROR: Did not throw exception')
63
+ except SnapPeaIsNull:
64
+ pass
65
+
66
+ print(Rational(1,2).doubleApprox())
67
+ try:
68
+ print(Rational(1,0).doubleApprox())
69
+ print('ERROR: Did not throw exception')
70
+ except UnsolvedCase:
71
+ pass
72
+
73
+ s = SFSpace()
74
+ print(s.construct().homology())
75
+ s.addPuncture()
76
+ try:
77
+ print(s.construct())
78
+ print('ERROR: Did not throw exception')
79
+ except NotImplemented:
80
+ pass
81
+
82
+ t = Example3.poincare()
83
+ s = NormalSurfaces(t, NS_STANDARD)
84
+ t = None
85
+ print(s)
86
+ try:
87
+ t = s.triangulation()
88
+ print(t.isReadOnlySnapshot())
89
+ # TODO: subdivide(), due to a swap() in its internal implementation,
90
+ # actually throws a SnapshotWriteError from a triangulation destructor.
91
+ # This is *bad*, and moreover results in an exception that Python cannot
92
+ # catch.
93
+ # t.subdivide()
94
+ t.pachner(t.triangle(0))
95
+ print('ERROR: Did not throw exception')
96
+ except SnapshotWriteError:
97
+ pass
98
+
99
+ print('All done!')
100
+