synkit 1.6.5__py3-none-win_amd64.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.
Files changed (636) hide show
  1. synkit/CRN/Benchmark/__init__.py +53 -0
  2. synkit/CRN/Benchmark/crosschecks.py +13 -0
  3. synkit/CRN/Benchmark/kegg.py +12 -0
  4. synkit/CRN/Benchmark/networks.py +13 -0
  5. synkit/CRN/Benchmark/scaling.py +13 -0
  6. synkit/CRN/Benchmark/validate.py +13 -0
  7. synkit/CRN/Construct/__init__.py +16 -0
  8. synkit/CRN/Construct/abstract.py +668 -0
  9. synkit/CRN/Construct/arity.py +36 -0
  10. synkit/CRN/Construct/builder.py +619 -0
  11. synkit/CRN/Construct/derivation.py +63 -0
  12. synkit/CRN/Construct/flattener.py +100 -0
  13. synkit/CRN/Construct/keys.py +14 -0
  14. synkit/CRN/Construct/mixtures.py +117 -0
  15. synkit/CRN/Construct/rdkit_worker.py +69 -0
  16. synkit/CRN/Construct/smiles.py +99 -0
  17. synkit/CRN/Construct/state.py +31 -0
  18. synkit/CRN/Construct/strategy.py +75 -0
  19. synkit/CRN/Construct/worker.py +42 -0
  20. synkit/CRN/IO/__init__.py +36 -0
  21. synkit/CRN/IO/sbml.py +925 -0
  22. synkit/CRN/Pathway/__init__.py +72 -0
  23. synkit/CRN/Pathway/_adapter.py +333 -0
  24. synkit/CRN/Pathway/pathfinder.py +500 -0
  25. synkit/CRN/Pathway/reachability.py +796 -0
  26. synkit/CRN/Pathway/realizability.py +1322 -0
  27. synkit/CRN/Petrinet/__init__.py +93 -0
  28. synkit/CRN/Petrinet/analyzer.py +486 -0
  29. synkit/CRN/Petrinet/minimal_semiflows.py +436 -0
  30. synkit/CRN/Petrinet/net.py +1041 -0
  31. synkit/CRN/Petrinet/persistence.py +97 -0
  32. synkit/CRN/Petrinet/semiflows.py +483 -0
  33. synkit/CRN/Petrinet/siphon_search.py +402 -0
  34. synkit/CRN/Petrinet/structure.py +286 -0
  35. synkit/CRN/Props/__init__.py +130 -0
  36. synkit/CRN/Props/_rank.py +29 -0
  37. synkit/CRN/Props/deficiency.py +953 -0
  38. synkit/CRN/Props/dynamics.py +832 -0
  39. synkit/CRN/Props/helper.py +151 -0
  40. synkit/CRN/Props/stoich.py +751 -0
  41. synkit/CRN/Props/thermo.py +584 -0
  42. synkit/CRN/Query/__init__.py +66 -0
  43. synkit/CRN/Query/cache.py +41 -0
  44. synkit/CRN/Query/kegg_api.py +99 -0
  45. synkit/CRN/Query/kegg_extract.py +714 -0
  46. synkit/CRN/Query/kegg_impute.py +707 -0
  47. synkit/CRN/Query/kegg_parse.py +480 -0
  48. synkit/CRN/Query/to_syncrn.py +290 -0
  49. synkit/CRN/README.md +234 -0
  50. synkit/CRN/Structure/__init__.py +12 -0
  51. synkit/CRN/Structure/_graph_io.py +713 -0
  52. synkit/CRN/Structure/_matrices.py +88 -0
  53. synkit/CRN/Structure/_parse.py +544 -0
  54. synkit/CRN/Structure/reaction.py +237 -0
  55. synkit/CRN/Structure/rule.py +55 -0
  56. synkit/CRN/Structure/species.py +46 -0
  57. synkit/CRN/Structure/syncrn.py +929 -0
  58. synkit/CRN/Symmetry/__init__.py +20 -0
  59. synkit/CRN/Symmetry/_common.py +1059 -0
  60. synkit/CRN/Symmetry/_ir.py +940 -0
  61. synkit/CRN/Symmetry/automorphism.py +472 -0
  62. synkit/CRN/Symmetry/canon.py +441 -0
  63. synkit/CRN/Symmetry/isomorphism.py +412 -0
  64. synkit/CRN/Symmetry/symmetry.py +61 -0
  65. synkit/CRN/Symmetry/wl_canon.py +967 -0
  66. synkit/CRN/Visualize/__init__.py +11 -0
  67. synkit/CRN/Visualize/labels.py +113 -0
  68. synkit/CRN/Visualize/layout.py +708 -0
  69. synkit/CRN/Visualize/palette.py +292 -0
  70. synkit/CRN/Visualize/validation.py +122 -0
  71. synkit/CRN/Visualize/vis.py +1152 -0
  72. synkit/CRN/__init__.py +233 -0
  73. synkit/CRN/_build.py +50 -0
  74. synkit/CRN/_native_build.py +175 -0
  75. synkit/CRN/analysis.py +629 -0
  76. synkit/CRN/backend.py +74 -0
  77. synkit/CRN/cpp/CMakeLists.txt +58 -0
  78. synkit/CRN/cpp/algebra.cpp +46 -0
  79. synkit/CRN/cpp/closure.cpp +29 -0
  80. synkit/CRN/cpp/exact.h +55 -0
  81. synkit/CRN/cpp/pathway.cpp +46 -0
  82. synkit/CRN/cpp/semiflows.cpp +209 -0
  83. synkit/CRN/cpp/structural.cpp +240 -0
  84. synkit/CRN/cpp/symmetry.cpp +45 -0
  85. synkit/CRN/cpp/write_manifest.cmake +28 -0
  86. synkit/CRN/kinds.py +137 -0
  87. synkit/CRN/lib/synkit_crn.dll +0 -0
  88. synkit/CRN/lib/synkit_crn.json +33 -0
  89. synkit/CRN/native.py +388 -0
  90. synkit/CRN/native_analysis.py +459 -0
  91. synkit/Chem/Cluster/__init__.py +0 -0
  92. synkit/Chem/Cluster/butina.py +140 -0
  93. synkit/Chem/Fingerprint/__init__.py +0 -0
  94. synkit/Chem/Fingerprint/fp_calculator.py +155 -0
  95. synkit/Chem/Fingerprint/smiles_featurizer.py +258 -0
  96. synkit/Chem/Fingerprint/transformation_fp.py +139 -0
  97. synkit/Chem/Mapper/README.rst +43 -0
  98. synkit/Chem/Mapper/__init__.py +255 -0
  99. synkit/Chem/Mapper/_compat.py +130 -0
  100. synkit/Chem/Mapper/adapters/__init__.py +1 -0
  101. synkit/Chem/Mapper/adapters/prediction.py +126 -0
  102. synkit/Chem/Mapper/adapters/template.py +412 -0
  103. synkit/Chem/Mapper/chem/__init__.py +52 -0
  104. synkit/Chem/Mapper/chem/aam.py +673 -0
  105. synkit/Chem/Mapper/chem/blind.py +160 -0
  106. synkit/Chem/Mapper/chem/its.py +309 -0
  107. synkit/Chem/Mapper/chem/smiles.py +564 -0
  108. synkit/Chem/Mapper/graph/__init__.py +66 -0
  109. synkit/Chem/Mapper/graph/automorphism.py +395 -0
  110. synkit/Chem/Mapper/graph/blockcut.py +98 -0
  111. synkit/Chem/Mapper/graph/labeled_graph.py +104 -0
  112. synkit/Chem/Mapper/graph/refine.py +176 -0
  113. synkit/Chem/Mapper/graph/synkit_adapter.py +110 -0
  114. synkit/Chem/Mapper/io/__init__.py +13 -0
  115. synkit/Chem/Mapper/io/idxmapstr.py +82 -0
  116. synkit/Chem/Mapper/mapper.py +685 -0
  117. synkit/Chem/Mapper/reaction_search.py +554 -0
  118. synkit/Chem/Mapper/reporting/__init__.py +1 -0
  119. synkit/Chem/Mapper/reporting/alternatives.py +451 -0
  120. synkit/Chem/Mapper/reporting/analysis.py +681 -0
  121. synkit/Chem/Mapper/reporting/native_analysis.py +485 -0
  122. synkit/Chem/Mapper/reporting/spectrum.py +642 -0
  123. synkit/Chem/Mapper/solvers/__init__.py +1 -0
  124. synkit/Chem/Mapper/solvers/exact/__init__.py +141 -0
  125. synkit/Chem/Mapper/solvers/exact/assignment/__init__.py +1 -0
  126. synkit/Chem/Mapper/solvers/exact/assignment/assignment_certificate.py +113 -0
  127. synkit/Chem/Mapper/solvers/exact/assignment/assignment_domains.py +162 -0
  128. synkit/Chem/Mapper/solvers/exact/assignment/assignment_verification.py +58 -0
  129. synkit/Chem/Mapper/solvers/exact/assignment/incremental_assignment.py +247 -0
  130. synkit/Chem/Mapper/solvers/exact/certificate.py +128 -0
  131. synkit/Chem/Mapper/solvers/exact/core.py +183 -0
  132. synkit/Chem/Mapper/solvers/exact/distance_search/__init__.py +1 -0
  133. synkit/Chem/Mapper/solvers/exact/distance_search/bounds.py +319 -0
  134. synkit/Chem/Mapper/solvers/exact/distance_search/exhaustive.py +179 -0
  135. synkit/Chem/Mapper/solvers/exact/distance_search/inputs.py +283 -0
  136. synkit/Chem/Mapper/solvers/exact/distance_search/records.py +242 -0
  137. synkit/Chem/Mapper/solvers/exact/distance_search/search.py +1025 -0
  138. synkit/Chem/Mapper/solvers/exact/distance_search/verify.py +378 -0
  139. synkit/Chem/Mapper/solvers/exact/edit_support.py +375 -0
  140. synkit/Chem/Mapper/solvers/exact/hybrid.py +224 -0
  141. synkit/Chem/Mapper/solvers/exact/hydrogen.py +264 -0
  142. synkit/Chem/Mapper/solvers/exact/kernel_solvers/__init__.py +1 -0
  143. synkit/Chem/Mapper/solvers/exact/kernel_solvers/branching.py +499 -0
  144. synkit/Chem/Mapper/solvers/exact/kernel_solvers/enumerate.py +1050 -0
  145. synkit/Chem/Mapper/solvers/exact/kernel_solvers/enumeration_result.py +30 -0
  146. synkit/Chem/Mapper/solvers/exact/kernel_solvers/kernel.py +256 -0
  147. synkit/Chem/Mapper/solvers/exact/kernel_solvers/milp.py +194 -0
  148. synkit/Chem/Mapper/solvers/exact/native/__init__.py +1 -0
  149. synkit/Chem/Mapper/solvers/exact/native/build.py +154 -0
  150. synkit/Chem/Mapper/solvers/exact/native/candidates.py +593 -0
  151. synkit/Chem/Mapper/solvers/exact/native/canonical.py +396 -0
  152. synkit/Chem/Mapper/solvers/exact/native/disk_frontier.py +415 -0
  153. synkit/Chem/Mapper/solvers/exact/native/frontier.py +390 -0
  154. synkit/Chem/Mapper/solvers/exact/native/hydrogen_quotient.py +213 -0
  155. synkit/Chem/Mapper/solvers/exact/native/its.py +528 -0
  156. synkit/Chem/Mapper/solvers/exact/native/native_distance.cpp +2803 -0
  157. synkit/Chem/Mapper/solvers/exact/native/orbit_aggregation.py +328 -0
  158. synkit/Chem/Mapper/solvers/exact/native/parallel.py +205 -0
  159. synkit/Chem/Mapper/solvers/exact/native/pmcd.py +203 -0
  160. synkit/Chem/Mapper/solvers/exact/native/runtime.py +40 -0
  161. synkit/Chem/Mapper/solvers/exact/native/search.py +294 -0
  162. synkit/Chem/Mapper/solvers/exact/native/separator.py +224 -0
  163. synkit/Chem/Mapper/solvers/exact/native_build.py +12 -0
  164. synkit/Chem/Mapper/solvers/exact/pabs/__init__.py +1 -0
  165. synkit/Chem/Mapper/solvers/exact/pabs/cost_lattice.py +43 -0
  166. synkit/Chem/Mapper/solvers/exact/pabs/factor_spectrum.py +110 -0
  167. synkit/Chem/Mapper/solvers/exact/pabs/multi_shell.py +368 -0
  168. synkit/Chem/Mapper/solvers/exact/pabs/propagation.py +679 -0
  169. synkit/Chem/Mapper/solvers/exact/pabs/propagation_bounds.py +436 -0
  170. synkit/Chem/Mapper/solvers/exact/pabs/propagation_limits.py +13 -0
  171. synkit/Chem/Mapper/solvers/exact/pabs/propagation_search.py +856 -0
  172. synkit/Chem/Mapper/solvers/exact/pabs/propagation_symmetry.py +66 -0
  173. synkit/Chem/Mapper/solvers/exact/pabs/residual_typed_bonds.py +136 -0
  174. synkit/Chem/Mapper/solvers/exact/pabs/reward_frontier.py +201 -0
  175. synkit/Chem/Mapper/solvers/exact/pabs/separator_bound.py +258 -0
  176. synkit/Chem/Mapper/solvers/exact/pabs/separator_spectrum.py +308 -0
  177. synkit/Chem/Mapper/solvers/exact/pabs/sparse_reward_bound.py +207 -0
  178. synkit/Chem/Mapper/solvers/exact/pabs/suffix_spectrum.py +299 -0
  179. synkit/Chem/Mapper/solvers/exact/search.py +55 -0
  180. synkit/Chem/Mapper/solvers/exact/seeds/__init__.py +1 -0
  181. synkit/Chem/Mapper/solvers/exact/seeds/seed.py +104 -0
  182. synkit/Chem/Mapper/solvers/exact/seeds/seed_fragments.py +148 -0
  183. synkit/Chem/Mapper/solvers/exact/seeds/seed_relaxation.py +181 -0
  184. synkit/Chem/Mapper/solvers/exact/symmetry.py +223 -0
  185. synkit/Chem/Mapper/solvers/native/__init__.py +4 -0
  186. synkit/Chem/Mapper/solvers/native/assignment.py +99 -0
  187. synkit/Chem/Mapper/solvers/native/astar.py +22 -0
  188. synkit/Chem/Mapper/solvers/native/build.py +385 -0
  189. synkit/Chem/Mapper/solvers/native/classification.py +641 -0
  190. synkit/Chem/Mapper/solvers/native/core.py +378 -0
  191. synkit/Chem/Mapper/solvers/native/cpp/CMakeLists.txt +120 -0
  192. synkit/Chem/Mapper/solvers/native/cpp/examples/map_reaction.cpp +29 -0
  193. synkit/Chem/Mapper/solvers/native/cpp/examples/slap_graph.cpp +63 -0
  194. synkit/Chem/Mapper/solvers/native/cpp/include/synkit_mapper/assignment/assignment.h +18 -0
  195. synkit/Chem/Mapper/solvers/native/cpp/include/synkit_mapper/astar/astar.h +18 -0
  196. synkit/Chem/Mapper/solvers/native/cpp/include/synkit_mapper/astar/bound.h +33 -0
  197. synkit/Chem/Mapper/solvers/native/cpp/include/synkit_mapper/core/pmcd_witness.h +16 -0
  198. synkit/Chem/Mapper/solvers/native/cpp/include/synkit_mapper/core/runtime.h +130 -0
  199. synkit/Chem/Mapper/solvers/native/cpp/include/synkit_mapper/hydrogen/hydrogen.h +73 -0
  200. synkit/Chem/Mapper/solvers/native/cpp/include/synkit_mapper/mapper.h +175 -0
  201. synkit/Chem/Mapper/solvers/native/cpp/include/synkit_mapper/mces/mces.h +9 -0
  202. synkit/Chem/Mapper/solvers/native/cpp/include/synkit_mapper/pabs/seed.h +34 -0
  203. synkit/Chem/Mapper/solvers/native/cpp/include/synkit_mapper/reaction/reaction.h +30 -0
  204. synkit/Chem/Mapper/solvers/native/cpp/include/synkit_mapper/sepdp/sepdp.h +21 -0
  205. synkit/Chem/Mapper/solvers/native/cpp/include/synkit_mapper/slap.h +72 -0
  206. synkit/Chem/Mapper/solvers/native/cpp/include/synkit_mapper/solvers/solvers.h +16 -0
  207. synkit/Chem/Mapper/solvers/native/cpp/include/synkit_mapper/symmetry/classification.h +140 -0
  208. synkit/Chem/Mapper/solvers/native/cpp/include/synkit_mapper/symmetry/cpabs.h +33 -0
  209. synkit/Chem/Mapper/solvers/native/cpp/src/assignment/abb.cpp +302 -0
  210. synkit/Chem/Mapper/solvers/native/cpp/src/astar/CMakeLists.txt +12 -0
  211. synkit/Chem/Mapper/solvers/native/cpp/src/astar/README.md +47 -0
  212. synkit/Chem/Mapper/solvers/native/cpp/src/astar/astar.cpp +228 -0
  213. synkit/Chem/Mapper/solvers/native/cpp/src/astar/astar_graph.cpp +37 -0
  214. synkit/Chem/Mapper/solvers/native/cpp/src/astar/bound.cpp +212 -0
  215. synkit/Chem/Mapper/solvers/native/cpp/src/core/dispatch.cpp +272 -0
  216. synkit/Chem/Mapper/solvers/native/cpp/src/core/pmcd_witness.cpp +36 -0
  217. synkit/Chem/Mapper/solvers/native/cpp/src/hydrogen/hydrogen.cpp +380 -0
  218. synkit/Chem/Mapper/solvers/native/cpp/src/mces/README.md +57 -0
  219. synkit/Chem/Mapper/solvers/native/cpp/src/mces/mces.cpp +287 -0
  220. synkit/Chem/Mapper/solvers/native/cpp/src/pabs/bridge.cpp +334 -0
  221. synkit/Chem/Mapper/solvers/native/cpp/src/pabs/chemical_floor.inc +181 -0
  222. synkit/Chem/Mapper/solvers/native/cpp/src/pabs/endpoint_symmetry.inc +104 -0
  223. synkit/Chem/Mapper/solvers/native/cpp/src/pabs/exact_helpers.h +20 -0
  224. synkit/Chem/Mapper/solvers/native/cpp/src/pabs/lp_assignment_certificate.h +165 -0
  225. synkit/Chem/Mapper/solvers/native/cpp/src/pabs/lp_certificate.h +125 -0
  226. synkit/Chem/Mapper/solvers/native/cpp/src/pabs/lp_model.h +365 -0
  227. synkit/Chem/Mapper/solvers/native/cpp/src/pabs/lp_provider.inc +319 -0
  228. synkit/Chem/Mapper/solvers/native/cpp/src/pabs/lp_rounding.inc +170 -0
  229. synkit/Chem/Mapper/solvers/native/cpp/src/pabs/lp_test_hooks.h +342 -0
  230. synkit/Chem/Mapper/solvers/native/cpp/src/pabs/objective_reduction.inc +137 -0
  231. synkit/Chem/Mapper/solvers/native/cpp/src/pabs/overlap_dual.inc +351 -0
  232. synkit/Chem/Mapper/solvers/native/cpp/src/pabs/profile_seed.inc +214 -0
  233. synkit/Chem/Mapper/solvers/native/cpp/src/pabs/seed_heuristics.inc +640 -0
  234. synkit/Chem/Mapper/solvers/native/cpp/src/pabs/sparse_embedding.cpp +430 -0
  235. synkit/Chem/Mapper/solvers/native/cpp/src/pabs/sparse_root_lp.h +176 -0
  236. synkit/Chem/Mapper/solvers/native/cpp/src/pabs/test_hooks.inc +262 -0
  237. synkit/Chem/Mapper/solvers/native/cpp/src/reaction/reaction.cpp +611 -0
  238. synkit/Chem/Mapper/solvers/native/cpp/src/sepdp/README.md +61 -0
  239. synkit/Chem/Mapper/solvers/native/cpp/src/sepdp/sepdp.cpp +253 -0
  240. synkit/Chem/Mapper/solvers/native/cpp/src/slap.cpp +810 -0
  241. synkit/Chem/Mapper/solvers/native/cpp/src/solvers/formulation.h +138 -0
  242. synkit/Chem/Mapper/solvers/native/cpp/src/solvers/maxsat.cpp +526 -0
  243. synkit/Chem/Mapper/solvers/native/cpp/src/solvers/ortools.cpp +475 -0
  244. synkit/Chem/Mapper/solvers/native/cpp/src/solvers/seed.h +80 -0
  245. synkit/Chem/Mapper/solvers/native/cpp/src/solvers/weighted_cnf.h +256 -0
  246. synkit/Chem/Mapper/solvers/native/cpp/src/supporting/README.md +43 -0
  247. synkit/Chem/Mapper/solvers/native/cpp/src/supporting/dfs.cpp +123 -0
  248. synkit/Chem/Mapper/solvers/native/cpp/src/supporting/edit_support.cpp +224 -0
  249. synkit/Chem/Mapper/solvers/native/cpp/src/symmetry/classification.cpp +553 -0
  250. synkit/Chem/Mapper/solvers/native/cpp/src/symmetry/classification_pipeline.cpp +124 -0
  251. synkit/Chem/Mapper/solvers/native/cpp/src/symmetry/classification_stream.h +13 -0
  252. synkit/Chem/Mapper/solvers/native/cpp/src/symmetry/cpabs.cpp +455 -0
  253. synkit/Chem/Mapper/solvers/native/cpp/src/symmetry/edge_deck.cpp +743 -0
  254. synkit/Chem/Mapper/solvers/native/cpp/src/symmetry/vendor/nauty/COPYRIGHT +44 -0
  255. synkit/Chem/Mapper/solvers/native/cpp/src/symmetry/vendor/nauty/LICENSE-2.0.txt +202 -0
  256. synkit/Chem/Mapper/solvers/native/cpp/src/symmetry/vendor/nauty/naugraph.c +732 -0
  257. synkit/Chem/Mapper/solvers/native/cpp/src/symmetry/vendor/nauty/naurng.c +94 -0
  258. synkit/Chem/Mapper/solvers/native/cpp/src/symmetry/vendor/nauty/naurng.h +49 -0
  259. synkit/Chem/Mapper/solvers/native/cpp/src/symmetry/vendor/nauty/nausparse.c +1771 -0
  260. synkit/Chem/Mapper/solvers/native/cpp/src/symmetry/vendor/nauty/nausparse.h +133 -0
  261. synkit/Chem/Mapper/solvers/native/cpp/src/symmetry/vendor/nauty/nautil.c +750 -0
  262. synkit/Chem/Mapper/solvers/native/cpp/src/symmetry/vendor/nauty/naututil.h +355 -0
  263. synkit/Chem/Mapper/solvers/native/cpp/src/symmetry/vendor/nauty/nauty.c +1256 -0
  264. synkit/Chem/Mapper/solvers/native/cpp/src/symmetry/vendor/nauty/nauty.h +1544 -0
  265. synkit/Chem/Mapper/solvers/native/cpp/src/symmetry/vendor/nauty/schreier.c +1131 -0
  266. synkit/Chem/Mapper/solvers/native/cpp/src/symmetry/vendor/nauty/schreier.h +70 -0
  267. synkit/Chem/Mapper/solvers/native/cpp/src/symmetry/vendor/nauty/sorttemplates.c +580 -0
  268. synkit/Chem/Mapper/solvers/native/hydrogen.py +711 -0
  269. synkit/Chem/Mapper/solvers/native/implicit.py +506 -0
  270. synkit/Chem/Mapper/solvers/native/implicit_certificate.py +187 -0
  271. synkit/Chem/Mapper/solvers/native/implicit_preparation.py +309 -0
  272. synkit/Chem/Mapper/solvers/native/lib/synkit_mapper.dll +0 -0
  273. synkit/Chem/Mapper/solvers/native/mces.py +16 -0
  274. synkit/Chem/Mapper/solvers/native/reaction.py +179 -0
  275. synkit/Chem/Mapper/solvers/native/reaction_build.py +277 -0
  276. synkit/Chem/Mapper/solvers/native/reaction_text.py +26 -0
  277. synkit/Chem/Mapper/solvers/native/runtime.py +242 -0
  278. synkit/Chem/Mapper/solvers/native/sepdp.py +47 -0
  279. synkit/Chem/Mapper/solvers/native/slap.py +266 -0
  280. synkit/Chem/Mapper/solvers/native/solvers.py +67 -0
  281. synkit/Chem/Mapper/solvers/native/stereo.py +86 -0
  282. synkit/Chem/Mapper/solvers/native/supporting.py +34 -0
  283. synkit/Chem/Mapper/solvers/native/symmetry.py +91 -0
  284. synkit/Chem/Mapper/solvers/slap/__init__.py +29 -0
  285. synkit/Chem/Mapper/solvers/slap/lap.py +174 -0
  286. synkit/Chem/Mapper/solvers/slap/sequential.py +696 -0
  287. synkit/Chem/Mapper/validation/__init__.py +1 -0
  288. synkit/Chem/Mapper/validation/aam_validator.py +442 -0
  289. synkit/Chem/Mapper/validation/annotations.py +274 -0
  290. synkit/Chem/Mapper/validation/bonds.py +124 -0
  291. synkit/Chem/Mapper/validation/cohorts.py +72 -0
  292. synkit/Chem/Mapper/validation/identifiability.py +150 -0
  293. synkit/Chem/Mapper/validation/numerical_scope.py +36 -0
  294. synkit/Chem/Mapper/validation/orbits.py +137 -0
  295. synkit/Chem/Molecule/__init__.py +0 -0
  296. synkit/Chem/Molecule/_chirality_loci.py +165 -0
  297. synkit/Chem/Molecule/_chirality_types.py +231 -0
  298. synkit/Chem/Molecule/_helical_loci.py +167 -0
  299. synkit/Chem/Molecule/_stereo_axis_evidence.py +202 -0
  300. synkit/Chem/Molecule/_stereo_element_detection.py +193 -0
  301. synkit/Chem/Molecule/_stereo_orientation_constraints.py +511 -0
  302. synkit/Chem/Molecule/_tetrahedral_carriers.py +63 -0
  303. synkit/Chem/Molecule/atom_features.py +379 -0
  304. synkit/Chem/Molecule/chirality.py +1041 -0
  305. synkit/Chem/Molecule/cip_assignment.py +569 -0
  306. synkit/Chem/Molecule/cip_ranking.py +843 -0
  307. synkit/Chem/Molecule/coordinate_stereo.py +503 -0
  308. synkit/Chem/Molecule/derived_stereo_naming.py +165 -0
  309. synkit/Chem/Molecule/descriptors.py +452 -0
  310. synkit/Chem/Molecule/formula.py +249 -0
  311. synkit/Chem/Molecule/global_stereo.py +175 -0
  312. synkit/Chem/Molecule/graph_annotator.py +300 -0
  313. synkit/Chem/Molecule/standardize.py +817 -0
  314. synkit/Chem/Molecule/stereo_evidence.py +179 -0
  315. synkit/Chem/Molecule/stereo_perception.py +1032 -0
  316. synkit/Chem/Molecule/valence.py +123 -0
  317. synkit/Chem/Reaction/Mapper/__init__.py +44 -0
  318. synkit/Chem/Reaction/__init__.py +20 -0
  319. synkit/Chem/Reaction/aam_validator.py +5 -0
  320. synkit/Chem/Reaction/balance_check.py +138 -0
  321. synkit/Chem/Reaction/canon_rsmi.py +249 -0
  322. synkit/Chem/Reaction/cleaning.py +58 -0
  323. synkit/Chem/Reaction/deionize.py +199 -0
  324. synkit/Chem/Reaction/explicit_h_audit.py +232 -0
  325. synkit/Chem/Reaction/fix_aam.py +64 -0
  326. synkit/Chem/Reaction/neutralize.py +207 -0
  327. synkit/Chem/Reaction/radical_wildcard.py +224 -0
  328. synkit/Chem/Reaction/standardize.py +203 -0
  329. synkit/Chem/Reaction/tautomerize.py +205 -0
  330. synkit/Chem/__init__.py +1 -0
  331. synkit/Chem/utils.py +315 -0
  332. synkit/Data/__init__.py +0 -0
  333. synkit/Data/aldol.json.gz +1 -0
  334. synkit/Data/gen_partial_aam.py +147 -0
  335. synkit/Data/paracetamol.json.gz +1 -0
  336. synkit/Graph/Canon/__init__.py +16 -0
  337. synkit/Graph/Canon/_native/__init__.py +13 -0
  338. synkit/Graph/Canon/_native/build.py +93 -0
  339. synkit/Graph/Canon/_native/lib/synkit_canon.dll +0 -0
  340. synkit/Graph/Canon/_native/prepare.py +49 -0
  341. synkit/Graph/Canon/_native/runtime.py +140 -0
  342. synkit/Graph/Canon/_native/search.py +137 -0
  343. synkit/Graph/Canon/canon_algs.py +228 -0
  344. synkit/Graph/Canon/canon_graph.py +531 -0
  345. synkit/Graph/Canon/cpp/CMakeLists.txt +42 -0
  346. synkit/Graph/Canon/cpp/README.md +123 -0
  347. synkit/Graph/Canon/cpp/examples/canonical_graph.cpp +16 -0
  348. synkit/Graph/Canon/cpp/include/synkit_canon/canon.h +85 -0
  349. synkit/Graph/Canon/cpp/src/canonical.cpp +391 -0
  350. synkit/Graph/Canon/cpp/src/symmetry.h +83 -0
  351. synkit/Graph/Canon/cpp/tests/symmetry.cpp +93 -0
  352. synkit/Graph/Canon/exact.py +1020 -0
  353. synkit/Graph/Canon/exact_refinement.py +368 -0
  354. synkit/Graph/Canon/nauty.py +143 -0
  355. synkit/Graph/Context/__init__.py +0 -0
  356. synkit/Graph/Context/hier_context.py +244 -0
  357. synkit/Graph/Context/radius_expand.py +252 -0
  358. synkit/Graph/FG/__init__.py +19 -0
  359. synkit/Graph/FG/api.py +39 -0
  360. synkit/Graph/FG/audit.py +155 -0
  361. synkit/Graph/FG/catalog.py +919 -0
  362. synkit/Graph/FG/detector.py +288 -0
  363. synkit/Graph/FG/model.py +97 -0
  364. synkit/Graph/FG/recognizers.py +274 -0
  365. synkit/Graph/FG/ring_system.py +154 -0
  366. synkit/Graph/Feature/Descriptors/topology.py +857 -0
  367. synkit/Graph/Feature/Fingerprint/__init__.py +0 -0
  368. synkit/Graph/Feature/Fingerprint/wl_rxn_fps.py +222 -0
  369. synkit/Graph/Feature/__init__.py +5 -0
  370. synkit/Graph/Feature/graph_descriptors.py +323 -0
  371. synkit/Graph/Feature/graph_fps.py +96 -0
  372. synkit/Graph/Feature/graph_signature.py +239 -0
  373. synkit/Graph/Feature/hash_fps.py +133 -0
  374. synkit/Graph/Feature/morgan_fps.py +88 -0
  375. synkit/Graph/Feature/path_fps.py +81 -0
  376. synkit/Graph/Feature/wl_hash.py +134 -0
  377. synkit/Graph/Fusion/__init__.py +85 -0
  378. synkit/Graph/Fusion/candidate.py +559 -0
  379. synkit/Graph/Fusion/constructor.py +877 -0
  380. synkit/Graph/Fusion/identity.py +184 -0
  381. synkit/Graph/Fusion/interface.py +700 -0
  382. synkit/Graph/Fusion/search.py +241 -0
  383. synkit/Graph/Hyrogen/__init__.py +6 -0
  384. synkit/Graph/Hyrogen/_misc.py +591 -0
  385. synkit/Graph/Hyrogen/hcomplete.py +995 -0
  386. synkit/Graph/Hyrogen/hcomplete_legacy.py +368 -0
  387. synkit/Graph/Hyrogen/hcompletion_algorithms.py +713 -0
  388. synkit/Graph/Hyrogen/hextend.py +570 -0
  389. synkit/Graph/Hyrogen/hextend_legacy.py +215 -0
  390. synkit/Graph/ITS/__init__.py +4 -0
  391. synkit/Graph/ITS/its_builder.py +120 -0
  392. synkit/Graph/ITS/its_construction.py +719 -0
  393. synkit/Graph/ITS/its_decompose.py +572 -0
  394. synkit/Graph/ITS/its_destruction.py +331 -0
  395. synkit/Graph/ITS/its_expand.py +1251 -0
  396. synkit/Graph/ITS/its_relabel.py +187 -0
  397. synkit/Graph/ITS/its_reverter.py +356 -0
  398. synkit/Graph/ITS/normalize_aam.py +145 -0
  399. synkit/Graph/ITS/partial_its.py +238 -0
  400. synkit/Graph/ITS/rc_extractor.py +656 -0
  401. synkit/Graph/ITS/stereo.py +74 -0
  402. synkit/Graph/MTG/__init__.py +107 -0
  403. synkit/Graph/MTG/gluing.py +451 -0
  404. synkit/Graph/MTG/history.py +928 -0
  405. synkit/Graph/MTG/inventory.py +118 -0
  406. synkit/Graph/MTG/local.py +447 -0
  407. synkit/Graph/MTG/mcs_matcher.py +246 -0
  408. synkit/Graph/MTG/mtg.py +611 -0
  409. synkit/Graph/MTG/mtg_explore.py +74 -0
  410. synkit/Graph/MTG/observation.py +209 -0
  411. synkit/Graph/MTG/process.py +577 -0
  412. synkit/Graph/MTG/queries.py +66 -0
  413. synkit/Graph/MTG/realization.py +95 -0
  414. synkit/Graph/MTG/series_parallel.py +107 -0
  415. synkit/Graph/MTG/utils.py +424 -0
  416. synkit/Graph/Matcher/__init__.py +10 -0
  417. synkit/Graph/Matcher/approx_mcs.py +1264 -0
  418. synkit/Graph/Matcher/auto_est.py +736 -0
  419. synkit/Graph/Matcher/automorphism.py +314 -0
  420. synkit/Graph/Matcher/batch_cluster.py +224 -0
  421. synkit/Graph/Matcher/dedup_matches.py +247 -0
  422. synkit/Graph/Matcher/graph_cluster.py +191 -0
  423. synkit/Graph/Matcher/graph_matcher.py +312 -0
  424. synkit/Graph/Matcher/graph_morphism.py +421 -0
  425. synkit/Graph/Matcher/mcs_matcher.py +804 -0
  426. synkit/Graph/Matcher/multi_turbo_iso.py +186 -0
  427. synkit/Graph/Matcher/orbit.py +284 -0
  428. synkit/Graph/Matcher/partial_matcher.py +694 -0
  429. synkit/Graph/Matcher/sing.py +544 -0
  430. synkit/Graph/Matcher/subgraph_matcher.py +812 -0
  431. synkit/Graph/Matcher/turbo_iso.py +272 -0
  432. synkit/Graph/Matcher/wl_sel.py +537 -0
  433. synkit/Graph/Mech/__init__.py +26 -0
  434. synkit/Graph/Mech/conversion.py +1466 -0
  435. synkit/Graph/Mech/conversion_debug.py +237 -0
  436. synkit/Graph/Mech/electron_accounting.py +200 -0
  437. synkit/Graph/Mech/lwg_editor.py +406 -0
  438. synkit/Graph/Mech/lwg_ops.py +313 -0
  439. synkit/Graph/Morphism/__init__.py +99 -0
  440. synkit/Graph/Morphism/constraints.py +460 -0
  441. synkit/Graph/Morphism/llg.py +999 -0
  442. synkit/Graph/Morphism/morphism.py +349 -0
  443. synkit/Graph/Morphism/stereo.py +258 -0
  444. synkit/Graph/Morphism/stereo_morphism.py +383 -0
  445. synkit/Graph/Morphism/stereo_morphism_helpers.py +957 -0
  446. synkit/Graph/Morphism/stereo_morphism_types.py +117 -0
  447. synkit/Graph/Stereo/__init__.py +376 -0
  448. synkit/Graph/Stereo/_descriptor_core.py +207 -0
  449. synkit/Graph/Stereo/_descriptor_serialization.py +138 -0
  450. synkit/Graph/Stereo/canonical.py +648 -0
  451. synkit/Graph/Stereo/changes.py +964 -0
  452. synkit/Graph/Stereo/composition.py +391 -0
  453. synkit/Graph/Stereo/configured.py +946 -0
  454. synkit/Graph/Stereo/couplings.py +245 -0
  455. synkit/Graph/Stereo/descriptors.py +1030 -0
  456. synkit/Graph/Stereo/enumeration.py +597 -0
  457. synkit/Graph/Stereo/extended_descriptors.py +406 -0
  458. synkit/Graph/Stereo/global_configured.py +152 -0
  459. synkit/Graph/Stereo/global_stereo.py +304 -0
  460. synkit/Graph/Stereo/identity.py +648 -0
  461. synkit/Graph/Stereo/interchange.py +496 -0
  462. synkit/Graph/Stereo/legacy.py +460 -0
  463. synkit/Graph/Stereo/matching.py +899 -0
  464. synkit/Graph/Stereo/native.py +154 -0
  465. synkit/Graph/Stereo/orbits.py +668 -0
  466. synkit/Graph/Stereo/outcomes.py +99 -0
  467. synkit/Graph/Stereo/pairwise.py +350 -0
  468. synkit/Graph/Stereo/rdkit_adapter.py +662 -0
  469. synkit/Graph/Stereo/rdkit_identity.py +118 -0
  470. synkit/Graph/Stereo/rdkit_resonance.py +140 -0
  471. synkit/Graph/Stereo/reaction_interchange.py +266 -0
  472. synkit/Graph/Stereo/semantics.py +296 -0
  473. synkit/Graph/Stereo/supports.py +257 -0
  474. synkit/Graph/Stereo/wire.py +339 -0
  475. synkit/Graph/Wildcard/__init__.py +0 -0
  476. synkit/Graph/Wildcard/fuse_graph.py +156 -0
  477. synkit/Graph/Wildcard/graph_wc.py +303 -0
  478. synkit/Graph/Wildcard/its_merge.py +857 -0
  479. synkit/Graph/Wildcard/radwc.py +114 -0
  480. synkit/Graph/Wildcard/wc_matcher.py +576 -0
  481. synkit/Graph/Wildcard/wildcard.py +225 -0
  482. synkit/Graph/__init__.py +17 -0
  483. synkit/Graph/canon_graph.py +14 -0
  484. synkit/Graph/syn_graph.py +199 -0
  485. synkit/Graph/utils.py +324 -0
  486. synkit/IO/__init__.py +4 -0
  487. synkit/IO/chem_converter.py +1059 -0
  488. synkit/IO/combinatorial/__init__.py +8 -0
  489. synkit/IO/combinatorial/gml_to_graph.py +223 -0
  490. synkit/IO/combinatorial/graph_to_gml.py +280 -0
  491. synkit/IO/combinatorial/graph_to_smarts.py +186 -0
  492. synkit/IO/combinatorial/smarts_expander.py +147 -0
  493. synkit/IO/combinatorial/smarts_generalizer.py +133 -0
  494. synkit/IO/combinatorial/smarts_to_graph.py +179 -0
  495. synkit/IO/conversion.py +42 -0
  496. synkit/IO/data_io.py +269 -0
  497. synkit/IO/data_process.py +143 -0
  498. synkit/IO/debug.py +73 -0
  499. synkit/IO/gml_to_nx.py +150 -0
  500. synkit/IO/graph_to_mol.py +199 -0
  501. synkit/IO/mol_to_graph.py +1105 -0
  502. synkit/IO/mol_to_graph_chemistry.py +545 -0
  503. synkit/IO/nx_to_gml.py +209 -0
  504. synkit/IO/smiles_to_id.py +123 -0
  505. synkit/Mechanism/__init__.py +151 -0
  506. synkit/Mechanism/adapters.py +136 -0
  507. synkit/Mechanism/audit.py +323 -0
  508. synkit/Mechanism/benchmark.py +638 -0
  509. synkit/Mechanism/compatibility.py +13 -0
  510. synkit/Mechanism/drawing.py +85 -0
  511. synkit/Mechanism/electron_models.py +725 -0
  512. synkit/Mechanism/equivalence.py +521 -0
  513. synkit/Mechanism/evidence.py +262 -0
  514. synkit/Mechanism/interchange.py +141 -0
  515. synkit/Mechanism/model.py +918 -0
  516. synkit/Mechanism/neighbor_stereo.py +312 -0
  517. synkit/Mechanism/radical_data.py +740 -0
  518. synkit/Mechanism/replay.py +986 -0
  519. synkit/Mechanism/schema.py +264 -0
  520. synkit/Mechanism/stereo_state.py +416 -0
  521. synkit/Mechanism/symbols.py +91 -0
  522. synkit/Rule/Apply/__init__.py +35 -0
  523. synkit/Rule/Apply/conditions.py +45 -0
  524. synkit/Rule/Apply/dpo.py +998 -0
  525. synkit/Rule/Apply/rule_matcher.py +218 -0
  526. synkit/Rule/Apply/validation.py +354 -0
  527. synkit/Rule/Compose/__init__.py +106 -0
  528. synkit/Rule/Compose/_identity.py +43 -0
  529. synkit/Rule/Compose/composition.py +976 -0
  530. synkit/Rule/Compose/laws.py +439 -0
  531. synkit/Rule/Compose/search.py +771 -0
  532. synkit/Rule/Compose/synrule.py +170 -0
  533. synkit/Rule/Modify/__init__.py +0 -0
  534. synkit/Rule/Modify/implict_rule.py +56 -0
  535. synkit/Rule/Modify/longest_path.py +92 -0
  536. synkit/Rule/Modify/molecule_rule.py +115 -0
  537. synkit/Rule/Modify/prune_templates.py +78 -0
  538. synkit/Rule/Modify/rule_utils.py +194 -0
  539. synkit/Rule/Modify/strip_rule.py +97 -0
  540. synkit/Rule/__init__.py +28 -0
  541. synkit/Rule/generic_stereo.py +884 -0
  542. synkit/Rule/stereo_identity.py +271 -0
  543. synkit/Rule/syn_rule.py +1090 -0
  544. synkit/Synthesis/MSR/__init__.py +0 -0
  545. synkit/Synthesis/MSR/path_finder.py +239 -0
  546. synkit/Synthesis/Metrics/__init__.py +0 -0
  547. synkit/Synthesis/Metrics/_base.py +52 -0
  548. synkit/Synthesis/Metrics/_plot.py +129 -0
  549. synkit/Synthesis/Metrics/_ranking.py +179 -0
  550. synkit/Synthesis/RBL/__init__.py +80 -0
  551. synkit/Synthesis/RBL/engine.py +1249 -0
  552. synkit/Synthesis/RBL/matching.py +652 -0
  553. synkit/Synthesis/RBL/overlap.py +336 -0
  554. synkit/Synthesis/RBL/pipeline.py +376 -0
  555. synkit/Synthesis/RBL/policy.py +139 -0
  556. synkit/Synthesis/RBL/proof.py +370 -0
  557. synkit/Synthesis/RBL/reaction.py +506 -0
  558. synkit/Synthesis/RBL/state.py +169 -0
  559. synkit/Synthesis/RBL/validation.py +1060 -0
  560. synkit/Synthesis/Reactor/__init__.py +60 -0
  561. synkit/Synthesis/Reactor/core/__init__.py +1 -0
  562. synkit/Synthesis/Reactor/core/engine.py +967 -0
  563. synkit/Synthesis/Reactor/core/product.py +621 -0
  564. synkit/Synthesis/Reactor/core/rewrite.py +561 -0
  565. synkit/Synthesis/Reactor/core/strategy.py +44 -0
  566. synkit/Synthesis/Reactor/matching/__init__.py +1 -0
  567. synkit/Synthesis/Reactor/matching/mixin.py +920 -0
  568. synkit/Synthesis/Reactor/matching/policy.py +345 -0
  569. synkit/Synthesis/Reactor/matching/symmetry.py +309 -0
  570. synkit/Synthesis/Reactor/output/__init__.py +1 -0
  571. synkit/Synthesis/Reactor/output/deduplication.py +703 -0
  572. synkit/Synthesis/Reactor/output/policy.py +16 -0
  573. synkit/Synthesis/Reactor/output/serialization.py +485 -0
  574. synkit/Synthesis/Reactor/output/structural.py +893 -0
  575. synkit/Synthesis/Reactor/stereo/__init__.py +1 -0
  576. synkit/Synthesis/Reactor/stereo/assignment.py +35 -0
  577. synkit/Synthesis/Reactor/stereo/mixin.py +780 -0
  578. synkit/Synthesis/Reactor/variants/__init__.py +1 -0
  579. synkit/Synthesis/Reactor/variants/imbalanced.py +180 -0
  580. synkit/Synthesis/Reactor/variants/partial.py +84 -0
  581. synkit/Synthesis/Reactor/workflow/__init__.py +1 -0
  582. synkit/Synthesis/Reactor/workflow/batch.py +550 -0
  583. synkit/Synthesis/Reactor/workflow/benchmark.py +143 -0
  584. synkit/Synthesis/Reactor/workflow/postprocess.py +267 -0
  585. synkit/Synthesis/Reactor/workflow/rule_filter.py +210 -0
  586. synkit/Synthesis/__init__.py +0 -0
  587. synkit/Synthesis/reactor_utils.py +316 -0
  588. synkit/Utils/__init__.py +0 -0
  589. synkit/Utils/utils.py +172 -0
  590. synkit/Vis/__init__.py +91 -0
  591. synkit/Vis/crn/__init__.py +40 -0
  592. synkit/Vis/epd/__init__.py +20 -0
  593. synkit/Vis/epd/arrows.py +425 -0
  594. synkit/Vis/epd/chem.py +197 -0
  595. synkit/Vis/epd/constants.py +83 -0
  596. synkit/Vis/epd/layout.py +283 -0
  597. synkit/Vis/epd/mapping.py +51 -0
  598. synkit/Vis/epd/models.py +136 -0
  599. synkit/Vis/epd/render.py +543 -0
  600. synkit/Vis/epd/utils.py +108 -0
  601. synkit/Vis/epd/visualizer.py +811 -0
  602. synkit/Vis/graph_visualizer.py +375 -0
  603. synkit/Vis/its/__init__.py +19 -0
  604. synkit/Vis/its/drawer.py +615 -0
  605. synkit/Vis/its_drawer.py +35 -0
  606. synkit/Vis/molecule/__init__.py +31 -0
  607. synkit/Vis/molecule/drawer.py +563 -0
  608. synkit/Vis/molecule/reaction.py +285 -0
  609. synkit/Vis/molecule_drawer.py +33 -0
  610. synkit/Vis/mtg/__init__.py +17 -0
  611. synkit/Vis/mtg/drawer.py +769 -0
  612. synkit/Vis/mtg_drawer.py +34 -0
  613. synkit/Vis/pdf_writer.py +146 -0
  614. synkit/Vis/reaction/__init__.py +19 -0
  615. synkit/Vis/reaction/rule.py +141 -0
  616. synkit/Vis/reaction/rxn.py +532 -0
  617. synkit/Vis/reaction_drawer.py +41 -0
  618. synkit/Vis/space/__init__.py +17 -0
  619. synkit/Vis/space/chemical.py +80 -0
  620. synkit/Vis/space/embedding.py +87 -0
  621. synkit/Vis/vis_synedu/Vis/__init__.py +7 -0
  622. synkit/Vis/vis_synedu/Vis/dpo.py +862 -0
  623. synkit/Vis/vis_synedu/rxn_vis.py +377 -0
  624. synkit/Vis/vis_synedu/vis.py +501 -0
  625. synkit/Vis/visual_drawer.py +215 -0
  626. synkit/Vis/visual_model.py +520 -0
  627. synkit/__init__.py +3 -0
  628. synkit/_native.py +91 -0
  629. synkit/examples.py +50 -0
  630. synkit/version.py +23 -0
  631. synkit-1.6.5.dist-info/METADATA +156 -0
  632. synkit-1.6.5.dist-info/RECORD +636 -0
  633. synkit-1.6.5.dist-info/WHEEL +4 -0
  634. synkit-1.6.5.dist-info/licenses/LICENSE +21 -0
  635. synkit-1.6.5.dist-info/licenses/synkit/Chem/Mapper/solvers/native/cpp/src/symmetry/vendor/nauty/COPYRIGHT +44 -0
  636. synkit-1.6.5.dist-info/licenses/synkit/Chem/Mapper/solvers/native/cpp/src/symmetry/vendor/nauty/LICENSE-2.0.txt +202 -0
