aboutsummaryrefslogtreecommitdiffstats
path: root/meowpp.test/src/VP_Tree.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'meowpp.test/src/VP_Tree.cpp')
-rw-r--r--meowpp.test/src/VP_Tree.cpp26
1 files changed, 15 insertions, 11 deletions
diff --git a/meowpp.test/src/VP_Tree.cpp b/meowpp.test/src/VP_Tree.cpp
index c30b118..8e93224 100644
--- a/meowpp.test/src/VP_Tree.cpp
+++ b/meowpp.test/src/VP_Tree.cpp
@@ -3,7 +3,7 @@
#include "meowpp/utility.h"
-#include "meowpp.h"
+#include "dsa.h"
#include <vector>
@@ -12,13 +12,17 @@
#include <algorithm>
#include <ctime>
+extern "C" {
+#include <sys/types.h>
+}
+
#include <queue>
static int N = 100000;
static int D = 32;
static int MAX = 1000;
-typedef long long lnt;
+typedef int64_t lnt;
struct MyVector{
std::vector<lnt> v;
@@ -54,27 +58,27 @@ void show(MyVector const& v, std::vector<MyVector> const& r1, std::vector<MyVect
for(int i = 0; i < N; i++){
printf("%3d) ", data[i].w);
for(int j = 0; j < D; j++)
- printf("%8lld ", data[i][j]);
- printf(" ===> %lld\n", dist2(data[i], v));
+ printf("%8ld ", data[i][j]);
+ printf(" ===> %ld\n", dist2(data[i], v));
}
printf("\n");
printf("ask) ");
for(int j = 0; j < D; j++)
- printf("%8lld ", v[j]);
+ printf("%8ld ", v[j]);
printf("\n");
printf("---------\n");
for(size_t i = 0; i < r1.size(); i++){
printf("%3d) ", r1[i].w);
for(int j = 0; j < D; j++)
- printf("%8lld ", r1[i][j]);
- printf(" ===> %lld\n", dist2(r1[i], v));
+ printf("%8ld ", r1[i][j]);
+ printf(" ===> %ld\n", dist2(r1[i], v));
}
printf("---------\n");
for(size_t i = 0; i < r2.size(); i++){
printf("%3d) ", r2[i].w);
for(int j = 0; j < D; j++)
- printf("%8lld ", r2[i][j]);
- printf(" ===> %lld\n", dist2(r2[i], v));
+ printf("%8ld ", r2[i][j]);
+ printf(" ===> %ld\n", dist2(r2[i], v));
}
}
}
@@ -181,5 +185,5 @@ TEST(VP_Tree, "A little bit slow"){
return true;
-};
-;
+}
+