1#ifndef HASH_PAIR_BUILDER_PERIODIC_H
2#define HASH_PAIR_BUILDER_PERIODIC_H
18 template<
class Pred,
class OP>
37 for (
unsigned dim = 0; dim<3; ++dim)
40 dmsg <<
" period = " << period <<
endl;
46 std::size_t *buckets =
new size_t[Nbucket];
47 std::size_t *next =
new size_t[size];
48 std::fill(buckets, buckets+Nbucket, END);
49 std::fill(next, next+size, END);
54 int offset[14][3] = {{ 1, 1, 1}, { 0, 1, 1}, {-1, 1, 1},
55 { 1, 0, 1}, { 0, 0, 1}, {-1, 0, 1},
56 { 1,-1, 1}, { 0,-1, 1}, {-1,-1, 1},
57 { 1, 1, 0}, { 0, 1, 0}, {-1, 1, 0},
58 { 1, 0, 0}, { 0, 0, 0}};
61 for(std::size_t i = 0;i<size;++i) {
63 next[i] = buckets[bucket_id];
64 buckets[bucket_id] = i;
73 for (
unsigned n=0;
n<neigh;++
n){
74 int bx_neigh, by_neigh, bz_neigh;
77 bx_neigh = bx+offset[
n][0];
81 shift[0] = -period[0];
89 by_neigh = by+offset[
n][1];
92 shift[1] = -period[1];
98 bz_neigh = bz+offset[
n][2];
101 shift[2] = -period[2];
105 shift[2] = period[2];
113 unsigned bucket_id_neigh =
116 std::size_t i = buckets[bucket_id_self];
122 j = buckets[bucket_id_neigh];
124 for (
int o=0;o<self_offset;o++){
139 if (bucket_id_self==bucket_id_neigh)
160 for (
unsigned d=0; d<3; ++d)
T::PETE_Expr_t::PETE_Return_t max(const PETE_Expr< T > &expr, NDIndex< D > &loc)
PETE_TUTree< FnFloor, typename T::PETE_Expr_t > floor(const PETE_Expr< T > &l)
Inform & endl(Inform &inf)
Vektor< double, 3 > rmin_m
HashPairBuilderPeriodic(PBase &p)
Vektor< double, 3 > rmax_m
PBase::Position_t Position_t
void for_each(const Pred &pred, const OP &op, Vektor< double, 3 > extend_l, Vektor< double, 3 > extend_r)
int get_bucket_id(int i, const Pred &)
Vektor< double, 3 > h_chaining
Vektor< int, 3 > buckets_per_dim