diff --git a/src/include/ranges/anonymous_range.h b/src/include/ranges/anonymous_range.h index 324680e..0aefc39 100644 --- a/src/include/ranges/anonymous_range.h +++ b/src/include/ranges/anonymous_range.h @@ -65,7 +65,8 @@ namespace MultiArrayTools virtual size_t size() const override; virtual size_t dim() const override; - + + size_t anonymousDim() const; size_t get(size_t pos) const; size_t getMeta(size_t metaPos) const; @@ -129,6 +130,7 @@ namespace MultiArrayTools void AnonymousRangeFactory::append(std::shared_ptr r) { if(mProductCreated){ + mProd = std::shared_ptr( new AnonymousRange( *std::dynamic_pointer_cast(mProd) ) ); mProductCreated = false; } @@ -153,7 +155,9 @@ namespace MultiArrayHelper size_t origpos, size_t size) { AnonymousRangeFactory arf; + //VCHECK(size); for(size_t op = origpos; op != origpos + size; ++op){ + //VCHECK(op); arf.append(orig[op]); } rp = std::dynamic_pointer_cast( arf.create() ); @@ -180,7 +184,6 @@ namespace MultiArrayTools SingleRange::SingleRange(const std::tuple...>& origs) : RangeInterface() { - mOrig.resize(sizeof...(RangeTypes)); RPackNum::RangesToVec( origs, mOrig ); mSize = RPackNum::getSize( origs ); } @@ -190,7 +193,6 @@ namespace MultiArrayTools RangeInterface() { auto rst = std::make_tuple(origs...); - //mOrig.resize(sizeof...(RangeTypes)); RPackNum::RangesToVec( rst, mOrig ); mSize = RPackNum::getSize( rst ); } diff --git a/src/include/ranges/rpack_num.h b/src/include/ranges/rpack_num.h index c348e41..bfc9818 100644 --- a/src/include/ranges/rpack_num.h +++ b/src/include/ranges/rpack_num.h @@ -90,7 +90,6 @@ namespace MultiArrayHelper std::intptr_t idxPtrNum) { auto& siPtr = std::get(ip); - //VCHECK(siPtr.id()); if(reinterpret_cast(siPtr.get()) == idxPtrNum){ return RPackNum::pp(ip, bs, idxPtrNum); } @@ -277,9 +276,7 @@ namespace MultiArrayHelper const auto& ni = ii.template get(); const size_t max = ni.max(); const size_t tmp = getStepSize(ni, j); - //VCHECK(tmp); ss += tmp * sx; - //VCHECK(ss); sx *= max; RPackNum::getStepSizeX(ii, j, ss, sx); } @@ -480,9 +477,7 @@ namespace MultiArrayHelper const auto& ni = ii.template get<0>(); const size_t max = ni.max(); const size_t tmp = getStepSize(ni, j); - //VCHECK(tmp); ss += tmp * sx; - //VCHECK(ss); sx *= max; } diff --git a/src/lib/ranges/anonymous_range.cc b/src/lib/ranges/anonymous_range.cc index 4ab93a6..992e098 100644 --- a/src/lib/ranges/anonymous_range.cc +++ b/src/lib/ranges/anonymous_range.cc @@ -76,7 +76,12 @@ namespace MultiArrayTools { return 1; } - + + size_t AnonymousRange::anonymousDim() const + { + return mOrig.size(); + } + typename AnonymousRange::IndexType AnonymousRange::begin() const { AnonymousIndex i