OpenFPM_pdata  4.1.0
Project that contain the implementation of distributed structures
Support.hpp
1 //
2 // Created by tommaso on 29/03/19.
3 // Modified by Abhinav and Pietro
4 
5 #ifndef OPENFPM_PDATA_SUPPORT_HPP
6 #define OPENFPM_PDATA_SUPPORT_HPP
7 
8 #include <Space/Shape/Point.hpp>
9 #include <Vector/vector_dist.hpp>
10 
11 class Support
12 {
13  // This class is basically a wrapper around a point and a set of offsets.
14  // Offsets are stored as they are the data that is mostly required in DCPSE, so we
15  // pre-compute and store them, while the positions can be re-computed everytime is
16  // necessary (it should almost never be the case) (todo: check if this is required)
17 
18 private:
19 
20  size_t referencePointKey;
21  std::vector<size_t> keys;
22 
23 public:
24 
25  Support() {};
26 
27  Support(const size_t &referencePoint, const std::vector<size_t> &keys)
28  :referencePointKey(referencePoint),
29  keys(keys)
30  {}
31 
32  Support(const Support &other)
33  : referencePointKey(other.referencePointKey),
34  keys(other.keys)
35  {}
36 
37  size_t size()
38  {
39  return keys.size();
40  }
41 
42  const size_t getReferencePointKey() const
43  {
44  return referencePointKey;
45  }
46 
47  const std::vector<size_t> &getKeys() const
48  {
49  return keys;
50  }
51 };
52 
53 
54 #endif //OPENFPM_PDATA_SUPPORT_HPP