| 512 | // ------------------------------------------------------------------------------------ |
| 513 | |
| 514 | double funct_info::find_nn ( |
| 515 | const std::vector<function_evaluation>& evals, |
| 516 | const matrix<double,0,1>& x |
| 517 | ) |
| 518 | { |
| 519 | double best_y = 0; |
| 520 | double best_dist = std::numeric_limits<double>::infinity(); |
| 521 | for (auto& v : evals) |
| 522 | { |
| 523 | double dist = length_squared(v.x-x); |
| 524 | if (dist < best_dist) |
| 525 | { |
| 526 | best_dist = dist; |
| 527 | best_y = v.y; |
| 528 | } |
| 529 | } |
| 530 | return best_y; |
| 531 | } |
| 532 | |
| 533 | } // end namespace gopt_impl |
| 534 |
nothing calls this directly
no test coverage detected