rdkit-headers 2022.3.3__py3-none-any.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.
- rdkit_headers/__init__.py +13 -0
- rdkit_headers/include/rdkit/CIPLabeler/CIPLabeler.h +59 -0
- rdkit_headers/include/rdkit/CIPLabeler/TooManyNodesException.h +28 -0
- rdkit_headers/include/rdkit/Catalogs/Catalog.h +461 -0
- rdkit_headers/include/rdkit/Catalogs/CatalogEntry.h +48 -0
- rdkit_headers/include/rdkit/Catalogs/CatalogParams.h +42 -0
- rdkit_headers/include/rdkit/ChemicalFeatures/ChemicalFeature.h +38 -0
- rdkit_headers/include/rdkit/ChemicalFeatures/FreeChemicalFeature.h +97 -0
- rdkit_headers/include/rdkit/DataManip/MetricMatrixCalc/MetricFuncs.h +54 -0
- rdkit_headers/include/rdkit/DataManip/MetricMatrixCalc/MetricMatrixCalc.h +106 -0
- rdkit_headers/include/rdkit/DataStructs/BitOps.h +337 -0
- rdkit_headers/include/rdkit/DataStructs/BitVect.h +68 -0
- rdkit_headers/include/rdkit/DataStructs/BitVectUtils.h +35 -0
- rdkit_headers/include/rdkit/DataStructs/BitVects.h +25 -0
- rdkit_headers/include/rdkit/DataStructs/DatastructsException.h +31 -0
- rdkit_headers/include/rdkit/DataStructs/DatastructsStreamOps.h +72 -0
- rdkit_headers/include/rdkit/DataStructs/DiscreteDistMat.h +30 -0
- rdkit_headers/include/rdkit/DataStructs/DiscreteValueVect.h +146 -0
- rdkit_headers/include/rdkit/DataStructs/ExplicitBitVect.h +96 -0
- rdkit_headers/include/rdkit/DataStructs/FPBReader.h +281 -0
- rdkit_headers/include/rdkit/DataStructs/MultiFPBReader.h +213 -0
- rdkit_headers/include/rdkit/DataStructs/SparseBitVect.h +101 -0
- rdkit_headers/include/rdkit/DataStructs/SparseIntVect.h +571 -0
- rdkit_headers/include/rdkit/DataStructs/base64.h +41 -0
- rdkit_headers/include/rdkit/DistGeom/BoundsMatrix.h +121 -0
- rdkit_headers/include/rdkit/DistGeom/ChiralSet.h +58 -0
- rdkit_headers/include/rdkit/DistGeom/ChiralViolationContrib.h +96 -0
- rdkit_headers/include/rdkit/DistGeom/DistGeomUtils.h +195 -0
- rdkit_headers/include/rdkit/DistGeom/DistViolationContrib.h +54 -0
- rdkit_headers/include/rdkit/DistGeom/FourthDimContrib.h +65 -0
- rdkit_headers/include/rdkit/DistGeom/TriangleSmooth.h +36 -0
- rdkit_headers/include/rdkit/Features/Feature.h +96 -0
- rdkit_headers/include/rdkit/ForceField/Contrib.h +40 -0
- rdkit_headers/include/rdkit/ForceField/ForceField.h +253 -0
- rdkit_headers/include/rdkit/ForceField/MMFF/AngleBend.h +78 -0
- rdkit_headers/include/rdkit/ForceField/MMFF/AngleConstraint.h +64 -0
- rdkit_headers/include/rdkit/ForceField/MMFF/BondStretch.h +67 -0
- rdkit_headers/include/rdkit/ForceField/MMFF/Contribs.h +26 -0
- rdkit_headers/include/rdkit/ForceField/MMFF/DistanceConstraint.h +61 -0
- rdkit_headers/include/rdkit/ForceField/MMFF/Nonbonded.h +105 -0
- rdkit_headers/include/rdkit/ForceField/MMFF/OopBend.h +65 -0
- rdkit_headers/include/rdkit/ForceField/MMFF/Params.h +1134 -0
- rdkit_headers/include/rdkit/ForceField/MMFF/PositionConstraint.h +55 -0
- rdkit_headers/include/rdkit/ForceField/MMFF/StretchBend.h +70 -0
- rdkit_headers/include/rdkit/ForceField/MMFF/TorsionAngle.h +79 -0
- rdkit_headers/include/rdkit/ForceField/MMFF/TorsionConstraint.h +70 -0
- rdkit_headers/include/rdkit/ForceField/UFF/AngleBend.h +92 -0
- rdkit_headers/include/rdkit/ForceField/UFF/AngleConstraint.h +64 -0
- rdkit_headers/include/rdkit/ForceField/UFF/BondStretch.h +83 -0
- rdkit_headers/include/rdkit/ForceField/UFF/Contribs.h +23 -0
- rdkit_headers/include/rdkit/ForceField/UFF/DistanceConstraint.h +62 -0
- rdkit_headers/include/rdkit/ForceField/UFF/Inversion.h +81 -0
- rdkit_headers/include/rdkit/ForceField/UFF/Nonbonded.h +87 -0
- rdkit_headers/include/rdkit/ForceField/UFF/Params.h +153 -0
- rdkit_headers/include/rdkit/ForceField/UFF/PositionConstraint.h +55 -0
- rdkit_headers/include/rdkit/ForceField/UFF/TorsionAngle.h +115 -0
- rdkit_headers/include/rdkit/ForceField/UFF/TorsionConstraint.h +70 -0
- rdkit_headers/include/rdkit/Geometry/Grid3D.h +55 -0
- rdkit_headers/include/rdkit/Geometry/GridUtils.h +64 -0
- rdkit_headers/include/rdkit/Geometry/Transform.h +19 -0
- rdkit_headers/include/rdkit/Geometry/Transform2D.h +85 -0
- rdkit_headers/include/rdkit/Geometry/Transform3D.h +101 -0
- rdkit_headers/include/rdkit/Geometry/UniformGrid3D.h +217 -0
- rdkit_headers/include/rdkit/Geometry/Utils.h +97 -0
- rdkit_headers/include/rdkit/Geometry/point.h +585 -0
- rdkit_headers/include/rdkit/GraphMol/Abbreviations/Abbreviations.h +132 -0
- rdkit_headers/include/rdkit/GraphMol/Atom.h +449 -0
- rdkit_headers/include/rdkit/GraphMol/AtomIterators.h +212 -0
- rdkit_headers/include/rdkit/GraphMol/Bond.h +393 -0
- rdkit_headers/include/rdkit/GraphMol/BondIterators.h +75 -0
- rdkit_headers/include/rdkit/GraphMol/Canon.h +130 -0
- rdkit_headers/include/rdkit/GraphMol/ChemReactions/Enumerate/CartesianProduct.h +147 -0
- rdkit_headers/include/rdkit/GraphMol/ChemReactions/Enumerate/Enumerate.h +187 -0
- rdkit_headers/include/rdkit/GraphMol/ChemReactions/Enumerate/EnumerateBase.h +200 -0
- rdkit_headers/include/rdkit/GraphMol/ChemReactions/Enumerate/EnumerateTypes.h +59 -0
- rdkit_headers/include/rdkit/GraphMol/ChemReactions/Enumerate/EnumerationPickler.h +60 -0
- rdkit_headers/include/rdkit/GraphMol/ChemReactions/Enumerate/EnumerationStrategyBase.h +227 -0
- rdkit_headers/include/rdkit/GraphMol/ChemReactions/Enumerate/RandomSample.h +163 -0
- rdkit_headers/include/rdkit/GraphMol/ChemReactions/Enumerate/RandomSampleAllBBs.h +184 -0
- rdkit_headers/include/rdkit/GraphMol/ChemReactions/PreprocessRxn.h +64 -0
- rdkit_headers/include/rdkit/GraphMol/ChemReactions/Reaction.h +491 -0
- rdkit_headers/include/rdkit/GraphMol/ChemReactions/ReactionFingerprints.h +147 -0
- rdkit_headers/include/rdkit/GraphMol/ChemReactions/ReactionParser.h +274 -0
- rdkit_headers/include/rdkit/GraphMol/ChemReactions/ReactionPickler.h +119 -0
- rdkit_headers/include/rdkit/GraphMol/ChemReactions/ReactionRunner.h +116 -0
- rdkit_headers/include/rdkit/GraphMol/ChemReactions/ReactionUtils.h +74 -0
- rdkit_headers/include/rdkit/GraphMol/ChemReactions/SanitizeRxn.h +169 -0
- rdkit_headers/include/rdkit/GraphMol/ChemTransforms/ChemTransforms.h +270 -0
- rdkit_headers/include/rdkit/GraphMol/ChemTransforms/MolFragmenter.h +120 -0
- rdkit_headers/include/rdkit/GraphMol/Chirality.h +137 -0
- rdkit_headers/include/rdkit/GraphMol/Conformer.h +183 -0
- rdkit_headers/include/rdkit/GraphMol/CoordGen.h +195 -0
- rdkit_headers/include/rdkit/GraphMol/Depictor/DepictUtils.h +366 -0
- rdkit_headers/include/rdkit/GraphMol/Depictor/EmbeddedFrag.h +544 -0
- rdkit_headers/include/rdkit/GraphMol/Depictor/RDDepictor.h +284 -0
- rdkit_headers/include/rdkit/GraphMol/Deprotect/Deprotect.h +105 -0
- rdkit_headers/include/rdkit/GraphMol/Descriptors/AUTOCORR2D.h +49 -0
- rdkit_headers/include/rdkit/GraphMol/Descriptors/AUTOCORR3D.h +51 -0
- rdkit_headers/include/rdkit/GraphMol/Descriptors/AtomFeat.h +39 -0
- rdkit_headers/include/rdkit/GraphMol/Descriptors/BCUT.h +66 -0
- rdkit_headers/include/rdkit/GraphMol/Descriptors/ConnectivityDescriptors.h +211 -0
- rdkit_headers/include/rdkit/GraphMol/Descriptors/CoulombMat.h +42 -0
- rdkit_headers/include/rdkit/GraphMol/Descriptors/Crippen.h +137 -0
- rdkit_headers/include/rdkit/GraphMol/Descriptors/Data3Ddescriptors.h +55 -0
- rdkit_headers/include/rdkit/GraphMol/Descriptors/EEM.h +59 -0
- rdkit_headers/include/rdkit/GraphMol/Descriptors/GETAWAY.h +51 -0
- rdkit_headers/include/rdkit/GraphMol/Descriptors/Lipinski.h +169 -0
- rdkit_headers/include/rdkit/GraphMol/Descriptors/MORSE.h +50 -0
- rdkit_headers/include/rdkit/GraphMol/Descriptors/MQN.h +47 -0
- rdkit_headers/include/rdkit/GraphMol/Descriptors/MolData3Ddescriptors.h +62 -0
- rdkit_headers/include/rdkit/GraphMol/Descriptors/MolDescriptors.h +86 -0
- rdkit_headers/include/rdkit/GraphMol/Descriptors/MolDescriptors3D.h +25 -0
- rdkit_headers/include/rdkit/GraphMol/Descriptors/MolSurf.h +120 -0
- rdkit_headers/include/rdkit/GraphMol/Descriptors/PBF.h +60 -0
- rdkit_headers/include/rdkit/GraphMol/Descriptors/PMI.h +128 -0
- rdkit_headers/include/rdkit/GraphMol/Descriptors/Property.h +123 -0
- rdkit_headers/include/rdkit/GraphMol/Descriptors/RDF.h +52 -0
- rdkit_headers/include/rdkit/GraphMol/Descriptors/RegisterDescriptor.h +84 -0
- rdkit_headers/include/rdkit/GraphMol/Descriptors/USRDescriptor.h +137 -0
- rdkit_headers/include/rdkit/GraphMol/Descriptors/WHIM.h +51 -0
- rdkit_headers/include/rdkit/GraphMol/DistGeomHelpers/BoundsMatrixBuilder.h +77 -0
- rdkit_headers/include/rdkit/GraphMol/DistGeomHelpers/Embedder.h +437 -0
- rdkit_headers/include/rdkit/GraphMol/FMCS/FMCS.h +194 -0
- rdkit_headers/include/rdkit/GraphMol/FMCS/Graph.h +43 -0
- rdkit_headers/include/rdkit/GraphMol/FileParsers/FileParserUtils.h +231 -0
- rdkit_headers/include/rdkit/GraphMol/FileParsers/FileParsers.h +399 -0
- rdkit_headers/include/rdkit/GraphMol/FileParsers/GeneralFileReader.h +170 -0
- rdkit_headers/include/rdkit/GraphMol/FileParsers/MolFileStereochem.h +60 -0
- rdkit_headers/include/rdkit/GraphMol/FileParsers/MolSupplier.h +444 -0
- rdkit_headers/include/rdkit/GraphMol/FileParsers/MolWriters.h +338 -0
- rdkit_headers/include/rdkit/GraphMol/FileParsers/MultithreadedMolSupplier.h +102 -0
- rdkit_headers/include/rdkit/GraphMol/FileParsers/MultithreadedSDMolSupplier.h +65 -0
- rdkit_headers/include/rdkit/GraphMol/FileParsers/MultithreadedSmilesMolSupplier.h +66 -0
- rdkit_headers/include/rdkit/GraphMol/FileParsers/PNGParser.h +203 -0
- rdkit_headers/include/rdkit/GraphMol/FileParsers/SequenceParsers.h +117 -0
- rdkit_headers/include/rdkit/GraphMol/FileParsers/SequenceWriters.h +47 -0
- rdkit_headers/include/rdkit/GraphMol/FilterCatalog/FilterCatalog.h +260 -0
- rdkit_headers/include/rdkit/GraphMol/FilterCatalog/FilterCatalogEntry.h +276 -0
- rdkit_headers/include/rdkit/GraphMol/FilterCatalog/FilterMatcherBase.h +152 -0
- rdkit_headers/include/rdkit/GraphMol/FilterCatalog/FilterMatchers.h +576 -0
- rdkit_headers/include/rdkit/GraphMol/FilterCatalog/FunctionalGroupHierarchy.h +52 -0
- rdkit_headers/include/rdkit/GraphMol/Fingerprints/AtomPairGenerator.h +188 -0
- rdkit_headers/include/rdkit/GraphMol/Fingerprints/AtomPairs.h +268 -0
- rdkit_headers/include/rdkit/GraphMol/Fingerprints/FingerprintGenerator.h +372 -0
- rdkit_headers/include/rdkit/GraphMol/Fingerprints/FingerprintUtil.h +160 -0
- rdkit_headers/include/rdkit/GraphMol/Fingerprints/Fingerprints.h +167 -0
- rdkit_headers/include/rdkit/GraphMol/Fingerprints/MACCS.h +32 -0
- rdkit_headers/include/rdkit/GraphMol/Fingerprints/MHFP.h +285 -0
- rdkit_headers/include/rdkit/GraphMol/Fingerprints/MorganFingerprints.h +210 -0
- rdkit_headers/include/rdkit/GraphMol/Fingerprints/MorganGenerator.h +251 -0
- rdkit_headers/include/rdkit/GraphMol/Fingerprints/RDKitFPGenerator.h +162 -0
- rdkit_headers/include/rdkit/GraphMol/Fingerprints/TopologicalTorsionGenerator.h +127 -0
- rdkit_headers/include/rdkit/GraphMol/ForceFieldHelpers/CrystalFF/TorsionAngleM6.h +72 -0
- rdkit_headers/include/rdkit/GraphMol/ForceFieldHelpers/CrystalFF/TorsionPreferences.h +41 -0
- rdkit_headers/include/rdkit/GraphMol/ForceFieldHelpers/FFConvenience.h +130 -0
- rdkit_headers/include/rdkit/GraphMol/ForceFieldHelpers/MMFF/AtomTyper.h +236 -0
- rdkit_headers/include/rdkit/GraphMol/ForceFieldHelpers/MMFF/Builder.h +141 -0
- rdkit_headers/include/rdkit/GraphMol/ForceFieldHelpers/MMFF/MMFF.h +105 -0
- rdkit_headers/include/rdkit/GraphMol/ForceFieldHelpers/UFF/AtomTyper.h +57 -0
- rdkit_headers/include/rdkit/GraphMol/ForceFieldHelpers/UFF/Builder.h +129 -0
- rdkit_headers/include/rdkit/GraphMol/ForceFieldHelpers/UFF/UFF.h +82 -0
- rdkit_headers/include/rdkit/GraphMol/FragCatalog/FragCatGenerator.h +33 -0
- rdkit_headers/include/rdkit/GraphMol/FragCatalog/FragCatParams.h +94 -0
- rdkit_headers/include/rdkit/GraphMol/FragCatalog/FragCatalogEntry.h +136 -0
- rdkit_headers/include/rdkit/GraphMol/FragCatalog/FragCatalogUtils.h +62 -0
- rdkit_headers/include/rdkit/GraphMol/FragCatalog/FragFPGenerator.h +38 -0
- rdkit_headers/include/rdkit/GraphMol/GenericGroups/GenericGroups.h +301 -0
- rdkit_headers/include/rdkit/GraphMol/GraphMol.h +22 -0
- rdkit_headers/include/rdkit/GraphMol/MMPA/MMPA.h +81 -0
- rdkit_headers/include/rdkit/GraphMol/MolAlign/AlignMolecules.h +183 -0
- rdkit_headers/include/rdkit/GraphMol/MolAlign/O3AAlignMolecules.h +354 -0
- rdkit_headers/include/rdkit/GraphMol/MolBundle.h +121 -0
- rdkit_headers/include/rdkit/GraphMol/MolCatalog/MolCatalog.h +20 -0
- rdkit_headers/include/rdkit/GraphMol/MolCatalog/MolCatalogEntry.h +109 -0
- rdkit_headers/include/rdkit/GraphMol/MolCatalog/MolCatalogParams.h +40 -0
- rdkit_headers/include/rdkit/GraphMol/MolChemicalFeatures/FeatureParser.h +58 -0
- rdkit_headers/include/rdkit/GraphMol/MolChemicalFeatures/MolChemicalFeature.h +98 -0
- rdkit_headers/include/rdkit/GraphMol/MolChemicalFeatures/MolChemicalFeatureDef.h +68 -0
- rdkit_headers/include/rdkit/GraphMol/MolChemicalFeatures/MolChemicalFeatureFactory.h +78 -0
- rdkit_headers/include/rdkit/GraphMol/MolDraw2D/MolDraw2D.h +539 -0
- rdkit_headers/include/rdkit/GraphMol/MolDraw2D/MolDraw2DHelpers.h +284 -0
- rdkit_headers/include/rdkit/GraphMol/MolDraw2D/MolDraw2DJS.h +62 -0
- rdkit_headers/include/rdkit/GraphMol/MolDraw2D/MolDraw2DSVG.h +88 -0
- rdkit_headers/include/rdkit/GraphMol/MolDraw2D/MolDraw2DUtils.h +179 -0
- rdkit_headers/include/rdkit/GraphMol/MolDraw2D/MolDraw2Dwx.h +107 -0
- rdkit_headers/include/rdkit/GraphMol/MolEnumerator/LinkNode.h +159 -0
- rdkit_headers/include/rdkit/GraphMol/MolEnumerator/MolEnumerator.h +276 -0
- rdkit_headers/include/rdkit/GraphMol/MolHash/MolHash.h +12 -0
- rdkit_headers/include/rdkit/GraphMol/MolHash/nmmolhash.h +60 -0
- rdkit_headers/include/rdkit/GraphMol/MolInterchange/MolInterchange.h +93 -0
- rdkit_headers/include/rdkit/GraphMol/MolInterchange/details.h +49 -0
- rdkit_headers/include/rdkit/GraphMol/MolOps.h +1016 -0
- rdkit_headers/include/rdkit/GraphMol/MolPickler.h +314 -0
- rdkit_headers/include/rdkit/GraphMol/MolStandardize/AcidBaseCatalog/AcidBaseCatalogEntry.h +56 -0
- rdkit_headers/include/rdkit/GraphMol/MolStandardize/AcidBaseCatalog/AcidBaseCatalogParams.h +65 -0
- rdkit_headers/include/rdkit/GraphMol/MolStandardize/AcidBaseCatalog/AcidBaseCatalogUtils.h +37 -0
- rdkit_headers/include/rdkit/GraphMol/MolStandardize/Charge.h +145 -0
- rdkit_headers/include/rdkit/GraphMol/MolStandardize/Fragment.h +105 -0
- rdkit_headers/include/rdkit/GraphMol/MolStandardize/FragmentCatalog/FragmentCatalogEntry.h +60 -0
- rdkit_headers/include/rdkit/GraphMol/MolStandardize/FragmentCatalog/FragmentCatalogParams.h +63 -0
- rdkit_headers/include/rdkit/GraphMol/MolStandardize/FragmentCatalog/FragmentCatalogUtils.h +35 -0
- rdkit_headers/include/rdkit/GraphMol/MolStandardize/Metal.h +73 -0
- rdkit_headers/include/rdkit/GraphMol/MolStandardize/MolStandardize.h +178 -0
- rdkit_headers/include/rdkit/GraphMol/MolStandardize/Normalize.h +104 -0
- rdkit_headers/include/rdkit/GraphMol/MolStandardize/Tautomer.h +428 -0
- rdkit_headers/include/rdkit/GraphMol/MolStandardize/TautomerCatalog/TautomerCatalogEntry.h +59 -0
- rdkit_headers/include/rdkit/GraphMol/MolStandardize/TautomerCatalog/TautomerCatalogParams.h +69 -0
- rdkit_headers/include/rdkit/GraphMol/MolStandardize/TautomerCatalog/TautomerCatalogUtils.h +81 -0
- rdkit_headers/include/rdkit/GraphMol/MolStandardize/TransformCatalog/TransformCatalogEntry.h +57 -0
- rdkit_headers/include/rdkit/GraphMol/MolStandardize/TransformCatalog/TransformCatalogParams.h +66 -0
- rdkit_headers/include/rdkit/GraphMol/MolStandardize/TransformCatalog/TransformCatalogUtils.h +37 -0
- rdkit_headers/include/rdkit/GraphMol/MolStandardize/Validate.h +199 -0
- rdkit_headers/include/rdkit/GraphMol/MolTransforms/MolTransforms.h +222 -0
- rdkit_headers/include/rdkit/GraphMol/MonomerInfo.h +138 -0
- rdkit_headers/include/rdkit/GraphMol/PartialCharges/GasteigerCharges.h +27 -0
- rdkit_headers/include/rdkit/GraphMol/PartialCharges/GasteigerParams.h +86 -0
- rdkit_headers/include/rdkit/GraphMol/PeriodicTable.h +325 -0
- rdkit_headers/include/rdkit/GraphMol/QueryAtom.h +161 -0
- rdkit_headers/include/rdkit/GraphMol/QueryBond.h +146 -0
- rdkit_headers/include/rdkit/GraphMol/QueryOps.h +1110 -0
- rdkit_headers/include/rdkit/GraphMol/RDKitBase.h +35 -0
- rdkit_headers/include/rdkit/GraphMol/RDKitQueries.h +25 -0
- rdkit_headers/include/rdkit/GraphMol/RGroupDecomposition/RGroupDecomp.h +225 -0
- rdkit_headers/include/rdkit/GraphMol/ROMol.h +844 -0
- rdkit_headers/include/rdkit/GraphMol/RWMol.h +222 -0
- rdkit_headers/include/rdkit/GraphMol/ReducedGraphs/ReducedGraphs.h +85 -0
- rdkit_headers/include/rdkit/GraphMol/Resonance.h +236 -0
- rdkit_headers/include/rdkit/GraphMol/RingInfo.h +274 -0
- rdkit_headers/include/rdkit/GraphMol/Rings.h +90 -0
- rdkit_headers/include/rdkit/GraphMol/SLNParse/SLNAttribs.h +93 -0
- rdkit_headers/include/rdkit/GraphMol/SLNParse/SLNParse.h +70 -0
- rdkit_headers/include/rdkit/GraphMol/SLNParse/SLNParseOps.h +328 -0
- rdkit_headers/include/rdkit/GraphMol/SanitException.h +120 -0
- rdkit_headers/include/rdkit/GraphMol/ScaffoldNetwork/ScaffoldNetwork.h +195 -0
- rdkit_headers/include/rdkit/GraphMol/ShapeHelpers/ShapeEncoder.h +73 -0
- rdkit_headers/include/rdkit/GraphMol/ShapeHelpers/ShapeUtils.h +279 -0
- rdkit_headers/include/rdkit/GraphMol/SmilesParse/SmartsWrite.h +46 -0
- rdkit_headers/include/rdkit/GraphMol/SmilesParse/SmilesParse.h +160 -0
- rdkit_headers/include/rdkit/GraphMol/SmilesParse/SmilesParseOps.h +53 -0
- rdkit_headers/include/rdkit/GraphMol/SmilesParse/SmilesWrite.h +288 -0
- rdkit_headers/include/rdkit/GraphMol/SmilesParse/primes.h +18 -0
- rdkit_headers/include/rdkit/GraphMol/StereoGroup.h +74 -0
- rdkit_headers/include/rdkit/GraphMol/Subgraphs/SubgraphUtils.h +57 -0
- rdkit_headers/include/rdkit/GraphMol/Subgraphs/Subgraphs.h +154 -0
- rdkit_headers/include/rdkit/GraphMol/SubstanceGroup.h +297 -0
- rdkit_headers/include/rdkit/GraphMol/Substruct/SubstructMatch.h +232 -0
- rdkit_headers/include/rdkit/GraphMol/Substruct/SubstructUtils.h +44 -0
- rdkit_headers/include/rdkit/GraphMol/SubstructLibrary/PatternFactory.h +40 -0
- rdkit_headers/include/rdkit/GraphMol/SubstructLibrary/SubstructLibrary.h +951 -0
- rdkit_headers/include/rdkit/GraphMol/SubstructLibrary/SubstructLibrarySerialization.h +231 -0
- rdkit_headers/include/rdkit/GraphMol/TautomerQuery/TautomerQuery.h +104 -0
- rdkit_headers/include/rdkit/GraphMol/Trajectory/Snapshot.h +69 -0
- rdkit_headers/include/rdkit/GraphMol/Trajectory/Trajectory.h +105 -0
- rdkit_headers/include/rdkit/GraphMol/atomic_data.h +76 -0
- rdkit_headers/include/rdkit/GraphMol/details.h +15 -0
- rdkit_headers/include/rdkit/GraphMol/new_canon.h +772 -0
- rdkit_headers/include/rdkit/Numerics/Alignment/AlignPoints.h +49 -0
- rdkit_headers/include/rdkit/Numerics/Conrec.h +203 -0
- rdkit_headers/include/rdkit/Numerics/EigenSolvers/PowerEigenSolver.h +68 -0
- rdkit_headers/include/rdkit/Numerics/Matrix.h +347 -0
- rdkit_headers/include/rdkit/Numerics/Optimizer/BFGSOpt.h +397 -0
- rdkit_headers/include/rdkit/Numerics/SquareMatrix.h +89 -0
- rdkit_headers/include/rdkit/Numerics/SymmMatrix.h +361 -0
- rdkit_headers/include/rdkit/Numerics/Vector.h +327 -0
- rdkit_headers/include/rdkit/Query/AndQuery.h +57 -0
- rdkit_headers/include/rdkit/Query/EqualityQuery.h +88 -0
- rdkit_headers/include/rdkit/Query/GreaterEqualQuery.h +74 -0
- rdkit_headers/include/rdkit/Query/GreaterQuery.h +74 -0
- rdkit_headers/include/rdkit/Query/LessEqualQuery.h +75 -0
- rdkit_headers/include/rdkit/Query/LessQuery.h +74 -0
- rdkit_headers/include/rdkit/Query/NullQueryAlgebra.h +86 -0
- rdkit_headers/include/rdkit/Query/OrQuery.h +58 -0
- rdkit_headers/include/rdkit/Query/Query.h +210 -0
- rdkit_headers/include/rdkit/Query/QueryObjects.h +38 -0
- rdkit_headers/include/rdkit/Query/RangeQuery.h +116 -0
- rdkit_headers/include/rdkit/Query/SetQuery.h +87 -0
- rdkit_headers/include/rdkit/Query/XOrQuery.h +63 -0
- rdkit_headers/include/rdkit/RDGeneral/BadFileException.h +39 -0
- rdkit_headers/include/rdkit/RDGeneral/BoostEndInclude.h +69 -0
- rdkit_headers/include/rdkit/RDGeneral/BoostStartInclude.h +95 -0
- rdkit_headers/include/rdkit/RDGeneral/ConcurrentQueue.h +132 -0
- rdkit_headers/include/rdkit/RDGeneral/Dict.h +350 -0
- rdkit_headers/include/rdkit/RDGeneral/Exceptions.h +73 -0
- rdkit_headers/include/rdkit/RDGeneral/FileParseException.h +36 -0
- rdkit_headers/include/rdkit/RDGeneral/Invariant.h +198 -0
- rdkit_headers/include/rdkit/RDGeneral/LocaleSwitcher.h +54 -0
- rdkit_headers/include/rdkit/RDGeneral/RDAny.h +217 -0
- rdkit_headers/include/rdkit/RDGeneral/RDConfig.h +49 -0
- rdkit_headers/include/rdkit/RDGeneral/RDExportMacros.h +40 -0
- rdkit_headers/include/rdkit/RDGeneral/RDLog.h +142 -0
- rdkit_headers/include/rdkit/RDGeneral/RDProps.h +172 -0
- rdkit_headers/include/rdkit/RDGeneral/RDThreads.h +44 -0
- rdkit_headers/include/rdkit/RDGeneral/RDValue-doublemagic.h +478 -0
- rdkit_headers/include/rdkit/RDGeneral/RDValue-taggedunion.h +518 -0
- rdkit_headers/include/rdkit/RDGeneral/RDValue.h +285 -0
- rdkit_headers/include/rdkit/RDGeneral/Ranking.h +87 -0
- rdkit_headers/include/rdkit/RDGeneral/StreamOps.h +637 -0
- rdkit_headers/include/rdkit/RDGeneral/export.h +559 -0
- rdkit_headers/include/rdkit/RDGeneral/hanoiSort.h +167 -0
- rdkit_headers/include/rdkit/RDGeneral/hash/detail/float_functions.hpp +156 -0
- rdkit_headers/include/rdkit/RDGeneral/hash/detail/hash_float.hpp +179 -0
- rdkit_headers/include/rdkit/RDGeneral/hash/extensions.hpp +152 -0
- rdkit_headers/include/rdkit/RDGeneral/hash/hash.hpp +463 -0
- rdkit_headers/include/rdkit/RDGeneral/hash/hash_fwd.hpp +51 -0
- rdkit_headers/include/rdkit/RDGeneral/test.h +274 -0
- rdkit_headers/include/rdkit/RDGeneral/types.h +401 -0
- rdkit_headers/include/rdkit/RDGeneral/utils.h +106 -0
- rdkit_headers/include/rdkit/RDGeneral/versions.h +27 -0
- rdkit_headers/include/rdkit/RDStreams/streams.h +19 -0
- rdkit_headers/include/rdkit/RingDecomposerLib.h +751 -0
- rdkit_headers/include/rdkit/SimDivPickers/DistPicker.h +92 -0
- rdkit_headers/include/rdkit/SimDivPickers/HierarchicalClusterPicker.h +107 -0
- rdkit_headers/include/rdkit/SimDivPickers/LeaderPicker.h +470 -0
- rdkit_headers/include/rdkit/SimDivPickers/MaxMinPicker.h +303 -0
- rdkit_headers-2022.3.3.dist-info/METADATA +24 -0
- rdkit_headers-2022.3.3.dist-info/RECORD +320 -0
- rdkit_headers-2022.3.3.dist-info/WHEEL +4 -0
- rdkit_headers-2022.3.3.dist-info/entry_points.txt +4 -0
- rdkit_headers-2022.3.3.dist-info/licenses/LICENSE +29 -0
- rdkit_headers-2022.3.3.dist-info/licenses/NOTICE +5 -0
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
// Copyright (c) 2015, Novartis Institutes for BioMedical Research Inc.
|
|
2
|
+
// All rights reserved.
|
|
3
|
+
//
|
|
4
|
+
// Redistribution and use in source and binary forms, with or without
|
|
5
|
+
// modification, are permitted provided that the following conditions are
|
|
6
|
+
// met:
|
|
7
|
+
//
|
|
8
|
+
// * Redistributions of source code must retain the above copyright
|
|
9
|
+
// notice, this list of conditions and the following disclaimer.
|
|
10
|
+
// * Redistributions in binary form must reproduce the above
|
|
11
|
+
// copyright notice, this list of conditions and the following
|
|
12
|
+
// disclaimer in the documentation and/or other materials provided
|
|
13
|
+
// with the distribution.
|
|
14
|
+
// * Neither the name of Novartis Institutes for BioMedical Research Inc.
|
|
15
|
+
// nor the names of its contributors may be used to endorse or promote
|
|
16
|
+
// products derived from this software without specific prior written
|
|
17
|
+
// permission.
|
|
18
|
+
//
|
|
19
|
+
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
20
|
+
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
21
|
+
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
22
|
+
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
23
|
+
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
24
|
+
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
25
|
+
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
26
|
+
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
27
|
+
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
28
|
+
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
29
|
+
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
30
|
+
//
|
|
31
|
+
#include <RDGeneral/export.h>
|
|
32
|
+
#ifndef RDKIT_RDVALUE_H
|
|
33
|
+
#define RDKIT_RDVALUE_H
|
|
34
|
+
|
|
35
|
+
//#define UNSAFE_RDVALUE
|
|
36
|
+
#ifdef UNSAFE_RDVALUE
|
|
37
|
+
#include "RDValue-doublemagic.h"
|
|
38
|
+
#else
|
|
39
|
+
#include "RDValue-taggedunion.h"
|
|
40
|
+
#endif
|
|
41
|
+
|
|
42
|
+
namespace RDKit {
|
|
43
|
+
// Common Casts (POD Casts are implementation dependent)
|
|
44
|
+
// string casts
|
|
45
|
+
template <>
|
|
46
|
+
inline std::string rdvalue_cast<std::string>(RDValue_cast_t v) {
|
|
47
|
+
if (rdvalue_is<std::string>(v)) {
|
|
48
|
+
return *v.ptrCast<std::string>();
|
|
49
|
+
}
|
|
50
|
+
throw boost::bad_any_cast();
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
template <>
|
|
54
|
+
inline std::string &rdvalue_cast<std::string &>(RDValue_cast_t v) {
|
|
55
|
+
if (rdvalue_is<std::string>(v)) {
|
|
56
|
+
return *v.ptrCast<std::string>();
|
|
57
|
+
}
|
|
58
|
+
throw boost::bad_any_cast();
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// Special Vecor Casts
|
|
62
|
+
template <>
|
|
63
|
+
inline std::vector<double> rdvalue_cast<std::vector<double>>(RDValue_cast_t v) {
|
|
64
|
+
if (rdvalue_is<std::vector<double>>(v)) {
|
|
65
|
+
return *v.ptrCast<std::vector<double>>();
|
|
66
|
+
}
|
|
67
|
+
throw boost::bad_any_cast();
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
template <>
|
|
71
|
+
inline std::vector<double> &rdvalue_cast<std::vector<double> &>(
|
|
72
|
+
RDValue_cast_t v) {
|
|
73
|
+
if (rdvalue_is<std::vector<double>>(v)) {
|
|
74
|
+
return *v.ptrCast<std::vector<double>>();
|
|
75
|
+
}
|
|
76
|
+
throw boost::bad_any_cast();
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
template <>
|
|
80
|
+
inline std::vector<float> rdvalue_cast<std::vector<float>>(RDValue_cast_t v) {
|
|
81
|
+
if (rdvalue_is<std::vector<float>>(v)) {
|
|
82
|
+
return *v.ptrCast<std::vector<float>>();
|
|
83
|
+
}
|
|
84
|
+
throw boost::bad_any_cast();
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
template <>
|
|
88
|
+
inline std::vector<float> &rdvalue_cast<std::vector<float> &>(
|
|
89
|
+
RDValue_cast_t v) {
|
|
90
|
+
if (rdvalue_is<std::vector<float>>(v)) {
|
|
91
|
+
return *v.ptrCast<std::vector<float>>();
|
|
92
|
+
}
|
|
93
|
+
throw boost::bad_any_cast();
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
template <>
|
|
97
|
+
inline std::vector<std::string> rdvalue_cast<std::vector<std::string>>(
|
|
98
|
+
RDValue_cast_t v) {
|
|
99
|
+
if (rdvalue_is<std::vector<std::string>>(v)) {
|
|
100
|
+
return *v.ptrCast<std::vector<std::string>>();
|
|
101
|
+
}
|
|
102
|
+
throw boost::bad_any_cast();
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
template <>
|
|
106
|
+
inline std::vector<std::string> &rdvalue_cast<std::vector<std::string> &>(
|
|
107
|
+
RDValue_cast_t v) {
|
|
108
|
+
if (rdvalue_is<std::vector<std::string>>(v)) {
|
|
109
|
+
return *v.ptrCast<std::vector<std::string>>();
|
|
110
|
+
}
|
|
111
|
+
throw boost::bad_any_cast();
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
template <>
|
|
115
|
+
inline std::vector<int> rdvalue_cast<std::vector<int>>(RDValue_cast_t v) {
|
|
116
|
+
if (rdvalue_is<std::vector<int>>(v)) {
|
|
117
|
+
return *v.ptrCast<std::vector<int>>();
|
|
118
|
+
}
|
|
119
|
+
throw boost::bad_any_cast();
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
template <>
|
|
123
|
+
inline std::vector<int> &rdvalue_cast<std::vector<int> &>(RDValue_cast_t v) {
|
|
124
|
+
if (rdvalue_is<std::vector<int>>(v)) {
|
|
125
|
+
return *v.ptrCast<std::vector<int>>();
|
|
126
|
+
}
|
|
127
|
+
throw boost::bad_any_cast();
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
template <>
|
|
131
|
+
inline std::vector<unsigned int> rdvalue_cast<std::vector<unsigned int>>(
|
|
132
|
+
RDValue_cast_t v) {
|
|
133
|
+
if (rdvalue_is<std::vector<unsigned int>>(v)) {
|
|
134
|
+
return *v.ptrCast<std::vector<unsigned int>>();
|
|
135
|
+
}
|
|
136
|
+
throw boost::bad_any_cast();
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
template <>
|
|
140
|
+
inline std::vector<unsigned int> &rdvalue_cast<std::vector<unsigned int> &>(
|
|
141
|
+
RDValue_cast_t v) {
|
|
142
|
+
if (rdvalue_is<std::vector<unsigned int>>(v)) {
|
|
143
|
+
return *v.ptrCast<std::vector<unsigned int>>();
|
|
144
|
+
}
|
|
145
|
+
throw boost::bad_any_cast();
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
// Get boost any
|
|
149
|
+
template <>
|
|
150
|
+
inline boost::any rdvalue_cast<boost::any>(RDValue_cast_t v) {
|
|
151
|
+
if (rdvalue_is<boost::any>(v)) {
|
|
152
|
+
return *v.ptrCast<boost::any>();
|
|
153
|
+
}
|
|
154
|
+
throw boost::bad_any_cast();
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
template <>
|
|
158
|
+
inline boost::any &rdvalue_cast<boost::any &>(RDValue_cast_t v) {
|
|
159
|
+
if (rdvalue_is<boost::any>(v)) {
|
|
160
|
+
return *v.ptrCast<boost::any>();
|
|
161
|
+
}
|
|
162
|
+
throw boost::bad_any_cast();
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
template <>
|
|
166
|
+
inline const boost::any &rdvalue_cast<const boost::any &>(RDValue_cast_t v) {
|
|
167
|
+
if (rdvalue_is<boost::any>(v)) {
|
|
168
|
+
return *v.ptrCast<boost::any>();
|
|
169
|
+
}
|
|
170
|
+
throw boost::bad_any_cast();
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/////////////////////////////////////////////////////////////////////////////////////
|
|
174
|
+
// lexical casts...
|
|
175
|
+
template <class T>
|
|
176
|
+
std::string vectToString(RDValue val) {
|
|
177
|
+
const std::vector<T> &tv = rdvalue_cast<std::vector<T> &>(val);
|
|
178
|
+
std::ostringstream sstr;
|
|
179
|
+
sstr.imbue(std::locale("C"));
|
|
180
|
+
sstr << std::setprecision(17);
|
|
181
|
+
sstr << "[";
|
|
182
|
+
std::copy(tv.begin(), tv.end(), std::ostream_iterator<T>(sstr, ","));
|
|
183
|
+
sstr << "]";
|
|
184
|
+
return sstr.str();
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
inline bool rdvalue_tostring(RDValue_cast_t val, std::string &res) {
|
|
188
|
+
switch (val.getTag()) {
|
|
189
|
+
case RDTypeTag::StringTag:
|
|
190
|
+
res = rdvalue_cast<std::string>(val);
|
|
191
|
+
break;
|
|
192
|
+
case RDTypeTag::IntTag:
|
|
193
|
+
res = boost::lexical_cast<std::string>(rdvalue_cast<int>(val));
|
|
194
|
+
break;
|
|
195
|
+
case RDTypeTag::DoubleTag: {
|
|
196
|
+
Utils::LocaleSwitcher ls; // for lexical cast...
|
|
197
|
+
res = boost::lexical_cast<std::string>(rdvalue_cast<double>(val));
|
|
198
|
+
break;
|
|
199
|
+
}
|
|
200
|
+
case RDTypeTag::UnsignedIntTag:
|
|
201
|
+
res = boost::lexical_cast<std::string>(rdvalue_cast<unsigned int>(val));
|
|
202
|
+
break;
|
|
203
|
+
#ifdef RDVALUE_HASBOOL
|
|
204
|
+
case RDTypeTag::BoolTag:
|
|
205
|
+
res = boost::lexical_cast<std::string>(rdvalue_cast<bool>(val));
|
|
206
|
+
break;
|
|
207
|
+
#endif
|
|
208
|
+
case RDTypeTag::FloatTag: {
|
|
209
|
+
Utils::LocaleSwitcher ls; // for lexical cast...
|
|
210
|
+
res = boost::lexical_cast<std::string>(rdvalue_cast<float>(val));
|
|
211
|
+
break;
|
|
212
|
+
}
|
|
213
|
+
case RDTypeTag::VecDoubleTag: {
|
|
214
|
+
// vectToString uses std::imbue for locale
|
|
215
|
+
res = vectToString<double>(val);
|
|
216
|
+
break;
|
|
217
|
+
}
|
|
218
|
+
case RDTypeTag::VecFloatTag: {
|
|
219
|
+
// vectToString uses std::imbue for locale
|
|
220
|
+
res = vectToString<float>(val);
|
|
221
|
+
break;
|
|
222
|
+
}
|
|
223
|
+
case RDTypeTag::VecIntTag:
|
|
224
|
+
res = vectToString<int>(val);
|
|
225
|
+
break;
|
|
226
|
+
case RDTypeTag::VecUnsignedIntTag:
|
|
227
|
+
res = vectToString<unsigned int>(val);
|
|
228
|
+
break;
|
|
229
|
+
case RDTypeTag::VecStringTag:
|
|
230
|
+
res = vectToString<std::string>(val);
|
|
231
|
+
break;
|
|
232
|
+
case RDTypeTag::AnyTag: {
|
|
233
|
+
Utils::LocaleSwitcher ls; // for lexical cast...
|
|
234
|
+
try {
|
|
235
|
+
res = boost::any_cast<std::string>(rdvalue_cast<boost::any &>(val));
|
|
236
|
+
} catch (const boost::bad_any_cast &) {
|
|
237
|
+
if (rdvalue_cast<boost::any &>(val).type() == typeid(long)) {
|
|
238
|
+
res = boost::lexical_cast<std::string>(
|
|
239
|
+
boost::any_cast<long>(rdvalue_cast<boost::any &>(val)));
|
|
240
|
+
} else if (rdvalue_cast<boost::any &>(val).type() ==
|
|
241
|
+
typeid(unsigned long)) {
|
|
242
|
+
res = boost::lexical_cast<std::string>(
|
|
243
|
+
boost::any_cast<unsigned long>(rdvalue_cast<boost::any &>(val)));
|
|
244
|
+
} else {
|
|
245
|
+
throw;
|
|
246
|
+
return false;
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
break;
|
|
250
|
+
}
|
|
251
|
+
default:
|
|
252
|
+
res = "";
|
|
253
|
+
}
|
|
254
|
+
return true;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
// from_rdvalue -> converts string values to appropriate types
|
|
258
|
+
template <class T>
|
|
259
|
+
typename boost::enable_if<boost::is_arithmetic<T>, T>::type from_rdvalue(
|
|
260
|
+
RDValue_cast_t arg) {
|
|
261
|
+
T res;
|
|
262
|
+
if (arg.getTag() == RDTypeTag::StringTag) {
|
|
263
|
+
Utils::LocaleSwitcher ls;
|
|
264
|
+
try {
|
|
265
|
+
res = rdvalue_cast<T>(arg);
|
|
266
|
+
} catch (const boost::bad_any_cast &exc) {
|
|
267
|
+
try {
|
|
268
|
+
res = boost::lexical_cast<T>(rdvalue_cast<std::string>(arg));
|
|
269
|
+
} catch (...) {
|
|
270
|
+
throw exc;
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
} else {
|
|
274
|
+
res = rdvalue_cast<T>(arg);
|
|
275
|
+
}
|
|
276
|
+
return res;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
template <class T>
|
|
280
|
+
typename boost::disable_if<boost::is_arithmetic<T>, T>::type from_rdvalue(
|
|
281
|
+
RDValue_cast_t arg) {
|
|
282
|
+
return rdvalue_cast<T>(arg);
|
|
283
|
+
}
|
|
284
|
+
} // namespace RDKit
|
|
285
|
+
#endif
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright (C) 2004-2015 Greg Landrum and Rational Discovery LLC
|
|
3
|
+
//
|
|
4
|
+
// @@ All Rights Reserved @@
|
|
5
|
+
// This file is part of the RDKit.
|
|
6
|
+
// The contents are covered by the terms of the BSD license
|
|
7
|
+
// which is included in the file license.txt, found at the root
|
|
8
|
+
// of the RDKit source tree.
|
|
9
|
+
//
|
|
10
|
+
|
|
11
|
+
//! \file Ranking.h
|
|
12
|
+
/*!
|
|
13
|
+
\brief Utility functionality used to rank sequences
|
|
14
|
+
|
|
15
|
+
Much of this used to be in GraphMol/RankAtoms.h
|
|
16
|
+
*/
|
|
17
|
+
#include <RDGeneral/export.h>
|
|
18
|
+
#ifndef RD_RANKING_H
|
|
19
|
+
#define RD_RANKING_H
|
|
20
|
+
|
|
21
|
+
#include <vector>
|
|
22
|
+
#include <functional>
|
|
23
|
+
#include <algorithm>
|
|
24
|
+
#include <cstdint>
|
|
25
|
+
|
|
26
|
+
namespace Rankers {
|
|
27
|
+
//! functor for implementing > on two std::pairs. The first entries are
|
|
28
|
+
/// compared.
|
|
29
|
+
template <typename T1, typename T2>
|
|
30
|
+
struct pairGreater
|
|
31
|
+
: public std::binary_function<std::pair<T1, T2>, std::pair<T1, T2>, bool> {
|
|
32
|
+
bool operator()(const std::pair<T1, T2> &v1,
|
|
33
|
+
const std::pair<T1, T2> &v2) const {
|
|
34
|
+
return v1.first > v2.first;
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
//! function for implementing < on two std::pairs. The first entries are
|
|
39
|
+
/// compared.
|
|
40
|
+
template <typename T1, typename T2>
|
|
41
|
+
struct pairLess
|
|
42
|
+
: public std::binary_function<std::pair<T1, T2>, std::pair<T1, T2>, bool> {
|
|
43
|
+
bool operator()(const std::pair<T1, T2> &v1,
|
|
44
|
+
const std::pair<T1, T2> &v2) const {
|
|
45
|
+
return v1.first < v2.first;
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
template <typename T>
|
|
50
|
+
class argless : public std::binary_function<T, T, bool> {
|
|
51
|
+
public:
|
|
52
|
+
argless(const T &c) : std::binary_function<T, T, bool>(), container(c) {}
|
|
53
|
+
bool operator()(unsigned int v1, unsigned int v2) const {
|
|
54
|
+
return container[v1] < container[v2];
|
|
55
|
+
}
|
|
56
|
+
const T &container;
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
//! ranks the entries in a vector
|
|
60
|
+
/*!
|
|
61
|
+
\param vect the vector to rank
|
|
62
|
+
\param res is used to return the ranks of each entry
|
|
63
|
+
*/
|
|
64
|
+
template <typename T1, typename T2>
|
|
65
|
+
void rankVect(const std::vector<T1> &vect, T2 &res) {
|
|
66
|
+
PRECONDITION(res.size() >= vect.size(), "vector size mismatch");
|
|
67
|
+
unsigned int nEntries = rdcast<unsigned int>(vect.size());
|
|
68
|
+
|
|
69
|
+
std::vector<unsigned int> indices(nEntries);
|
|
70
|
+
for (unsigned int i = 0; i < nEntries; ++i) {
|
|
71
|
+
indices[i] = i;
|
|
72
|
+
}
|
|
73
|
+
std::sort(indices.begin(), indices.end(), argless<std::vector<T1>>(vect));
|
|
74
|
+
|
|
75
|
+
int currRank = 0;
|
|
76
|
+
unsigned int lastIdx = indices[0];
|
|
77
|
+
for (auto idx : indices) {
|
|
78
|
+
if (vect[idx] == vect[lastIdx]) {
|
|
79
|
+
res[idx] = currRank;
|
|
80
|
+
} else {
|
|
81
|
+
res[idx] = ++currRank;
|
|
82
|
+
lastIdx = idx;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
} // namespace Rankers
|
|
87
|
+
#endif
|