Update to DistinctIndices function (for issue #857).
Replaces pull request #974.
This commit is contained in:
@@ -12,18 +12,12 @@ bool DistinctIndices(const FullStepRow<WIDTH>& a, const FullStepRow<WIDTH>& b, s
|
|||||||
{
|
{
|
||||||
std::vector<eh_index> aSrt = a.GetIndices(len, lenIndices);
|
std::vector<eh_index> aSrt = a.GetIndices(len, lenIndices);
|
||||||
std::vector<eh_index> bSrt = b.GetIndices(len, lenIndices);
|
std::vector<eh_index> bSrt = b.GetIndices(len, lenIndices);
|
||||||
|
for(auto const& value1: aSrt) {
|
||||||
std::sort(aSrt.begin(), aSrt.end());
|
for(auto const& value2: bSrt) {
|
||||||
std::sort(bSrt.begin(), bSrt.end());
|
if (value1==value2) {
|
||||||
|
return false;
|
||||||
unsigned int i = 0;
|
}
|
||||||
for (unsigned int j = 0; j < bSrt.size(); j++) {
|
|
||||||
while (aSrt[i] < bSrt[j]) {
|
|
||||||
i++;
|
|
||||||
if (i == aSrt.size()) { return true; }
|
|
||||||
}
|
}
|
||||||
assert(aSrt[i] >= bSrt[j]);
|
|
||||||
if (aSrt[i] == bSrt[j]) { return false; }
|
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user