OpenFPM_pdata  1.1.0
Project that contain the implementation of distributed structures
 All Data Structures Namespaces Functions Variables Typedefs Enumerations Friends Pages
convert.hpp
1 /*
2  * convert.hpp
3  *
4  * Created on: Aug 26, 2015
5  * Author: i-bird
6  */
7 
8 #ifndef SRC_UTIL_CONVERT_HPP_
9 #define SRC_UTIL_CONVERT_HPP_
10 
18 template<unsigned int dim, typename St>
19 class toPoint
20 {
21 public:
25  static inline Point<dim,St> convert(const comb<dim> & c)
26  {
27  // Point
28  Point<dim,St> ret;
29 
30  // set the point
31  for (size_t i = 0; i < dim ; i++)
32  ret.get(i) = c.c[i];
33 
34  return ret;
35  }
36 };
37 
38 
39 
40 #endif /* SRC_UTIL_CONVERT_HPP_ */
Position of the element of dimension d in the hyper-cube of dimension dim.
Definition: comb.hpp:34
static Point< dim, St > convert(const comb< dim > &c)
Return the combination converted to point.
Definition: convert.hpp:25
This class implement the point shape in an N-dimensional space.
Definition: Point.hpp:22
const T & get(size_t i) const
Get coordinate.
Definition: Point.hpp:142
char c[dim]
Array that store the combination.
Definition: comb.hpp:37