RDKit
Open-source cheminformatics and machine learning.
DistPicker.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2003-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_DISTPICKER_H
12 #define _RD_DISTPICKER_H
13 
14 #include <RDGeneral/types.h>
15 
16 namespace RDPickers {
17 
18 /*! \brief function to lookup distance from 1D lower triangular distance matrix
19  *
20  *
21  * \param distMat - a pointer to a 1D lower triangular distance matrix \n
22  * \param i - row index \n
23  * \param j - column index \n
24  *
25  * RETURNS:
26  *
27  * if (i == j) : 0.0
28  * if (i > j) : distMat[i*(i-1)/2 + j]
29  * if (j < i) : distMat[j*(j-1)/2 + i]
30  */
31 RDKIT_SIMDIVPICKERS_EXPORT double getDistFromLTM(const double *distMat, unsigned int i, unsigned int j);
32 
33 /*! \brief Abstract base class to do perform item picking (typically molecules)
34  *using a
35  * distance matrix
36  *
37  * This class should never be instantiated by itself. One of the child classes
38  *need to be
39  * used. The picking algorithm itself is missing here and only the child
40  *calsses implement that
41  * This class contains a pointer to a distance matrix, but it is not
42  *responsible for cleaning it up
43  */
45  public:
46  /*! \brief Default constructor
47  *
48  */
50  virtual ~DistPicker(){};
51 
52  /*! \brief this is a virtual function specific to the type of algorihtm used
53  *
54  * The child classes need to implement this function
55  *
56  * ARGUMENTS:
57  *
58  * \param distMat - distance matrix - a vector of double. It is assumed
59  *that only the
60  * lower triangle elements of the matrix are supplied in a 1D
61  *array
62  * \param poolSize - the size of teh pool to pick the items from. It is
63  *assumed that the
64  * distance matrix above contains the right number of elements;
65  *i.e.
66  * poolSize*(poolSize-1)
67  * \param pickSize - the number items to pick from pool (<= poolSize)
68  *
69  * \return a vector with indices of the picked items.
70  */
71  virtual RDKit::INT_VECT pick(const double *distMat, unsigned int poolSize,
72  unsigned int pickSize) const = 0;
73 };
74 };
75 
76 #endif
virtual ~DistPicker()
Definition: DistPicker.h:50
#define RDKIT_SIMDIVPICKERS_EXPORT
Definition: export.h:580
std::vector< int > INT_VECT
Definition: types.h:247
RDKIT_SIMDIVPICKERS_EXPORT double getDistFromLTM(const double *distMat, unsigned int i, unsigned int j)
function to lookup distance from 1D lower triangular distance matrix
Abstract base class to do perform item picking (typically molecules) using a distance matrix...
Definition: DistPicker.h:44
DistPicker()
Default constructor.
Definition: DistPicker.h:49