Medusa  1.1
Coordinate Free Mehless Method implementation
UniformShapeStorage_fwd.hpp
Go to the documentation of this file.
1 #ifndef MEDUSA_BITS_OPERATORS_UNIFORMSHAPESTORAGE_FWD_HPP_
2 #define MEDUSA_BITS_OPERATORS_UNIFORMSHAPESTORAGE_FWD_HPP_
3 
11 #include <medusa/Config.hpp>
12 #include <vector>
14 #include <iosfwd>
15 #include <Eigen/Core>
16 #include "ShapeStorage_fwd.hpp"
17 
18 namespace mm {
19 
53 template <typename vec_t, typename OpFamilies =
54  std::tuple<Lap<vec_t::dim>, Der1s<vec_t::dim>, Der2s<vec_t::dim>>>
56  public ShapeStorage<UniformShapeStorage<vec_t, OpFamilies>, vec_t, OpFamilies> {
57  public:
58  typedef vec_t vector_t;
59  typedef typename vec_t::scalar_t scalar_t;
60  enum { dim = vec_t::dim };
62 
63  private:
66  friend base_t;
68  using base_t::support_;
69  using base_t::shapes_;
70 
73 
74  public:
75  using base_t::num_operators;
76  using base_t::size;
77 
80 
82  int supportSize(int /* node */) const { return support_size_; }
83 
84  private:
91  void resize_(const std::vector<int>& support_sizes);
92 
94  template <typename T> T* access(std::vector<T>& v, int op, int node) const {
95  return v.data() + op*domain_size_*support_size_ + node*support_size_; }
97  template <typename T> T* access(std::vector<T>& v, int node) const {
98  return v.data() + node*support_size_; }
100  template <typename T> const T* access(const std::vector<T>& v, int op, int node) const {
101  return v.data() + op*domain_size_*support_size_ + node*support_size_; }
103  template <typename T> const T* access(const std::vector<T>& v, int node) const {
104  return v.data() + node*support_size_; }
105 };
106 
107 } // namespace mm
108 
109 #endif // MEDUSA_BITS_OPERATORS_UNIFORMSHAPESTORAGE_FWD_HPP_
mm
Root namespace for the whole library.
Definition: Gaussian.hpp:14
shape_flags.hpp
scalar_t
Scalar scalar_t
Type of the elements, alias of Scalar.
Definition: MatrixBaseAddons.hpp:16
mm::ShapeStorage::domain_size_
int domain_size_
Total number of nodes.
Definition: ShapeStorage_fwd.hpp:56
mm::UniformShapeStorage::vector_t
vec_t vector_t
Vector type used.
Definition: UniformShapeStorage_fwd.hpp:58
ShapeStorage_fwd.hpp
mm::UniformShapeStorage::base_t
friend base_t
Be friends with derived class.
Definition: UniformShapeStorage_fwd.hpp:66
dim
@ dim
Number of elements of this matrix.
Definition: MatrixBaseAddons.hpp:14
mm::ShapeStorage::num_operators
constexpr static int num_operators
Number of operator families in this storage.
Definition: ShapeStorage_fwd.hpp:50
mm::UniformShapeStorage::resize_
void resize_(const std::vector< int > &support_sizes)
Resizes the storage to accommodate shapes of given sizes.
Definition: UniformShapeStorage.hpp:19
mm::UniformShapeStorage::access
const T * access(const std::vector< T > &v, int node) const
Returns const pointer to the start of values for node-th node.
Definition: UniformShapeStorage_fwd.hpp:103
mm::ShapeStorage
Shape storage base class.
Definition: ShapeStorage_fwd.hpp:41
mm::UniformShapeStorage::access
T * access(std::vector< T > &v, int op, int node) const
Returns pointer to the start of values for node-th node for op-th operator.
Definition: UniformShapeStorage_fwd.hpp:94
mm::UniformShapeStorage::scalar_t
vec_t::scalar_t scalar_t
Scalar type used.
Definition: UniformShapeStorage_fwd.hpp:59
mm::ShapeStorage::shapes_
std::array< Range< scalar_t >, num_operators > shapes_
Tuple of shape containers for given operators.
Definition: ShapeStorage_fwd.hpp:61
mm::ShapeStorage::support_
Range< int > support_
Local copy of support domains.
Definition: ShapeStorage_fwd.hpp:58
Config.hpp
mm::UniformShapeStorage::UniformShapeStorage
UniformShapeStorage()
< Number of nodes that shapes can be stored for.
Definition: UniformShapeStorage_fwd.hpp:79
mm::UniformShapeStorage::base_t
ShapeStorage< UniformShapeStorage< vec_t, OpFamilies >, vec_t, OpFamilies > base_t
Parent class.
Definition: UniformShapeStorage_fwd.hpp:65
mm::UniformShapeStorage::access
const T * access(const std::vector< T > &v, int op, int node) const
Returns const pointer to the start of values for node-th node for op-th operator.
Definition: UniformShapeStorage_fwd.hpp:100
mm::UniformShapeStorage
Efficiently stores shape functions of uniform length.
Definition: UniformShapeStorage_fwd.hpp:55
mm::UniformShapeStorage::dim
@ dim
Dimensionality of the domain.
Definition: UniformShapeStorage_fwd.hpp:61
mm::UniformShapeStorage::supportSize
int supportSize(int) const
Returns support size of node-th node.
Definition: UniformShapeStorage_fwd.hpp:82
mm::UniformShapeStorage::access
T * access(std::vector< T > &v, int node) const
Returns pointer to the start of values for node-th node.
Definition: UniformShapeStorage_fwd.hpp:97
mm::UniformShapeStorage::support_size_
int support_size_
Support size.
Definition: UniformShapeStorage_fwd.hpp:72
mm::ShapeStorage::size
int size() const
Returns number of nodes.
Definition: ShapeStorage_fwd.hpp:87