11 #include "util/mathutil.hpp" 
   21 template<
unsigned int dim, 
typename ORB>
 
   37         orb.template bisect<T::value>();
 
   53 template<
unsigned int dim, 
unsigned int i, 
typename ORB, 
class Enable=
void>
 
   61 template<
unsigned int dim, 
unsigned int i, 
typename ORB>
 
   62 struct do_when_dim_gr_i<dim,i,ORB,typename boost::enable_if< boost::mpl::bool_<(i < dim)> >::type>
 
   64     static void bisect_loop(
bisect_unroll<dim,ORB> & bu, 
typename boost::enable_if< boost::mpl::bool_<(i < dim)> >::type* dummy = 0)
 
   66         boost::mpl::for_each< boost::mpl::range_c<int,0,i> >(bu);
 
   79 template<
typename T> 
class ORB_node : 
public aggregate<T>
 
   83     static const unsigned int CM = 0;
 
   97 template<
unsigned int dim, 
typename T, 
typename loc_wg=openfpm::vector<
float>, 
typename loc_pos=openfpm::vector<Po
int<dim,T>> , 
typename Box=Box<dim,T>, 
template<
typename,
typename> 
class Tree=
Graph_CSR_s>
 
  128     template<
unsigned int dir> 
void local_cm(
size_t start)
 
  137         auto it = lp.getIterator();
 
  144             size_t lbl = lp_lbl.get(
key) - start;
 
  147             cm.get(lbl) += lp.template get<s::x>(
key)[dir];
 
  164     template<
unsigned int dir> 
inline void local_label()
 
  169         const size_t dir_cm = (dir == 0)?(dim-1):(dir-1);
 
  172         if (grp.getNVertex() == 1)
 
  173         {lp_lbl.resize(lp.size());lp_lbl.fill(0); 
return;}
 
  177         auto p_it = lp.getIterator();
 
  181             auto key = p_it.get();
 
  184             size_t lbl = lp_lbl.get(
key);
 
  188             size_t n1 = grp.getChild(lbl,0);
 
  189             size_t n2 = grp.getChild(lbl,1);
 
  192             T cm = grp.template vertex_p<ORB_node<T>::CM>(lbl);
 
  197             if (lp.template get<s::x>(
key)[dir_cm] < cm)
 
  198             {lp_lbl.get(
key) = n1;}
 
  200             {lp_lbl.get(
key) = n2;}
 
  212     template<
unsigned int dir> 
size_t bisect()
 
  215         size_t start = grp.getNVertex();
 
  221         size_t n_node = (start + 1) / 2;
 
  224         local_cm<dir>(start - n_node);
 
  233         for (
size_t i = 0 ; i < n_node ; i++)
 
  235             grp.template vertex_p<ORB_node<T>::CM>(start-n_node+i) = cm.get(i) / cm_cnt.get(i);
 
  240         for (
size_t i = start - n_node, s = 0 ; i < start ; i++, s++)
 
  245             grp.template addEdge(i,start+2*s);
 
  246             grp.template addEdge(i,start+2*s+1);
 
  265     ORB(
Box dom, 
size_t n_sub, loc_pos & lp)
 
  266     :v_cl(create_vcluster()),lp(lp)
 
  268         typedef ORB<dim,T,loc_wg,loc_pos,Box,Tree> ORB_class;
 
  272         n_sub = openfpm::math::round_big_2(n_sub);
 
  273         size_t nsub = log2(n_sub);
 
  276         cm.resize(2 << nsub);
 
  277         cm_cnt.resize(2 << nsub);
 
  280         size_t dim_cycle = nsub / dim;
 
  287         for (
size_t i = 0 ; i < dim_cycle ; i++)
 
  289             boost::mpl::for_each< boost::mpl::range_c<int,0,dim> >(bu);
 
  294         switch(nsub - dim_cycle * dim)
 
  320             std::cerr << 
"Error: " << __FILE__ << 
":" << __LINE__ << 
" ORB is not working for dimension bigger than 8";
 
This class implement the point shape in an N-dimensional space. 
 
this class is a functor for "for_each" algorithm 
 
Implementation of VCluster class. 
 
bisect_unroll(ORB &orb)
constructor 
 
This class represent an N-dimensional box. 
 
This class is a trick to indicate the compiler a specific specialization pattern. ...
 
void operator()(T &t)
It call the copy function for each property. 
 
Simplified implementation of Graph_CSR. 
 
aggregate of properties, from a list of object if create a struct that follow the OPENFPM native stru...
 
Implementation of 1-D std::vector like structure. 
 
This structure use SFINAE to avoid instantiation of invalid code.