Fix getTupleNodes unique function

This commit is contained in:
Alejandro Gallo 2021-11-10 13:46:52 +01:00
parent 427995b1e3
commit 60dab24f29

View File

@ -1749,16 +1749,12 @@ struct Info {
// return the node (or all nodes) where the elements of this // return the node (or all nodes) where the elements of this
// tuple are located // tuple are located
std::vector<size_t> getTupleNodes(ABCTuple t, size_t nNodes) { std::vector<size_t> getTupleNodes(ABCTuple t, size_t nNodes) {
std::vector<size_t> result; std::vector<size_t>
ABCTuple nTuple = { isOnNode(t[0], nNodes) nTuple = { isOnNode(t[0], nNodes)
, isOnNode(t[1], nNodes) , isOnNode(t[1], nNodes)
, isOnNode(t[2], nNodes) , isOnNode(t[2], nNodes)
}; };
std::sort(nTuple.begin(), nTuple.end()); return unique(nTuple);
ABCTuple::iterator it = std::unique(nTuple.begin(), nTuple.end());
result.resize(it - nTuple.begin());
std::copy(nTuple.begin(), it, result.begin());
return result;
} }
#+end_src #+end_src