@@ -0,0 +1,1544 @@
1
+ /**************************************************************************
2
+ * This is the header file for Version 2.9.3 of nauty().
3
+ * nauty.h. Generated from nauty-h.in by configure.
4
+ **************************************************************************/
5
+
6
+ #ifndef _NAUTY_H_ /* only process this file once */
7
+ #define _NAUTY_H_
8
+
9
+ /* The parts between the ==== lines are modified by configure when
10
+ creating nauty.h out of nauty-h.in. If configure is not being used,
11
+ it is necessary to check they are correct.
12
+ ====================================================================*/
13
+
14
+ /* Check whether various headers or options are available */
15
+ #define HAVE_UNISTD_H 1 /* <unistd.h> */
16
+ #define HAVE_SYSTYPES_H 1 /* <sys/types.h> */
17
+ #define HAVE_STDDEF_H 1 /* <stddef.h> */
18
+ #define HAVE_STDLIB_H 1 /* <stdlib.h> */
19
+ #define HAVE_STRING_H 1 /* <string.h> */
20
+ #define HAVE_LIMITS_H 1 /* <limits.h> */
21
+ #define HAVE_STDINT_H 1 /* <stdint.h> */
22
+ #define MALLOC_DEC 1 /* 1 = malloc() is declared in stdlib.h, */
23
+ /* 2 = in malloc.h, 0 = in neither place */
24
+ #define HAVE_FLOCKFILE 1 /* Whether flockfile() is available */
25
+ #define HAS_STDIO_UNLOCK 1 /* Whether there are getc_unlocked, */
26
+ /* putc_unlocked,flockfile and funlockfile */
27
+ #define STDIO_UNLOCK_DECL 1 /* is getc_unlocked() declared */
28
+ #define STDIO_FLOCKFILE_DECL 1 /* is flockfile() declared */
29
+ #define HAVE_WRITE 1 /* Whether write() is available */
30
+
31
+ #define DEFAULT_WORDSIZE 0
32
+
33
+ /* Note that thread-local storage (TLS) is only useful for running nauty
34
+ in multiple threads and will slow it down a little otherwise. */
35
+ #define TLS_SUPPORTED 1 /* Compiler supports thread-local */
36
+
37
+ /* If USE_TLS is defined, define TLS_ATTR to be the attribute name
38
+ for TLS and define HAVE_TLS=1. Otherwise define TLS_ATTR to be empty
39
+ and HAVE_TLS=0. USE_TLS can be defined on the command line or by
40
+ configuring with --enable-tls. */
41
+ #ifndef USE_TLS
42
+
43
+ #endif
44
+ #ifdef USE_TLS
45
+ #if !TLS_SUPPORTED
46
+ #error "TLS is requested but not available"
47
+ #else
48
+ #define TLS_ATTR thread_local
49
+ #define HAVE_TLS 1
50
+ #endif
51
+ #else
52
+ #define TLS_ATTR
53
+ #define HAVE_TLS 0
54
+ #endif
55
+
56
+ /* Function noreturn attribute, if any */
57
+ #define C_NORET_ATTR _Noreturn /* Only for C */
58
+
59
+ #ifndef __cplusplus
60
+ #define NORET_ATTR C_NORET_ATTR
61
+ #elif __cplusplus >= 201103L
62
+ #define NORET_ATTR [[noreturn]]
63
+ #elif defined(__GNUC__)
64
+ #define NORET_ATTR __attribute__((noreturn))
65
+ #elif defined(_MSC_VER)
66
+ #define NORET_ATTR __declspec(noreturn)
67
+ #else
68
+ #define NORET_ATTR
69
+ #endif
70
+
71
+ #define USE_ANSICONTROLS 0
72
+ /* whether --enable-ansicontrols is used */
73
+ #define FLEX_ARRAY_OK 1
74
+ /* whether the compiler supports flexible array members in structures */
75
+
76
+ #define NAUTY_LARGEFILE_OPTS 0
77
+ #undef _FILE_OFFSET_BITS
78
+ #if NAUTY_LARGEFILE_OPTS == 1
79
+ #define _FILE_OFFSET_BITS 64
80
+ #elif NAUTY_LARGEFILE_OPTS == 2
81
+ #undef _LARGE_FILES
82
+ #define _LARGE_FILES 1
83
+ #endif
84
+
85
+ #ifndef _LARGEFILE_SOURCE
86
+ #define _LARGEFILE_SOURCE 0
87
+ #endif
88
+ #if _LARGEFILE_SOURCE == 0
89
+ #undef _LARGEFILE_SOURCE
90
+ #elif _FILE_OFFSET_BITS == 64
91
+ #undef _LARGEFILE_SOURCE
92
+ #define _LARGEFILE_SOURCE 1
93
+ #endif
94
+
95
+ #if _FILE_OFFSET_BITS == 0
96
+ #undef _FILE_OFFSET_BITS
97
+ #endif
98
+
99
+ /* Support of gcc extensions __builtin_clz, __builtin_clzl, __builtin_clzll */
100
+ #ifndef HAVE_HWLZCNT
101
+ #define HAVE_HWLZCNT 1
102
+ #endif
103
+ #define HAVE_CLZ 1
104
+ #define HAVE_CLZL 1
105
+ #define HAVE_CLZLL 1
106
+
107
+ /* Support of gcc extensions
108
+ __builtin_popcount, __builtin_popcountl, __builtin_popcountll
109
+ Note that these may only be fast if the compiler switch -mpopcnt is used.
110
+
111
+ Also the intrinsics
112
+ _mm_popcnt_u32, _mm_popcnt_u64
113
+ for the Intel compiler icc. These need no compiler switch.
114
+ */
115
+ #ifndef HAVE_HWPOPCNT
116
+ #define HAVE_HWPOPCNT 1
117
+ #endif
118
+ #define HAVE_POPCNT 1
119
+ #define HAVE_POPCNTL 1
120
+ #define HAVE_POPCNTLL 1
121
+ #define HAVE_MMPOP32 0
122
+ #define HAVE_MMPOP64 0
123
+
124
+ #if defined(__unix) || defined(__unix__) || defined(unix)
125
+ #define SYS_UNIX
126
+ #endif
127
+
128
+ #define IS_ARM64 0
129
+
130
+ /*==================================================================*/
131
+
132
+ /* The following line must be uncommented for compiling into Magma. */
133
+ /* #define NAUTY_IN_MAGMA */
134
+
135
+ #ifdef NAUTY_IN_MAGMA
136
+ #include "defs.h"
137
+ #include "system.h"
138
+ #include "bs.h"
139
+ #define OLDEXTDEFS
140
+ #else
141
+ #include <stdio.h>
142
+ #define P_(x) x
143
+ #endif
144
+
145
+ /*****************************************************************************
146
+ * *
147
+ * AUTHOR: Brendan D. McKay *
148
+ * School of Computing *
149
+ * Australian National University *
150
+ * Canberra, ACT 2601, Australia *
151
+ * email: Brendan.McKay@anu.edu.au *
152
+ * *
153
+ * This software is subject to copyright as detailed in the file COPYRIGHT. *
154
+ * *
155
+ * Reference manual: *
156
+ * B. D. McKay and A. Piperno, nauty User's Guide (Version 2.9), *
157
+ * http://pallini.di.uniroma1.it *
158
+ * https://users.cecs.anu.edu.au/~bdm/nauty/ *
159
+ * *
160
+ * CHANGE HISTORY *
161
+ * 10-Nov-87 : final changes for version 1.2 *
162
+ * 5-Dec-87 : renamed to version 1.3 (no changes to this file) *
163
+ * 28-Sep-88 : added PC Turbo C support, making version 1.4 *
164
+ * 23-Mar-89 : changes for version 1.5 : *
165
+ * - reworked M==1 code *
166
+ * - defined NAUTYVERSION string *
167
+ * - made NAUTYH_READ to allow this file to be read twice *
168
+ * - added optional ANSI function prototypes *
169
+ * - added validity check for WORDSIZE *
170
+ * - added new fields to optionblk structure *
171
+ * - updated DEFAULTOPTIONS to add invariants fields *
172
+ * - added (set*) cast to definition of GRAPHROW *
173
+ * - added definition of ALLOCS and FREES *
174
+ * 25-Mar-89 : - added declaration of new function doref() *
175
+ * - added UNION macro *
176
+ * 29-Mar-89 : - reduced the default MAXN for small machines *
177
+ * - removed OUTOFSPACE (no longer used) *
178
+ * - added SETDIFF and XOR macros *
179
+ * 2-Apr-89 : - extended statsblk structure *
180
+ * 4-Apr-89 : - added IS_* macros *
181
+ * - added ERRFILE definition *
182
+ * - replaced statsblk.outofspace by statsblk.errstatus *
183
+ * 5-Apr-89 : - deleted definition of np2vector (no longer used) *
184
+ * - introduced EMPTYSET macro *
185
+ * 12-Apr-89 : - eliminated MARK, UNMARK and ISMARKED (no longer used) *
186
+ * 18-Apr-89 : - added MTOOBIG and CANONGNIL *
187
+ * 12-May-89 : - made ISELEM1 and ISELEMENT return 0 or 1 *
188
+ * 2-Mar-90 : - added EXTPROC macro and used it *
189
+ * 12-Mar-90 : - added SYS_CRAY, with help from N. Sloane and A. Grosky *
190
+ * - added dummy groupopts field to optionblk *
191
+ * - select some ANSI things if __STDC__ exists *
192
+ * 20-Mar-90 : - changed default MAXN for Macintosh versions *
193
+ * - created SYS_MACTHINK for Macintosh THINK compiler *
194
+ * 27-Mar-90 : - split SYS_MSDOS into SYS_PCMS4 and SYS_PCMS5 *
195
+ * 13-Oct-90 : changes for version 1.6: *
196
+ * - fix definition of setword for WORDSIZE==64 *
197
+ * 14-Oct-90 : - added SYS_APOLLO version to avoid compiler bug *
198
+ * 15-Oct-90 : - improve detection of ANSI conformance *
199
+ * 17-Oct-90 : - changed temp name in EMPTYSET to avoid A/UX bug *
200
+ * 16-Apr-91 : changes for version 1.7: *
201
+ * - made version SYS_PCTURBO use free(), not cfree() *
202
+ * 2-Sep-91 : - noted that SYS_PCMS5 also works for Quick C *
203
+ * - moved MULTIPLY to here from nauty.c *
204
+ * 12-Jun-92 : - changed the top part of this comment *
205
+ * 27-Aug-92 : - added version SYS_IBMC, thanks to Ivo Duentsch *
206
+ * 5-Jun-93 : - renamed to version 1.7+, only change in naututil.h *
207
+ * 29-Jul-93 : changes for version 1.8: *
208
+ * - fixed error in default 64-bit version of FIRSTBIT *
209
+ * (not used in any version before ALPHA) *
210
+ * - installed ALPHA version (thanks to Gordon Royle) *
211
+ * - defined ALLOCS,FREES for SYS_IBMC *
212
+ * 3-Sep-93 : - make calloc void* in ALPHA version *
213
+ * 17-Sep-93 : - renamed to version 1.9, *
214
+ * changed only dreadnaut.c and nautinv.c *
215
+ * 24-Feb-94 : changes for version 1.10: *
216
+ * - added version SYS_AMIGAAZT, thanks to Carsten Saager *
217
+ * (making 1.9+) *
218
+ * 19-Apr-95 : - added prototype wrapper for C++, *
219
+ * thanks to Daniel Huson *
220
+ * 5-Mar-96 : - added SYS_ALPHA32 version (32-bit setwords on Alpha) *
221
+ * 13-Jul-96 : changes for version 2.0: *
222
+ * - added dynamic allocation *
223
+ * - ERRFILE must be defined *
224
+ * - added FLIPELEM1 and FLIPELEMENT macros *
225
+ * 13-Aug-96 : - added SWCHUNK? macros *
226
+ * - added TAKEBIT macro *
227
+ * 28-Nov-96 : - include sys/types.h if not ANSI (tentative!) *
228
+ * 24-Jan-97 : - and stdlib.h if ANSI *
229
+ * - removed use of cfree() from UNIX variants *
230
+ * 25-Jan-97 : - changed options.getcanon from boolean to int *
231
+ * Backwards compatibility is ok, as boolean and int *
232
+ * are the same. Now getcanon=2 means to get the label *
233
+ * and not care about the group. Sometimes faster. *
234
+ * 6-Feb-97 : - Put in #undef for FALSE and TRUE to cope with *
235
+ * compilers that illegally predefine them. *
236
+ * - declared nauty_null and nautil_null *
237
+ * 2-Jul-98 : - declared ALLBITS *
238
+ * 21-Oct-98 : - allow WORDSIZE==64 using unsigned long long *
239
+ * - added BIGNAUTY option for really big graphs *
240
+ * 11-Dec-99 : - made bit, leftbit and bytecount static in each file *
241
+ * 9-Jan-00 : - declared nauty_check() and nautil_check() *
242
+ * 12-Feb-00 : - Used #error for compile-time checks *
243
+ * - Added DYNREALLOC *
244
+ * 4-Mar-00 : - declared ALLMASK(n) *
245
+ * 27-May-00 : - declared CONDYNFREE *
246
+ * 28-May-00 : - declared nautil_freedyn() *
247
+ * 16-Aug-00 : - added OLDNAUTY and changed canonical labelling *
248
+ * 16-Nov-00 : - function prototypes are now default and unavoidable *
249
+ * - removed UPROC, now assume all compilers know void *
250
+ * - removed nvector, now just int (as it always was) *
251
+ * - added extra parameter to targetcell() *
252
+ * - removed old versions which were only to skip around *
253
+ * bugs that should have been long fixed: *
254
+ * SYS_APOLLO and SYS_VAXBSD. *
255
+ * - DEFAULTOPIONS now specifies no output *
256
+ * - Removed obsolete SYS_MACLSC version *
257
+ * 21-Apr-01 : - Added code to satisfy compilation into Magma. This *
258
+ * is activated by defining NAUTY_IN_MAGMA above. *
259
+ * - The *_null routines no longer exist *
260
+ * - Default maxinvarlevel is now 1. (This has no effect *
261
+ * unless an invariant is specified.) *
262
+ * - Now labelorg has a concrete declaration in nautil.c *
263
+ * and EXTDEFS is not needed *
264
+ * 5-May-01 : - NILFUNCTION, NILSET, NILGRAPH now obsolete. Use NULL. *
265
+ * 11-Sep-01 : - setword is unsigned int in the event that UINT_MAX *
266
+ * is defined and indicates it is big enough *
267
+ * 17-Oct-01 : - major rewrite for 2.1. SYS_* variables gone! *
268
+ * Some modernity assumed, eg size_t *
269
+ * 8-Aug-02 : - removed MAKEEMPTY (use EMPTYSET instead) *
270
+ * - deleted OLDNAUTY everywhere *
271
+ * 27-Aug-02 : - converted to use autoconf. Now the original of this *
272
+ * file is nauty-h.in. Run configure to make nauty.h. *
273
+ * 20-Dec-02 : - increased INFINITY *
274
+ * some reorganization to please Magma *
275
+ * - declared nauty_freedyn() *
276
+ * 17-Nov-03 : - renamed INFINITY to NAUTY_INFINITY *
277
+ * 29-May-04 : - added definition of SETWORD_FORMAT *
278
+ * 14-Sep-04 : - extended prototypes even to recursive functions *
279
+ * 16-Oct-04 : - added DEFAULTOPTIONS_GRAPH *
280
+ * 24-Oct-04 : Starting 2.3 *
281
+ * - remove register declarations as modern compilers *
282
+ * tend to find them a nuisance *
283
+ * - Don't define the obsolete symbol INFINITY if it is *
284
+ * defined already *
285
+ * 17-Nov-04 : - make 6 counters in statsblk unsigned long *
286
+ * 17-Jan-04 : - add init() and cleanup() to dispatchvec *
287
+ * 12-Nov-05 : - Changed NAUTY_INFINITY to 2^30+2 in BIGNAUTY case *
288
+ * 22-Nov-06 : Starting 2.4 *
289
+ * - removed usertcellproc from options *
290
+ * changed bestcell to targetcell in dispatch vector *
291
+ * declare targetcell and maketargetcell *
292
+ * 29-Nov-06 : - add extraoptions to optionblk *
293
+ * - add declarations of extra_autom and extra_level *
294
+ * 10-Dec-06 : - BIGNAUTY is gone! Now permutation=shortish=int. *
295
+ * NAUTY_INFINITY only depends on whether sizeof(int)=2. *
296
+ * 27-Jun-08 : - define nauty_counter and LONG_LONG_COUNTERS *
297
+ * 30-Jun-08 : - declare version 2.4 *
298
+ * 8-Nov-09 : - final release of version 2.4; *
299
+ * 10-Nov-10 : Starting 2.5 *
300
+ * - declare shortish and permutation obsolete, now int *
301
+ * 14-Nov-10 : - SETWORDSNEEDED(n) *
302
+ * 23-May-10 : - declare densenauty() *
303
+ * 29-Jun-10 : - add PRINT_COUNTER(f,x) *
304
+ * - add DEFAULTOPTIONS_DIGRAPH() *
305
+ * 27-Mar-11 : - declare writegroupsize() *
306
+ * 14-Jan-12 : - add HAVE_TLS and TLS_ATTR *
307
+ * 21-Feb-12 : - add ENABLE_ANSI *
308
+ * 18-Mar-12 : - add COUNTER_FMT *
309
+ * 18-Aug-12 : - add ADDONEARC, ADDONEEDGE, EMPTYGRAPH *
310
+ * 29-Aug-12 : - add CLZ macros and FIRSTBITNZ *
311
+ * 19-Oct-12 : - add DEFAULT_WORDSIZE *
312
+ * 3-Jan-12 : Released 2.5rc1 *
313
+ * 18-Jan-12 : Froze 2.5 *
314
+ * 18-Jan-12 : - add NAUABORTED and NAUKILLED *
315
+ * - add nauty_kill_request *
316
+ * - add usercanonproc *
317
+ * 1-Oct-15 : - add COUNTER_FMT_RAW *
318
+ * 10-Jan-16 : - defined POPCOUNTMAC, optionally use popcnt *
319
+ * - remove SYS_CRAY, let's hope it is long obsolete *
320
+ * - add Intel popcount intrinsics for icc *
321
+ * 12-Jan-16 : - DYNFREE and CONDYNFREE now set the pointer to NULL *
322
+ * 16-Jan-16 : - Change NAUTY_INFINITY to 2 billion + 2 *
323
+ * 12-Mar-16 : - Add const to alloc_error() *
324
+ * : Froze 2.6 *
325
+ * 29-Aug-16 : - Add SWHIBIT, TAKEHIBIT and ATMOSTONEBIT *
326
+ * 10-Mar-18 : - Add SETWORD_DEC_FORMAT for decimal output *
327
+ * - Fix 64-bit SETWORD_FORMAT to use 0 padding. *
328
+ * 28-Feb-19 : - Use intrinsics for WORDSIZE=16 *
329
+ * - Macro versions of FIRSTBIT and FIRSTBITNZ are always *
330
+ * available as FIRSTBITMAC and FIRSTBITNZMAC *
331
+ * 1-Mar-19 : - Add AVOID* tests for non-POSIX header files *
332
+ * 31-Aug-19 : - Revise type size determinations to be more robust if *
333
+ * configuration wasn't done. *
334
+ * - HAVE_HWLZCNT and HAVE_HWPOPCNT can be defined at *
335
+ * compile time *
336
+ * - FIRSTBITNZ, FIRSTBIT and POPCOUNT can be defined at *
337
+ * compile time *
338
+ * 11-Oct-19 : - Move labelorg and nauty_kill_request into the *
339
+ * "C" block for C++ compatibiliy *
340
+ * 23-Mar-20 : - Don't define INFINITY even if it is absent from math.h *
341
+ * 17-Nov-20 : - Use USE_TLS for thread-local storage *
342
+ * - Define FLEX_ARRAY_OK *
343
+ * 26-Aug-21 : - Add WITHOUTHIBIT, REMOVEHIBIT *
344
+ * : Froze 2.7 *
345
+ * 9-Jan-21 : - add IS_ARM64 and change __POPCNT__ test. That *
346
+ * architecture has a vector CNT instruction that gcc *
347
+ * uses with __builtin_popcount() *
348
+ * 12-Jun-23 : nauty_counter is always unsigned long long *
349
+ * Jun-23 : Added support for WORDSIZE=128 *
350
+ * 7-Aug-23 : Added FILLSET and SETSIZE macros *
351
+ * 11-Nov-23 : Added NORET_ATTR noreturn attribute for functions *
352
+ * 9-Feb-24 : Removed groupsize1, groupsize2 and outofspace #defines *
353
+ * 22-Jan-25 : Removed extern from all external function prototypes *
354
+ * 7-Mar-25 : Reworked the no-return attribute, declare flockfile() *
355
+ * if needed, moved all function defs inside C++ wal, *
356
+ * defined _LARGEFILE_SOURCE and _FILE_OFFSET_BITS *
357
+ * if needed. *
358
+ * *
359
+ * ++++++ This file is automatically generated, don't edit it by hand! ++++++
360
+ * *
361
+ *****************************************************************************/
362
+
363
+ /*****************************************************************************
364
+ * *
365
+ * 16-bit, 32-bit and 64-bit versions can be selected by defining WORDSIZE. *
366
+ * The largest graph that can be handled has MAXN vertices. *
367
+ * Both WORDSIZE and MAXN can be defined on the command line. *
368
+ * WORDSIZE must be 16, 32 or 64; MAXN must be <= NAUTY_INFINITY-2; *
369
+ * *
370
+ * With a very slight loss of efficiency (depending on platform), nauty *
371
+ * can be compiled to dynamically allocate arrays. Predefine MAXN=0 to *
372
+ * achieve this effect, which is default behaviour from version 2.0. *
373
+ * In that case, graphs of size up to NAUTY_INFINITY-2 can be handled *
374
+ * if the memory is available. *
375
+ * *
376
+ * If only very small graphs need to be processed, use MAXN<=WORDSIZE *
377
+ * since this causes substantial code optimizations. *
378
+ * *
379
+ * Conventions and Assumptions: *
380
+ * *
381
+ * A 'setword' is the chunk of memory that is occupied by one part of *
382
+ * a set. This is assumed to be >= WORDSIZE bits in size. *
383
+ * *
384
+ * The rightmost (loworder) WORDSIZE bits of setwords are numbered *
385
+ * 0..WORDSIZE-1, left to right. It is necessary that the 2^WORDSIZE *
386
+ * setwords with the other bits zero are totally ordered under <,=,>. *
387
+ * This needs care on a 1's-complement machine. *
388
+ * *
389
+ * The int variables m and n have consistent meanings throughout. *
390
+ * Graphs have n vertices always, and sets have m setwords always. *
391
+ * *
392
+ * A 'set' consists of m contiguous setwords, whose bits are numbered *
393
+ * 0,1,2,... from left (high-order) to right (low-order), using only *
394
+ * the rightmost WORDSIZE bits of each setword. It is used to *
395
+ * represent a subset of {0,1,...,n-1} in the usual way - bit number x *
396
+ * is 1 iff x is in the subset. Bits numbered n or greater, and *
397
+ * unnumbered bits, are assumed permanently zero. *
398
+ * *
399
+ * A 'graph' consists of n contiguous sets. The i-th set represents *
400
+ * the vertices adjacent to vertex i, for i = 0,1,...,n-1. *
401
+ * *
402
+ * A 'permutation' is an array of n ints repesenting a permutation of *
403
+ * the set {0,1,...,n-1}. The value of the i-th entry is the number to *
404
+ * which i is mapped. *
405
+ * *
406
+ * If g is a graph and p is a permutation, then g^p is the graph in *
407
+ * which vertex i is adjacent to vertex j iff vertex p[i] is adjacent *
408
+ * to vertex p[j] in g. *
409
+ * *
410
+ * A partition nest is represented by a pair (lab,ptn), where lab and ptn *
411
+ * are int arrays. The "partition at level x" is the partition whose *
412
+ * cells are {lab[i],lab[i+1],...,lab[j]}, where [i,j] is a maximal *
413
+ * subinterval of [0,n-1] such that ptn[k] > x for i <= k < j and *
414
+ * ptn[j] <= x. The partition at level 0 is given to nauty by the user. *
415
+ * This is refined for the root of the tree, which has level 1. *
416
+ * *
417
+ *****************************************************************************/
418
+
419
+ #ifndef NAUTY_IN_MAGMA
420
+ #if HAVE_SYSTYPES_H && !defined(AVOID_SYS_TYPES_H)
421
+ #include <sys/types.h>
422
+ #endif
423
+ #if HAVE_UNISTD_H && !defined(AVOID_UNISTD_H)
424
+ #include <unistd.h>
425
+ #endif
426
+ #if HAVE_STDDEF_H
427
+ #include <stddef.h>
428
+ #endif
429
+ #if HAVE_STDLIB_H
430
+ #include <stdlib.h>
431
+ #endif
432
+ #if HAVE_LIMITS_H
433
+ #include <limits.h>
434
+ #endif
435
+ #if HAVE_STDINT_H
436
+ #include <stdint.h>
437
+ #endif
438
+ #if HAVE_STRING_H
439
+ #include <string.h>
440
+ #elif !defined(AVOID_STRINGS_H)
441
+ #include <strings.h>
442
+ #endif
443
+ #endif
444
+
445
+ /* Now we determine some sizes, relying on limits.h and
446
+ stdint.h first in case configuration was not done.
447
+ None of these tests are perfect, but sizeof() is not
448
+ allowed in preprocessor tests. The program nautest.c
449
+ will check these. */
450
+
451
+ #if defined(INT_MAX)
452
+ #if INT_MAX == 65535
453
+ #define SIZEOF_INT 2
454
+ #else
455
+ #define SIZEOF_INT 4
456
+ #endif
457
+ #else
458
+ #define SIZEOF_INT 4
459
+ #endif
460
+
461
+ #if defined(LONG_MAX)
462
+ #if LONG_MAX == 2147483647L
463
+ #define SIZEOF_LONG 4
464
+ #else
465
+ #define SIZEOF_LONG 8
466
+ #endif
467
+ #else
468
+ #define SIZEOF_LONG 8
469
+ #endif
470
+
471
+ #if defined(LLONG_MAX)
472
+ #define SIZEOF_LONG_LONG 8
473
+ #else
474
+ #define SIZEOF_LONG_LONG 8 /* 0 if nonexistent */
475
+ #endif
476
+
477
+ #if defined(_MSC_VER)
478
+ #define SIZEOF_UNINT128 0
479
+ #define SIZEOF_UINT128_T 0
480
+ #else
481
+ /* These sizes will be 0 if the type doesn't exist or is disabled */
482
+ #define SIZEOF_UNINT128 16
483
+ #define SIZEOF_UINT128_T 16
484
+ #endif
485
+
486
+ #if defined(_WIN64)
487
+ #define SIZEOF_POINTER 8
488
+ #elif defined(_WIN32)
489
+ #define SIZEOF_POINTER 4
490
+ #elif defined(UINTPTR_MAX) && UINTPTRMAX == 4294967295UL
491
+ #define SIZEOF_POINTER 4
492
+ #else
493
+ #define SIZEOF_POINTER 8
494
+ #endif
495
+
496
+ /* WORDSIZE is the number of set elements per setword (16, 32 or 64).
497
+ WORDSIZE and setword are defined as follows:
498
+
499
+ DEFAULT_WORDSIZE is usually 0 but is set by the configure script
500
+ to NN if --enable-wordsize=NN is used, where NN is 16, 32 or 64.
501
+
502
+ If WORDSIZE is not defined, but DEFAULT_WORDSIZE > 0, then set
503
+ WORDSIZE to the same value as DEFAULT_WORDSIZE.
504
+ If WORDSIZE is so far undefined, use 32 unless longs have more
505
+ than 32 bits, in which case use 64.
506
+ Define setword thus:
507
+ WORDSIZE==16 : unsigned short
508
+ WORDSIZE==32 : unsigned int unless it is too small,
509
+ in which case unsigned long
510
+ WORDSIZE==64 : the first of unsigned int, unsigned long,
511
+ unsigned long long which is large enough.
512
+ WORDSIZE==128 : __uint128_t or unsigned __int128
513
+ */
514
+
515
+ #ifdef NAUTY_IN_MAGMA
516
+ #undef WORDSIZE
517
+ #define WORDSIZE WORDBITS
518
+ #endif
519
+
520
+ #ifndef WORDSIZE
521
+ #if DEFAULT_WORDSIZE > 0
522
+ #define WORDSIZE DEFAULT_WORDSIZE
523
+ #endif
524
+ #endif
525
+
526
+ #ifdef WORDSIZE
527
+
528
+ #if (WORDSIZE != 16) && (WORDSIZE != 32) && (WORDSIZE != 64) && (WORDSIZE != 128)
529
+ #error "WORDSIZE must be 16, 32, 64 or 128"
530
+ #endif
531
+
532
+ #else /* WORDSIZE undefined */
533
+
534
+ #if SIZEOF_LONG>4
535
+ #define WORDSIZE 64
536
+ #else
537
+ #define WORDSIZE 32
538
+ #endif
539
+
540
+ #endif /* WORDSIZE */
541
+
542
+ #ifdef NAUTY_IN_MAGMA
543
+ typedef t_uint setword;
544
+ #define SETWORD_INT /* Don't assume this is correct in Magma. */
545
+
546
+ #else /* NAUTY_IN_MAGMA */
547
+
548
+ #if WORDSIZE==16
549
+ typedef unsigned short setword;
550
+ #define SETWORD_SHORT
551
+ #endif
552
+
553
+ #if WORDSIZE==32
554
+ #if SIZEOF_INT>=4
555
+ typedef unsigned int setword;
556
+ #define SETWORD_INT
557
+ #else
558
+ typedef unsigned long setword;
559
+ #define SETWORD_LONG
560
+ #endif
561
+ #endif
562
+
563
+ #if WORDSIZE==64
564
+ #if SIZEOF_INT>=8
565
+ typedef unsigned int setword;
566
+ #define SETWORD_INT
567
+ #else
568
+ #if SIZEOF_LONG>=8
569
+ typedef unsigned long setword;
570
+ #define SETWORD_LONG
571
+ #else
572
+ typedef unsigned long long setword;
573
+ #define SETWORD_LONGLONG
574
+ #endif
575
+ #endif
576
+ #endif
577
+
578
+ #if WORDSIZE==128
579
+ #if SIZEOF_UNINT128!=16 && SIZEOF_UINT128_T!=16
580
+ #error WORDSIZE=128 but no unsigned type of length 128 found
581
+ #endif
582
+ #if SIZEOF_UNINT128==16
583
+ typedef unsigned __int128 setword;
584
+ #define SETWORD_128
585
+ #else
586
+ typedef __uint128_t setword;
587
+ #define SETWORD_128
588
+ #endif
589
+
590
+ /* There is no syntax for a 128-bit constant, so we use a macro that
591
+ puts together two 64-bit constants. By the ansi-C standard this is
592
+ legal for initializers, but there could be trouble if you try to
593
+ use it in pre-processing conditionals like #if. */
594
+ #define SETWORD_128
595
+ #define C128(a,b) (((setword)(a)<<64) | (setword)(b))
596
+ #endif
597
+
598
+ #endif /* NAUTY_IN_MAGMA else */
599
+
600
+ typedef unsigned long long nauty_counter;
601
+ #define LONG_LONG_COUNTERS 1
602
+ #define COUNTER_FMT "%llu"
603
+ #define COUNTER_FMT_RAW "llu"
604
+ #define PRINT_COUNTER(f,x) fprintf(f,COUNTER_FMT,x)
605
+
606
+ #define NAUTYVERSIONID (29300+HAVE_TLS) /* 10000*version + HAVE_TLS */
607
+ #define NAUTYREQUIRED NAUTYVERSIONID /* Minimum compatible version */
608
+
609
+ #if WORDSIZE==16
610
+ #define NAUTYVERSION "2.9.3 (16 bits)"
611
+ #elif WORDSIZE==32
612
+ #define NAUTYVERSION "2.9.3 (32 bits)"
613
+ #elif WORDSIZE==64
614
+ #define NAUTYVERSION "2.9.3 (64 bits)"
615
+ #elif WORDSIZE==128
616
+ #define NAUTYVERSION "2.9.3 (128 bits)"
617
+ #endif
618
+
619
+ #ifndef MAXN /* maximum allowed n value; use 0 for dynamic sizing. */
620
+ #define MAXN 0
621
+ #define MAXM 0
622
+ #else
623
+ #define MAXM ((MAXN+WORDSIZE-1)/WORDSIZE) /* max setwords in a set */
624
+ #endif /* MAXN */
625
+
626
+ /* Starting at version 2.2, set operations work for all set sizes unless
627
+ ONE_WORD_SETS is defined. In the latter case, if MAXM=1, set ops
628
+ work only for single-setword sets. In any case, macro versions
629
+ ending with 1 work for single-setword sets and versions ending with
630
+ 0 work for all set sizes.
631
+ */
632
+
633
+ #if WORDSIZE==16
634
+ #define SETWD(pos) ((pos)>>4) /* number of setword containing bit pos */
635
+ #define SETBT(pos) ((pos)&0xF) /* position within setword of bit pos */
636
+ #define TIMESWORDSIZE(w) ((w)<<4)
637
+ #define SETWORDSNEEDED(n) ((((n)-1)>>4)+1) /* setwords needed for n bits */
638
+ #endif
639
+
640
+ #if WORDSIZE==32
641
+ #define SETWD(pos) ((pos)>>5)
642
+ #define SETBT(pos) ((pos)&0x1F)
643
+ #define TIMESWORDSIZE(w) ((w)<<5)
644
+ #define SETWORDSNEEDED(n) ((((n)-1)>>5)+1)
645
+ #endif
646
+
647
+ #if WORDSIZE==64
648
+ #define SETWD(pos) ((pos)>>6)
649
+ #define SETBT(pos) ((pos)&0x3F)
650
+ #define TIMESWORDSIZE(w) ((w)<<6) /* w*WORDSIZE */
651
+ #define SETWORDSNEEDED(n) ((((n)-1)>>6)+1)
652
+ #endif
653
+
654
+ #if WORDSIZE==128
655
+ #define SETWD(pos) ((pos)>>7)
656
+ #define SETBT(pos) ((pos)&0x7F)
657
+ #define TIMESWORDSIZE(w) ((w)<<7) /* w*WORDSIZE */
658
+ #define SETWORDSNEEDED(n) ((((n)-1)>>7)+1)
659
+ #endif
660
+
661
+ #ifdef NAUTY_IN_MAGMA
662
+ #define BITT bs_bit
663
+ #else
664
+ #define BITT bit
665
+ #endif
666
+
667
+ #define ADDELEMENT1(setadd,pos) (*(setadd) |= BITT[pos])
668
+ #define DELELEMENT1(setadd,pos) (*(setadd) &= ~BITT[pos])
669
+ #define FLIPELEMENT1(setadd,pos) (*(setadd) ^= BITT[pos])
670
+ #define ISELEMENT1(setadd,pos) ((*(setadd) & BITT[pos]) != 0)
671
+ #define EMPTYSET1(setadd,m) *(setadd) = 0;
672
+ #define GRAPHROW1(g,v,m) ((set*)(g)+(v))
673
+ #define ADDONEARC1(g,v,w,m) (g)[v] |= BITT[w]
674
+ #define ADDONEEDGE1(g,v,w,m) { ADDONEARC1(g,v,w,m); ADDONEARC1(g,w,v,m); }
675
+ #define DELONEARC1(g,v,w,m) (g)[v] &= ~BITT[w]
676
+ #define DELONEEDGE1(g,v,w,m) { DELONEARC1(g,v,w,m); DELONEARC1(g,w,v,m); }
677
+ #define EMPTYGRAPH1(g,m,n) EMPTYSET0(g,n) /* really EMPTYSET0 */
678
+
679
+ #define ADDELEMENT0(setadd,pos) ((setadd)[SETWD(pos)] |= BITT[SETBT(pos)])
680
+ #define DELELEMENT0(setadd,pos) ((setadd)[SETWD(pos)] &= ~BITT[SETBT(pos)])
681
+ #define FLIPELEMENT0(setadd,pos) ((setadd)[SETWD(pos)] ^= BITT[SETBT(pos)])
682
+ #define ISELEMENT0(setadd,pos) (((setadd)[SETWD(pos)] & BITT[SETBT(pos)]) != 0)
683
+ #define EMPTYSET0(setadd,m) \
684
+ {setword *es_; \
685
+ for (es_ = (setword*)(setadd)+(m); es_ > (setword*)(setadd);) *--es_=0;}
686
+ #define GRAPHROW0(g,v,m) ((set*)(g) + (m)*(size_t)(v))
687
+ #define ADDONEARC0(g,v,w,m) ADDELEMENT0(GRAPHROW0(g,v,m),w)
688
+ #define ADDONEEDGE0(g,v,w,m) { ADDONEARC0(g,v,w,m); ADDONEARC0(g,w,v,m); }
689
+ #define DELONEARC0(g,v,w,m) DELELEMENT0(GRAPHROW0(g,v,m),w)
690
+ #define DELONEEDGE0(g,v,w,m) { DELONEARC0(g,v,w,m); DELONEARC0(g,w,v,m); }
691
+ #define EMPTYGRAPH0(g,m,n) EMPTYSET0(g,(m)*(size_t)(n))
692
+
693
+ #if (MAXM==1) && defined(ONE_WORD_SETS)
694
+ #define ADDELEMENT ADDELEMENT1
695
+ #define DELELEMENT DELELEMENT1
696
+ #define FLIPELEMENT FLIPELEMENT1
697
+ #define ISELEMENT ISELEMENT1
698
+ #define EMPTYSET EMPTYSET1
699
+ #define GRAPHROW GRAPHROW1
700
+ #define ADDONEARC ADDONEARC1
701
+ #define ADDONEEDGE ADDONEEDGE1
702
+ #define DELONEARC DELONEARC1
703
+ #define DELONEEDGE DELONEEDGE1
704
+ #define EMPTYGRAPH EMPTYGRAPH1
705
+ #define FILLSET(setadd,m,n) { *(setword*)(setadd) = ALLMASK(n); }
706
+ #define SETSIZE(sz,setadd,m) { setword s__=*(setadd); (sz) = POPCOUNT(s__); }
707
+ #else
708
+ #define ADDELEMENT ADDELEMENT0
709
+ #define DELELEMENT DELELEMENT0
710
+ #define FLIPELEMENT FLIPELEMENT0
711
+ #define ISELEMENT ISELEMENT0
712
+ #define EMPTYSET EMPTYSET0
713
+ #define GRAPHROW GRAPHROW0
714
+ #define ADDONEARC ADDONEARC0
715
+ #define ADDONEEDGE ADDONEEDGE0
716
+ #define DELONEARC DELONEARC0
717
+ #define DELONEEDGE DELONEEDGE0
718
+ #define EMPTYGRAPH EMPTYGRAPH0
719
+ #define FILLSET(setadd,m,n) {int i_,t_; t_=(n)/WORDSIZE; \
720
+ for (i_ = 0; i_ < t_; ++i_) (setadd)[i_]=ALLBITS; \
721
+ if ((t_=(n)-t_*WORDSIZE)>0) (setadd)[i_++]=ALLMASK(t_); \
722
+ for (;i_ < m; ++i_) (setadd)[i_] = 0; }
723
+ #define SETSIZE(sz,setadd,m) { set s__,*s_; size_t sz_=0; \
724
+ for (s_ = (set*)(setadd)+(m); s_ > (set*)(setadd); ) \
725
+ { s__=*--s_; sz_ += POPCOUNT(s__); } (sz) = sz_; }
726
+ #endif
727
+
728
+
729
+ #ifdef NAUTY_IN_MAGMA
730
+ #undef EMPTYSET
731
+ #define EMPTYSET(setadd,m) {t_int _i; bsp_makeempty(setadd,m,_i);}
732
+ #endif
733
+
734
+ #define NOTSUBSET(word1,word2) ((word1) & ~(word2)) /* test if the 1-bits
735
+ in setword word1 do not form a subset of those in word2 */
736
+ #define INTERSECT(word1,word2) ((word1) &= (word2)) /* AND word2 into word1 */
737
+ #define UNION(word1,word2) ((word1) |= (word2)) /* OR word2 into word1 */
738
+ #define SETDIFF(word1,word2) ((word1) &= ~(word2)) /* - word2 into word1 */
739
+ #define XOR(word1,word2) ((word1) ^= (word2)) /* XOR word2 into word1 */
740
+ #define ZAPBIT(word,x) ((word) &= ~BITT[x]) /* delete bit x in setword */
741
+ #define TAKEBIT(iw,w) {(iw) = FIRSTBITNZ(w); (w) ^= BITT[iw];}
742
+
743
+ #define SWHIBIT(w) ((w)&(-(w))) /* Lowest order bit of unsigned type */
744
+ #define REMOVEHIBIT(bit,w) {(bit) = SWHIBIT(w); (w) ^= (bit);}
745
+ #define ATMOSTONEBIT(w) (((w)&(-(w)))==(w)) /* True if |w| <= 1 */
746
+ #define WITHOUTHIBIT(w) ((w)&((w)-1)) /* w without the lowest order bit */
747
+
748
+ #ifdef SETWORD_LONGLONG
749
+ #define MSK3232 0xFFFFFFFF00000000ULL
750
+ #define MSK1648 0xFFFF000000000000ULL
751
+ #define MSK0856 0xFF00000000000000ULL
752
+ #define MSK1632 0x0000FFFF00000000ULL
753
+ #define MSK0840 0xFF0000000000ULL
754
+ #define MSK1616 0xFFFF0000ULL
755
+ #define MSK0824 0xFF000000ULL
756
+ #define MSK0808 0xFF00ULL
757
+ #define MSK63C 0x7FFFFFFFFFFFFFFFULL
758
+ #define MSK31C 0x7FFFFFFFULL
759
+ #define MSK15C 0x7FFFULL
760
+ #define MSK64 0xFFFFFFFFFFFFFFFFULL
761
+ #define MSK32 0xFFFFFFFFULL
762
+ #define MSK16 0xFFFFULL
763
+ #define MSK8 0xFFULL
764
+ #endif
765
+
766
+ #ifdef SETWORD_LONG
767
+ #define MSK3232 0xFFFFFFFF00000000UL
768
+ #define MSK1648 0xFFFF000000000000UL
769
+ #define MSK0856 0xFF00000000000000UL
770
+ #define MSK1632 0x0000FFFF00000000UL
771
+ #define MSK0840 0xFF0000000000UL
772
+ #define MSK1616 0xFFFF0000UL
773
+ #define MSK0824 0xFF000000UL
774
+ #define MSK0808 0xFF00UL
775
+ #define MSK63C 0x7FFFFFFFFFFFFFFFUL
776
+ #define MSK31C 0x7FFFFFFFUL
777
+ #define MSK15C 0x7FFFUL
778
+ #define MSK64 0xFFFFFFFFFFFFFFFFUL
779
+ #define MSK32 0xFFFFFFFFUL
780
+ #define MSK16 0xFFFFUL
781
+ #define MSK8 0xFFUL
782
+ #endif
783
+
784
+ #if defined(SETWORD_INT) || defined(SETWORD_SHORT)
785
+ #define MSK3232 0xFFFFFFFF00000000U
786
+ #define MSK1648 0xFFFF000000000000U
787
+ #define MSK0856 0xFF00000000000000U
788
+ #define MSK1632 0x0000FFFF00000000U
789
+ #define MSK0840 0xFF0000000000U
790
+ #define MSK1616 0xFFFF0000U
791
+ #define MSK0824 0xFF000000U
792
+ #define MSK0808 0xFF00U
793
+ #define MSK63C 0x7FFFFFFFFFFFFFFFU
794
+ #define MSK31C 0x7FFFFFFFU
795
+ #define MSK15C 0x7FFFU
796
+ #define MSK64 0xFFFFFFFFFFFFFFFFU
797
+ #define MSK32 0xFFFFFFFFU
798
+ #define MSK16 0xFFFFU
799
+ #define MSK8 0xFFU
800
+ #endif
801
+
802
+ #if defined(SETWORD_LONGLONG)
803
+ #define SETWORD_DEC_FORMAT "%llu"
804
+ #if WORDSIZE==16
805
+ #define SETWORD_FORMAT "%04llx"
806
+ #endif
807
+ #if WORDSIZE==32
808
+ #define SETWORD_FORMAT "%08llx"
809
+ #endif
810
+ #if WORDSIZE==64
811
+ #define SETWORD_FORMAT "%016llx"
812
+ #endif
813
+ #endif
814
+
815
+ #if defined(SETWORD_LONG)
816
+ #define SETWORD_DEC_FORMAT "%lu"
817
+ #if WORDSIZE==16
818
+ #define SETWORD_FORMAT "%04lx"
819
+ #endif
820
+ #if WORDSIZE==32
821
+ #define SETWORD_FORMAT "%08lx"
822
+ #endif
823
+ #if WORDSIZE==64
824
+ #define SETWORD_FORMAT "%016lx"
825
+ #endif
826
+ #endif
827
+
828
+ #if defined(SETWORD_INT)
829
+ #define SETWORD_DEC_FORMAT "%u"
830
+ #if WORDSIZE==16
831
+ #define SETWORD_FORMAT "%04x"
832
+ #endif
833
+ #if WORDSIZE==32
834
+ #define SETWORD_FORMAT "%08x"
835
+ #endif
836
+ #if WORDSIZE==64
837
+ #define SETWORD_FORMAT "%016x"
838
+ #endif
839
+ #endif
840
+
841
+ #if defined(SETWORD_SHORT)
842
+ #define SETWORD_DEC_FORMAT "%hu"
843
+ #if WORDSIZE==16
844
+ #define SETWORD_FORMAT "%04hx"
845
+ #endif
846
+ #if WORDSIZE==32
847
+ #define SETWORD_FORMAT "%08hx"
848
+ #endif
849
+ #if WORDSIZE==64
850
+ #define SETWORD_FORMAT "%016hx"
851
+ #endif
852
+ #endif
853
+
854
+ /* POPCOUNT(x) = number of 1-bits in a setword x
855
+ POPCOUNTMAC(x) = Macro version of POPCOUNT
856
+ FIRSTBIT(x) = number of first 1-bit in non-zero setword (0..WORDSIZE-1)
857
+ or WORDSIZE if x == 0
858
+ FIRSTBITNZ(x) = as FIRSTBIT(x) but assumes x is not zero
859
+ BITMASK(x) = setword whose rightmost WORDSIZE-x-1 (numbered) bits
860
+ are 1 and the rest 0 (0 <= x < WORDSIZE)
861
+ (I.e., bits 0..x are unselected and the rest selected.)
862
+ Note: BITMASK(WORDSIZE) is erroneous!
863
+ ALLBITS = all (numbered) bits in a setword */
864
+
865
+ #if WORDSIZE==64
866
+ #define POPCOUNTMAC(x) (bytecount[(x)>>56 & 0xFF] + bytecount[(x)>>48 & 0xFF] \
867
+ + bytecount[(x)>>40 & 0xFF] + bytecount[(x)>>32 & 0xFF] \
868
+ + bytecount[(x)>>24 & 0xFF] + bytecount[(x)>>16 & 0xFF] \
869
+ + bytecount[(x)>>8 & 0xFF] + bytecount[(x) & 0xFF])
870
+ #define FIRSTBITMAC(x) ((x) & MSK3232 ? \
871
+ (x) & MSK1648 ? \
872
+ (x) & MSK0856 ? \
873
+ 0+leftbit[((x)>>56) & MSK8] : \
874
+ 8+leftbit[(x)>>48] \
875
+ : (x) & MSK0840 ? \
876
+ 16+leftbit[(x)>>40] : \
877
+ 24+leftbit[(x)>>32] \
878
+ : (x) & MSK1616 ? \
879
+ (x) & MSK0824 ? \
880
+ 32+leftbit[(x)>>24] : \
881
+ 40+leftbit[(x)>>16] \
882
+ : (x) & MSK0808 ? \
883
+ 48+leftbit[(x)>>8] : \
884
+ 56+leftbit[x])
885
+ #define BITMASK(x) (MSK63C >> (x))
886
+ #define ALLBITS MSK64
887
+ #endif
888
+
889
+ #if WORDSIZE==32
890
+ #define POPCOUNTMAC(x) (bytecount[(x)>>24 & 0xFF] + bytecount[(x)>>16 & 0xFF] \
891
+ + bytecount[(x)>>8 & 0xFF] + bytecount[(x) & 0xFF])
892
+ #define FIRSTBITMAC(x) ((x) & MSK1616 ? ((x) & MSK0824 ? \
893
+ leftbit[((x)>>24) & MSK8] : 8+leftbit[(x)>>16]) \
894
+ : ((x) & MSK0808 ? 16+leftbit[(x)>>8] : 24+leftbit[x]))
895
+ #define BITMASK(x) (MSK31C >> (x))
896
+ #define ALLBITS MSK32
897
+ #endif
898
+
899
+ #if WORDSIZE==16
900
+ #define POPCOUNTMAC(x) (bytecount[(x)>>8 & 0xFF] + bytecount[(x) & 0xFF])
901
+ #define FIRSTBITMAC(x) ((x) & MSK0808 ? leftbit[((x)>>8) & MSK8] : 8+leftbit[x])
902
+ #define BITMASK(x) ((setword)(MSK15C >> (x)))
903
+ #define ALLBITS ((setword)MSK16)
904
+ #endif
905
+
906
+ #if WORDSIZE==128
907
+ #define MASK128L C128(0xFFFFFFFFFFFFFFFFULL,0)
908
+ #define MASK128R C128(0,0xFFFFFFFFFFFFFFFFULL)
909
+ #define MASK128LL C128(0xFFFFFFFF00000000ULL,0)
910
+ #define MASK128RL C128(0,0xFFFFFFFF00000000ULL)
911
+ #define POPCOUNTMAC(x) \
912
+ (bytecount[(x)>>120 & 0xFF] + bytecount[(x)>>112 & 0xFF] \
913
+ + bytecount[(x)>>104 & 0xFF] + bytecount[(x)>>96 & 0xFF] \
914
+ + bytecount[(x)>>88 & 0xFF] + bytecount[(x)>>80 & 0xFF] \
915
+ + bytecount[(x)>>72 & 0xFF] + bytecount[(x)>>64 & 0xFF] \
916
+ + bytecount[(x)>>56 & 0xFF] + bytecount[(x)>>48 & 0xFF] \
917
+ + bytecount[(x)>>40 & 0xFF] + bytecount[(x)>>32 & 0xFF] \
918
+ + bytecount[(x)>>24 & 0xFF] + bytecount[(x)>>16 & 0xFF] \
919
+ + bytecount[(x)>>8 & 0xFF] + bytecount[(x) & 0xFF])
920
+ #define FIRSTBIT_32(x) ((x) & 0xFFFF0000 ? ((x) & 0xFF000000 ? \
921
+ leftbit[((x)>>24) & 0xFF] : 8+leftbit[(x)>>16]) \
922
+ : ((x) & 0xFF00U ? 16+leftbit[(x)>>8] : 24+leftbit[x]))
923
+ #define FIRSTBITMAC(x) (((x)&MASK128L) \
924
+ ? (((x)&MASK128LL) ? FIRSTBIT_32((unsigned)((x)>>96)) \
925
+ : 32 + FIRSTBIT_32((unsigned)((x)>>64))) \
926
+ : (((x)&MASK128RL) ? 64 + FIRSTBIT_32((unsigned)((x)>>32)) \
927
+ : 96 + FIRSTBIT_32((unsigned)((x)))))
928
+ #define BITMASK(x) (C128(0x7FFFFFFFFFFFFFFFULL,0xFFFFFFFFFFFFFFFFULL) >> (x))
929
+ #define ALLBITS C128(0xFFFFFFFFFFFFFFFFULL,0xFFFFFFFFFFFFFFFFULL)
930
+ #endif
931
+
932
+ #define FIRSTBITNZMAC FIRSTBITMAC
933
+
934
+ /* Use clz instructions if available */
935
+
936
+ #ifndef FIRSTBITNZ /* Can be defined outside */
937
+
938
+ #ifdef NAUTY_IN_MAGMA
939
+ #define FIRSTBITNZ(x) bs_firstbit(x)
940
+
941
+ #elif defined(_MSC_VER)
942
+ #if _MSC_VER >= 1800
943
+ #include <intrin.h>
944
+ #else
945
+ #include <x86intrin.h>
946
+ #endif
947
+
948
+ #if HAVE_HWLZCNT
949
+
950
+ #if WORDSIZE==64 && defined(_WIN64)
951
+ #define FIRSTBITNZ(x) (int)_lzcnt_u64(x)
952
+ #elif WORDSIZE==32
953
+ #define FIRSTBITNZ(x) (int)_lzcnt_u32(x)
954
+ #else
955
+ #define FIRSTBITNZ(x) (int)_lzcnt16(x)
956
+ #endif
957
+
958
+ #else /* not HAVE_HWLZCNT */
959
+
960
+ #if WORDSIZE==64 && defined(_WIN64)
961
+ static int msc_bsr_64(setword x) \
962
+ { unsigned long *p; \
963
+ _BitScanReverse64(&p,x); return 63 - *p; }
964
+ #define FIRSTBITNZ(x) (msc_bsr_64(x))
965
+ #elif WORDSIZE==32
966
+ #pragma intrinsic(_BitScanReverse)
967
+ static int msc_bsr_32(setword x) \
968
+ { unsigned *p; \
969
+ _BitScanReverse(&p,x); return 31 - *p; }
970
+ #define FIRSTBITNZ(x) (msc_bsr_32(x))
971
+ #elif WORDSIZE==16
972
+ #pragma intrinsic(_BitScanReverse)
973
+ static int msc_bsr_16(setword x) \
974
+ { unsigned long *p; \
975
+ _BitScanReverse(&p,(unsigned long)x); return 15 - *p; }
976
+ #define FIRSTBITNZ(x) (msc_bsr_16(x))
977
+ #endif /* WORDSIZE choice */
978
+
979
+ #endif /* HAVE_HWLZCNT choice */
980
+
981
+ #else /* Not MAGMA or WIN */
982
+
983
+ #if HAVE_HWLZCNT
984
+ #if defined(SETWORD_LONGLONG) && HAVE_CLZLL
985
+ #define FIRSTBITNZ(x) __builtin_clzll(x)
986
+ #elif defined(SETWORD_LONG) && HAVE_CLZL
987
+ #define FIRSTBITNZ(x) __builtin_clzl(x)
988
+ #elif defined(SETWORD_INT) && HAVE_CLZ
989
+ #define FIRSTBITNZ(x) __builtin_clz(x)
990
+ #elif defined(SETWORD_SHORT) && HAVE_CLZ
991
+ #define FIRSTBITNZ(x) (__builtin_clz((unsigned int)(x)) - 16)
992
+ #elif defined(SETWORD_128) && HAVE_CLZLL
993
+ #define FIRSTBITNZ(x) (((x)&MASK128L) ? \
994
+ __builtin_clzll((unsigned long long)((x)>>64)) : \
995
+ 64 + __builtin_clzll((unsigned long long)((x)&MASK128R)))
996
+ #endif /* size choice */
997
+ #endif /* HAVE_HWLZCNT */
998
+
999
+ #endif /* MAGMA-WIN-OTHER choice */
1000
+
1001
+ #endif /* ifndef FIRSTBITNZ */
1002
+
1003
+ /* Now fall back on macros for things not defined */
1004
+ #if defined(FIRSTBITNZ) && !defined(FIRSTBIT)
1005
+ #define FIRSTBIT(x) ((x) ? FIRSTBITNZ(x) : WORDSIZE)
1006
+ #else
1007
+ #ifndef FIRSTBITNZ
1008
+ #define FIRSTBITNZ FIRSTBITNZMAC
1009
+ #endif
1010
+ #ifndef FIRSTBIT
1011
+ #define FIRSTBIT FIRSTBITMAC
1012
+ #endif
1013
+ #endif
1014
+
1015
+ /* Use popcount instructions if available */
1016
+
1017
+ #ifndef POPCOUNT /* Can be defined outside */
1018
+
1019
+ #ifdef NAUTY_IN_MAGMA
1020
+ #undef BITMASK
1021
+ #define POPCOUNT(x) bs_popcount(x)
1022
+ #define BITMASK(x) bs_bitmask(x)
1023
+
1024
+ #elif defined(_MSC_VER)
1025
+ #if _MSC_VER >= 1800
1026
+ #include <intrin.h>
1027
+ #else
1028
+ #include <x86intrin.h>
1029
+ #endif
1030
+ #if WORDSIZE==128
1031
+ #pragma instrinsic(_mm_popcnt_u64)
1032
+ #define POPCOUNT(x) ((int)_mm_popcnt_u64((unsigned long long)((x)>>64)) \
1033
+ + (int)_mm_popcnt_u64((unsigned long long)((x)&MASK128R)))
1034
+ #elif WORDSIZE==64
1035
+ #pragma instrinsic(_mm_popcnt_u64)
1036
+ #define POPCOUNT(x) ((int)_mm_popcnt_u64(x))
1037
+ #elif WORDSIZE==32
1038
+ #pragma instrinsic(_mm_popcnt_u32)
1039
+ #define POPCOUNT(x) _mm_popcnt_u32(x)
1040
+ #elif WORDSIZE==16
1041
+ #pragma instrinsic(_mm_popcnt_u32)
1042
+ #define POPCOUNT(x) _mm_popcnt_u32((unsigned int)(x))
1043
+ #endif
1044
+
1045
+ #elif defined(__INTEL_COMPILER)
1046
+ #include <nmmintrin.h>
1047
+ #if WORDSIZE==128 && HAVE_MMPOP64
1048
+ #define POPCOUNT(x) ((int)_mm_popcnt_u64((unsigned long long)((x)>>64)) \
1049
+ + (int)_mm_popcnt_u64((unsigned long long)((x)&MASK128R)))
1050
+ #elif WORDSIZE==64 && HAVE_MMPOP64
1051
+ #define POPCOUNT(x) ((int)_mm_popcnt_u64(x))
1052
+ #elif WORDSIZE==32 && HAVE_MMPOP32
1053
+ #define POPCOUNT(x) _mm_popcnt_u32(x)
1054
+ #elif WORDSIZE==16 && HAVE_MMPOP32
1055
+ #define POPCOUNT(x) _mm_popcnt_u32((unsigned int)(x))
1056
+ #endif
1057
+
1058
+ /* Note that, unlike icc, gcc will not use the POPCNT instruction
1059
+ without permission, in which case it defines __POPCNT__
1060
+ except on Apple M1 hardware. */
1061
+ #elif defined(__POPCNT__) || IS_ARM64
1062
+ #if defined(SETWORD_LONGLONG) && HAVE_POPCNTLL
1063
+ #define POPCOUNT(x) __builtin_popcountll(x)
1064
+ #elif defined(SETWORD_LONG) && HAVE_POPCNTL
1065
+ #define POPCOUNT(x) __builtin_popcountl(x)
1066
+ #elif defined(SETWORD_INT) && HAVE_POPCNT
1067
+ #define POPCOUNT(x) __builtin_popcount(x)
1068
+ #elif defined(SETWORD_SHORT) && HAVE_POPCNT
1069
+ #define POPCOUNT(x) __builtin_popcount((unsigned int)(x))
1070
+ #elif defined(SETWORD_128) && HAVE_POPCNTLL
1071
+ #define POPCOUNT(x) (__builtin_popcountll((unsigned long long)((x)>>64)) \
1072
+ + __builtin_popcountll((unsigned long long)((x)&MASK128R)))
1073
+ #endif
1074
+ #endif
1075
+
1076
+ /* Fall-back position */
1077
+ #ifndef POPCOUNT
1078
+ #define POPCOUNT POPCOUNTMAC
1079
+ #endif
1080
+
1081
+ #endif /* ifndef POPCOUNT */
1082
+
1083
+ #define ALLMASK(n) ((setword)((n)?~BITMASK((n)-1):0)) /* First n bits */
1084
+
1085
+ /* various constants: */
1086
+ #undef FALSE
1087
+ #undef TRUE
1088
+ #define FALSE 0
1089
+ #define TRUE 1
1090
+
1091
+ #if SIZEOF_INT>=4
1092
+ #define NAUTY_INFINITY 2000000002 /* Max graph size is 2 billion */
1093
+ #else
1094
+ #define NAUTY_INFINITY 0x7FFF
1095
+ #endif
1096
+
1097
+ /* The following four types are obsolete, use int in new code. */
1098
+ typedef int shortish;
1099
+ typedef int permutation;
1100
+ typedef int nvector,np2vector;
1101
+
1102
+ #if MAXN > NAUTY_INFINITY-2
1103
+ #error MAXN must be at most NAUTY_INFINITY-2
1104
+ #endif
1105
+
1106
+ /* typedefs for sets, graphs, permutations, etc.: */
1107
+
1108
+ typedef int boolean; /* boolean MUST be the same as int */
1109
+
1110
+ #define UPROC void /* obsolete */
1111
+
1112
+ typedef setword set,graph;
1113
+ #ifdef NAUTY_IN_MAGMA
1114
+ typedef graph nauty_graph;
1115
+ typedef set nauty_set;
1116
+ #endif
1117
+
1118
+ typedef struct
1119
+ {
1120
+ double grpsize1; /* size of group is */
1121
+ int grpsize2; /* grpsize1 * 10^grpsize2 */
1122
+ /* #define groupsize1 grpsize1 for backwards compatibility */
1123
+ /* #define groupsize2 grpsize2 for backwards compatibility */
1124
+ int numorbits; /* number of orbits in group */
1125
+ int numgenerators; /* number of generators found */
1126
+ int errstatus; /* if non-zero : an error code */
1127
+ /* #define outofspace errstatus; for backwards compatibility */
1128
+ unsigned long numnodes; /* total number of nodes */
1129
+ unsigned long numbadleaves; /* number of leaves of no use */
1130
+ int maxlevel; /* maximum depth of search */
1131
+ unsigned long tctotal; /* total size of all target cells */
1132
+ unsigned long canupdates; /* number of updates of best label */
1133
+ unsigned long invapplics; /* number of applications of invarproc */
1134
+ unsigned long invsuccesses; /* number of successful uses of invarproc() */
1135
+ int invarsuclevel; /* least level where invarproc worked */
1136
+ } statsblk;
1137
+
1138
+ /* codes for errstatus field (see nauty.c for more accurate descriptions): */
1139
+ /* 0 is normal - no error */
1140
+ #define NTOOBIG 1 /* n > MAXN or n > WORDSIZE*m */
1141
+ #define MTOOBIG 2 /* m > MAXM */
1142
+ #define CANONGNIL 3 /* canong = NULL, but getcanon = TRUE */
1143
+ #define NAUABORTED 4 /* nauty is terminated early under program control */
1144
+ #define NAUKILLED 5 /* nauty is terminated early by caught signal */
1145
+
1146
+ /* manipulation of real approximation to group size */
1147
+ #define MULTIPLY(s1,s2,i) if ((s1 *= i) >= 1e10) {s1 /= 1e10; s2 += 10;}
1148
+
1149
+ struct optionstruct; /* incomplete definition */
1150
+
1151
+ typedef struct
1152
+ {
1153
+ boolean (*isautom) /* test for automorphism */
1154
+ (graph*,int*,boolean,int,int);
1155
+ int (*testcanlab) /* test for better labelling */
1156
+ (graph*,graph*,int*,int*,int,int);
1157
+ void (*updatecan) /* update canonical object */
1158
+ (graph*,graph*,int*,int,int,int);
1159
+ void (*refine) /* refine partition */
1160
+ (graph*,int*,int*,int,int*,int*,set*,int*,int,int);
1161
+ void (*refine1) /* refine partition, MAXM==1 */
1162
+ (graph*,int*,int*,int,int*,int*,set*,int*,int,int);
1163
+ boolean (*cheapautom) /* test for easy automorphism */
1164
+ (int*,int,boolean,int);
1165
+ int (*targetcell) /* decide which cell to split */
1166
+ (graph*,int*,int*,int,int,boolean,int,int,int);
1167
+ void (*freedyn)(void); /* free dynamic memory */
1168
+ void (*check) /* check compilation parameters */
1169
+ (int,int,int,int);
1170
+ void (*init)(graph*,graph**,graph*,graph**,int*,int*,set*,
1171
+ struct optionstruct*,int*,int,int);
1172
+ void (*cleanup)(graph*,graph**,graph*,graph**,int*,int*,
1173
+ struct optionstruct*,statsblk*,int,int);
1174
+ } dispatchvec;
1175
+
1176
+ typedef struct optionstruct
1177
+ {
1178
+ int getcanon; /* make canong and canonlab? */
1179
+ #define LABELONLY 2 /* new value UNIMPLEMENTED */
1180
+ boolean digraph; /* multiple edges or loops? */
1181
+ boolean writeautoms; /* write automorphisms? */
1182
+ boolean writemarkers; /* write stats on pts fixed, etc.? */
1183
+ boolean defaultptn; /* set lab,ptn,active for single cell? */
1184
+ boolean cartesian; /* use cartesian rep for writing automs? */
1185
+ int linelength; /* max chars/line (excl. '\n') for output */
1186
+ FILE *outfile; /* file for output, if any */
1187
+ void (*userrefproc) /* replacement for usual refine procedure */
1188
+ (graph*,int*,int*,int,int*,int*,set*,int*,int,int);
1189
+ void (*userautomproc) /* procedure called for each automorphism */
1190
+ (int,int*,int*,int,int,int);
1191
+ void (*userlevelproc) /* procedure called for each level */
1192
+ (int*,int*,int,int*,statsblk*,int,int,int,int,int,int);
1193
+ void (*usernodeproc) /* procedure called for each node */
1194
+ (graph*,int*,int*,int,int,int,int,int,int);
1195
+ int (*usercanonproc) /* procedure called for better labellings */
1196
+ (graph*,int*,graph*,unsigned long,int,int,int);
1197
+ void (*invarproc) /* procedure to compute vertex-invariant */
1198
+ (graph*,int*,int*,int,int,int,int*,int,boolean,int,int);
1199
+ int tc_level; /* max level for smart target cell choosing */
1200
+ int mininvarlevel; /* min level for invariant computation */
1201
+ int maxinvarlevel; /* max level for invariant computation */
1202
+ int invararg; /* value passed to (*invarproc)() */
1203
+ dispatchvec *dispatch; /* vector of object-specific routines */
1204
+ boolean schreier; /* use random schreier method */
1205
+ void *extra_options; /* arbitrary extra options */
1206
+ #ifdef NAUTY_IN_MAGMA
1207
+ boolean print_stats; /* CAYLEY specfic - GYM Sep 1990 */
1208
+ char *invarprocname; /* Magma - no longer global sjc 1994 */
1209
+ int lab_h; /* Magma - no longer global sjc 1994 */
1210
+ int ptn_h; /* Magma - no longer global sjc 1994 */
1211
+ int orbitset_h; /* Magma - no longer global sjc 1994 */
1212
+ #endif
1213
+ } optionblk;
1214
+
1215
+ #ifndef CONSOLWIDTH
1216
+ #define CONSOLWIDTH 78
1217
+ #endif
1218
+
1219
+ /* The following are obsolete. Just use NULL. */
1220
+ #define NILFUNCTION ((void(*)())NULL) /* nil pointer to user-function */
1221
+ #define NILSET ((set*)NULL) /* nil pointer to set */
1222
+ #define NILGRAPH ((graph*)NULL) /* nil pointer to graph */
1223
+
1224
+ #define DEFAULTOPTIONS_GRAPH(options) optionblk options = \
1225
+ {0,FALSE,FALSE,FALSE,TRUE,FALSE,CONSOLWIDTH, \
1226
+ NULL,NULL,NULL,NULL,NULL,NULL,NULL,100,0,1,0,&dispatch_graph,FALSE,NULL}
1227
+ #define DEFAULTOPTIONS_DIGRAPH(options) optionblk options = \
1228
+ {0,TRUE,FALSE,FALSE,TRUE,FALSE,CONSOLWIDTH, \
1229
+ NULL,NULL,NULL,NULL,NULL,NULL,adjacencies,100,0,999,0,&dispatch_graph,FALSE,NULL}
1230
+
1231
+ #ifndef DEFAULTOPTIONS
1232
+ #define DEFAULTOPTIONS DEFAULTOPTIONS_GRAPH
1233
+ #endif
1234
+ #ifndef DEFAULTOPTIONS_DENSEGRAPH
1235
+ #define DEFAULTOPTIONS_DENSEGRAPH DEFAULTOPTIONS_GRAPH
1236
+ #endif
1237
+
1238
+ #ifdef NAUTY_IN_MAGMA
1239
+ #define PUTC(c,f) io_putchar(c)
1240
+ #else
1241
+ #ifdef IS_JAVA
1242
+ void javastream(FILE* f,char c);
1243
+ #define PUTC(c,f) javastream(f,c)
1244
+ #else
1245
+ #define PUTC(c,f) putc(c,f)
1246
+ #endif
1247
+ #endif
1248
+
1249
+ /* ALLOCS(x,y) should return a pointer (any pointer type) to x*y units of new
1250
+ storage, not necessarily initialised. A "unit" of storage is defined by
1251
+ the sizeof operator. x and y are integer values of type int or larger,
1252
+ but x*y may well be too large for an int. The macro should cast to the
1253
+ correct type for the call. On failure, ALLOCS(x,y) should return a NULL
1254
+ pointer. FREES(p) should free storage previously allocated by ALLOCS,
1255
+ where p is the value that ALLOCS returned. */
1256
+
1257
+ #ifdef NAUTY_IN_MAGMA
1258
+ #define ALLOCS(x,y) mem_malloc((size_t)(x)*(size_t)(y))
1259
+ #define REALLOCS(p,x) mem_realloc(p,(size_t)(x))
1260
+ #define FREES(p) mem_free(p)
1261
+ #else
1262
+ #define ALLOCS(x,y) malloc((size_t)(x)*(size_t)(y))
1263
+ #define REALLOCS(p,x) realloc(p,(size_t)(x))
1264
+ #define FREES(p) free(p)
1265
+ #endif
1266
+
1267
+ /* The following macros are used by nauty if MAXN=0. They dynamically
1268
+ allocate arrays of size dependent on m or n. For each array there
1269
+ should be two static variables:
1270
+ type *name;
1271
+ size_t name_sz;
1272
+ "name" will hold a pointer to an allocated array. "name_sz" will hold
1273
+ the size of the allocated array in units of sizeof(type). DYNALLSTAT
1274
+ declares both variables and initialises name_sz=0. DYNALLOC1 and
1275
+ DYNALLOC2 test if there is enough space allocated, and if not free
1276
+ the existing space and allocate a bigger space. The allocated space
1277
+ is not initialised.
1278
+
1279
+ In the case of DYNALLOC1, the space is allocated using
1280
+ ALLOCS(sz,sizeof(type)).
1281
+ In the case of DYNALLOC2, the space is allocated using
1282
+ ALLOCS(sz1,sz2*sizeof(type)).
1283
+
1284
+ DYNREALLOC is like DYNALLOC1 except that the old contents are copied
1285
+ into the new space. Availability of realloc() is assumed.
1286
+
1287
+ DYNFREE frees any allocated array and sets name_sz back to 0.
1288
+ CONDYNFREE does the same, but only if name_sz exceeds some limit.
1289
+ */
1290
+
1291
+ #define DYNALLSTAT(type,name,name_sz) \
1292
+ static TLS_ATTR type *name; static TLS_ATTR size_t name_sz=0
1293
+ #define DYNALLOC1(type,name,name_sz,sz,msg) \
1294
+ if ((size_t)(sz) > name_sz) \
1295
+ { if (name_sz) FREES(name); name_sz = (sz); \
1296
+ if ((name=(type*)ALLOCS(sz,sizeof(type))) == NULL) {alloc_error(msg);}}
1297
+ #define DYNALLOC2(type,name,name_sz,sz1,sz2,msg) \
1298
+ if ((size_t)(sz1)*(size_t)(sz2) > name_sz) \
1299
+ { if (name_sz) FREES(name); name_sz = (size_t)(sz1)*(size_t)(sz2); \
1300
+ if ((name=(type*)ALLOCS((sz1),(sz2)*sizeof(type))) == NULL) \
1301
+ {alloc_error(msg);}}
1302
+ #define DYNREALLOC(type,name,name_sz,sz,msg) \
1303
+ {if ((size_t)(sz) > name_sz) \
1304
+ { if ((name = (type*)REALLOCS(name,(sz)*sizeof(type))) == NULL) \
1305
+ {alloc_error(msg);} else name_sz = (sz);}}
1306
+ #define DYNFREE(name,name_sz) \
1307
+ { if (name) FREES(name); name = NULL; name_sz = 0;}
1308
+ #define CONDYNFREE(name,name_sz,minsz) \
1309
+ if (name_sz > (size_t)(minsz)) {DYNFREE(name,name_sz);}
1310
+
1311
+ /* File to write error messages to (used as first argument to fprintf()). */
1312
+ #define ERRFILE stderr
1313
+
1314
+ /* Don't use OLDEXTDEFS, it is only still here for Magma. */
1315
+ #ifdef OLDEXTDEFS
1316
+ #define EXTDEF_CLASS
1317
+ #ifdef EXTDEFS
1318
+ #define EXTDEF_TYPE 1
1319
+ #else
1320
+ #define EXTDEF_TYPE 2
1321
+ #endif
1322
+ #else
1323
+ #define EXTDEF_CLASS static
1324
+ #define EXTDEF_TYPE 2
1325
+ #endif
1326
+
1327
+ #ifndef NAUTY_IN_MAGMA
1328
+ /* Things equivalent to bit, bytecount, leftbit are defined
1329
+ in bs.h for Magma. */
1330
+ #if EXTDEF_TYPE==1
1331
+ extern setword bit[];
1332
+ extern int bytecount[];
1333
+ extern int leftbit[];
1334
+
1335
+ #else
1336
+ /* array giving setwords with single 1-bit */
1337
+
1338
+ #if WORDSIZE==128
1339
+ #define B128(i) (((setword)1) << (127-(i)))
1340
+ EXTDEF_CLASS const setword bit[] =
1341
+ {B128(0), B128(1), B128(2), B128(3), B128(4),
1342
+ B128(5), B128(6), B128(7), B128(8), B128(9),
1343
+ B128(10), B128(11), B128(12), B128(13), B128(14),
1344
+ B128(15), B128(16), B128(17), B128(18), B128(19),
1345
+ B128(20), B128(21), B128(22), B128(23), B128(24),
1346
+ B128(25), B128(26), B128(27), B128(28), B128(29),
1347
+ B128(30), B128(31), B128(32), B128(33), B128(34),
1348
+ B128(35), B128(36), B128(37), B128(38), B128(39),
1349
+ B128(40), B128(41), B128(42), B128(43), B128(44),
1350
+ B128(45), B128(46), B128(47), B128(48), B128(49),
1351
+ B128(50), B128(51), B128(52), B128(53), B128(54),
1352
+ B128(55), B128(56), B128(57), B128(58), B128(59),
1353
+ B128(60), B128(61), B128(62), B128(63), B128(64),
1354
+ B128(65), B128(66), B128(67), B128(68), B128(69),
1355
+ B128(70), B128(71), B128(72), B128(73), B128(74),
1356
+ B128(75), B128(76), B128(77), B128(78), B128(79),
1357
+ B128(80), B128(81), B128(82), B128(83), B128(84),
1358
+ B128(85), B128(86), B128(87), B128(88), B128(89),
1359
+ B128(90), B128(91), B128(92), B128(93), B128(94),
1360
+ B128(95), B128(96), B128(97), B128(98), B128(99),
1361
+ B128(100),B128(101),B128(102),B128(103),B128(104),
1362
+ B128(105),B128(106),B128(107),B128(108),B128(109),
1363
+ B128(110),B128(111),B128(112),B128(113),B128(114),
1364
+ B128(115),B128(116),B128(117),B128(118),B128(119),
1365
+ B128(120),B128(121),B128(122),B128(123),B128(124),
1366
+ B128(125),B128(126),B128(127)};
1367
+ #endif
1368
+
1369
+ #if WORDSIZE==64
1370
+ #ifdef SETWORD_LONGLONG
1371
+ EXTDEF_CLASS const
1372
+ setword bit[] =
1373
+ {0x8000000000000000ULL,0x4000000000000000ULL,0x2000000000000000ULL,
1374
+ 0x1000000000000000ULL,0x800000000000000ULL,0x400000000000000ULL,
1375
+ 0x200000000000000ULL,0x100000000000000ULL,0x80000000000000ULL,
1376
+ 0x40000000000000ULL,0x20000000000000ULL,0x10000000000000ULL,
1377
+ 0x8000000000000ULL,0x4000000000000ULL,0x2000000000000ULL,0x1000000000000ULL,
1378
+ 0x800000000000ULL,0x400000000000ULL,0x200000000000ULL,0x100000000000ULL,
1379
+ 0x80000000000ULL,0x40000000000ULL,0x20000000000ULL,0x10000000000ULL,
1380
+ 0x8000000000ULL,0x4000000000ULL,0x2000000000ULL,0x1000000000ULL,
1381
+ 0x800000000ULL,0x400000000ULL,0x200000000ULL,0x100000000ULL,0x80000000ULL,
1382
+ 0x40000000ULL,0x20000000ULL,0x10000000ULL,0x8000000ULL,0x4000000ULL,
1383
+ 0x2000000ULL,0x1000000ULL,0x800000ULL,0x400000ULL,0x200000ULL,0x100000ULL,
1384
+ 0x80000ULL,0x40000ULL,0x20000ULL,0x10000ULL,0x8000ULL,0x4000ULL,0x2000ULL,
1385
+ 0x1000ULL,0x800ULL,0x400ULL,0x200ULL,0x100ULL,0x80ULL,0x40ULL,0x20ULL,
1386
+ 0x10ULL,0x8ULL,0x4ULL,0x2ULL,0x1ULL};
1387
+ #else
1388
+ EXTDEF_CLASS const
1389
+ setword bit[] =
1390
+ {0x8000000000000000UL,0x4000000000000000UL,0x2000000000000000UL,
1391
+ 0x1000000000000000UL,0x800000000000000UL,0x400000000000000UL,
1392
+ 0x200000000000000UL,0x100000000000000UL,0x80000000000000UL,
1393
+ 0x40000000000000UL,0x20000000000000UL,0x10000000000000UL,
1394
+ 0x8000000000000UL,0x4000000000000UL,0x2000000000000UL,0x1000000000000UL,
1395
+ 0x800000000000UL,0x400000000000UL,0x200000000000UL,0x100000000000UL,
1396
+ 0x80000000000UL,0x40000000000UL,0x20000000000UL,0x10000000000UL,
1397
+ 0x8000000000UL,0x4000000000UL,0x2000000000UL,0x1000000000UL,0x800000000UL,
1398
+ 0x400000000UL,0x200000000UL,0x100000000UL,0x80000000UL,0x40000000UL,
1399
+ 0x20000000UL,0x10000000UL,0x8000000UL,0x4000000UL,0x2000000UL,0x1000000UL,
1400
+ 0x800000UL,0x400000UL,0x200000UL,0x100000UL,0x80000UL,0x40000UL,0x20000UL,
1401
+ 0x10000UL,0x8000UL,0x4000UL,0x2000UL,0x1000UL,0x800UL,0x400UL,0x200UL,
1402
+ 0x100UL,0x80UL,0x40UL,0x20UL,0x10UL,0x8UL,0x4UL,0x2UL,0x1UL};
1403
+ #endif
1404
+ #endif
1405
+
1406
+ #if WORDSIZE==32
1407
+ EXTDEF_CLASS const
1408
+ setword bit[] =
1409
+ {0x80000000,0x40000000,0x20000000,0x10000000,0x8000000,0x4000000,0x2000000,
1410
+ 0x1000000,0x800000,0x400000,0x200000,0x100000,0x80000,0x40000,0x20000,
1411
+ 0x10000,0x8000,0x4000,0x2000,0x1000,0x800,0x400,0x200,0x100,0x80,0x40,
1412
+ 0x20,0x10,0x8,0x4,0x2,0x1};
1413
+ #endif
1414
+
1415
+ #if WORDSIZE==16
1416
+ EXTDEF_CLASS const
1417
+ setword bit[] =
1418
+ {0x8000,0x4000,0x2000,0x1000,0x800,0x400,0x200,0x100,0x80,0x40,
1419
+ 0x20,0x10,0x8,0x4,0x2,0x1};
1420
+ #endif
1421
+
1422
+ /* array giving number of 1-bits in bytes valued 0..255: */
1423
+ EXTDEF_CLASS const
1424
+ int bytecount[] = {0,1,1,2,1,2,2,3,1,2,2,3,2,3,3,4,
1425
+ 1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5,
1426
+ 1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5,
1427
+ 2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,
1428
+ 1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5,
1429
+ 2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,
1430
+ 2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,
1431
+ 3,4,4,5,4,5,5,6,4,5,5,6,5,6,6,7,
1432
+ 1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5,
1433
+ 2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,
1434
+ 2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,
1435
+ 3,4,4,5,4,5,5,6,4,5,5,6,5,6,6,7,
1436
+ 2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,
1437
+ 3,4,4,5,4,5,5,6,4,5,5,6,5,6,6,7,
1438
+ 3,4,4,5,4,5,5,6,4,5,5,6,5,6,6,7,
1439
+ 4,5,5,6,5,6,6,7,5,6,6,7,6,7,7,8};
1440
+
1441
+ /* array giving position (1..7) of high-order 1-bit in byte: */
1442
+ EXTDEF_CLASS const
1443
+ int leftbit[] = {8,7,6,6,5,5,5,5,4,4,4,4,4,4,4,4,
1444
+ 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,
1445
+ 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
1446
+ 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
1447
+ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1448
+ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1449
+ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1450
+ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1451
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1452
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1453
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1454
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1455
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1456
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1457
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1458
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
1459
+ #endif /* EXTDEFS */
1460
+
1461
+ #endif /* not NAUTY_IN_MAGMA */
1462
+
1463
+ #define ANSIPROT 1
1464
+ #define EXTPROC(func,args) func args; /* obsolete */
1465
+
1466
+ /* The following is for C++ programs that read nauty.h. Compile nauty
1467
+ itself using C, not C++. */
1468
+
1469
+ #ifdef __cplusplus
1470
+ extern "C" {
1471
+ #endif
1472
+
1473
+ #ifndef NAUTY_IN_MAGMA
1474
+ #if MALLOC_DEC==2
1475
+ #include <malloc.h>
1476
+ #endif
1477
+ #if MALLOC_DEC==0
1478
+ void *malloc(size_t);
1479
+ void *realloc(void*,size_t);
1480
+ void free(void*);
1481
+ #endif
1482
+ #endif
1483
+
1484
+ #if HAS_STDIO_UNLOCK && !STDIO_UNLOCK_DECL
1485
+ int getc_unlocked(FILE *stream);
1486
+ int putc_unlocked(int c, FILE *stream);
1487
+ #endif
1488
+ #if HAVE_FLOCKFILE && !STDIO_FLOCKFILE_DECL
1489
+ void flockfile(FILE *stream);
1490
+ void funlockfile(FILE *stream);
1491
+ #endif
1492
+
1493
+ NORET_ATTR void alloc_error(const char*);
1494
+ void breakout(int*,int*,int,int,int,set*,int);
1495
+ boolean cheapautom(int*,int,boolean,int);
1496
+ void doref(graph*,int*,int*,int,int*,int*,int*,set*,int*,
1497
+ void(*)(graph*,int*,int*,int,int*,int*,set*,int*,int,int),
1498
+ void(*)(graph*,int*,int*,int,int,int,int*,int,boolean,int,int),
1499
+ int,int,int,boolean,int,int);
1500
+ void extra_autom(int*,int);
1501
+ void extra_level(int,int*,int*,int,int,int,int,int,int);
1502
+ boolean isautom(graph*,int*,boolean,int,int);
1503
+ extern dispatchvec dispatch_graph;
1504
+ int itos(int,char*);
1505
+ void fmperm(const int*,set*,set*,int,int);
1506
+ void fmptn(const int*,const int*,int,set*,set*,int,int);
1507
+ void longprune(set*,set*,set*,set*,int);
1508
+ void nauty(graph*,int*,int*,set*,int*,optionblk*,
1509
+ statsblk*,set*,int,int,int,graph*);
1510
+ void maketargetcell(graph*,int*,int*,int,
1511
+ set*,int*,int*,int,boolean,int,
1512
+ int (*)(graph*,int*,int*,int,int,boolean,int,int,int),int,int);
1513
+ int nextelement(const set*,int,int);
1514
+ int orbjoin(int*,const int*,int);
1515
+ void permset(const set*,set*,int,int*);
1516
+ void putstring(FILE*,const char*);
1517
+ void refine(graph*,int*,int*,int,int*,int*,set*,int*,int,int);
1518
+ void refine1(graph*,int*,int*,int,int*,int*,set*,int*,int,int);
1519
+ void shortprune(set*,const set*,int);
1520
+ int targetcell(graph*,int*,int*,int,int,boolean,int,int,int);
1521
+ int testcanlab(graph*,graph*,int*,int*,int,int);
1522
+ void updatecan(graph*,graph*,int*,int,int,int);
1523
+ void writeperm(FILE*,const int*,boolean,int,int);
1524
+ void nauty_freedyn(void);
1525
+ void nauty_check(int,int,int,int);
1526
+ void naugraph_check(int,int,int,int);
1527
+ void nautil_check(int,int,int,int);
1528
+ void nautil_freedyn(void);
1529
+ void naugraph_freedyn(void);
1530
+ void densenauty(graph*,int*,int*,int*,
1531
+ optionblk*,statsblk*,int,int,graph*);
1532
+ void writegroupsize(FILE*,double,int);
1533
+
1534
+ extern int labelorg; /* Declared in nautil.c */
1535
+ extern volatile int nauty_kill_request; /* Also declared in nautil.c */
1536
+
1537
+ #ifdef __cplusplus
1538
+ }
1539
+ #endif
1540
+
1541
+ /* ++++++ This file is automatically generated, don't edit it by hand! ++++++ */
1542
+
1543
+
1544
+ #endif /* _NAUTY_H_ */