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
scalar.hpp
1 /*
2  * scalar.hpp
3  *
4  * Created on: Feb 3, 2015
5  * Author: i-bird
6  */
7 
8 #ifndef SCALAR_HPP_
9 #define SCALAR_HPP_
10 
11 #include <boost/fusion/container/vector.hpp>
12 
19 template <typename T>
20 class scalar
21 {
22 public:
23 
24  typedef boost::fusion::vector<T> type;
25 
26  type data;
27 
28  static const unsigned int ele = 0;
29  static const unsigned int max_prop = 1;
30 
31  // Setter method
32 
33  inline void set(T s_) {boost::fusion::at_c<0>(data) = s_;};
34 
35  // getter method
36 
37  T& get() {return boost::fusion::at_c<ele>(data);};
38 };
39 
40 
41 #endif /* SCALAR_HPP_ */
it define a scalar value compatible with grid_cpu , grid_gpu, vector, graph ...
Definition: scalar.hpp:20