-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpoint.cpp
30 lines (20 loc) · 820 Bytes
/
point.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
#include "structures.hpp"
void write_sorted_set(std::vector<point> &buff,
unsigned long int num_points,
int box_length) {
for (unsigned long int i = 0; i < num_points; ++i) {
buff.emplace_back(i / (box_length * box_length),
(i / box_length) % box_length,
i % box_length);
}
std::sort(buff.begin(), buff.end(), [](const point &p1, const point &p2) {
return p1.peanokey < p2.peanokey;
});
if (verbose >= 3) {
std::cout << "\nProposed point set : " << std::endl;
for (unsigned long int i = 0; i < num_points; ++i) {
std::cout << buff[i] << std::endl;
}
}
return;
}