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> double tanimotoDistance(const GRIDTYPE &grid1,
26  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> double protrudeDistance(const GRIDTYPE &grid1,
34  const GRIDTYPE &grid2);
35 
36 
37  //! calculate the grid centroid within a window of a point
38  Point3D computeGridCentroid(const UniformGrid3D &grid,
39  const Point3D &pt,
40  double windowRadius,
41  double &weightSum);
42 
43  //! find terminal points of a shape encoded on a grid
44  //! this is part of the subshape implementation
45  std::vector<Point3D> findGridTerminalPoints(const UniformGrid3D &grid,
46  double windowRadius,
47  double inclusionFraction);
48 
49 
50 }
51 
52 #endif
53 
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