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 #ifndef _GRIDUTILS_H_20050126
11 #define _GRIDUTILS_H_20050126
12 
13 #include <vector>
14 
15 namespace RDGeom {
16 class UniformGrid3D;
17 class Point3D;
18 
19 //! calculate the tanimoto distance between the shapes encoded on two grids
20 /*!
21 
22  tanimoto(S1,S2) = 1 - ( | S1&S2 | / | S1|S2 | )
23 
24 */
25 template <class GRIDTYPE>
26 double tanimotoDistance(const GRIDTYPE &grid1, const GRIDTYPE &grid2);
27 //! calculate the protrude distance between the shapes encoded on two grids
28 /*!
29 
30  protrude(S1,S2) = ( | S1|S2 | - | S1&S2 | ) / | S1 |
31 
32 */
33 template <class GRIDTYPE>
34 double protrudeDistance(const GRIDTYPE &grid1, const GRIDTYPE &grid2);
35 
36 //! calculate the grid centroid within a window of a point
37 Point3D computeGridCentroid(const UniformGrid3D &grid, const Point3D &pt,
38  double windowRadius, double &weightSum);
39 
40 //! find terminal points of a shape encoded on a grid
41 //! this is part of the subshape implementation
42 std::vector<Point3D> findGridTerminalPoints(const UniformGrid3D &grid,
43  double windowRadius,
44  double inclusionFraction);
45 }
46 
47 #endif
std::vector< Point3D > findGridTerminalPoints(const UniformGrid3D &grid, double windowRadius, double inclusionFraction)
double tanimotoDistance(const GRIDTYPE &grid1, const GRIDTYPE &grid2)
calculate the tanimoto distance between the shapes encoded on two grids
Point3D computeGridCentroid(const UniformGrid3D &grid, const Point3D &pt, double windowRadius, double &weightSum)
calculate the grid centroid within a window of a point
double protrudeDistance(const GRIDTYPE &grid1, const GRIDTYPE &grid2)
calculate the protrude distance between the shapes encoded on two grids