More tests
This commit is contained in:
parent
1213155222
commit
31ecbe79d7
@ -2,10 +2,12 @@
|
||||
#include <cassert>
|
||||
#include <cstdlib>
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#define __KD_TREE_NUMNODES
|
||||
#include "mykdtree.hpp"
|
||||
|
||||
#define NTRY 3
|
||||
#define ND 2
|
||||
#define ND 3
|
||||
|
||||
using namespace std;
|
||||
using namespace CosmoTool;
|
||||
@ -61,6 +63,7 @@ int main()
|
||||
cout << "Check consistency..." << endl;
|
||||
MyCell **ngb = new MyCell *[12];
|
||||
|
||||
ofstream fngb("nearest.txt");
|
||||
for (int k = 0; k < NTRY; k++) {
|
||||
cout << "Seed = " << xc[k][0] << " " << xc[k][1] << " " << xc[k][2] << endl;
|
||||
tree.getNearestNeighbours(xc[k], 12, ngb);
|
||||
@ -70,7 +73,7 @@ int main()
|
||||
double d2 = 0;
|
||||
for (int l = 0; l < 3; l++)
|
||||
d2 += ({double delta = xc[k][l] - ngb[i]->coord[l]; delta*delta;});
|
||||
cout << ngb[i]->coord[0] << " " << ngb[i]->coord[1] << " " << ngb[i]->coord[2] << " " << sqrt(d2) << endl;
|
||||
fngb << ngb[i]->coord[0] << " " << ngb[i]->coord[1] << " " << ngb[i]->coord[2] << " " << sqrt(d2) << endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user