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,361 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright (C) 2004-2006 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
|
+
#include <RDGeneral/export.h>
|
|
11
|
+
#ifndef __RD_SYMM_MATRIX_H__
|
|
12
|
+
#define __RD_SYMM_MATRIX_H__
|
|
13
|
+
|
|
14
|
+
#include "Matrix.h"
|
|
15
|
+
#include "SquareMatrix.h"
|
|
16
|
+
#include <cstring>
|
|
17
|
+
#include <boost/smart_ptr.hpp>
|
|
18
|
+
|
|
19
|
+
//#ifndef INVARIANT_SILENT_METHOD
|
|
20
|
+
//#define INVARIANT_SILENT_METHOD
|
|
21
|
+
//#endif
|
|
22
|
+
namespace RDNumeric {
|
|
23
|
+
//! A symmetric matrix class
|
|
24
|
+
/*!
|
|
25
|
+
The data is stored as the lower triangle, so
|
|
26
|
+
A[i,j] = data[i*(i+1) + j] when i >= j and
|
|
27
|
+
A[i,j] = data[j*(j+1) + i] when i < j
|
|
28
|
+
*/
|
|
29
|
+
template <class TYPE>
|
|
30
|
+
class SymmMatrix {
|
|
31
|
+
public:
|
|
32
|
+
typedef boost::shared_array<TYPE> DATA_SPTR;
|
|
33
|
+
|
|
34
|
+
explicit SymmMatrix(unsigned int N) : d_size(N), d_dataSize(N * (N + 1) / 2) {
|
|
35
|
+
TYPE *data = new TYPE[d_dataSize];
|
|
36
|
+
memset(static_cast<void *>(data), 0, d_dataSize * sizeof(TYPE));
|
|
37
|
+
d_data.reset(data);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
SymmMatrix(unsigned int N, TYPE val)
|
|
41
|
+
: d_size(N), d_dataSize(N * (N + 1) / 2) {
|
|
42
|
+
TYPE *data = new TYPE[d_dataSize];
|
|
43
|
+
unsigned int i;
|
|
44
|
+
for (i = 0; i < d_dataSize; i++) {
|
|
45
|
+
data[i] = val;
|
|
46
|
+
}
|
|
47
|
+
d_data.reset(data);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
SymmMatrix(unsigned int N, DATA_SPTR data)
|
|
51
|
+
: d_size(N), d_dataSize(N * (N + 1) / 2) {
|
|
52
|
+
d_data = data;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
SymmMatrix(const SymmMatrix<TYPE> &other)
|
|
56
|
+
: d_size(other.numRows()), d_dataSize(other.getDataSize()) {
|
|
57
|
+
TYPE *data = new TYPE[d_dataSize];
|
|
58
|
+
const TYPE *otherData = other.getData();
|
|
59
|
+
|
|
60
|
+
memcpy(static_cast<void *>(data), static_cast<const void *>(otherData),
|
|
61
|
+
d_dataSize * sizeof(TYPE));
|
|
62
|
+
d_data.reset(data);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
~SymmMatrix() = default;
|
|
66
|
+
|
|
67
|
+
//! returns the number of rows
|
|
68
|
+
inline unsigned int numRows() const { return d_size; }
|
|
69
|
+
|
|
70
|
+
//! returns the number of columns
|
|
71
|
+
inline unsigned int numCols() const { return d_size; }
|
|
72
|
+
|
|
73
|
+
inline unsigned int getDataSize() const { return d_dataSize; }
|
|
74
|
+
|
|
75
|
+
void setToIdentity() {
|
|
76
|
+
TYPE *data = d_data.get();
|
|
77
|
+
memset(static_cast<void *>(data), 0, d_dataSize * sizeof(TYPE));
|
|
78
|
+
for (unsigned int i = 0; i < d_size; i++) {
|
|
79
|
+
data[i * (i + 3) / 2] = (TYPE)1.0;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
TYPE getVal(unsigned int i, unsigned int j) const {
|
|
84
|
+
URANGE_CHECK(i, d_size);
|
|
85
|
+
URANGE_CHECK(j, d_size);
|
|
86
|
+
unsigned int id;
|
|
87
|
+
if (i >= j) {
|
|
88
|
+
id = i * (i + 1) / 2 + j;
|
|
89
|
+
} else {
|
|
90
|
+
id = j * (j + 1) / 2 + i;
|
|
91
|
+
}
|
|
92
|
+
return d_data[id];
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
void setVal(unsigned int i, unsigned int j, TYPE val) {
|
|
96
|
+
URANGE_CHECK(i, d_size);
|
|
97
|
+
URANGE_CHECK(j, d_size);
|
|
98
|
+
unsigned int id;
|
|
99
|
+
if (i >= j) {
|
|
100
|
+
id = i * (i + 1) / 2 + j;
|
|
101
|
+
} else {
|
|
102
|
+
id = j * (j + 1) / 2 + i;
|
|
103
|
+
}
|
|
104
|
+
d_data[id] = val;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
void getRow(unsigned int i, Vector<TYPE> &row) {
|
|
108
|
+
CHECK_INVARIANT(d_size == row.size(), "");
|
|
109
|
+
TYPE *rData = row.getData();
|
|
110
|
+
TYPE *data = d_data.get();
|
|
111
|
+
for (unsigned int j = 0; j < d_size; j++) {
|
|
112
|
+
unsigned int id;
|
|
113
|
+
if (j <= i) {
|
|
114
|
+
id = i * (i + 1) / 2 + j;
|
|
115
|
+
} else {
|
|
116
|
+
id = j * (j + 1) / 2 + i;
|
|
117
|
+
}
|
|
118
|
+
rData[j] = data[id];
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
void getCol(unsigned int i, Vector<TYPE> &col) {
|
|
123
|
+
CHECK_INVARIANT(d_size == col.size(), "");
|
|
124
|
+
TYPE *rData = col.getData();
|
|
125
|
+
TYPE *data = d_data.get();
|
|
126
|
+
for (unsigned int j = 0; j < d_size; j++) {
|
|
127
|
+
unsigned int id;
|
|
128
|
+
if (i <= j) {
|
|
129
|
+
id = j * (j + 1) / 2 + i;
|
|
130
|
+
} else {
|
|
131
|
+
id = i * (i + 1) / 2 + j;
|
|
132
|
+
}
|
|
133
|
+
rData[j] = data[id];
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
//! returns a pointer to our data array
|
|
138
|
+
inline TYPE *getData() { return d_data.get(); }
|
|
139
|
+
|
|
140
|
+
//! returns a const pointer to our data array
|
|
141
|
+
inline const TYPE *getData() const { return d_data.get(); }
|
|
142
|
+
|
|
143
|
+
SymmMatrix<TYPE> &operator*=(TYPE scale) {
|
|
144
|
+
TYPE *data = d_data.get();
|
|
145
|
+
for (unsigned int i = 0; i < d_dataSize; i++) {
|
|
146
|
+
data[i] *= scale;
|
|
147
|
+
}
|
|
148
|
+
return *this;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
SymmMatrix<TYPE> &operator/=(TYPE scale) {
|
|
152
|
+
TYPE *data = d_data.get();
|
|
153
|
+
for (unsigned int i = 0; i < d_dataSize; i++) {
|
|
154
|
+
data[i] /= scale;
|
|
155
|
+
}
|
|
156
|
+
return *this;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
SymmMatrix<TYPE> &operator+=(const SymmMatrix<TYPE> &other) {
|
|
160
|
+
CHECK_INVARIANT(d_size == other.numRows(),
|
|
161
|
+
"Sizes don't match in the addition");
|
|
162
|
+
const TYPE *oData = other.getData();
|
|
163
|
+
TYPE *data = d_data.get();
|
|
164
|
+
for (unsigned int i = 0; i < d_dataSize; i++) {
|
|
165
|
+
data[i] += oData[i];
|
|
166
|
+
}
|
|
167
|
+
return *this;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
SymmMatrix<TYPE> &operator-=(const SymmMatrix<TYPE> &other) {
|
|
171
|
+
CHECK_INVARIANT(d_size == other.numRows(),
|
|
172
|
+
"Sizes don't match in the addition");
|
|
173
|
+
const TYPE *oData = other.getData();
|
|
174
|
+
TYPE *data = d_data.get();
|
|
175
|
+
for (unsigned int i = 0; i < d_dataSize; i++) {
|
|
176
|
+
data[i] -= oData[i];
|
|
177
|
+
}
|
|
178
|
+
return *this;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
//! in-place matrix multiplication
|
|
182
|
+
SymmMatrix<TYPE> &operator*=(const SymmMatrix<TYPE> &B) {
|
|
183
|
+
CHECK_INVARIANT(d_size == B.numRows(),
|
|
184
|
+
"Size mismatch during multiplication");
|
|
185
|
+
TYPE *cData = new TYPE[d_dataSize];
|
|
186
|
+
const TYPE *bData = B.getData();
|
|
187
|
+
TYPE *data = d_data.get();
|
|
188
|
+
for (unsigned int i = 0; i < d_size; i++) {
|
|
189
|
+
unsigned int idC = i * (i + 1) / 2;
|
|
190
|
+
for (unsigned int j = 0; j < i + 1; j++) {
|
|
191
|
+
unsigned int idCt = idC + j;
|
|
192
|
+
cData[idCt] = (TYPE)0.0;
|
|
193
|
+
for (unsigned int k = 0; k < d_size; k++) {
|
|
194
|
+
unsigned int idA, idB;
|
|
195
|
+
if (k <= i) {
|
|
196
|
+
idA = i * (i + 1) / 2 + k;
|
|
197
|
+
} else {
|
|
198
|
+
idA = k * (k + 1) / 2 + i;
|
|
199
|
+
}
|
|
200
|
+
if (k <= j) {
|
|
201
|
+
idB = j * (j + 1) / 2 + k;
|
|
202
|
+
} else {
|
|
203
|
+
idB = k * (k + 1) / 2 + j;
|
|
204
|
+
}
|
|
205
|
+
cData[idCt] += (data[idA] * bData[idB]);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
for (unsigned int i = 0; i < d_dataSize; i++) {
|
|
211
|
+
data[i] = cData[i];
|
|
212
|
+
}
|
|
213
|
+
delete[] cData;
|
|
214
|
+
return (*this);
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
/* Transpose will basically return a copy of itself
|
|
218
|
+
*/
|
|
219
|
+
SymmMatrix<TYPE> &transpose(SymmMatrix<TYPE> &transpose) const {
|
|
220
|
+
CHECK_INVARIANT(d_size == transpose.numRows(),
|
|
221
|
+
"Size mismatch during transposing");
|
|
222
|
+
TYPE *tData = transpose.getData();
|
|
223
|
+
TYPE *data = d_data.get();
|
|
224
|
+
for (unsigned int i = 0; i < d_dataSize; i++) {
|
|
225
|
+
tData[i] = data[i];
|
|
226
|
+
}
|
|
227
|
+
return transpose;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
SymmMatrix<TYPE> &transposeInplace() {
|
|
231
|
+
// nothing to be done we are symmetric
|
|
232
|
+
return (*this);
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
protected:
|
|
236
|
+
SymmMatrix() : d_data(0) {}
|
|
237
|
+
unsigned int d_size{0};
|
|
238
|
+
unsigned int d_dataSize{0};
|
|
239
|
+
DATA_SPTR d_data;
|
|
240
|
+
|
|
241
|
+
private:
|
|
242
|
+
SymmMatrix<TYPE> &operator=(const SymmMatrix<TYPE> &other);
|
|
243
|
+
};
|
|
244
|
+
|
|
245
|
+
//! SymmMatrix-SymmMatrix multiplication
|
|
246
|
+
/*!
|
|
247
|
+
Multiply SymmMatrix A with a second SymmMatrix B
|
|
248
|
+
and write the result to C = A*B
|
|
249
|
+
|
|
250
|
+
\param A the first SymmMatrix
|
|
251
|
+
\param B the second SymmMatrix to multiply
|
|
252
|
+
\param C SymmMatrix to use for the results
|
|
253
|
+
|
|
254
|
+
\return the results of multiplying A by B.
|
|
255
|
+
This is just a reference to C.
|
|
256
|
+
|
|
257
|
+
This method is reimplemented here for efficiency reasons
|
|
258
|
+
(we basically don't want to use getter and setter functions)
|
|
259
|
+
|
|
260
|
+
*/
|
|
261
|
+
template <class TYPE>
|
|
262
|
+
SymmMatrix<TYPE> &multiply(const SymmMatrix<TYPE> &A, const SymmMatrix<TYPE> &B,
|
|
263
|
+
SymmMatrix<TYPE> &C) {
|
|
264
|
+
unsigned int aSize = A.numRows();
|
|
265
|
+
CHECK_INVARIANT(B.numRows() == aSize,
|
|
266
|
+
"Size mismatch in matric multiplication");
|
|
267
|
+
CHECK_INVARIANT(C.numRows() == aSize,
|
|
268
|
+
"Size mismatch in matric multiplication");
|
|
269
|
+
TYPE *cData = C.getData();
|
|
270
|
+
const TYPE *aData = A.getData();
|
|
271
|
+
const TYPE *bData = B.getData();
|
|
272
|
+
for (unsigned int i = 0; i < aSize; i++) {
|
|
273
|
+
unsigned int idC = i * (i + 1) / 2;
|
|
274
|
+
for (unsigned int j = 0; j < i + 1; j++) {
|
|
275
|
+
unsigned int idCt = idC + j;
|
|
276
|
+
cData[idCt] = (TYPE)0.0;
|
|
277
|
+
for (unsigned int k = 0; k < aSize; k++) {
|
|
278
|
+
unsigned int idA, idB;
|
|
279
|
+
if (k <= i) {
|
|
280
|
+
idA = i * (i + 1) / 2 + k;
|
|
281
|
+
} else {
|
|
282
|
+
idA = k * (k + 1) / 2 + i;
|
|
283
|
+
}
|
|
284
|
+
if (k <= j) {
|
|
285
|
+
idB = j * (j + 1) / 2 + k;
|
|
286
|
+
} else {
|
|
287
|
+
idB = k * (k + 1) / 2 + j;
|
|
288
|
+
}
|
|
289
|
+
cData[idCt] += (aData[idA] * bData[idB]);
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
return C;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
//! SymmMatrix-Vector multiplication
|
|
297
|
+
/*!
|
|
298
|
+
Multiply a SymmMatrix A with a Vector x
|
|
299
|
+
so the result is y = A*x
|
|
300
|
+
|
|
301
|
+
\param A the SymmMatrix for multiplication
|
|
302
|
+
\param x the Vector by which to multiply
|
|
303
|
+
\param y Vector to use for the results
|
|
304
|
+
|
|
305
|
+
\return the results of multiplying x by A
|
|
306
|
+
This is just a reference to y.
|
|
307
|
+
|
|
308
|
+
This method is reimplemented here for efficiency reasons
|
|
309
|
+
(we basically don't want to use getter and setter functions)
|
|
310
|
+
|
|
311
|
+
*/
|
|
312
|
+
template <class TYPE>
|
|
313
|
+
Vector<TYPE> &multiply(const SymmMatrix<TYPE> &A, const Vector<TYPE> &x,
|
|
314
|
+
Vector<TYPE> &y) {
|
|
315
|
+
unsigned int aSize = A.numRows();
|
|
316
|
+
CHECK_INVARIANT(aSize == x.size(), "Size mismatch during multiplication");
|
|
317
|
+
CHECK_INVARIANT(aSize == y.size(), "Size mismatch during multiplication");
|
|
318
|
+
const TYPE *xData = x.getData();
|
|
319
|
+
const TYPE *aData = A.getData();
|
|
320
|
+
TYPE *yData = y.getData();
|
|
321
|
+
for (unsigned int i = 0; i < aSize; i++) {
|
|
322
|
+
yData[i] = (TYPE)(0.0);
|
|
323
|
+
unsigned int idA = i * (i + 1) / 2;
|
|
324
|
+
for (unsigned int j = 0; j < i + 1; j++) {
|
|
325
|
+
// idA = i*(i+1)/2 + j;
|
|
326
|
+
yData[i] += (aData[idA] * xData[j]);
|
|
327
|
+
idA++;
|
|
328
|
+
}
|
|
329
|
+
idA--;
|
|
330
|
+
for (unsigned int j = i + 1; j < aSize; j++) {
|
|
331
|
+
// idA = j*(j+1)/2 + i;
|
|
332
|
+
idA += j;
|
|
333
|
+
yData[i] += (aData[idA] * xData[j]);
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
return y;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
typedef SymmMatrix<double> DoubleSymmMatrix;
|
|
340
|
+
typedef SymmMatrix<int> IntSymmMatrix;
|
|
341
|
+
typedef SymmMatrix<unsigned int> UintSymmMatrix;
|
|
342
|
+
} // namespace RDNumeric
|
|
343
|
+
|
|
344
|
+
//! ostream operator for Matrix's
|
|
345
|
+
template <class TYPE>
|
|
346
|
+
std::ostream &operator<<(std::ostream &target,
|
|
347
|
+
const RDNumeric::SymmMatrix<TYPE> &mat) {
|
|
348
|
+
unsigned int nr = mat.numRows();
|
|
349
|
+
unsigned int nc = mat.numCols();
|
|
350
|
+
target << "Rows: " << mat.numRows() << " Columns: " << mat.numCols() << "\n";
|
|
351
|
+
|
|
352
|
+
for (unsigned int i = 0; i < nr; i++) {
|
|
353
|
+
for (unsigned int j = 0; j < nc; j++) {
|
|
354
|
+
target << std::setw(7) << std::setprecision(3) << mat.getVal(i, j);
|
|
355
|
+
}
|
|
356
|
+
target << "\n";
|
|
357
|
+
}
|
|
358
|
+
return target;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
#endif
|
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright (C) 2004-2008 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
|
+
#include <RDGeneral/export.h>
|
|
11
|
+
#ifndef __RD_VECTOR_H__
|
|
12
|
+
#define __RD_VECTOR_H__
|
|
13
|
+
|
|
14
|
+
#include <RDGeneral/Invariant.h>
|
|
15
|
+
#include <RDGeneral/utils.h>
|
|
16
|
+
#include <cmath>
|
|
17
|
+
#include <iostream>
|
|
18
|
+
#include <iomanip>
|
|
19
|
+
#include <cstdlib>
|
|
20
|
+
#include <cstring>
|
|
21
|
+
#include <ctime>
|
|
22
|
+
#include <boost/random.hpp>
|
|
23
|
+
#include <boost/smart_ptr.hpp>
|
|
24
|
+
|
|
25
|
+
namespace RDNumeric {
|
|
26
|
+
|
|
27
|
+
//! A class to represent vectors of numbers.
|
|
28
|
+
template <class TYPE>
|
|
29
|
+
class Vector {
|
|
30
|
+
public:
|
|
31
|
+
typedef boost::shared_array<TYPE> DATA_SPTR;
|
|
32
|
+
|
|
33
|
+
//! Initialize with only a size.
|
|
34
|
+
explicit Vector(unsigned int N) {
|
|
35
|
+
d_size = N;
|
|
36
|
+
TYPE *data = new TYPE[N];
|
|
37
|
+
memset(static_cast<void *>(data), 0, d_size * sizeof(TYPE));
|
|
38
|
+
d_data.reset(data);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
//! Initialize with a size and default value.
|
|
42
|
+
Vector(unsigned int N, TYPE val) { //: Vector(N) {
|
|
43
|
+
d_size = N;
|
|
44
|
+
TYPE *data = new TYPE[N];
|
|
45
|
+
|
|
46
|
+
unsigned int i;
|
|
47
|
+
for (i = 0; i < N; i++) {
|
|
48
|
+
data[i] = val;
|
|
49
|
+
}
|
|
50
|
+
d_data.reset(data);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
//! Initialize from a smart pointer.
|
|
54
|
+
/*!
|
|
55
|
+
<b>NOTE:</b> the data is not copied in this case
|
|
56
|
+
*/
|
|
57
|
+
Vector(unsigned int N, DATA_SPTR data) { // TYPE *data) {
|
|
58
|
+
d_size = N;
|
|
59
|
+
d_data = data;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
//! copy constructor
|
|
63
|
+
/*! We make a copy of the other vector's data.
|
|
64
|
+
*/
|
|
65
|
+
Vector(const Vector &other) {
|
|
66
|
+
d_size = other.size();
|
|
67
|
+
const TYPE *otherData = other.getData();
|
|
68
|
+
TYPE *data = new TYPE[d_size];
|
|
69
|
+
|
|
70
|
+
memcpy(static_cast<void *>(data), static_cast<const void *>(otherData),
|
|
71
|
+
d_size * sizeof(TYPE));
|
|
72
|
+
d_data.reset(data);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
~Vector() = default;
|
|
76
|
+
|
|
77
|
+
//! return the size (dimension) of the vector
|
|
78
|
+
unsigned int size() const { return d_size; }
|
|
79
|
+
|
|
80
|
+
//! returns the value at a particular index
|
|
81
|
+
inline TYPE getVal(unsigned int i) const {
|
|
82
|
+
PRECONDITION(i < d_size, "bad index");
|
|
83
|
+
return d_data[i];
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
//! sets the index at a particular value
|
|
87
|
+
inline void setVal(unsigned int i, TYPE val) {
|
|
88
|
+
PRECONDITION(i < d_size, "bad index");
|
|
89
|
+
d_data[i] = val;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
inline TYPE operator[](unsigned int i) const {
|
|
93
|
+
PRECONDITION(i < d_size, "bad index");
|
|
94
|
+
return d_data[i];
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
inline TYPE &operator[](unsigned int i) {
|
|
98
|
+
PRECONDITION(i < d_size, "bad index");
|
|
99
|
+
return d_data[i];
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
//! returns a pointer to our data array
|
|
103
|
+
inline TYPE *getData() { return d_data.get(); }
|
|
104
|
+
|
|
105
|
+
//! returns a const pointer to our data array
|
|
106
|
+
inline const TYPE *getData() const {
|
|
107
|
+
// return dp_data;
|
|
108
|
+
return d_data.get();
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
//! Copy operator.
|
|
112
|
+
/*! We make a copy of the other Vector's data.
|
|
113
|
+
*/
|
|
114
|
+
|
|
115
|
+
Vector<TYPE> &assign(const Vector<TYPE> &other) {
|
|
116
|
+
PRECONDITION(d_size == other.size(), "Size mismatch in vector copying");
|
|
117
|
+
const TYPE *otherData = other.getData();
|
|
118
|
+
memcpy(static_cast<void *>(d_data.get()),
|
|
119
|
+
static_cast<const void *>(otherData), d_size * sizeof(TYPE));
|
|
120
|
+
return *this;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
//! elementwise addition, vectors must be the same size.
|
|
124
|
+
Vector<TYPE> &operator+=(const Vector<TYPE> &other) {
|
|
125
|
+
PRECONDITION(d_size == other.size(), "Size mismatch in vector addition");
|
|
126
|
+
const TYPE *otherData = other.getData();
|
|
127
|
+
TYPE *data = d_data.get();
|
|
128
|
+
unsigned int i;
|
|
129
|
+
for (i = 0; i < d_size; i++) {
|
|
130
|
+
data[i] += otherData[i];
|
|
131
|
+
}
|
|
132
|
+
return *this;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
//! elementwise subtraction, vectors must be the same size.
|
|
136
|
+
Vector<TYPE> &operator-=(const Vector<TYPE> &other) {
|
|
137
|
+
PRECONDITION(d_size == other.size(), "Size mismatch in vector subtraction");
|
|
138
|
+
const TYPE *otherData = other.getData();
|
|
139
|
+
TYPE *data = d_data.get();
|
|
140
|
+
unsigned int i;
|
|
141
|
+
for (i = 0; i < d_size; i++) {
|
|
142
|
+
data[i] -= otherData[i];
|
|
143
|
+
}
|
|
144
|
+
return *this;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
//! multiplication by a scalar
|
|
148
|
+
Vector<TYPE> &operator*=(TYPE scale) {
|
|
149
|
+
unsigned int i;
|
|
150
|
+
for (i = 0; i < d_size; i++) {
|
|
151
|
+
d_data[i] *= scale;
|
|
152
|
+
}
|
|
153
|
+
return *this;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
//! division by a scalar
|
|
157
|
+
Vector<TYPE> &operator/=(TYPE scale) {
|
|
158
|
+
unsigned int i;
|
|
159
|
+
for (i = 0; i < d_size; i++) {
|
|
160
|
+
d_data[i] /= scale;
|
|
161
|
+
}
|
|
162
|
+
return *this;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
//! L2 norm squared
|
|
166
|
+
inline TYPE normL2Sq() const {
|
|
167
|
+
TYPE res = (TYPE)0.0;
|
|
168
|
+
unsigned int i;
|
|
169
|
+
TYPE *data = d_data.get();
|
|
170
|
+
for (i = 0; i < d_size; i++) {
|
|
171
|
+
res += data[i] * data[i];
|
|
172
|
+
}
|
|
173
|
+
return res;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
//! L2 norm
|
|
177
|
+
inline TYPE normL2() const { return sqrt(this->normL2Sq()); }
|
|
178
|
+
|
|
179
|
+
//! L1 norm
|
|
180
|
+
inline TYPE normL1() const {
|
|
181
|
+
TYPE res = (TYPE)0.0;
|
|
182
|
+
unsigned int i;
|
|
183
|
+
TYPE *data = d_data.get();
|
|
184
|
+
for (i = 0; i < d_size; i++) {
|
|
185
|
+
res += fabs(data[i]);
|
|
186
|
+
}
|
|
187
|
+
return res;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
//! L-infinity norm
|
|
191
|
+
inline TYPE normLinfinity() const {
|
|
192
|
+
TYPE res = (TYPE)(-1.0);
|
|
193
|
+
unsigned int i;
|
|
194
|
+
TYPE *data = d_data.get();
|
|
195
|
+
for (i = 0; i < d_size; i++) {
|
|
196
|
+
if (fabs(data[i]) > res) {
|
|
197
|
+
res = fabs(data[i]);
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
return res;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
//! \brief Gets the ID of the entry that has the largest absolute value
|
|
204
|
+
//! i.e. the entry being used for the L-infinity norm
|
|
205
|
+
inline unsigned int largestAbsValId() const {
|
|
206
|
+
TYPE res = (TYPE)(-1.0);
|
|
207
|
+
unsigned int i, id = d_size;
|
|
208
|
+
TYPE *data = d_data.get();
|
|
209
|
+
for (i = 0; i < d_size; i++) {
|
|
210
|
+
if (fabs(data[i]) > res) {
|
|
211
|
+
res = fabs(data[i]);
|
|
212
|
+
id = i;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
return id;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
//! \brief Gets the ID of the entry that has the largest value
|
|
219
|
+
inline unsigned int largestValId() const {
|
|
220
|
+
TYPE res = (TYPE)(-1.e8);
|
|
221
|
+
unsigned int i, id = d_size;
|
|
222
|
+
TYPE *data = d_data.get();
|
|
223
|
+
for (i = 0; i < d_size; i++) {
|
|
224
|
+
if (data[i] > res) {
|
|
225
|
+
res = data[i];
|
|
226
|
+
id = i;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
return id;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
//! \brief Gets the ID of the entry that has the smallest value
|
|
233
|
+
inline unsigned int smallestValId() const {
|
|
234
|
+
TYPE res = (TYPE)(1.e8);
|
|
235
|
+
unsigned int i, id = d_size;
|
|
236
|
+
TYPE *data = d_data.get();
|
|
237
|
+
for (i = 0; i < d_size; i++) {
|
|
238
|
+
if (data[i] < res) {
|
|
239
|
+
res = data[i];
|
|
240
|
+
id = i;
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
return id;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
//! returns the dot product between two Vectors
|
|
247
|
+
inline TYPE dotProduct(const Vector<TYPE> other) const {
|
|
248
|
+
PRECONDITION(d_size == other.size(),
|
|
249
|
+
"Size mismatch in vector doct product");
|
|
250
|
+
const TYPE *oData = other.getData();
|
|
251
|
+
unsigned int i;
|
|
252
|
+
TYPE res = (TYPE)(0.0);
|
|
253
|
+
TYPE *data = d_data.get();
|
|
254
|
+
for (i = 0; i < d_size; i++) {
|
|
255
|
+
res += (data[i] * oData[i]);
|
|
256
|
+
}
|
|
257
|
+
return res;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
//! Normalize the vector using the L2 norm
|
|
261
|
+
inline void normalize() {
|
|
262
|
+
TYPE val = this->normL2();
|
|
263
|
+
(*this) /= val;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
//! Set to a random unit vector
|
|
267
|
+
inline void setToRandom(unsigned int seed = 0) {
|
|
268
|
+
// we want to get our own RNG here instead of using the global
|
|
269
|
+
// one. This is related to Issue285.
|
|
270
|
+
RDKit::rng_type generator(42u);
|
|
271
|
+
RDKit::uniform_double dist(0, 1.0);
|
|
272
|
+
RDKit::double_source_type randSource(generator, dist);
|
|
273
|
+
if (seed > 0) {
|
|
274
|
+
generator.seed(seed);
|
|
275
|
+
} else {
|
|
276
|
+
// we can't initialize using only clock(), because it's possible
|
|
277
|
+
// that we'll get here fast enough that clock() will return 0
|
|
278
|
+
// and generator.seed(0) is an error:
|
|
279
|
+
generator.seed(clock() + 1);
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
unsigned int i;
|
|
283
|
+
TYPE *data = d_data.get();
|
|
284
|
+
for (i = 0; i < d_size; i++) {
|
|
285
|
+
data[i] = randSource();
|
|
286
|
+
}
|
|
287
|
+
this->normalize();
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
private:
|
|
291
|
+
unsigned int d_size; //! < our length
|
|
292
|
+
DATA_SPTR d_data;
|
|
293
|
+
Vector<TYPE> &operator=(const Vector<TYPE> &other);
|
|
294
|
+
};
|
|
295
|
+
|
|
296
|
+
typedef Vector<double> DoubleVector;
|
|
297
|
+
|
|
298
|
+
//! returns the algebraic tanimoto similarity [defn' from JCIM 46:587-96 (2006)]
|
|
299
|
+
template <typename T>
|
|
300
|
+
double TanimotoSimilarity(const Vector<T> &v1, const Vector<T> &v2) {
|
|
301
|
+
double numer = v1.dotProduct(v2);
|
|
302
|
+
if (numer == 0.0) {
|
|
303
|
+
return 0.0;
|
|
304
|
+
}
|
|
305
|
+
double denom = v1.normL2Sq() + v2.normL2Sq() - numer;
|
|
306
|
+
if (denom == 0.0) {
|
|
307
|
+
return 0.0;
|
|
308
|
+
}
|
|
309
|
+
return numer / denom;
|
|
310
|
+
}
|
|
311
|
+
} // end of namespace RDNumeric
|
|
312
|
+
|
|
313
|
+
//! ostream operator for Vectors
|
|
314
|
+
template <typename TYPE>
|
|
315
|
+
std::ostream &operator<<(std::ostream &target,
|
|
316
|
+
const RDNumeric::Vector<TYPE> &vec) {
|
|
317
|
+
unsigned int siz = vec.size();
|
|
318
|
+
target << "Size: " << siz << " [";
|
|
319
|
+
unsigned int i;
|
|
320
|
+
for (i = 0; i < siz; i++) {
|
|
321
|
+
target << std::setw(7) << std::setprecision(3) << vec.getVal(i) << ", ";
|
|
322
|
+
}
|
|
323
|
+
target << "]\n";
|
|
324
|
+
return target;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
#endif
|