Skip to content

Commit 80345bb

Browse files
committed
Small changes to nearest neighbor search speed test.
1 parent a009752 commit 80345bb

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

src/EMTree.cpp

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -365,19 +365,19 @@ void testHistogram(vector<SVector<bool>*>& vectors) {
365365
void testMeanVersusNNSpeed(vector<SVector<bool>*>& vectors) {
366366
if (!vectors.empty()) {
367367
const int dims = vectors[0]->size();
368-
SVector<bool> mean(dims);
368+
SVector<bool>* mean = new SVector<bool>(dims);
369369
vector<int> weights;
370370
{
371371
boost::timer::auto_cpu_timer time("calculating mean: %w seconds\n");
372372
meanBitPrototype2 proto;
373-
proto(&mean, vectors, weights);
373+
proto(mean, vectors, weights);
374374
}
375375
{
376376
boost::timer::auto_cpu_timer hammingTime("hamming distance: %w seconds\n");
377377
hammingDistance distance;
378378
uint64_t sum = 0;
379379
for (auto vector : vectors) {
380-
sum += distance(&mean, vector);
380+
sum += distance(mean, vector);
381381
}
382382
cout << sum << endl;
383383
}
@@ -386,18 +386,17 @@ void testMeanVersusNNSpeed(vector<SVector<bool>*>& vectors) {
386386

387387
int main(int argc, char** argv) {
388388
vector < SVector<bool>*> vectors;
389-
//int veccount = -1;
390-
int veccount = 100000;
389+
int veccount = -1;
391390
{
392391
boost::timer::auto_cpu_timer seed("loading signatures: %w seconds\n");
393392
loadWikiSignatures(vectors, veccount);
394393
}
395394

396395
//sigKTreeCluster(vectors);
397396
//sigTSVQCluster(vectors);
398-
sigEMTreeCluster(vectors);
397+
//sigEMTreeCluster(vectors);
399398
//testHistogram(vectors);
400-
//testMeanVersusNNSpeed(vectors);
399+
testMeanVersusNNSpeed(vectors);
401400
//testReadVectors();
402401
//TestSigEMTree();
403402
return EXIT_SUCCESS;

0 commit comments

Comments
 (0)