RDKit
Open-source cheminformatics and machine learning.
GridUtils.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2003-2007 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 _GRIDUTILS_H_20050126
12 #define _GRIDUTILS_H_20050126
13 
14 #include <vector>
15 
16 namespace RDGeom {
17 class UniformGrid3D;
18 class Point3D;
19 
20 //! calculate the tversky index between the shapes encoded on two grids
21 /*!
22 
23  tversky(S1,S2) = | S1&S2 | / ( alpha * ( | S1 | - | S1&S2 | ) + beta * ( | S2 | - | S1&S2 | ) + | S1&S2 | )
24 
25 */
26 
27 template <class GRIDTYPE>
28 RDKIT_RDGEOMETRYLIB_EXPORT double tverskyIndex(const GRIDTYPE &grid1, const GRIDTYPE &grid2, double alpha, double beta);
29 
30 //! calculate the tanimoto distance between the shapes encoded on two grids
31 /*!
32 
33  tanimoto(S1,S2) = 1 - ( | S1&S2 | / | S1|S2 | )
34 
35 */
36 
37 template <class GRIDTYPE>
38 RDKIT_RDGEOMETRYLIB_EXPORT double tanimotoDistance(const GRIDTYPE &grid1, const GRIDTYPE &grid2);
39 //! calculate the protrude distance between the shapes encoded on two grids
40 /*!
41 
42  protrude(S1,S2) = ( | S1|S2 | - | S1&S2 | ) / | S1 |
43 
44 */
45 template <class GRIDTYPE>
46 RDKIT_RDGEOMETRYLIB_EXPORT double protrudeDistance(const GRIDTYPE &grid1, const GRIDTYPE &grid2);
47 
48 //! calculate the grid centroid within a window of a point
49 RDKIT_RDGEOMETRYLIB_EXPORT Point3D computeGridCentroid(const UniformGrid3D &grid, const Point3D &pt,
50  double windowRadius, double &weightSum);
51 
52 //! find terminal points of a shape encoded on a grid
53 //! this is part of the subshape implementation
54 RDKIT_RDGEOMETRYLIB_EXPORT std::vector<Point3D> findGridTerminalPoints(const UniformGrid3D &grid,
55  double windowRadius,
56  double inclusionFraction);
57 }
58 
59 #endif
#define RDKIT_RDGEOMETRYLIB_EXPORT
Definition: export.h:502
RDKIT_RDGEOMETRYLIB_EXPORT Point3D computeGridCentroid(const UniformGrid3D &grid, const Point3D &pt, double windowRadius, double &weightSum)
calculate the grid centroid within a window of a point
RDKIT_RDGEOMETRYLIB_EXPORT double tverskyIndex(const GRIDTYPE &grid1, const GRIDTYPE &grid2, double alpha, double beta)
calculate the tversky index between the shapes encoded on two grids
RDKIT_RDGEOMETRYLIB_EXPORT double protrudeDistance(const GRIDTYPE &grid1, const GRIDTYPE &grid2)
calculate the protrude distance between the shapes encoded on two grids
RDKIT_RDGEOMETRYLIB_EXPORT double tanimotoDistance(const GRIDTYPE &grid1, const GRIDTYPE &grid2)
calculate the tanimoto distance between the shapes encoded on two grids
RDKIT_RDGEOMETRYLIB_EXPORT std::vector< Point3D > findGridTerminalPoints(const UniformGrid3D &grid, double windowRadius, double inclusionFraction)