RDKit
Open-source cheminformatics and machine learning.
Loading...
Searching...
No Matches
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
16namespace RDGeom {
17class UniformGrid3D;
18class 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 * ( |
24 S2 | - | S1&S2 | ) + | S1&S2 | )
25
26*/
27
28template <class GRIDTYPE>
29RDKIT_RDGEOMETRYLIB_EXPORT double tverskyIndex(const GRIDTYPE &grid1,
30 const GRIDTYPE &grid2,
31 double alpha, double beta);
32
33//! calculate the tanimoto distance between the shapes encoded on two grids
34/*!
35
36 tanimoto(S1,S2) = 1 - ( | S1&S2 | / | S1|S2 | )
37
38*/
39
40template <class GRIDTYPE>
41RDKIT_RDGEOMETRYLIB_EXPORT double tanimotoDistance(const GRIDTYPE &grid1,
42 const GRIDTYPE &grid2);
43//! calculate the protrude distance between the shapes encoded on two grids
44/*!
45
46 protrude(S1,S2) = ( | S1|S2 | - | S1&S2 | ) / | S1 |
47
48*/
49template <class GRIDTYPE>
50RDKIT_RDGEOMETRYLIB_EXPORT double protrudeDistance(const GRIDTYPE &grid1,
51 const GRIDTYPE &grid2);
52
53//! calculate the grid centroid within a window of a point
56 double windowRadius, double &weightSum);
57
58//! find terminal points of a shape encoded on a grid
59//! this is part of the subshape implementation
61 const UniformGrid3D &grid, double windowRadius, double inclusionFraction);
62} // namespace RDGeom
63
64#endif
#define RDKIT_RDGEOMETRYLIB_EXPORT
Definition export.h:409
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 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)
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 Point3D computeGridCentroid(const UniformGrid3D &grid, const Point3D &pt, double windowRadius, double &weightSum)
calculate the grid centroid within a window of a point