OpenFPM_pdata  4.1.0
Project that contain the implementation of distributed structures
 
Loading...
Searching...
No Matches
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
18template<unsigned int dim, typename St>
20{
21public:
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_ */
This class implement the point shape in an N-dimensional space.
Definition Point.hpp:28
__device__ __host__ const T & get(unsigned int i) const
Get coordinate.
Definition Point.hpp:172
static Point< dim, St > convert(const comb< dim > &c)
Return the combination converted to point.
Definition convert.hpp:25
Position of the element of dimension d in the hyper-cube of dimension dim.
Definition comb.hpp:35
signed char c[dim]
Array that store the combination.
Definition comb.hpp:37