diff --git a/src/include/map_range.cc.h b/src/include/map_range.cc.h index de2564f..0df0cdd 100644 --- a/src/include/map_range.cc.h +++ b/src/include/map_range.cc.h @@ -425,13 +425,19 @@ namespace MultiArrayTools mapMult = MultiArray( outRange, outmult ); } }; - //!!!!! + template template void GenMapRange::mkOutRange(const MA& mapf) { //FunctionalMultiArray fma(mSpace, mMapf); OutRangeMaker::mk(mOutRange,mMapMult,mapf); + auto i = mapf.begin(); + mMapPos.resize(i.max()); + for(; i.pos() != i.max(); ++i){ + mMapPos[i.pos()] = mOutRange->getMeta( mapf[i] ); + } + } template @@ -593,12 +599,7 @@ namespace MultiArrayTools template vector GenMapRange::mapPos() const { - auto i = mMapf.begin(); - vector out(i.max()); - for(; i.pos() != i.max(); ++i){ - out[i.pos()] = mOutRange->getMeta( mMapf[i] ); - } - return out; + return mMapPos; } /* diff --git a/src/include/map_range.h b/src/include/map_range.h index cddb51b..d3993f8 100644 --- a/src/include/map_range.h +++ b/src/include/map_range.h @@ -259,7 +259,8 @@ namespace MultiArrayTools //Op mMapf; std::shared_ptr mOutRange; MultiArray mMapMult; - + vector mMapPos; + private: template void mkOutRange(const MA& mapf);