diff --git a/VERSION b/VERSION index eb2ca0f1..ccb12466 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.10.15 +1.10.16 diff --git a/src/metkit/hypercube/HyperCube.cc b/src/metkit/hypercube/HyperCube.cc index 6c538f18..7c7ee5ef 100644 --- a/src/metkit/hypercube/HyperCube.cc +++ b/src/metkit/hypercube/HyperCube.cc @@ -256,14 +256,14 @@ std::vector> HyperCube::request(std return requests; } -std::vector HyperCube::vacantRequests() const { +std::vector HyperCube::aggregatedRequests(bool remaining) const { - if (countVacant() == 0) + if (countVacant() == (remaining ? 0 : size())) return std::vector{}; std::set idxs; for(size_t i = 0; i < set_.size(); ++i) { - if (set_[i]) + if (set_[i] == remaining) idxs.emplace(i); } diff --git a/src/metkit/hypercube/HyperCube.h b/src/metkit/hypercube/HyperCube.h index 818d99ff..32134987 100644 --- a/src/metkit/hypercube/HyperCube.h +++ b/src/metkit/hypercube/HyperCube.h @@ -44,9 +44,11 @@ class HyperCube { size_t size() const {return cube_.count(); } size_t fieldOrdinal(const metkit::mars::MarsRequest&, bool noholes = true) const; - std::vector vacantRequests() const; + std::vector vacantRequests() const { return aggregatedRequests(true); } + std::vector requests() const { return aggregatedRequests(false); } protected: + std::vector aggregatedRequests(bool remaining) const; int indexOf(const metkit::mars::MarsRequest&) const; bool clear(int index); metkit::mars::MarsRequest requestOf(size_t index) const;