mindex: copy sub-index instances in copy constr/assign + mpi: fixes

This commit is contained in:
Christian Zimmermann 2024-10-19 21:15:26 -07:00
parent 03afacb1e5
commit 462be41f1d
3 changed files with 11 additions and 2 deletions

View file

@ -169,6 +169,9 @@ namespace CNORXZ
mLMax(mkLMax(mIPack)), mLMax(mkLMax(mIPack)),
mPMax(mkPMax(mIPack,mFormat)) mPMax(mkPMax(mIPack,mFormat))
{ {
mIPack = iter<0,sizeof...(Indices)>
( [&](auto j) { return i.pack()[j]; },
[](const auto&... e) { return SPack<Indices...>(std::make_shared<Indices>(*e) ...); } );
*this = i.lex(); *this = i.lex();
} }
@ -182,6 +185,10 @@ namespace CNORXZ
mFormat = i.mFormat; mFormat = i.mFormat;
mLMax = mkLMax(mIPack); mLMax = mkLMax(mIPack);
mPMax = mkPMax(mIPack,mFormat); mPMax = mkPMax(mIPack,mFormat);
//iter<0,sizeof...(Indices)>( [&](auto j) { *mIPack[j] = *i.pack()[j]; }, NoF {} );
mIPack = iter<0,sizeof...(Indices)>
( [&](auto j) { return i.pack()[j]; },
[](const auto&... e) { return SPack<Indices...>(std::make_shared<Indices>(*e) ...); } );
return *this = i.lex(); return *this = i.lex();
} }

View file

@ -149,6 +149,7 @@ namespace CNORXZ
mPMax(mkPMax()), mPMax(mkPMax()),
mLMax(mkLMax()) mLMax(mkLMax())
{ {
// TODO: copy sub-index instances!!!
*this = i.lex(); *this = i.lex();
} }
@ -161,6 +162,7 @@ namespace CNORXZ
mLexFormat = i.mLexFormat; mLexFormat = i.mLexFormat;
mPMax = mkPMax(); mPMax = mkPMax();
mLMax = mkLMax(); mLMax = mkLMax();
// TODO: copy sub-index instances!!!
return *this = i.lex(); return *this = i.lex();
} }

View file

@ -247,7 +247,7 @@ namespace CNORXZ
template <class IndexI, class IndexK> template <class IndexI, class IndexK>
String RIndex<IndexI,IndexK>::stringMeta() const String RIndex<IndexI,IndexK>::stringMeta() const
{ {
const SizeT r = mK->lex(); const SizeT r = mK->lex()*mRankFormat;
String o; String o;
if(r == getRankNumber()){ if(r == getRankNumber()){
o = mI->stringMeta(); o = mI->stringMeta();
@ -261,7 +261,7 @@ namespace CNORXZ
{ {
MetaType o; MetaType o;
if constexpr(Typemap<MetaType>::exists){ if constexpr(Typemap<MetaType>::exists){
const SizeT r = mK->lex(); const SizeT r = mK->lex()*mRankFormat;
if(r == getRankNumber()){ if(r == getRankNumber()){
o = mI->meta(); o = mI->meta();
} }