-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
47 lines (32 loc) · 1.35 KB
/
main.cpp
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
#include <iostream>
#include "MGrid/MGrid/MGrid.h"
#include "Query/Query.h"
#include "Query/MGridQuery.h"
#include "GenerateData/DataSetGenerator.h"
#include <chrono>
using namespace std::chrono;
int main() {
// Generate the data set:
DataSetGenerator dataSetGenerator(10000, 64);
// Step 1: Get Data set
vector<vector<double>> metricObjects = dataSetGenerator.generateDataNonUniformDistribution();
// Step 2: Determine the number of Pivots and number of rings
long numberOfPivots = 4;
long numberOfRings = 5;
long queryIndex = 100;
long numberOfClusters = 20;
auto start = std::chrono::high_resolution_clock::now();
// Step 3: DataSetGenerator MGrid
MGrid mGrid(metricObjects, numberOfPivots, numberOfRings, queryIndex, numberOfClusters);
auto end = std::chrono::high_resolution_clock::now();
auto duration = std::chrono::duration_cast<std::chrono::milliseconds>(end - start);
cout << "Time takes to run the whole query " << duration.count() << " ms" << endl;
vector<vector<double>> pivots = mGrid.getPivots();
vector<Cluster> clusters = mGrid.getCluster();
// Step 4: Initialize the MGrid Query Object
Query* mGridQuery = new MGridQuery(mGrid);
// Step 5: Insert Objects to the MGrid:
MetricObject objectToBeInserted;
mGridQuery->insert(objectToBeInserted);
return 0;
}