Medusa  1.1
Coordinate Free Mehless Method implementation
UniformShapeStorage.hpp
Go to the documentation of this file.
1 #ifndef MEDUSA_BITS_OPERATORS_UNIFORMSHAPESTORAGE_HPP_
2 #define MEDUSA_BITS_OPERATORS_UNIFORMSHAPESTORAGE_HPP_
3 
10 #include "ShapeStorage.hpp"
11 #include "printShapes.hpp"
13 #include <cstring>
14 #include <Eigen/Core>
15 
16 namespace mm {
17 
18 template <typename vec_t, typename OpFamilies>
19 void UniformShapeStorage<vec_t, OpFamilies>::resize_(const std::vector<int>& support_sizes) {
20  support_size_ = (domain_size_ > 0) ? support_sizes[0] : 0;
21  for (int s : support_sizes) {
22  assert_msg(support_size_ == s, "Not all support sizes are equal, got sizes %d and %d. "
23  "Use RaggedShapeStorage instead.", support_size_, s);
24  }
25 
26  // Fills support with -1, to indicate which nodes have their shapes computed.
27  support_.resize(domain_size_ * support_size_, -1);
28  resize_internal::resize_storage_<OpFamilies, num_operators>::resize(
29  shapes_, domain_size_ * support_size_);
30 }
31 
32 } // namespace mm
33 
34 #endif // MEDUSA_BITS_OPERATORS_UNIFORMSHAPESTORAGE_HPP_
mm
Root namespace for the whole library.
Definition: Gaussian.hpp:14
printShapes.hpp
mm::UniformShapeStorage::resize_
void resize_(const std::vector< int > &support_sizes)
Resizes the storage to accommodate shapes of given sizes.
Definition: UniformShapeStorage.hpp:19
assert_msg
#define assert_msg(cond,...)
Assert with better error reporting.
Definition: assert.hpp:75
ShapeStorage.hpp
assert.hpp
UniformShapeStorage_fwd.hpp