47 , xmin_(xmin), ymin_(ymin), zmin_(zmin)
49 nx_ =
static_cast<int>(std::ceil((xmax - xmin) / cs_)) + 2;
50 ny_ =
static_cast<int>(std::ceil((ymax - ymin) / cs_)) + 2;
51 nz_ =
static_cast<int>(std::ceil((zmax - zmin) / cs_)) + 2;
52 const int total = nx_ * ny_ * nz_;
53 start_.assign(total + 1, 0);
54 count_.assign(total, 0);
108 static constexpr int FDX[13] = {-1, 0, 1, -1, 0, 1, -1, 0, 1, -1, 0, 1, 1};
109 static constexpr int FDY[13] = {-1,-1,-1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0};
110 static constexpr int FDZ[13] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0};
112 for (
int cz = 0; cz < nz_; ++cz) {
113 for (
int cy = 0; cy < ny_; ++cy) {
114 for (
int cx = 0; cx < nx_; ++cx) {
115 const int cid = (cz * ny_ + cy) * nx_ + cx;
116 const int beg = start_[
cid];
117 const int end = start_[
cid + 1];
118 if (
beg == end)
continue;
121 for (
int a =
beg;
a < end; ++
a)
122 for (
int b =
a + 1;
b < end; ++
b)
123 f(sorted_[
a], sorted_[
b]);
126 for (
int d = 0;
d < 13; ++
d) {
137 for (
int a =
beg;
a < end; ++
a)
139 f(sorted_[
a], sorted_[
b]);