Open-source cheminformatics and machine learning.
A generic metric matrix calculator (e.g similarity matrix or distance matrix) More...
|Default Constructor. More...|
|void||setMetricFunc (double(*mFunc)(const entryType &, const entryType &, unsigned int))|
|Set the metric function. More...|
|void||calcMetricMatrix (const vectType &descripts, unsigned int nItems, unsigned int dim, double *distMat)|
|The calculator function. More...|
A generic metric matrix calculator (e.g similarity matrix or distance matrix)
This templated class needs some explanation vectType is a container that can support  operator entryType is the type of entry that is returned by the  operator Examples of the container include PySequenceHolder which is wrapper around a python sequence objects like lists and tuples. Examples of the entryType include a sequence of double, floats, and ExplicitBitVects
The calculator function.
descrips - vectType container with a entryType for each item nItems - the number of item in the descripts. In several cases this argument is irrelvant since vectType probably supports a size() member function, But we would like this interface to take for example a double** and correctly parse the row and columns. dim - the dimension of the sequences distMat - pointer to an array to write the distance matrix to it is assumed that the right sized array has already be allocated.
FIX: we can probably make this function create the correct sized distMat and return it to the caller, but when pushing he result out to a python array not sure how to avoid copy the entire distance matrix in that case
pointer to a 1D array of doubles. Only the lower triangle elements are included in the array