-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathThesisSpillTreeTests.cpp
More file actions
86 lines (74 loc) · 3.99 KB
/
ThesisSpillTreeTests.cpp
File metadata and controls
86 lines (74 loc) · 3.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#define ARMA_64BIT_WORD
#include <armadillo>
#include <cstdint>
#include <sys/types.h>
#include <random>
#include <algorithm>
#include <unordered_map>
#include <set>
#include <list>
#include <fcntl.h>
#include <sys/mman.h>
#include <sys/time.h>
#include <iostream>
#include <sstream>
#include "KDTree.h"
#include "CoverTree.h"
#include "BallTree.h"
#include "DataReferenceEuclideanNode.h"
#include "ThesisTest.h"
int main (void) {
std::cout << "SPILL EPSILON, TREE TYPE, SIFT TIME, SIFT ACCURACY, GIST TIME, GIST ACCURACY" << std::endl;
std::pair<double, double> times;
double accuracy = 0.;
double stddev = 0.;
for (size_t j = 2; j <= 1000; j = 3*j/2) {
double i = j/500.;
std::cout << i << ", KD tree, ";
times = ThesisTest<
KDTree<DataReferenceEuclideanNode, DataReferenceEuclideanNode>
>::timeKNNSIFT(100, 1000000, 1000, std::numeric_limits<size_t>::max(), i);
std::tie(accuracy,stddev) = ThesisTest<
KDTree<DataReferenceEuclideanNode, DataReferenceEuclideanNode>
>::accuracyKNNSIFT(100, 1000000, 1000, std::numeric_limits<size_t>::max(), i);
std::cout << std::get<1>(times) << ", " << accuracy << " +/- " << stddev << ", ";
times = ThesisTest<
KDTree<DataReferenceEuclideanNode, DataReferenceEuclideanNode>
>::timeKNNGIST(100, 1000000, 1000, std::numeric_limits<size_t>::max(), i);
std::tie(accuracy,stddev) = ThesisTest<
KDTree<DataReferenceEuclideanNode, DataReferenceEuclideanNode>
>::accuracyKNNGIST(100, 1000000, 1000, std::numeric_limits<size_t>::max(), i);
std::cout << std::get<1>(times) << ", " << accuracy << std::endl;
std::cout << i << ", VP tree, ";
times = ThesisTest<
BallTree<DataReferenceEuclideanNode, DataReferenceEuclideanNode>
>::timeKNNSIFT(100, 1000000, 1000, std::numeric_limits<size_t>::max(), i);
std::tie(accuracy,stddev) = ThesisTest<
BallTree<DataReferenceEuclideanNode, DataReferenceEuclideanNode>
>::accuracyKNNSIFT(100, 1000000, 1000, std::numeric_limits<size_t>::max(), i);
std::cout << std::get<1>(times) << ", " << accuracy << " +/- " << stddev << ", ";
times = ThesisTest<
BallTree<DataReferenceEuclideanNode, DataReferenceEuclideanNode>
>::timeKNNGIST(100, 1000000, 1000, std::numeric_limits<size_t>::max(), i);
std::tie(accuracy,stddev) = ThesisTest<
BallTree<DataReferenceEuclideanNode, DataReferenceEuclideanNode>
>::accuracyKNNGIST(100, 1000000, 1000, std::numeric_limits<size_t>::max(), i);
std::cout << std::get<1>(times) << ", " << accuracy << std::endl;
std::cout << i << ", Cover tree, ";
times = ThesisTest<
CoverTree<DataReferenceEuclideanNode, DataReferenceEuclideanNode>
>::timeKNNSIFT(100, 1000000, 1000, std::numeric_limits<size_t>::max(), i);
std::tie(accuracy,stddev) = ThesisTest<
CoverTree<DataReferenceEuclideanNode, DataReferenceEuclideanNode>
>::accuracyKNNSIFT(100, 1000000, 1000, std::numeric_limits<size_t>::max(), i);
std::cout << std::get<1>(times) << ", " << accuracy << " +/- " << stddev << ", ";
times = ThesisTest<
CoverTree<DataReferenceEuclideanNode, DataReferenceEuclideanNode>
>::timeKNNGIST(100, 1000000, 1000, std::numeric_limits<size_t>::max(), i);
std::tie(accuracy,stddev) = ThesisTest<
CoverTree<DataReferenceEuclideanNode, DataReferenceEuclideanNode>
>::accuracyKNNGIST(100, 1000000, 1000, std::numeric_limits<size_t>::max(), i);
std::cout << std::get<1>(times) << ", " << accuracy << std::endl;
}
return 0;
};