Medusa  1.1
Coordinate Free Mehless Method implementation
RaggedShapeStorage.hpp
Go to the documentation of this file.
1 #ifndef MEDUSA_BITS_OPERATORS_RAGGEDSHAPESTORAGE_HPP_
2 #define MEDUSA_BITS_OPERATORS_RAGGEDSHAPESTORAGE_HPP_
3 
10 #include "shape_flags.hpp"
11 #include "ShapeStorage.hpp"
13 #include <cstring>
14 #include <Eigen/Core>
15 
16 namespace mm {
17 
18 template <typename vec_t, typename OpFamilies>
19 void RaggedShapeStorage<vec_t, OpFamilies>::resize_(const std::vector<int>& support_sizes) {
20  domain_size_ = support_sizes.size();
21  support_sizes_ = support_sizes;
22 
23  support_starts_.resize(domain_size_, 0);
24  for (int i = 1; i < domain_size_; ++i) {
25  support_starts_[i] = support_starts_[i-1] + support_sizes_[i-1];
26  }
27  total_size_ = support_starts_[domain_size_-1] + support_sizes_[domain_size_-1];
28 
29  // Fills support with -1, to indicate which nodes have their shapes computed.
30  support_.resize(total_size_, -1);
31  resize_internal::resize_storage_<OpFamilies, num_operators>::resize(
32  shapes_, total_size_);
33 }
34 
35 } // namespace mm
36 
37 #endif // MEDUSA_BITS_OPERATORS_RAGGEDSHAPESTORAGE_HPP_
mm
Root namespace for the whole library.
Definition: Gaussian.hpp:14
shape_flags.hpp
ShapeStorage.hpp
mm::RaggedShapeStorage::resize_
void resize_(const std::vector< int > &support_sizes)
Resizes the storage to accommodate shapes of given sizes.
Definition: RaggedShapeStorage.hpp:19
assert.hpp
RaggedShapeStorage_fwd.hpp