diff --git a/src/include/ranges/mrange.cc.h b/src/include/ranges/mrange.cc.h index ee29536..2a6d16a 100644 --- a/src/include/ranges/mrange.cc.h +++ b/src/include/ranges/mrange.cc.h @@ -629,6 +629,15 @@ namespace CNORXZ return *this; } + template + template + GMIndex& GMIndex::setSub(CSizeT ind, SizeT lex) + { + mIPack[ind] = lex; + return operator()(); + } + + template constexpr decltype(auto) mindex(const Sptr&... is) { diff --git a/src/include/ranges/mrange.h b/src/include/ranges/mrange.h index 6d59cb9..32f2d7c 100644 --- a/src/include/ranges/mrange.h +++ b/src/include/ranges/mrange.h @@ -182,6 +182,13 @@ namespace CNORXZ /** Assign new index format. */ GMIndex& setFormat(const FormatT& bs); + /** Set position of given sub index and update total index position. + @param ind Sub-index number [0,dim()-1]. + @param lex Lexicographic position to be assigned to the index. + */ + template + GMIndex& setSub(CSizeT ind, SizeT lex); + private: template static constexpr decltype(auto) mkLexFormat(const SPack& ipack, Isq is);