315 typename Range2::iterator
splitList (Range1& values, Range2& points){
316 std::vector<KeyValuePair<typename Range1::value_type, typename Range2::value_type> > range(values.size());
317 for(std::size_t i = 0; i != range.size(); ++i){
318 range[i].key = values[i];
319 range[i].value = points[i];
324 for(std::size_t i = 0; i != range.size(); ++i){
325 values[i] = range[i].key;
326 points[i] = range[i].value;
329 if (pos == range.end()) {
332 return points.begin();
339 double maximum = std::max_element(range.begin(), pos)->key;
342 return points.begin() + (pos - range.begin());