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.
- synkit/CRN/Benchmark/__init__.py +53 -0
- synkit/CRN/Benchmark/crosschecks.py +13 -0
- synkit/CRN/Benchmark/kegg.py +12 -0
- synkit/CRN/Benchmark/networks.py +13 -0
- synkit/CRN/Benchmark/scaling.py +13 -0
- synkit/CRN/Benchmark/validate.py +13 -0
- synkit/CRN/Construct/__init__.py +16 -0
- synkit/CRN/Construct/abstract.py +668 -0
- synkit/CRN/Construct/arity.py +36 -0
- synkit/CRN/Construct/builder.py +619 -0
- synkit/CRN/Construct/derivation.py +63 -0
- synkit/CRN/Construct/flattener.py +100 -0
- synkit/CRN/Construct/keys.py +14 -0
- synkit/CRN/Construct/mixtures.py +117 -0
- synkit/CRN/Construct/rdkit_worker.py +69 -0
- synkit/CRN/Construct/smiles.py +99 -0
- synkit/CRN/Construct/state.py +31 -0
- synkit/CRN/Construct/strategy.py +75 -0
- synkit/CRN/Construct/worker.py +42 -0
- synkit/CRN/IO/__init__.py +36 -0
- synkit/CRN/IO/sbml.py +925 -0
- synkit/CRN/Pathway/__init__.py +72 -0
- synkit/CRN/Pathway/_adapter.py +333 -0
- synkit/CRN/Pathway/pathfinder.py +500 -0
- synkit/CRN/Pathway/reachability.py +796 -0
- synkit/CRN/Pathway/realizability.py +1322 -0
- synkit/CRN/Petrinet/__init__.py +93 -0
- synkit/CRN/Petrinet/analyzer.py +486 -0
- synkit/CRN/Petrinet/minimal_semiflows.py +436 -0
- synkit/CRN/Petrinet/net.py +1041 -0
- synkit/CRN/Petrinet/persistence.py +97 -0
- synkit/CRN/Petrinet/semiflows.py +483 -0
- synkit/CRN/Petrinet/siphon_search.py +402 -0
- synkit/CRN/Petrinet/structure.py +286 -0
- synkit/CRN/Props/__init__.py +130 -0
- synkit/CRN/Props/_rank.py +29 -0
- synkit/CRN/Props/deficiency.py +953 -0
- synkit/CRN/Props/dynamics.py +832 -0
- synkit/CRN/Props/helper.py +151 -0
- synkit/CRN/Props/stoich.py +751 -0
- synkit/CRN/Props/thermo.py +584 -0
- synkit/CRN/Query/__init__.py +66 -0
- synkit/CRN/Query/cache.py +41 -0
- synkit/CRN/Query/kegg_api.py +99 -0
- synkit/CRN/Query/kegg_extract.py +714 -0
- synkit/CRN/Query/kegg_impute.py +707 -0
- synkit/CRN/Query/kegg_parse.py +480 -0
- synkit/CRN/Query/to_syncrn.py +290 -0
- synkit/CRN/README.md +234 -0
- synkit/CRN/Structure/__init__.py +12 -0
- synkit/CRN/Structure/_graph_io.py +713 -0
- synkit/CRN/Structure/_matrices.py +88 -0
- synkit/CRN/Structure/_parse.py +544 -0
- synkit/CRN/Structure/reaction.py +237 -0
- synkit/CRN/Structure/rule.py +55 -0
- synkit/CRN/Structure/species.py +46 -0
- synkit/CRN/Structure/syncrn.py +929 -0
- synkit/CRN/Symmetry/__init__.py +20 -0
- synkit/CRN/Symmetry/_common.py +1059 -0
- synkit/CRN/Symmetry/_ir.py +940 -0
- synkit/CRN/Symmetry/automorphism.py +472 -0
- synkit/CRN/Symmetry/canon.py +441 -0
- synkit/CRN/Symmetry/isomorphism.py +412 -0
- synkit/CRN/Symmetry/symmetry.py +61 -0
- synkit/CRN/Symmetry/wl_canon.py +967 -0
- synkit/CRN/Visualize/__init__.py +11 -0
- synkit/CRN/Visualize/labels.py +113 -0
- synkit/CRN/Visualize/layout.py +708 -0
- synkit/CRN/Visualize/palette.py +292 -0
- synkit/CRN/Visualize/validation.py +122 -0
- synkit/CRN/Visualize/vis.py +1152 -0
- synkit/CRN/__init__.py +233 -0
- synkit/CRN/_build.py +50 -0
- synkit/CRN/_native_build.py +175 -0
- synkit/CRN/analysis.py +629 -0
- synkit/CRN/backend.py +74 -0
- synkit/CRN/cpp/CMakeLists.txt +58 -0
- synkit/CRN/cpp/algebra.cpp +46 -0
- synkit/CRN/cpp/closure.cpp +29 -0
- synkit/CRN/cpp/exact.h +55 -0
- synkit/CRN/cpp/pathway.cpp +46 -0
- synkit/CRN/cpp/semiflows.cpp +209 -0
- synkit/CRN/cpp/structural.cpp +240 -0
- synkit/CRN/cpp/symmetry.cpp +45 -0
- synkit/CRN/cpp/write_manifest.cmake +28 -0
- synkit/CRN/kinds.py +137 -0
- synkit/CRN/lib/synkit_crn.dll +0 -0
- synkit/CRN/lib/synkit_crn.json +33 -0
- synkit/CRN/native.py +388 -0
- synkit/CRN/native_analysis.py +459 -0
- synkit/Chem/Cluster/__init__.py +0 -0
- synkit/Chem/Cluster/butina.py +140 -0
- synkit/Chem/Fingerprint/__init__.py +0 -0
- synkit/Chem/Fingerprint/fp_calculator.py +155 -0
- synkit/Chem/Fingerprint/smiles_featurizer.py +258 -0
- synkit/Chem/Fingerprint/transformation_fp.py +139 -0
- synkit/Chem/Mapper/README.rst +43 -0
- synkit/Chem/Mapper/__init__.py +255 -0
- synkit/Chem/Mapper/_compat.py +130 -0
- synkit/Chem/Mapper/adapters/__init__.py +1 -0
- synkit/Chem/Mapper/adapters/prediction.py +126 -0
- synkit/Chem/Mapper/adapters/template.py +412 -0
- synkit/Chem/Mapper/chem/__init__.py +52 -0
- synkit/Chem/Mapper/chem/aam.py +673 -0
- synkit/Chem/Mapper/chem/blind.py +160 -0
- synkit/Chem/Mapper/chem/its.py +309 -0
- synkit/Chem/Mapper/chem/smiles.py +564 -0
- synkit/Chem/Mapper/graph/__init__.py +66 -0
- synkit/Chem/Mapper/graph/automorphism.py +395 -0
- synkit/Chem/Mapper/graph/blockcut.py +98 -0
- synkit/Chem/Mapper/graph/labeled_graph.py +104 -0
- synkit/Chem/Mapper/graph/refine.py +176 -0
- synkit/Chem/Mapper/graph/synkit_adapter.py +110 -0
- synkit/Chem/Mapper/io/__init__.py +13 -0
- synkit/Chem/Mapper/io/idxmapstr.py +82 -0
- synkit/Chem/Mapper/mapper.py +685 -0
- synkit/Chem/Mapper/reaction_search.py +554 -0
- synkit/Chem/Mapper/reporting/__init__.py +1 -0
- synkit/Chem/Mapper/reporting/alternatives.py +451 -0
- synkit/Chem/Mapper/reporting/analysis.py +681 -0
- synkit/Chem/Mapper/reporting/native_analysis.py +485 -0
- synkit/Chem/Mapper/reporting/spectrum.py +642 -0
- synkit/Chem/Mapper/solvers/__init__.py +1 -0
- synkit/Chem/Mapper/solvers/exact/__init__.py +141 -0
- synkit/Chem/Mapper/solvers/exact/assignment/__init__.py +1 -0
- synkit/Chem/Mapper/solvers/exact/assignment/assignment_certificate.py +113 -0
- synkit/Chem/Mapper/solvers/exact/assignment/assignment_domains.py +162 -0
- synkit/Chem/Mapper/solvers/exact/assignment/assignment_verification.py +58 -0
- synkit/Chem/Mapper/solvers/exact/assignment/incremental_assignment.py +247 -0
- synkit/Chem/Mapper/solvers/exact/certificate.py +128 -0
- synkit/Chem/Mapper/solvers/exact/core.py +183 -0
- synkit/Chem/Mapper/solvers/exact/distance_search/__init__.py +1 -0
- synkit/Chem/Mapper/solvers/exact/distance_search/bounds.py +319 -0
- synkit/Chem/Mapper/solvers/exact/distance_search/exhaustive.py +179 -0
- synkit/Chem/Mapper/solvers/exact/distance_search/inputs.py +283 -0
- synkit/Chem/Mapper/solvers/exact/distance_search/records.py +242 -0
- synkit/Chem/Mapper/solvers/exact/distance_search/search.py +1025 -0
- synkit/Chem/Mapper/solvers/exact/distance_search/verify.py +378 -0
- synkit/Chem/Mapper/solvers/exact/edit_support.py +375 -0
- synkit/Chem/Mapper/solvers/exact/hybrid.py +224 -0
- synkit/Chem/Mapper/solvers/exact/hydrogen.py +264 -0
- synkit/Chem/Mapper/solvers/exact/kernel_solvers/__init__.py +1 -0
- synkit/Chem/Mapper/solvers/exact/kernel_solvers/branching.py +499 -0
- synkit/Chem/Mapper/solvers/exact/kernel_solvers/enumerate.py +1050 -0
- synkit/Chem/Mapper/solvers/exact/kernel_solvers/enumeration_result.py +30 -0
- synkit/Chem/Mapper/solvers/exact/kernel_solvers/kernel.py +256 -0
- synkit/Chem/Mapper/solvers/exact/kernel_solvers/milp.py +194 -0
- synkit/Chem/Mapper/solvers/exact/native/__init__.py +1 -0
- synkit/Chem/Mapper/solvers/exact/native/build.py +154 -0
- synkit/Chem/Mapper/solvers/exact/native/candidates.py +593 -0
- synkit/Chem/Mapper/solvers/exact/native/canonical.py +396 -0
- synkit/Chem/Mapper/solvers/exact/native/disk_frontier.py +415 -0
- synkit/Chem/Mapper/solvers/exact/native/frontier.py +390 -0
- synkit/Chem/Mapper/solvers/exact/native/hydrogen_quotient.py +213 -0
- synkit/Chem/Mapper/solvers/exact/native/its.py +528 -0
- synkit/Chem/Mapper/solvers/exact/native/native_distance.cpp +2803 -0
- synkit/Chem/Mapper/solvers/exact/native/orbit_aggregation.py +328 -0
- synkit/Chem/Mapper/solvers/exact/native/parallel.py +205 -0
- synkit/Chem/Mapper/solvers/exact/native/pmcd.py +203 -0
- synkit/Chem/Mapper/solvers/exact/native/runtime.py +40 -0
- synkit/Chem/Mapper/solvers/exact/native/search.py +294 -0
- synkit/Chem/Mapper/solvers/exact/native/separator.py +224 -0
- synkit/Chem/Mapper/solvers/exact/native_build.py +12 -0
- synkit/Chem/Mapper/solvers/exact/pabs/__init__.py +1 -0
- synkit/Chem/Mapper/solvers/exact/pabs/cost_lattice.py +43 -0
- synkit/Chem/Mapper/solvers/exact/pabs/factor_spectrum.py +110 -0
- synkit/Chem/Mapper/solvers/exact/pabs/multi_shell.py +368 -0
- synkit/Chem/Mapper/solvers/exact/pabs/propagation.py +679 -0
- synkit/Chem/Mapper/solvers/exact/pabs/propagation_bounds.py +436 -0
- synkit/Chem/Mapper/solvers/exact/pabs/propagation_limits.py +13 -0
- synkit/Chem/Mapper/solvers/exact/pabs/propagation_search.py +856 -0
- synkit/Chem/Mapper/solvers/exact/pabs/propagation_symmetry.py +66 -0
- synkit/Chem/Mapper/solvers/exact/pabs/residual_typed_bonds.py +136 -0
- synkit/Chem/Mapper/solvers/exact/pabs/reward_frontier.py +201 -0
- synkit/Chem/Mapper/solvers/exact/pabs/separator_bound.py +258 -0
- synkit/Chem/Mapper/solvers/exact/pabs/separator_spectrum.py +308 -0
- synkit/Chem/Mapper/solvers/exact/pabs/sparse_reward_bound.py +207 -0
- synkit/Chem/Mapper/solvers/exact/pabs/suffix_spectrum.py +299 -0
- synkit/Chem/Mapper/solvers/exact/search.py +55 -0
- synkit/Chem/Mapper/solvers/exact/seeds/__init__.py +1 -0
- synkit/Chem/Mapper/solvers/exact/seeds/seed.py +104 -0
- synkit/Chem/Mapper/solvers/exact/seeds/seed_fragments.py +148 -0
- synkit/Chem/Mapper/solvers/exact/seeds/seed_relaxation.py +181 -0
- synkit/Chem/Mapper/solvers/exact/symmetry.py +223 -0
- synkit/Chem/Mapper/solvers/native/__init__.py +4 -0
- synkit/Chem/Mapper/solvers/native/assignment.py +99 -0
- synkit/Chem/Mapper/solvers/native/astar.py +22 -0
- synkit/Chem/Mapper/solvers/native/build.py +385 -0
- synkit/Chem/Mapper/solvers/native/classification.py +641 -0
- synkit/Chem/Mapper/solvers/native/core.py +378 -0
- synkit/Chem/Mapper/solvers/native/cpp/CMakeLists.txt +120 -0
- synkit/Chem/Mapper/solvers/native/cpp/examples/map_reaction.cpp +29 -0
- synkit/Chem/Mapper/solvers/native/cpp/examples/slap_graph.cpp +63 -0
- synkit/Chem/Mapper/solvers/native/cpp/include/synkit_mapper/assignment/assignment.h +18 -0
- synkit/Chem/Mapper/solvers/native/cpp/include/synkit_mapper/astar/astar.h +18 -0
- synkit/Chem/Mapper/solvers/native/cpp/include/synkit_mapper/astar/bound.h +33 -0
- synkit/Chem/Mapper/solvers/native/cpp/include/synkit_mapper/core/pmcd_witness.h +16 -0
- synkit/Chem/Mapper/solvers/native/cpp/include/synkit_mapper/core/runtime.h +130 -0
- synkit/Chem/Mapper/solvers/native/cpp/include/synkit_mapper/hydrogen/hydrogen.h +73 -0
- synkit/Chem/Mapper/solvers/native/cpp/include/synkit_mapper/mapper.h +175 -0
- synkit/Chem/Mapper/solvers/native/cpp/include/synkit_mapper/mces/mces.h +9 -0
- synkit/Chem/Mapper/solvers/native/cpp/include/synkit_mapper/pabs/seed.h +34 -0
- synkit/Chem/Mapper/solvers/native/cpp/include/synkit_mapper/reaction/reaction.h +30 -0
- synkit/Chem/Mapper/solvers/native/cpp/include/synkit_mapper/sepdp/sepdp.h +21 -0
- synkit/Chem/Mapper/solvers/native/cpp/include/synkit_mapper/slap.h +72 -0
- synkit/Chem/Mapper/solvers/native/cpp/include/synkit_mapper/solvers/solvers.h +16 -0
- synkit/Chem/Mapper/solvers/native/cpp/include/synkit_mapper/symmetry/classification.h +140 -0
- synkit/Chem/Mapper/solvers/native/cpp/include/synkit_mapper/symmetry/cpabs.h +33 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/assignment/abb.cpp +302 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/astar/CMakeLists.txt +12 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/astar/README.md +47 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/astar/astar.cpp +228 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/astar/astar_graph.cpp +37 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/astar/bound.cpp +212 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/core/dispatch.cpp +272 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/core/pmcd_witness.cpp +36 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/hydrogen/hydrogen.cpp +380 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/mces/README.md +57 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/mces/mces.cpp +287 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/pabs/bridge.cpp +334 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/pabs/chemical_floor.inc +181 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/pabs/endpoint_symmetry.inc +104 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/pabs/exact_helpers.h +20 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/pabs/lp_assignment_certificate.h +165 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/pabs/lp_certificate.h +125 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/pabs/lp_model.h +365 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/pabs/lp_provider.inc +319 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/pabs/lp_rounding.inc +170 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/pabs/lp_test_hooks.h +342 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/pabs/objective_reduction.inc +137 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/pabs/overlap_dual.inc +351 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/pabs/profile_seed.inc +214 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/pabs/seed_heuristics.inc +640 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/pabs/sparse_embedding.cpp +430 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/pabs/sparse_root_lp.h +176 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/pabs/test_hooks.inc +262 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/reaction/reaction.cpp +611 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/sepdp/README.md +61 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/sepdp/sepdp.cpp +253 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/slap.cpp +810 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/solvers/formulation.h +138 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/solvers/maxsat.cpp +526 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/solvers/ortools.cpp +475 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/solvers/seed.h +80 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/solvers/weighted_cnf.h +256 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/supporting/README.md +43 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/supporting/dfs.cpp +123 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/supporting/edit_support.cpp +224 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/symmetry/classification.cpp +553 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/symmetry/classification_pipeline.cpp +124 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/symmetry/classification_stream.h +13 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/symmetry/cpabs.cpp +455 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/symmetry/edge_deck.cpp +743 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/symmetry/vendor/nauty/COPYRIGHT +44 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/symmetry/vendor/nauty/LICENSE-2.0.txt +202 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/symmetry/vendor/nauty/naugraph.c +732 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/symmetry/vendor/nauty/naurng.c +94 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/symmetry/vendor/nauty/naurng.h +49 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/symmetry/vendor/nauty/nausparse.c +1771 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/symmetry/vendor/nauty/nausparse.h +133 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/symmetry/vendor/nauty/nautil.c +750 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/symmetry/vendor/nauty/naututil.h +355 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/symmetry/vendor/nauty/nauty.c +1256 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/symmetry/vendor/nauty/nauty.h +1544 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/symmetry/vendor/nauty/schreier.c +1131 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/symmetry/vendor/nauty/schreier.h +70 -0
- synkit/Chem/Mapper/solvers/native/cpp/src/symmetry/vendor/nauty/sorttemplates.c +580 -0
- synkit/Chem/Mapper/solvers/native/hydrogen.py +711 -0
- synkit/Chem/Mapper/solvers/native/implicit.py +506 -0
- synkit/Chem/Mapper/solvers/native/implicit_certificate.py +187 -0
- synkit/Chem/Mapper/solvers/native/implicit_preparation.py +309 -0
- synkit/Chem/Mapper/solvers/native/lib/synkit_mapper.dll +0 -0
- synkit/Chem/Mapper/solvers/native/mces.py +16 -0
- synkit/Chem/Mapper/solvers/native/reaction.py +179 -0
- synkit/Chem/Mapper/solvers/native/reaction_build.py +277 -0
- synkit/Chem/Mapper/solvers/native/reaction_text.py +26 -0
- synkit/Chem/Mapper/solvers/native/runtime.py +242 -0
- synkit/Chem/Mapper/solvers/native/sepdp.py +47 -0
- synkit/Chem/Mapper/solvers/native/slap.py +266 -0
- synkit/Chem/Mapper/solvers/native/solvers.py +67 -0
- synkit/Chem/Mapper/solvers/native/stereo.py +86 -0
- synkit/Chem/Mapper/solvers/native/supporting.py +34 -0
- synkit/Chem/Mapper/solvers/native/symmetry.py +91 -0
- synkit/Chem/Mapper/solvers/slap/__init__.py +29 -0
- synkit/Chem/Mapper/solvers/slap/lap.py +174 -0
- synkit/Chem/Mapper/solvers/slap/sequential.py +696 -0
- synkit/Chem/Mapper/validation/__init__.py +1 -0
- synkit/Chem/Mapper/validation/aam_validator.py +442 -0
- synkit/Chem/Mapper/validation/annotations.py +274 -0
- synkit/Chem/Mapper/validation/bonds.py +124 -0
- synkit/Chem/Mapper/validation/cohorts.py +72 -0
- synkit/Chem/Mapper/validation/identifiability.py +150 -0
- synkit/Chem/Mapper/validation/numerical_scope.py +36 -0
- synkit/Chem/Mapper/validation/orbits.py +137 -0
- synkit/Chem/Molecule/__init__.py +0 -0
- synkit/Chem/Molecule/_chirality_loci.py +165 -0
- synkit/Chem/Molecule/_chirality_types.py +231 -0
- synkit/Chem/Molecule/_helical_loci.py +167 -0
- synkit/Chem/Molecule/_stereo_axis_evidence.py +202 -0
- synkit/Chem/Molecule/_stereo_element_detection.py +193 -0
- synkit/Chem/Molecule/_stereo_orientation_constraints.py +511 -0
- synkit/Chem/Molecule/_tetrahedral_carriers.py +63 -0
- synkit/Chem/Molecule/atom_features.py +379 -0
- synkit/Chem/Molecule/chirality.py +1041 -0
- synkit/Chem/Molecule/cip_assignment.py +569 -0
- synkit/Chem/Molecule/cip_ranking.py +843 -0
- synkit/Chem/Molecule/coordinate_stereo.py +503 -0
- synkit/Chem/Molecule/derived_stereo_naming.py +165 -0
- synkit/Chem/Molecule/descriptors.py +452 -0
- synkit/Chem/Molecule/formula.py +249 -0
- synkit/Chem/Molecule/global_stereo.py +175 -0
- synkit/Chem/Molecule/graph_annotator.py +300 -0
- synkit/Chem/Molecule/standardize.py +817 -0
- synkit/Chem/Molecule/stereo_evidence.py +179 -0
- synkit/Chem/Molecule/stereo_perception.py +1032 -0
- synkit/Chem/Molecule/valence.py +123 -0
- synkit/Chem/Reaction/Mapper/__init__.py +44 -0
- synkit/Chem/Reaction/__init__.py +20 -0
- synkit/Chem/Reaction/aam_validator.py +5 -0
- synkit/Chem/Reaction/balance_check.py +138 -0
- synkit/Chem/Reaction/canon_rsmi.py +249 -0
- synkit/Chem/Reaction/cleaning.py +58 -0
- synkit/Chem/Reaction/deionize.py +199 -0
- synkit/Chem/Reaction/explicit_h_audit.py +232 -0
- synkit/Chem/Reaction/fix_aam.py +64 -0
- synkit/Chem/Reaction/neutralize.py +207 -0
- synkit/Chem/Reaction/radical_wildcard.py +224 -0
- synkit/Chem/Reaction/standardize.py +203 -0
- synkit/Chem/Reaction/tautomerize.py +205 -0
- synkit/Chem/__init__.py +1 -0
- synkit/Chem/utils.py +315 -0
- synkit/Data/__init__.py +0 -0
- synkit/Data/aldol.json.gz +1 -0
- synkit/Data/gen_partial_aam.py +147 -0
- synkit/Data/paracetamol.json.gz +1 -0
- synkit/Graph/Canon/__init__.py +16 -0
- synkit/Graph/Canon/_native/__init__.py +13 -0
- synkit/Graph/Canon/_native/build.py +93 -0
- synkit/Graph/Canon/_native/lib/synkit_canon.dll +0 -0
- synkit/Graph/Canon/_native/prepare.py +49 -0
- synkit/Graph/Canon/_native/runtime.py +140 -0
- synkit/Graph/Canon/_native/search.py +137 -0
- synkit/Graph/Canon/canon_algs.py +228 -0
- synkit/Graph/Canon/canon_graph.py +531 -0
- synkit/Graph/Canon/cpp/CMakeLists.txt +42 -0
- synkit/Graph/Canon/cpp/README.md +123 -0
- synkit/Graph/Canon/cpp/examples/canonical_graph.cpp +16 -0
- synkit/Graph/Canon/cpp/include/synkit_canon/canon.h +85 -0
- synkit/Graph/Canon/cpp/src/canonical.cpp +391 -0
- synkit/Graph/Canon/cpp/src/symmetry.h +83 -0
- synkit/Graph/Canon/cpp/tests/symmetry.cpp +93 -0
- synkit/Graph/Canon/exact.py +1020 -0
- synkit/Graph/Canon/exact_refinement.py +368 -0
- synkit/Graph/Canon/nauty.py +143 -0
- synkit/Graph/Context/__init__.py +0 -0
- synkit/Graph/Context/hier_context.py +244 -0
- synkit/Graph/Context/radius_expand.py +252 -0
- synkit/Graph/FG/__init__.py +19 -0
- synkit/Graph/FG/api.py +39 -0
- synkit/Graph/FG/audit.py +155 -0
- synkit/Graph/FG/catalog.py +919 -0
- synkit/Graph/FG/detector.py +288 -0
- synkit/Graph/FG/model.py +97 -0
- synkit/Graph/FG/recognizers.py +274 -0
- synkit/Graph/FG/ring_system.py +154 -0
- synkit/Graph/Feature/Descriptors/topology.py +857 -0
- synkit/Graph/Feature/Fingerprint/__init__.py +0 -0
- synkit/Graph/Feature/Fingerprint/wl_rxn_fps.py +222 -0
- synkit/Graph/Feature/__init__.py +5 -0
- synkit/Graph/Feature/graph_descriptors.py +323 -0
- synkit/Graph/Feature/graph_fps.py +96 -0
- synkit/Graph/Feature/graph_signature.py +239 -0
- synkit/Graph/Feature/hash_fps.py +133 -0
- synkit/Graph/Feature/morgan_fps.py +88 -0
- synkit/Graph/Feature/path_fps.py +81 -0
- synkit/Graph/Feature/wl_hash.py +134 -0
- synkit/Graph/Fusion/__init__.py +85 -0
- synkit/Graph/Fusion/candidate.py +559 -0
- synkit/Graph/Fusion/constructor.py +877 -0
- synkit/Graph/Fusion/identity.py +184 -0
- synkit/Graph/Fusion/interface.py +700 -0
- synkit/Graph/Fusion/search.py +241 -0
- synkit/Graph/Hyrogen/__init__.py +6 -0
- synkit/Graph/Hyrogen/_misc.py +591 -0
- synkit/Graph/Hyrogen/hcomplete.py +995 -0
- synkit/Graph/Hyrogen/hcomplete_legacy.py +368 -0
- synkit/Graph/Hyrogen/hcompletion_algorithms.py +713 -0
- synkit/Graph/Hyrogen/hextend.py +570 -0
- synkit/Graph/Hyrogen/hextend_legacy.py +215 -0
- synkit/Graph/ITS/__init__.py +4 -0
- synkit/Graph/ITS/its_builder.py +120 -0
- synkit/Graph/ITS/its_construction.py +719 -0
- synkit/Graph/ITS/its_decompose.py +572 -0
- synkit/Graph/ITS/its_destruction.py +331 -0
- synkit/Graph/ITS/its_expand.py +1251 -0
- synkit/Graph/ITS/its_relabel.py +187 -0
- synkit/Graph/ITS/its_reverter.py +356 -0
- synkit/Graph/ITS/normalize_aam.py +145 -0
- synkit/Graph/ITS/partial_its.py +238 -0
- synkit/Graph/ITS/rc_extractor.py +656 -0
- synkit/Graph/ITS/stereo.py +74 -0
- synkit/Graph/MTG/__init__.py +107 -0
- synkit/Graph/MTG/gluing.py +451 -0
- synkit/Graph/MTG/history.py +928 -0
- synkit/Graph/MTG/inventory.py +118 -0
- synkit/Graph/MTG/local.py +447 -0
- synkit/Graph/MTG/mcs_matcher.py +246 -0
- synkit/Graph/MTG/mtg.py +611 -0
- synkit/Graph/MTG/mtg_explore.py +74 -0
- synkit/Graph/MTG/observation.py +209 -0
- synkit/Graph/MTG/process.py +577 -0
- synkit/Graph/MTG/queries.py +66 -0
- synkit/Graph/MTG/realization.py +95 -0
- synkit/Graph/MTG/series_parallel.py +107 -0
- synkit/Graph/MTG/utils.py +424 -0
- synkit/Graph/Matcher/__init__.py +10 -0
- synkit/Graph/Matcher/approx_mcs.py +1264 -0
- synkit/Graph/Matcher/auto_est.py +736 -0
- synkit/Graph/Matcher/automorphism.py +314 -0
- synkit/Graph/Matcher/batch_cluster.py +224 -0
- synkit/Graph/Matcher/dedup_matches.py +247 -0
- synkit/Graph/Matcher/graph_cluster.py +191 -0
- synkit/Graph/Matcher/graph_matcher.py +312 -0
- synkit/Graph/Matcher/graph_morphism.py +421 -0
- synkit/Graph/Matcher/mcs_matcher.py +804 -0
- synkit/Graph/Matcher/multi_turbo_iso.py +186 -0
- synkit/Graph/Matcher/orbit.py +284 -0
- synkit/Graph/Matcher/partial_matcher.py +694 -0
- synkit/Graph/Matcher/sing.py +544 -0
- synkit/Graph/Matcher/subgraph_matcher.py +812 -0
- synkit/Graph/Matcher/turbo_iso.py +272 -0
- synkit/Graph/Matcher/wl_sel.py +537 -0
- synkit/Graph/Mech/__init__.py +26 -0
- synkit/Graph/Mech/conversion.py +1466 -0
- synkit/Graph/Mech/conversion_debug.py +237 -0
- synkit/Graph/Mech/electron_accounting.py +200 -0
- synkit/Graph/Mech/lwg_editor.py +406 -0
- synkit/Graph/Mech/lwg_ops.py +313 -0
- synkit/Graph/Morphism/__init__.py +99 -0
- synkit/Graph/Morphism/constraints.py +460 -0
- synkit/Graph/Morphism/llg.py +999 -0
- synkit/Graph/Morphism/morphism.py +349 -0
- synkit/Graph/Morphism/stereo.py +258 -0
- synkit/Graph/Morphism/stereo_morphism.py +383 -0
- synkit/Graph/Morphism/stereo_morphism_helpers.py +957 -0
- synkit/Graph/Morphism/stereo_morphism_types.py +117 -0
- synkit/Graph/Stereo/__init__.py +376 -0
- synkit/Graph/Stereo/_descriptor_core.py +207 -0
- synkit/Graph/Stereo/_descriptor_serialization.py +138 -0
- synkit/Graph/Stereo/canonical.py +648 -0
- synkit/Graph/Stereo/changes.py +964 -0
- synkit/Graph/Stereo/composition.py +391 -0
- synkit/Graph/Stereo/configured.py +946 -0
- synkit/Graph/Stereo/couplings.py +245 -0
- synkit/Graph/Stereo/descriptors.py +1030 -0
- synkit/Graph/Stereo/enumeration.py +597 -0
- synkit/Graph/Stereo/extended_descriptors.py +406 -0
- synkit/Graph/Stereo/global_configured.py +152 -0
- synkit/Graph/Stereo/global_stereo.py +304 -0
- synkit/Graph/Stereo/identity.py +648 -0
- synkit/Graph/Stereo/interchange.py +496 -0
- synkit/Graph/Stereo/legacy.py +460 -0
- synkit/Graph/Stereo/matching.py +899 -0
- synkit/Graph/Stereo/native.py +154 -0
- synkit/Graph/Stereo/orbits.py +668 -0
- synkit/Graph/Stereo/outcomes.py +99 -0
- synkit/Graph/Stereo/pairwise.py +350 -0
- synkit/Graph/Stereo/rdkit_adapter.py +662 -0
- synkit/Graph/Stereo/rdkit_identity.py +118 -0
- synkit/Graph/Stereo/rdkit_resonance.py +140 -0
- synkit/Graph/Stereo/reaction_interchange.py +266 -0
- synkit/Graph/Stereo/semantics.py +296 -0
- synkit/Graph/Stereo/supports.py +257 -0
- synkit/Graph/Stereo/wire.py +339 -0
- synkit/Graph/Wildcard/__init__.py +0 -0
- synkit/Graph/Wildcard/fuse_graph.py +156 -0
- synkit/Graph/Wildcard/graph_wc.py +303 -0
- synkit/Graph/Wildcard/its_merge.py +857 -0
- synkit/Graph/Wildcard/radwc.py +114 -0
- synkit/Graph/Wildcard/wc_matcher.py +576 -0
- synkit/Graph/Wildcard/wildcard.py +225 -0
- synkit/Graph/__init__.py +17 -0
- synkit/Graph/canon_graph.py +14 -0
- synkit/Graph/syn_graph.py +199 -0
- synkit/Graph/utils.py +324 -0
- synkit/IO/__init__.py +4 -0
- synkit/IO/chem_converter.py +1059 -0
- synkit/IO/combinatorial/__init__.py +8 -0
- synkit/IO/combinatorial/gml_to_graph.py +223 -0
- synkit/IO/combinatorial/graph_to_gml.py +280 -0
- synkit/IO/combinatorial/graph_to_smarts.py +186 -0
- synkit/IO/combinatorial/smarts_expander.py +147 -0
- synkit/IO/combinatorial/smarts_generalizer.py +133 -0
- synkit/IO/combinatorial/smarts_to_graph.py +179 -0
- synkit/IO/conversion.py +42 -0
- synkit/IO/data_io.py +269 -0
- synkit/IO/data_process.py +143 -0
- synkit/IO/debug.py +73 -0
- synkit/IO/gml_to_nx.py +150 -0
- synkit/IO/graph_to_mol.py +199 -0
- synkit/IO/mol_to_graph.py +1105 -0
- synkit/IO/mol_to_graph_chemistry.py +545 -0
- synkit/IO/nx_to_gml.py +209 -0
- synkit/IO/smiles_to_id.py +123 -0
- synkit/Mechanism/__init__.py +151 -0
- synkit/Mechanism/adapters.py +136 -0
- synkit/Mechanism/audit.py +323 -0
- synkit/Mechanism/benchmark.py +638 -0
- synkit/Mechanism/compatibility.py +13 -0
- synkit/Mechanism/drawing.py +85 -0
- synkit/Mechanism/electron_models.py +725 -0
- synkit/Mechanism/equivalence.py +521 -0
- synkit/Mechanism/evidence.py +262 -0
- synkit/Mechanism/interchange.py +141 -0
- synkit/Mechanism/model.py +918 -0
- synkit/Mechanism/neighbor_stereo.py +312 -0
- synkit/Mechanism/radical_data.py +740 -0
- synkit/Mechanism/replay.py +986 -0
- synkit/Mechanism/schema.py +264 -0
- synkit/Mechanism/stereo_state.py +416 -0
- synkit/Mechanism/symbols.py +91 -0
- synkit/Rule/Apply/__init__.py +35 -0
- synkit/Rule/Apply/conditions.py +45 -0
- synkit/Rule/Apply/dpo.py +998 -0
- synkit/Rule/Apply/rule_matcher.py +218 -0
- synkit/Rule/Apply/validation.py +354 -0
- synkit/Rule/Compose/__init__.py +106 -0
- synkit/Rule/Compose/_identity.py +43 -0
- synkit/Rule/Compose/composition.py +976 -0
- synkit/Rule/Compose/laws.py +439 -0
- synkit/Rule/Compose/search.py +771 -0
- synkit/Rule/Compose/synrule.py +170 -0
- synkit/Rule/Modify/__init__.py +0 -0
- synkit/Rule/Modify/implict_rule.py +56 -0
- synkit/Rule/Modify/longest_path.py +92 -0
- synkit/Rule/Modify/molecule_rule.py +115 -0
- synkit/Rule/Modify/prune_templates.py +78 -0
- synkit/Rule/Modify/rule_utils.py +194 -0
- synkit/Rule/Modify/strip_rule.py +97 -0
- synkit/Rule/__init__.py +28 -0
- synkit/Rule/generic_stereo.py +884 -0
- synkit/Rule/stereo_identity.py +271 -0
- synkit/Rule/syn_rule.py +1090 -0
- synkit/Synthesis/MSR/__init__.py +0 -0
- synkit/Synthesis/MSR/path_finder.py +239 -0
- synkit/Synthesis/Metrics/__init__.py +0 -0
- synkit/Synthesis/Metrics/_base.py +52 -0
- synkit/Synthesis/Metrics/_plot.py +129 -0
- synkit/Synthesis/Metrics/_ranking.py +179 -0
- synkit/Synthesis/RBL/__init__.py +80 -0
- synkit/Synthesis/RBL/engine.py +1249 -0
- synkit/Synthesis/RBL/matching.py +652 -0
- synkit/Synthesis/RBL/overlap.py +336 -0
- synkit/Synthesis/RBL/pipeline.py +376 -0
- synkit/Synthesis/RBL/policy.py +139 -0
- synkit/Synthesis/RBL/proof.py +370 -0
- synkit/Synthesis/RBL/reaction.py +506 -0
- synkit/Synthesis/RBL/state.py +169 -0
- synkit/Synthesis/RBL/validation.py +1060 -0
- synkit/Synthesis/Reactor/__init__.py +60 -0
- synkit/Synthesis/Reactor/core/__init__.py +1 -0
- synkit/Synthesis/Reactor/core/engine.py +967 -0
- synkit/Synthesis/Reactor/core/product.py +621 -0
- synkit/Synthesis/Reactor/core/rewrite.py +561 -0
- synkit/Synthesis/Reactor/core/strategy.py +44 -0
- synkit/Synthesis/Reactor/matching/__init__.py +1 -0
- synkit/Synthesis/Reactor/matching/mixin.py +920 -0
- synkit/Synthesis/Reactor/matching/policy.py +345 -0
- synkit/Synthesis/Reactor/matching/symmetry.py +309 -0
- synkit/Synthesis/Reactor/output/__init__.py +1 -0
- synkit/Synthesis/Reactor/output/deduplication.py +703 -0
- synkit/Synthesis/Reactor/output/policy.py +16 -0
- synkit/Synthesis/Reactor/output/serialization.py +485 -0
- synkit/Synthesis/Reactor/output/structural.py +893 -0
- synkit/Synthesis/Reactor/stereo/__init__.py +1 -0
- synkit/Synthesis/Reactor/stereo/assignment.py +35 -0
- synkit/Synthesis/Reactor/stereo/mixin.py +780 -0
- synkit/Synthesis/Reactor/variants/__init__.py +1 -0
- synkit/Synthesis/Reactor/variants/imbalanced.py +180 -0
- synkit/Synthesis/Reactor/variants/partial.py +84 -0
- synkit/Synthesis/Reactor/workflow/__init__.py +1 -0
- synkit/Synthesis/Reactor/workflow/batch.py +550 -0
- synkit/Synthesis/Reactor/workflow/benchmark.py +143 -0
- synkit/Synthesis/Reactor/workflow/postprocess.py +267 -0
- synkit/Synthesis/Reactor/workflow/rule_filter.py +210 -0
- synkit/Synthesis/__init__.py +0 -0
- synkit/Synthesis/reactor_utils.py +316 -0
- synkit/Utils/__init__.py +0 -0
- synkit/Utils/utils.py +172 -0
- synkit/Vis/__init__.py +91 -0
- synkit/Vis/crn/__init__.py +40 -0
- synkit/Vis/epd/__init__.py +20 -0
- synkit/Vis/epd/arrows.py +425 -0
- synkit/Vis/epd/chem.py +197 -0
- synkit/Vis/epd/constants.py +83 -0
- synkit/Vis/epd/layout.py +283 -0
- synkit/Vis/epd/mapping.py +51 -0
- synkit/Vis/epd/models.py +136 -0
- synkit/Vis/epd/render.py +543 -0
- synkit/Vis/epd/utils.py +108 -0
- synkit/Vis/epd/visualizer.py +811 -0
- synkit/Vis/graph_visualizer.py +375 -0
- synkit/Vis/its/__init__.py +19 -0
- synkit/Vis/its/drawer.py +615 -0
- synkit/Vis/its_drawer.py +35 -0
- synkit/Vis/molecule/__init__.py +31 -0
- synkit/Vis/molecule/drawer.py +563 -0
- synkit/Vis/molecule/reaction.py +285 -0
- synkit/Vis/molecule_drawer.py +33 -0
- synkit/Vis/mtg/__init__.py +17 -0
- synkit/Vis/mtg/drawer.py +769 -0
- synkit/Vis/mtg_drawer.py +34 -0
- synkit/Vis/pdf_writer.py +146 -0
- synkit/Vis/reaction/__init__.py +19 -0
- synkit/Vis/reaction/rule.py +141 -0
- synkit/Vis/reaction/rxn.py +532 -0
- synkit/Vis/reaction_drawer.py +41 -0
- synkit/Vis/space/__init__.py +17 -0
- synkit/Vis/space/chemical.py +80 -0
- synkit/Vis/space/embedding.py +87 -0
- synkit/Vis/vis_synedu/Vis/__init__.py +7 -0
- synkit/Vis/vis_synedu/Vis/dpo.py +862 -0
- synkit/Vis/vis_synedu/rxn_vis.py +377 -0
- synkit/Vis/vis_synedu/vis.py +501 -0
- synkit/Vis/visual_drawer.py +215 -0
- synkit/Vis/visual_model.py +520 -0
- synkit/__init__.py +3 -0
- synkit/_native.py +91 -0
- synkit/examples.py +50 -0
- synkit/version.py +23 -0
- synkit-1.6.5.dist-info/METADATA +156 -0
- synkit-1.6.5.dist-info/RECORD +636 -0
- synkit-1.6.5.dist-info/WHEEL +4 -0
- synkit-1.6.5.dist-info/licenses/LICENSE +21 -0
- synkit-1.6.5.dist-info/licenses/synkit/Chem/Mapper/solvers/native/cpp/src/symmetry/vendor/nauty/COPYRIGHT +44 -0
- 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,130 @@
|
|
|
1
|
+
#ifndef SYNKIT_MAPPER_RUNTIME_H
|
|
2
|
+
#define SYNKIT_MAPPER_RUNTIME_H
|
|
3
|
+
|
|
4
|
+
#include "synkit_mapper/mapper.h"
|
|
5
|
+
#include <algorithm>
|
|
6
|
+
#include <atomic>
|
|
7
|
+
#include <chrono>
|
|
8
|
+
#include <cmath>
|
|
9
|
+
#include <map>
|
|
10
|
+
#include <stdexcept>
|
|
11
|
+
#include <vector>
|
|
12
|
+
|
|
13
|
+
namespace synkit_mapper {
|
|
14
|
+
using Clock = std::chrono::steady_clock;
|
|
15
|
+
struct Cancellation {
|
|
16
|
+
std::atomic<bool> requested{false};
|
|
17
|
+
};
|
|
18
|
+
struct Stop {
|
|
19
|
+
int reason;
|
|
20
|
+
};
|
|
21
|
+
inline double elapsed(Clock::time_point start) {
|
|
22
|
+
return std::chrono::duration<double>(Clock::now() - start).count();
|
|
23
|
+
}
|
|
24
|
+
inline bool cancelled(const Request &r) {
|
|
25
|
+
return r.cancel_token && static_cast<Cancellation *>(r.cancel_token)
|
|
26
|
+
->requested.load(std::memory_order_relaxed);
|
|
27
|
+
}
|
|
28
|
+
class Budget {
|
|
29
|
+
public:
|
|
30
|
+
explicit Budget(const Request &request)
|
|
31
|
+
: request_(request), start_(Clock::now()) {}
|
|
32
|
+
double remaining() const {
|
|
33
|
+
return request_.seconds < 0
|
|
34
|
+
? 1e100
|
|
35
|
+
: std::max(0.0, request_.seconds - elapsed(start_));
|
|
36
|
+
}
|
|
37
|
+
double seconds() const { return elapsed(start_); }
|
|
38
|
+
int reason() const {
|
|
39
|
+
if (cancelled(request_))
|
|
40
|
+
return SYNKIT_STOP_CANCELLED;
|
|
41
|
+
return remaining() == 0 ? SYNKIT_STOP_TIME : SYNKIT_STOP_NONE;
|
|
42
|
+
}
|
|
43
|
+
void check() const {
|
|
44
|
+
int r = reason();
|
|
45
|
+
if (r)
|
|
46
|
+
throw Stop{r};
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
private:
|
|
50
|
+
const Request &request_;
|
|
51
|
+
Clock::time_point start_;
|
|
52
|
+
};
|
|
53
|
+
inline void initialize(Statistics &s, const Request &r) {
|
|
54
|
+
s = {};
|
|
55
|
+
s.abi_version = 1;
|
|
56
|
+
s.backend = r.backend;
|
|
57
|
+
s.minimum2 = s.incumbent2 = s.lower_bound2 = -1;
|
|
58
|
+
s.class_count = s.labeled_count = s.peak_memory_bytes = -1;
|
|
59
|
+
s.classification_complete = r.classify == 0;
|
|
60
|
+
s.hydrogen_complete = 1;
|
|
61
|
+
}
|
|
62
|
+
inline void stopped(Statistics &s, int reason) {
|
|
63
|
+
s.status = SYNKIT_LIMIT;
|
|
64
|
+
s.reason = reason;
|
|
65
|
+
s.search_complete = 0;
|
|
66
|
+
}
|
|
67
|
+
inline int unsupported(Statistics &s) {
|
|
68
|
+
s.status = SYNKIT_UNSUPPORTED;
|
|
69
|
+
s.reason = SYNKIT_STOP_UNSUPPORTED;
|
|
70
|
+
s.search_complete = 0;
|
|
71
|
+
return 0;
|
|
72
|
+
}
|
|
73
|
+
inline int64_t mapping_cost2(const Problem &p,
|
|
74
|
+
const std::vector<int32_t> &map) {
|
|
75
|
+
if (static_cast<int>(map.size()) != p.n)
|
|
76
|
+
throw std::invalid_argument("Wrong mapping size");
|
|
77
|
+
std::vector<bool> used(p.n, false);
|
|
78
|
+
for (int i = 0; i < p.n; ++i) {
|
|
79
|
+
int j = map[i];
|
|
80
|
+
if (j < 0 || j >= p.n || used[j] || p.types_r[i] != p.types_p[j])
|
|
81
|
+
throw std::invalid_argument("Incompatible atom bijection");
|
|
82
|
+
used[j] = true;
|
|
83
|
+
}
|
|
84
|
+
int64_t cost = 0;
|
|
85
|
+
for (int i = 0; i < p.n; ++i)
|
|
86
|
+
for (int k = i + 1; k < p.n; ++k)
|
|
87
|
+
cost += std::abs(p.a2[i * p.n + k] - p.b2[map[i] * p.n + map[k]]);
|
|
88
|
+
return cost;
|
|
89
|
+
}
|
|
90
|
+
inline void validate(const Problem &p, const Request &r) {
|
|
91
|
+
if (p.abi_version != 1 || r.abi_version != 1 || p.n < 1 || p.n > 1024 ||
|
|
92
|
+
!p.a2 || !p.b2 || !p.types_r || !p.types_p)
|
|
93
|
+
throw std::invalid_argument("Invalid core problem ABI or dimensions");
|
|
94
|
+
if (r.backend < 0 || r.backend > SYNKIT_SEPDP || r.query < 0 || r.query > 3 ||
|
|
95
|
+
r.workers != 1 || (r.symmetry != 0 && r.symmetry != 1) ||
|
|
96
|
+
(r.classify != 0 && r.classify != 1) || !std::isfinite(r.seconds) ||
|
|
97
|
+
(r.seconds < 0 && r.seconds != -1) ||
|
|
98
|
+
((r.query == SYNKIT_EXACT_DISTANCE ||
|
|
99
|
+
r.query == SYNKIT_AT_MOST_DISTANCE) &&
|
|
100
|
+
r.target2 < 0))
|
|
101
|
+
throw std::invalid_argument("Invalid core request");
|
|
102
|
+
for (int64_t cap : {r.max_states, r.max_candidates, r.max_classes,
|
|
103
|
+
r.max_frontier, r.memory_limit_bytes})
|
|
104
|
+
if (cap == 0 || cap < -1)
|
|
105
|
+
throw std::invalid_argument("Core limits must be positive or -1");
|
|
106
|
+
std::map<int32_t, int> counts;
|
|
107
|
+
for (int i = 0; i < p.n; ++i) {
|
|
108
|
+
++counts[p.types_r[i]];
|
|
109
|
+
--counts[p.types_p[i]];
|
|
110
|
+
if (p.a2[i * p.n + i] || p.b2[i * p.n + i])
|
|
111
|
+
throw std::invalid_argument("Core matrices must be loop free");
|
|
112
|
+
for (int j = 0; j < p.n; ++j) {
|
|
113
|
+
auto a = p.a2[i * p.n + j], b = p.b2[i * p.n + j];
|
|
114
|
+
if (a < 0 || b < 0 || a > 1000000 || b > 1000000 ||
|
|
115
|
+
a != p.a2[j * p.n + i] || b != p.b2[j * p.n + i])
|
|
116
|
+
throw std::invalid_argument(
|
|
117
|
+
"Core weights must be bounded nonnegative symmetric integers");
|
|
118
|
+
if ((p.edge_colors_r &&
|
|
119
|
+
p.edge_colors_r[i * p.n + j] != p.edge_colors_r[j * p.n + i]) ||
|
|
120
|
+
(p.edge_colors_p &&
|
|
121
|
+
p.edge_colors_p[i * p.n + j] != p.edge_colors_p[j * p.n + i]))
|
|
122
|
+
throw std::invalid_argument("Class edge attributes must be symmetric");
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
for (auto [type, count] : counts)
|
|
126
|
+
if (count)
|
|
127
|
+
throw std::invalid_argument("Unequal compatible atom inventories");
|
|
128
|
+
}
|
|
129
|
+
} // namespace synkit_mapper
|
|
130
|
+
#endif
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
#ifndef SYNKIT_MAPPER_HYDROGEN_H
|
|
2
|
+
#define SYNKIT_MAPPER_HYDROGEN_H
|
|
3
|
+
#include "synkit_mapper/mapper.h"
|
|
4
|
+
#include "synkit_mapper/symmetry/classification.h"
|
|
5
|
+
#ifdef __cplusplus
|
|
6
|
+
extern "C" {
|
|
7
|
+
#endif
|
|
8
|
+
/* Additive hydrogen ABI1. Metadata uses original full endpoint indices.
|
|
9
|
+
* Objective matrices already contain forced electron anchors; neutral terminal
|
|
10
|
+
* H has exactly one weight2=2 edge and no additional electron cost. */
|
|
11
|
+
typedef struct SynkitHydrogenAttributes {
|
|
12
|
+
const int32_t *atomic_numbers_r,*atomic_numbers_p;
|
|
13
|
+
const int32_t *isotopes_r,*isotopes_p;
|
|
14
|
+
const int32_t *charges_r,*charges_p;
|
|
15
|
+
const int32_t *radicals_r,*radicals_p;
|
|
16
|
+
const int32_t *dummies_r,*dummies_p;
|
|
17
|
+
const int32_t *stereo_r,*stereo_p;
|
|
18
|
+
} SynkitHydrogenAttributes;
|
|
19
|
+
enum SynkitHydrogenEligibility {
|
|
20
|
+
SYNKIT_H_SUPPORTED=0,SYNKIT_H_NO_HYDROGEN=1,SYNKIT_H_ISOTOPE=2,
|
|
21
|
+
SYNKIT_H_STEREO=3,SYNKIT_H_DUMMY_BOND=4,SYNKIT_H_ELECTRON_STATE=5,
|
|
22
|
+
SYNKIT_H_NONTERMINAL=6,SYNKIT_H_BOND_STATE=7,SYNKIT_H_CLASS_ATTRIBUTES=8,
|
|
23
|
+
SYNKIT_H_REDUCED_BACKEND=9
|
|
24
|
+
};
|
|
25
|
+
typedef struct SynkitHydrogenStatistics {
|
|
26
|
+
int32_t supported,eligibility_reason,transport_complete,reason;
|
|
27
|
+
int64_t full_nodes,quotient_nodes,heavy_candidates,transport_plans,transport_nodes;
|
|
28
|
+
double reduction_seconds,heavy_seconds,transport_seconds;
|
|
29
|
+
} SynkitHydrogenStatistics;
|
|
30
|
+
typedef struct SynkitHydrogenTransportStatistics {
|
|
31
|
+
int64_t minimum2,plans,nodes;
|
|
32
|
+
int32_t complete,reason;
|
|
33
|
+
double elapsed_seconds;
|
|
34
|
+
} SynkitHydrogenTransportStatistics;
|
|
35
|
+
/* Flow cells are groups*groups, row-major. Their exact labeled multiplicity
|
|
36
|
+
* is decimal text, not a saturated int64. Costs are doubled CD. */
|
|
37
|
+
typedef int (*SynkitHydrogenTransportCallback)(const int32_t *cells,int64_t cost2,
|
|
38
|
+
const char *multiplicity,void *);
|
|
39
|
+
SYNKIT_MAPPER_API int synkit_mapper_hydrogen_abi(void);
|
|
40
|
+
SYNKIT_MAPPER_API const char *synkit_mapper_hydrogen_error(void);
|
|
41
|
+
/* reservoir=-1 means all groups are real parents; otherwise it is the single
|
|
42
|
+
* isolated dummy-H group. Queries use the shared minimum/exact/at-most enum.
|
|
43
|
+
* Caps are -1 unlimited or positive. minimum2 ignores dummy-reservoir edges. */
|
|
44
|
+
SYNKIT_MAPPER_API int synkit_mapper_hydrogen_transport(
|
|
45
|
+
int groups,const int32_t *rows,const int32_t *columns,int reservoir,int query,
|
|
46
|
+
int64_t target2,double seconds,int64_t max_plans,int64_t max_nodes,void *cancel_token,
|
|
47
|
+
SynkitHydrogenTransportCallback,void *,SynkitHydrogenTransportStatistics *);
|
|
48
|
+
/* Request.backend chooses the reduced heavy solver. Unsupported H states
|
|
49
|
+
* return UNSUPPORTED + eligibility_reason; no implicit full-search fallback.
|
|
50
|
+
* Numeric queries use a heavy minimum-H lower envelope and enumerate all
|
|
51
|
+
* bounded H allocations. max_candidates counts lifted flow representatives.
|
|
52
|
+
* memory_limit_bytes retains the selected heavy backend's accounted units;
|
|
53
|
+
* H/class intermediate buffers and RSS are outside those units. */
|
|
54
|
+
SYNKIT_MAPPER_API int synkit_mapper_hydrogen_solve(
|
|
55
|
+
const SynkitMapperProblem *,const SynkitHydrogenAttributes *,const SynkitMapperRequest *,
|
|
56
|
+
int64_t max_transport_plans,SynkitMapperCallback,void *,SynkitMapperStatistics *,
|
|
57
|
+
SynkitHydrogenStatistics *);
|
|
58
|
+
SYNKIT_MAPPER_API int synkit_mapper_hydrogen_solve_classified(
|
|
59
|
+
const SynkitMapperProblem *,const SynkitHydrogenAttributes *,const SynkitMapperRequest *,
|
|
60
|
+
const SynkitClassProblem *,int64_t max_transport_plans,int64_t max_canonical_nodes,
|
|
61
|
+
SynkitClassCallback,void *,SynkitMapperStatistics *,SynkitHydrogenStatistics *,
|
|
62
|
+
SynkitClassStatistics *);
|
|
63
|
+
/* Additive first-discovery/cumulative-count delivery. See the classification
|
|
64
|
+
* update API; legacy hydrogen classified callbacks remain final batch counts. */
|
|
65
|
+
SYNKIT_MAPPER_API int synkit_mapper_hydrogen_solve_classified_updates(
|
|
66
|
+
const SynkitMapperProblem *,const SynkitHydrogenAttributes *,const SynkitMapperRequest *,
|
|
67
|
+
const SynkitClassProblem *,int64_t max_transport_plans,int64_t max_canonical_nodes,
|
|
68
|
+
SynkitClassCallback,void *,SynkitMapperStatistics *,SynkitHydrogenStatistics *,
|
|
69
|
+
SynkitClassStatistics *);
|
|
70
|
+
#ifdef __cplusplus
|
|
71
|
+
}
|
|
72
|
+
#endif
|
|
73
|
+
#endif
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
#ifndef SYNKIT_MAPPER_CORE_H
|
|
2
|
+
#define SYNKIT_MAPPER_CORE_H
|
|
3
|
+
|
|
4
|
+
#include "synkit_mapper/slap.h"
|
|
5
|
+
#include <stdint.h>
|
|
6
|
+
|
|
7
|
+
// Additive core ABI; the original SLAP ABI1 and PABS ABI3 remain separate.
|
|
8
|
+
#define SYNKIT_MAPPER_CORE_ABI 1
|
|
9
|
+
|
|
10
|
+
enum SynkitBackend {
|
|
11
|
+
SYNKIT_SLAP = 0,
|
|
12
|
+
SYNKIT_PABS = 1,
|
|
13
|
+
SYNKIT_CP_SAT = 2,
|
|
14
|
+
SYNKIT_SCIP = 3,
|
|
15
|
+
SYNKIT_MAXSAT = 4,
|
|
16
|
+
SYNKIT_ASTAR = 5,
|
|
17
|
+
SYNKIT_CPABS = 6,
|
|
18
|
+
SYNKIT_ABB = 7,
|
|
19
|
+
SYNKIT_KBB = 8,
|
|
20
|
+
SYNKIT_KMILP = 9,
|
|
21
|
+
SYNKIT_EDIT = 10,
|
|
22
|
+
SYNKIT_DFS = 11,
|
|
23
|
+
SYNKIT_MCES = 12,
|
|
24
|
+
SYNKIT_SEPDP = 13
|
|
25
|
+
};
|
|
26
|
+
enum SynkitQuery {
|
|
27
|
+
SYNKIT_MINIMUM_CLASSES = 0,
|
|
28
|
+
SYNKIT_EXACT_DISTANCE = 1,
|
|
29
|
+
SYNKIT_AT_MOST_DISTANCE = 2,
|
|
30
|
+
SYNKIT_MINIMUM_PROOF = 3
|
|
31
|
+
};
|
|
32
|
+
enum SynkitRunStatus {
|
|
33
|
+
SYNKIT_FINISHED = 0,
|
|
34
|
+
SYNKIT_LIMIT = 1,
|
|
35
|
+
SYNKIT_UNSUPPORTED = 2,
|
|
36
|
+
SYNKIT_ERROR = 3
|
|
37
|
+
};
|
|
38
|
+
enum SynkitStopReason {
|
|
39
|
+
SYNKIT_STOP_NONE = 0,
|
|
40
|
+
SYNKIT_STOP_TIME = 1,
|
|
41
|
+
SYNKIT_STOP_STATES = 2,
|
|
42
|
+
SYNKIT_STOP_CANDIDATES = 3,
|
|
43
|
+
SYNKIT_STOP_CLASSES = 4,
|
|
44
|
+
SYNKIT_STOP_CALLBACK = 5,
|
|
45
|
+
SYNKIT_STOP_FRONTIER = 6,
|
|
46
|
+
SYNKIT_STOP_MEMORY = 7,
|
|
47
|
+
SYNKIT_STOP_UNSUPPORTED = 8,
|
|
48
|
+
SYNKIT_STOP_HEURISTIC = 9,
|
|
49
|
+
SYNKIT_STOP_CANCELLED = 10
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
typedef struct SynkitMapperProblem {
|
|
53
|
+
int32_t abi_version;
|
|
54
|
+
int32_t n;
|
|
55
|
+
// Actual objective matrices in doubled chemical-distance units. Unary
|
|
56
|
+
// electron/H terms, if encoded as forced anchors, are already in these.
|
|
57
|
+
const int64_t *a2;
|
|
58
|
+
const int64_t *b2;
|
|
59
|
+
const int32_t *types_r;
|
|
60
|
+
const int32_t *types_p;
|
|
61
|
+
// Optional extra endpoint attributes for symmetry/class identity. They are
|
|
62
|
+
// NOT hard matching restrictions. Palettes must be shared across endpoints.
|
|
63
|
+
const int32_t *node_colors_r;
|
|
64
|
+
const int32_t *node_colors_p;
|
|
65
|
+
const int32_t *edge_colors_r;
|
|
66
|
+
const int32_t *edge_colors_p;
|
|
67
|
+
} SynkitMapperProblem;
|
|
68
|
+
|
|
69
|
+
typedef struct SynkitMapperRequest {
|
|
70
|
+
int32_t abi_version;
|
|
71
|
+
int32_t backend;
|
|
72
|
+
int32_t query;
|
|
73
|
+
int32_t
|
|
74
|
+
symmetry; // 0 disabled, 1 verified subgroup; cPABS is its own backend.
|
|
75
|
+
int32_t
|
|
76
|
+
classify; // Reserved: 0 raw candidates, 1 requires native class support.
|
|
77
|
+
int32_t workers; // Primary common track requires one worker.
|
|
78
|
+
int64_t target2; // Numeric query threshold in doubled CD; otherwise ignored.
|
|
79
|
+
double seconds; // -1 unlimited; shared deadline includes callback wall time.
|
|
80
|
+
int64_t max_states;
|
|
81
|
+
int64_t max_candidates;
|
|
82
|
+
int64_t max_classes;
|
|
83
|
+
int64_t max_frontier;
|
|
84
|
+
int64_t memory_limit_bytes;
|
|
85
|
+
int32_t slap_max_fingerprints;
|
|
86
|
+
const int32_t
|
|
87
|
+
*slap_stop_flags; // Optional original-label policy; not type IDs.
|
|
88
|
+
void *cancel_token; // Created/freed through the core cancellation API.
|
|
89
|
+
} SynkitMapperRequest;
|
|
90
|
+
|
|
91
|
+
typedef struct SynkitMapperStatistics {
|
|
92
|
+
int32_t abi_version;
|
|
93
|
+
int32_t backend;
|
|
94
|
+
int32_t status;
|
|
95
|
+
int32_t reason;
|
|
96
|
+
int32_t minimum_proven;
|
|
97
|
+
int32_t search_complete;
|
|
98
|
+
int32_t classification_complete;
|
|
99
|
+
int32_t hydrogen_complete;
|
|
100
|
+
int32_t heuristic_finished;
|
|
101
|
+
int64_t minimum2;
|
|
102
|
+
int64_t incumbent2;
|
|
103
|
+
int64_t lower_bound2;
|
|
104
|
+
int64_t nodes;
|
|
105
|
+
int64_t leaves;
|
|
106
|
+
int64_t candidate_count;
|
|
107
|
+
int64_t class_count;
|
|
108
|
+
int64_t labeled_count;
|
|
109
|
+
int64_t peak_frontier;
|
|
110
|
+
int64_t peak_frontier_bytes;
|
|
111
|
+
int64_t peak_memory_bytes; // -1 unavailable, not a fabricated process RSS.
|
|
112
|
+
double model_seconds;
|
|
113
|
+
double optimization_seconds;
|
|
114
|
+
double
|
|
115
|
+
enumeration_seconds; // Includes callbacks; callback time also recorded.
|
|
116
|
+
double classification_seconds;
|
|
117
|
+
double callback_seconds;
|
|
118
|
+
double elapsed_seconds;
|
|
119
|
+
} SynkitMapperStatistics;
|
|
120
|
+
|
|
121
|
+
typedef int (*SynkitMapperCallback)(const int32_t *mapping, int64_t cost2,
|
|
122
|
+
void *userdata);
|
|
123
|
+
|
|
124
|
+
#ifdef __cplusplus
|
|
125
|
+
extern "C" {
|
|
126
|
+
#endif
|
|
127
|
+
SYNKIT_MAPPER_API int synkit_mapper_core_abi(void);
|
|
128
|
+
SYNKIT_MAPPER_API uint64_t synkit_mapper_capabilities(void);
|
|
129
|
+
SYNKIT_MAPPER_API const char *synkit_mapper_core_error(void);
|
|
130
|
+
SYNKIT_MAPPER_API const char *synkit_mapper_backend_version(int backend);
|
|
131
|
+
SYNKIT_MAPPER_API const char *synkit_mapper_backend_metadata(int backend);
|
|
132
|
+
SYNKIT_MAPPER_API int synkit_mapper_solve(const SynkitMapperProblem *,
|
|
133
|
+
const SynkitMapperRequest *,
|
|
134
|
+
SynkitMapperCallback, void *,
|
|
135
|
+
SynkitMapperStatistics *);
|
|
136
|
+
// Explicit row-major allowed-correspondence mask for restricted kernel
|
|
137
|
+
// methods. Scope is the supplied domains, never a full-space proof by default.
|
|
138
|
+
SYNKIT_MAPPER_API int synkit_mapper_solve_domains(
|
|
139
|
+
const SynkitMapperProblem *, const SynkitMapperRequest *, const uint8_t *,
|
|
140
|
+
SynkitMapperCallback, void *, SynkitMapperStatistics *);
|
|
141
|
+
SYNKIT_MAPPER_API void *synkit_mapper_cancel_create(void);
|
|
142
|
+
SYNKIT_MAPPER_API void synkit_mapper_cancel_request(void *);
|
|
143
|
+
SYNKIT_MAPPER_API void synkit_mapper_cancel_free(void *);
|
|
144
|
+
#ifdef __cplusplus
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
// Backend entry points are C++ functions inside the one library. The public C
|
|
148
|
+
// dispatcher validates input, catches exceptions and translates error state.
|
|
149
|
+
namespace synkit_mapper {
|
|
150
|
+
using Problem = SynkitMapperProblem;
|
|
151
|
+
using Request = SynkitMapperRequest;
|
|
152
|
+
using Statistics = SynkitMapperStatistics;
|
|
153
|
+
using Callback = SynkitMapperCallback;
|
|
154
|
+
int solve_pabs(const Problem &, const Request &, Callback, void *,
|
|
155
|
+
Statistics &);
|
|
156
|
+
int solve_ortools(const Problem &, const Request &, Callback, void *,
|
|
157
|
+
Statistics &);
|
|
158
|
+
int solve_maxsat(const Problem &, const Request &, Callback, void *,
|
|
159
|
+
Statistics &);
|
|
160
|
+
int solve_astar(const Problem &, const Request &, Callback, void *,
|
|
161
|
+
Statistics &);
|
|
162
|
+
int solve_cpabs(const Problem &, const Request &, Callback, void *,
|
|
163
|
+
Statistics &);
|
|
164
|
+
int solve_abb(const Problem &, const Request &, const uint8_t *, Callback,
|
|
165
|
+
void *, Statistics &);
|
|
166
|
+
int solve_kernel_milp(const Problem &, const Request &, const uint8_t *,
|
|
167
|
+
Callback, void *, Statistics &);
|
|
168
|
+
int solve_edit_support(const Problem &, const Request &, Callback, void *,
|
|
169
|
+
Statistics &);
|
|
170
|
+
int solve_dfs(const Problem &, const Request &, Callback, void *, Statistics &);
|
|
171
|
+
int solve_mces(const Problem &, const Request &, Callback, void *, Statistics &);
|
|
172
|
+
int solve_sepdp(const Problem &, const Request &, Callback, void *, Statistics &);
|
|
173
|
+
} // namespace synkit_mapper
|
|
174
|
+
#endif
|
|
175
|
+
#endif
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
#pragma once
|
|
2
|
+
#include "synkit_mapper/mapper.h"
|
|
3
|
+
namespace synkit_mapper {
|
|
4
|
+
// Full-bijection weighted common-edge overlap, via size-n cliques of the
|
|
5
|
+
// explicit compatible-correspondence association graph. Not binary-only MCES.
|
|
6
|
+
int solve_mces(const Problem &, const Request &, Callback, void *,
|
|
7
|
+
Statistics &);
|
|
8
|
+
const char *mces_run_metadata();
|
|
9
|
+
} // namespace synkit_mapper
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
#ifndef SYNKIT_MAPPER_PABS_SEED_H
|
|
2
|
+
#define SYNKIT_MAPPER_PABS_SEED_H
|
|
3
|
+
|
|
4
|
+
#include "synkit_mapper/core/runtime.h"
|
|
5
|
+
|
|
6
|
+
namespace synkit_mapper {
|
|
7
|
+
namespace pabs {
|
|
8
|
+
|
|
9
|
+
// Shared input-only feasible incumbent policy. The Problem must satisfy the
|
|
10
|
+
// common validated weighted/type-compatible graph contract. Returns false,
|
|
11
|
+
// without changing outputs, outside the legacy PABS seed domain: n<=512,
|
|
12
|
+
// doubled edge weights<=1024, at most16 distinct edge values, combined endpoint
|
|
13
|
+
// undirected edge mass<=500000. A caller with a broader domain must retain its
|
|
14
|
+
// own supported seed policy rather than declaring its exact backend unsupported.
|
|
15
|
+
//
|
|
16
|
+
// On true, mapping is a full compatible bijection, incumbent2 is its separately
|
|
17
|
+
// rescored pairwise cost, and lower_bound2 is ceil(profile-LAP minimum/2).
|
|
18
|
+
// The LAP uses the unchanged legacy Hungarian tie rules. polish=false retains
|
|
19
|
+
// just this profile assignment; true applies the existing eight swap passes
|
|
20
|
+
// and bounded native-SLAP/mixed-start policy. No reference, hard domains or
|
|
21
|
+
// optimality claim is introduced. All work shares the caller's Budget.
|
|
22
|
+
//
|
|
23
|
+
// Stop can interrupt preparation. Once a feasible initial map is available,
|
|
24
|
+
// mapping/incumbent2/lower_bound2 are published and remain valid on Stop; before
|
|
25
|
+
// that the outputs remain unchanged. The wall-limited policy does not promise
|
|
26
|
+
// identical seed maps or costs across independent executions.
|
|
27
|
+
bool prepare_seed(const Problem &problem, Budget &budget, bool polish,
|
|
28
|
+
std::vector<int32_t> &mapping, int64_t &incumbent2,
|
|
29
|
+
int64_t &lower_bound2, bool *original_profile_zero=nullptr);
|
|
30
|
+
|
|
31
|
+
} // namespace pabs
|
|
32
|
+
} // namespace synkit_mapper
|
|
33
|
+
|
|
34
|
+
#endif
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
#pragma once
|
|
2
|
+
#include "synkit_mapper/mapper.h"
|
|
3
|
+
|
|
4
|
+
typedef struct SynkitReactionOptions {
|
|
5
|
+
int32_t abi_version;
|
|
6
|
+
int32_t explicit_hydrogens;
|
|
7
|
+
int32_t lewis_objective;
|
|
8
|
+
int32_t dummy_balance;
|
|
9
|
+
int32_t binary;
|
|
10
|
+
int32_t hydrogen_quotient;
|
|
11
|
+
int32_t empty_numeric_shell;
|
|
12
|
+
int64_t max_canonical_nodes;
|
|
13
|
+
int64_t max_hydrogen_plans;
|
|
14
|
+
} SynkitReactionOptions;
|
|
15
|
+
|
|
16
|
+
#ifdef __cplusplus
|
|
17
|
+
extern "C" {
|
|
18
|
+
#endif
|
|
19
|
+
SYNKIT_MAPPER_API int synkit_mapper_reaction_abi(void);
|
|
20
|
+
SYNKIT_MAPPER_API const char *synkit_mapper_reaction_error(void);
|
|
21
|
+
SYNKIT_MAPPER_API const char *synkit_mapper_rdkit_version(void);
|
|
22
|
+
// Entire parse -> objective -> native search/classification -> mapped-SMILES
|
|
23
|
+
// pipeline. Returned UTF-8 JSON is owned by the caller and freed below.
|
|
24
|
+
SYNKIT_MAPPER_API int synkit_mapper_reaction_solve(
|
|
25
|
+
const char *, const SynkitReactionOptions *, const SynkitMapperRequest *,
|
|
26
|
+
char **json_output);
|
|
27
|
+
SYNKIT_MAPPER_API void synkit_mapper_reaction_free(char *);
|
|
28
|
+
#ifdef __cplusplus
|
|
29
|
+
}
|
|
30
|
+
#endif
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#ifndef SYNKIT_MAPPER_SEPDP_H
|
|
2
|
+
#define SYNKIT_MAPPER_SEPDP_H
|
|
3
|
+
|
|
4
|
+
#include "synkit_mapper/mapper.h"
|
|
5
|
+
|
|
6
|
+
typedef struct SynkitSepDPProfile {
|
|
7
|
+
int64_t separator_width;
|
|
8
|
+
int64_t states;
|
|
9
|
+
int64_t predecessor_arcs;
|
|
10
|
+
int64_t transitions;
|
|
11
|
+
int64_t peak_accounted_table_bytes;
|
|
12
|
+
} SynkitSepDPProfile;
|
|
13
|
+
|
|
14
|
+
#ifdef __cplusplus
|
|
15
|
+
extern "C" {
|
|
16
|
+
#endif
|
|
17
|
+
SYNKIT_MAPPER_API void synkit_mapper_sepdp_profile(SynkitSepDPProfile *);
|
|
18
|
+
#ifdef __cplusplus
|
|
19
|
+
}
|
|
20
|
+
#endif
|
|
21
|
+
#endif
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
#ifndef SYNKIT_MAPPER_SLAP_H
|
|
2
|
+
#define SYNKIT_MAPPER_SLAP_H
|
|
3
|
+
|
|
4
|
+
#include <stdint.h>
|
|
5
|
+
|
|
6
|
+
#if defined(_WIN32)
|
|
7
|
+
#define SYNKIT_MAPPER_API __declspec(dllexport)
|
|
8
|
+
#else
|
|
9
|
+
#define SYNKIT_MAPPER_API
|
|
10
|
+
#endif
|
|
11
|
+
|
|
12
|
+
#ifdef __cplusplus
|
|
13
|
+
extern "C" {
|
|
14
|
+
#endif
|
|
15
|
+
|
|
16
|
+
typedef struct SlapStatistics {
|
|
17
|
+
int64_t states;
|
|
18
|
+
int64_t lap_calls;
|
|
19
|
+
int64_t fingerprints;
|
|
20
|
+
int64_t candidates;
|
|
21
|
+
// Sum of incident-neighborhood costs in doubled-edge units. For a finished
|
|
22
|
+
// singleton mapping this is twice its cost2. -1 means no finished candidate.
|
|
23
|
+
int64_t best_proxy2;
|
|
24
|
+
// Finished heuristic exploration is not a global optimum/completeness proof.
|
|
25
|
+
int32_t completed;
|
|
26
|
+
// 0 finished, 1 deadline, 2 state cap, 3 mapping cap, 4 callback stop.
|
|
27
|
+
int32_t reason;
|
|
28
|
+
double elapsed_seconds;
|
|
29
|
+
double callback_seconds;
|
|
30
|
+
} SlapStatistics;
|
|
31
|
+
|
|
32
|
+
typedef int (*SlapMappingCallback)(const int32_t *mapping, int64_t cost2,
|
|
33
|
+
void *userdata);
|
|
34
|
+
|
|
35
|
+
SYNKIT_MAPPER_API int synkit_mapper_abi(void);
|
|
36
|
+
SYNKIT_MAPPER_API const char *synkit_mapper_error(void);
|
|
37
|
+
|
|
38
|
+
// Dependency-free deterministic weighted SLAP. A2/B2 are dense, symmetric,
|
|
39
|
+
// loop-free nonnegative matrices in twice chemical-distance units. Labels
|
|
40
|
+
// enforce original atom compatibility. The caller explicitly supplies the
|
|
41
|
+
// original algorithm's stop-on-multiple policy per source atom; label IDs have
|
|
42
|
+
// no special chemical meaning. n is 1..512. Negative seconds/caps must be -1,
|
|
43
|
+
// meaning unlimited. Output is the best completed mappings reached by the
|
|
44
|
+
// heuristic, never a claim to globally optimal/all-class enumeration.
|
|
45
|
+
// The inherited stop-on-multiple policy can leave no completed bijection on
|
|
46
|
+
// some graph inputs; this is reported explicitly rather than silently using
|
|
47
|
+
// another heuristic or claiming infeasibility.
|
|
48
|
+
//
|
|
49
|
+
// All neighborhood refinement, structural-fingerprint exploration, component
|
|
50
|
+
// filtering, LAP solving and noninteractive all-atom splitting run in C++.
|
|
51
|
+
// Stable collision-free signature interning, a deterministic Hungarian tie
|
|
52
|
+
// rule and native stable-WL split representatives distinguish this weighted
|
|
53
|
+
// variant from Python's hash/tie-dependent implementation.
|
|
54
|
+
//
|
|
55
|
+
// Return 0 on a finished/interrupted run; -1 on invalid input/heuristic failure
|
|
56
|
+
// or an internal error.
|
|
57
|
+
// The thread-local error string remains valid until the next call in that
|
|
58
|
+
// thread. Callbacks occur only for completed, independently rescored
|
|
59
|
+
// bijections.
|
|
60
|
+
SYNKIT_MAPPER_API int
|
|
61
|
+
synkit_slap_solve(int n, const int64_t *a2, const int64_t *b2,
|
|
62
|
+
const int32_t *labels_r, const int32_t *labels_p,
|
|
63
|
+
const int32_t *stop_on_multiple_per_source_node,
|
|
64
|
+
int max_fingerprints, double seconds, int64_t max_states,
|
|
65
|
+
int64_t max_mappings, SlapMappingCallback callback,
|
|
66
|
+
void *userdata, SlapStatistics *statistics);
|
|
67
|
+
|
|
68
|
+
#ifdef __cplusplus
|
|
69
|
+
}
|
|
70
|
+
#endif
|
|
71
|
+
|
|
72
|
+
#endif
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
#ifndef SYNKIT_MAPPER_SOLVERS_H
|
|
2
|
+
#define SYNKIT_MAPPER_SOLVERS_H
|
|
3
|
+
#include "synkit_mapper/mapper.h"
|
|
4
|
+
|
|
5
|
+
// Optional production adapters. Numerical SCIP proofs use the engine's
|
|
6
|
+
// configured tolerances (zero requested relative/absolute optimality gap);
|
|
7
|
+
// they are not independently checked formal certificates.
|
|
8
|
+
namespace synkit_mapper {
|
|
9
|
+
const char *ortools_solver_version(int backend);
|
|
10
|
+
const char *maxsat_solver_version();
|
|
11
|
+
const char *ortools_run_metadata();
|
|
12
|
+
const char *maxsat_run_metadata();
|
|
13
|
+
int solve_kernel_milp(const Problem &, const Request &, const uint8_t *,
|
|
14
|
+
Callback, void *, Statistics &);
|
|
15
|
+
} // namespace synkit_mapper
|
|
16
|
+
#endif
|