#include "index_wrapper.h" #include "rpack_num.h" namespace MultiArrayTools { template IndexWrapper::IndexWrapper(const std::shared_ptr& i) : mI(i) {} template IndexType IndexWrapper::type() const { return mI->type(); } template IndexWrapper& IndexWrapper::operator=(size_t pos) { (*mI) = pos; return *this; } template IndexWrapper& IndexWrapper::operator++() { ++(*mI); return *this; } template IndexWrapper& IndexWrapper::operator--() { --(*mI); return *this; } template size_t IndexWrapper::pos() const { return mI->pos(); } template size_t IndexWrapper::max() const { return mI->max(); } template int IndexWrapper::pp(std::intptr_t idxPtrNum) { return mI->pp(idxPtrNum); } template int IndexWrapper::mm(std::intptr_t idxPtrNum) { return mI->mm(idxPtrNum); } template std::string IndexWrapper::stringMeta() const { return mI->stringMeta(); } template IndexWrapper& IndexWrapper::at(const typename Index::MetaType& metaPos) { mI->at(metaPos); return *this; } template size_t IndexWrapper::posAt(const typename Index::MetaType& metaPos) { return mI->posAt(metaPos); } template size_t IndexWrapper::dim() const { return mI->dim(); } template bool IndexWrapper::last() const { return mI->last(); } template bool IndexWrapper::first() const { return mI->first(); } template std::shared_ptr IndexWrapper::range() const { return mI->range(); } template size_t IndexWrapper::getStepSize(size_t n) const { return mI->getStepSize(n); } template size_t IndexWrapper::getStepSizeComp(std::intptr_t j) const { return MultiArrayHelper::getStepSize(*mI, j); } template std::intptr_t IndexWrapper::get() const { return reinterpret_cast(mI.get()); } template std::intptr_t IndexWrapper::ptrNum() const { return mI->ptrNum(); } template DynamicExpression IndexWrapper::ifor(size_t step, DynamicExpression ex) const { return mI->ifor(step, ex); } template DynamicExpression IndexWrapper::iforh(size_t step, DynamicExpression ex) const { return mI->iforh(step, ex); } template std::shared_ptr IndexWrapper::duplicate() const { return std::make_shared( std::make_shared( *mI ) ); } template std::shared_ptr mkIndexWrapper(const Index& i) { return std::make_shared>(std::make_shared(i)); } }