Permalink
Browse files

..

  • Loading branch information...
aaalgo committed Mar 15, 2014
1 parent f26b0fd commit c4ef54b4c7e22e0f72019e7de795433798db8886
Showing with 10 additions and 5 deletions.
  1. +1 −1 Makefile
  2. +9 −4 test.cpp
@@ -13,7 +13,7 @@ NABO_LIBS+=-lnabo
COMMON=kgraph.o metric.o
HEADERS=kgraph.h kgraph-data.h
PROGS=index search split fvec2lshkit
EXTRA_PROGS=test.cpp
EXTRA_PROGS=test
FLANN_PROGS=flann_index flann_search
NABO_PROGS=nabo_search
@@ -8,7 +8,6 @@
#define KGRAPH_VALUE_TYPE float
#endif
#include <cctype>
#include <type_traits>
#include <iostream>
@@ -71,7 +70,14 @@ int main (int argc, char *argv[]) {
unsigned dim = data.dim();
VectorOracle<Matrix<value_type>, value_type const*> oracle(data,
[dim](value_type const *a, value_type const *b)
{return metric::l2sqr::apply<value_type>(a, b, dim);});
{
float r = 0;
for (unsigned i = 0; i < dim; ++i) {
float v = float(a[i]) - (b[i]);
r += v * v;
}
return r;
});
float recall = 0;
float cost = 0;
float time = 0;
@@ -83,8 +89,7 @@ int main (int argc, char *argv[]) {
KGraph *kgraph = KGraph::create();
{
KGraph::IndexParams params;
//kgraph->build(oracle, params, NULL);
kgraph->load("sift.kgraph");
kgraph->build(oracle, params, NULL);
}
boost::timer::auto_cpu_timer timer;

0 comments on commit c4ef54b

Please sign in to comment.