##// END OF EJS Templates
Adds subData() method
Alexandre Leroux -
r557:8d58d9ce4f09
parent child
Show More
@@ -192,6 +192,27 public:
192
192
193 Iterator cend() const { return Iterator{*this, false}; }
193 Iterator cend() const { return Iterator{*this, false}; }
194
194
195 std::pair<Iterator, Iterator> subData(double min, double max) const
196 {
197 if (min > max) {
198 std::swap(min, max);
199 }
200
201 auto begin = cbegin();
202 auto end = cend();
203
204 auto lowerIt
205 = std::lower_bound(begin, end, min, [](const auto &itValue, const auto &value) {
206 return itValue.x() == value;
207 });
208 auto upperIt
209 = std::upper_bound(begin, end, max, [](const auto &value, const auto &itValue) {
210 return itValue.x() == value;
211 });
212
213 return std::make_pair(lowerIt, upperIt);
214 }
215
195 // /////// //
216 // /////// //
196 // Mutexes //
217 // Mutexes //
197 // /////// //
218 // /////// //
General Comments 0
You need to be logged in to leave comments. Login now