diff options
Diffstat (limited to 'lib/core/c++')
| -rw-r--r-- | lib/core/c++/chunk.hpp | 14 | ||||
| -rw-r--r-- | lib/core/c++/flatten.hpp | 2 |
2 files changed, 11 insertions, 5 deletions
diff --git a/lib/core/c++/chunk.hpp b/lib/core/c++/chunk.hpp index ad7de34..6b028ba 100644 --- a/lib/core/c++/chunk.hpp +++ b/lib/core/c++/chunk.hpp @@ -47,7 +47,7 @@ public: data<ValueSchema, Encode>& ghost_at(const data<schema::FixedArray<schema::UInt64,sizeof...(Sides)>>& index){ return values_.at(index); } - + const data<ValueSchema, Encode>& ghost_at(const data<schema::FixedArray<schema::UInt64,sizeof...(Sides)>>& index) const { return values_.at(index); } @@ -55,7 +55,7 @@ public: static constexpr auto get_ghost_dims() { return data<InnerSchema,Encode>::get_dims(); } - + data<ValueSchema, Encode>& at(const data<schema::FixedArray<schema::UInt64,sizeof...(Sides)>>& index){ std::decay_t<decltype(index)> ind; for(uint64_t i = 0u; i < sizeof...(Sides); ++i){ @@ -63,7 +63,7 @@ public: } return values_.at(ind); } - + const data<ValueSchema, Encode>& at(const data<schema::FixedArray<schema::UInt64,sizeof...(Sides)>>& index) const { std::decay_t<decltype(index)> ind; for(uint64_t i = 0u; i < sizeof...(Sides); ++i){ @@ -75,6 +75,14 @@ public: static constexpr auto get_dims(){ return data<schema::FixedArray<schema::UInt64, sizeof...(Sides)>,Encode>{{Sides...}}; } + + auto flat_data(){ + return values_.flat_data(); + } + + static constexpr auto flat_size() { + return data<InnerSchema,Encode>::flat_size(); + } }; template<typename Sch, uint64_t Ghost, uint64_t... Sides> diff --git a/lib/core/c++/flatten.hpp b/lib/core/c++/flatten.hpp index 164bb77..1609589 100644 --- a/lib/core/c++/flatten.hpp +++ b/lib/core/c++/flatten.hpp @@ -20,7 +20,6 @@ public: return 1u; } - private: /// 2,3,4 => 2,6,24 /// i + j * 2 + k * 3*2 @@ -35,7 +34,6 @@ private: public: static saw::data<T> apply(const saw::data<sch::FixedArray<T,D>>& index, const saw::data<sch::FixedArray<T,D>>& meta){ saw::data<T> flat_ind{0u}; - apply_i<0u>(flat_ind, index, meta); return flat_ind; } |
