| 15 | //@{ |
| 16 | template <typename DistanceFn, typename Iter> |
| 17 | std::pair<double, Iter> MaxDistance(Iter first, Iter last, DistanceFn & distFn) |
| 18 | { |
| 19 | std::pair<double, Iter> res(0.0, last); |
| 20 | |
| 21 | for (Iter i = first + 1; i != last; ++i) |
| 22 | { |
| 23 | double const d = distFn(*first, *last, *i); |
| 24 | if (res.first < d) |
| 25 | { |
| 26 | res.first = d; |
| 27 | res.second = i; |
| 28 | } |
| 29 | } |
| 30 | |
| 31 | return res; |
| 32 | } |
| 33 | |
| 34 | // Actual SimplifyDP implementation. |
| 35 | template <typename DistanceFn, typename Iter, typename Out> |
no outgoing calls
no test coverage detected