yrange: solve lower-dim-reformat issue
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
parent
d66164e874
commit
0eb505f41b
2 changed files with 12 additions and 8 deletions
|
@ -551,21 +551,21 @@ namespace CNORXZ
|
|||
GMIndex<FormatT,Indices...>&
|
||||
GMIndex<FormatT,Indices...>::reformat(const Vector<SizeT>& f, const Vector<SizeT>& s)
|
||||
{
|
||||
// f: input format
|
||||
// s: input sizes
|
||||
CXZ_ASSERT(f.size() == s.size(), "input error: f.size() != s.size()");
|
||||
if(f.size() == 1){
|
||||
CXZ_ASSERT(s.size() == 1, "f.size() != s.size()");
|
||||
CXZ_ASSERT(s[0] == lmax().val(), "got inconsistent size; expeected "
|
||||
<< lmax().val() << ", got " << s[0]);
|
||||
return *this;
|
||||
}
|
||||
|
||||
if constexpr(std::is_same<FormatT,None>::value){
|
||||
CXZ_ASSERT(CNORXZ::formatIsTrivial(f,s),
|
||||
"cannot reformat MIndex with format type = None");
|
||||
return *this;
|
||||
}
|
||||
else {
|
||||
CXZ_ASSERT(f.size() == s.size(), "input error: f.size() != s.size()");
|
||||
// f: input format
|
||||
// s: input sizes
|
||||
SizeT j = 0;
|
||||
SizeT j0 = 0;
|
||||
SizeT xi = 1;
|
||||
|
|
|
@ -415,9 +415,15 @@ namespace CNORXZ
|
|||
|
||||
YIndex& YIndex::reformat(const Vector<SizeT>& f, const Vector<SizeT>& s)
|
||||
{
|
||||
CXZ_ASSERT(f.size() == s.size(), "input error: f.size() != s.size()");
|
||||
// f: input format
|
||||
// s: input sizes
|
||||
CXZ_ASSERT(f.size() == s.size(), "input error: f.size() != s.size()");
|
||||
if(f.size() == 1){
|
||||
CXZ_ASSERT(s[0] == lmax().val(), "got inconsistent size; expeected "
|
||||
<< lmax().val() << ", got " << s[0]);
|
||||
return *this;
|
||||
}
|
||||
|
||||
SizeT j = 0;
|
||||
SizeT j0 = 0;
|
||||
SizeT xi = 1;
|
||||
|
@ -427,9 +433,7 @@ namespace CNORXZ
|
|||
xi *= mIs[i]->lmax().val();
|
||||
SizeT xj = s[j];
|
||||
if(xi < xj) {
|
||||
// TODO: IMPLEMENT!!!
|
||||
// check trivial format in this partition
|
||||
CXZ_ERROR("reformating with lower-dimensional formats has not yet been implemented");
|
||||
CXZ_ERROR("reformating with lower-dimensional formats is not possible; use sub-indices instead");
|
||||
continue;
|
||||
}
|
||||
j0 = j;
|
||||
|
|
Loading…
Reference in a new issue