this builds and tests clean on linux. Windows still needs to be updated

This commit is contained in:
Greg Landrum
2007-11-09 18:33:18 +00:00
parent 83b8ce238a
commit 7855b72c85
4 changed files with 13 additions and 13 deletions

View File

@@ -22,7 +22,7 @@ namespace RDInfoTheory {
PyObject *getCorrMatrix(BitCorrMatGenerator *cmGen) {
double *dres = cmGen->getCorrMat();
unsigned int nb = cmGen->getCorrBitList().size();
unsigned int dim = nb*(nb-1)/2;
int dim = nb*(nb-1)/2;
PyArrayObject *res = (PyArrayObject *)PyArray_FromDims(1,&dim,PyArray_DOUBLE);
memcpy(static_cast<void *>(res->data),
static_cast<void *>(dres), dim*sizeof(double));

View File

@@ -7,4 +7,14 @@
#include "DistPicker.h"
namespace RDPickers {
double getDistFromLTM(const double *distMat, unsigned int i, unsigned int j){
CHECK_INVARIANT(distMat, "");
if (i == j) {
return 0.0;
} else if (i > j) {
return distMat[i*(i-1)/2 + j];
} else {
return distMat[j*(j-1)/2 + i];
}
}
}

View File

@@ -23,16 +23,7 @@ namespace RDPickers {
* if (i > j) : distMat[i*(i-1)/2 + j]
* if (j < i) : distMat[j*(j-1)/2 + i]
*/
double getDistFromLTM(const double *distMat, unsigned int i, unsigned int j){
CHECK_INVARIANT(distMat, "");
if (i == j) {
return 0.0;
} else if (i > j) {
return distMat[i*(i-1)/2 + j];
} else {
return distMat[j*(j-1)/2 + i];
}
}
double getDistFromLTM(const double *distMat, unsigned int i, unsigned int j);
/*! \brief Abstract base class to do perform item picking (typically molecules) using a
* distance matrix
@@ -48,6 +39,7 @@ namespace RDPickers {
*
*/
DistPicker(){};
virtual ~DistPicker() {};
/*! \brief this is a virtual function specific to the type of algorihtm used
*

View File

@@ -41,8 +41,6 @@ class TestCase(unittest.TestCase):
clbl = labels[cl[0]]
for id in cl:
assert clbl == labels[id]
hierarch = pkr.Pick(self.dMat, i, 2)
assert tuple(hierarch) == (1,30)