OpenFPM_data  0.1.0
Project that contain the implementation and interfaces for basic structure like vectors, grids, graph ... .
 All Data Structures Namespaces Functions Variables Typedefs Friends
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:20
T get(int i) const
Get coordinate.
Definition: Point.hpp:42
char c[dim]
Array that store the combination.
Definition: comb.hpp:37