| 65 | } |
| 66 | |
| 67 | void add ( |
| 68 | const function_evaluation& point |
| 69 | ) |
| 70 | { |
| 71 | DLIB_CASSERT(point.x.size() != 0, "The vectors can't be empty."); |
| 72 | if (points.size() == 0) |
| 73 | { |
| 74 | points.push_back(point); |
| 75 | return; |
| 76 | } |
| 77 | |
| 78 | DLIB_CASSERT(point.x.size() == dimensionality(), "All the vectors given to upper_bound_function must have the same dimensionality."); |
| 79 | |
| 80 | if (points.size() < 4) |
| 81 | { |
| 82 | points.push_back(point); |
| 83 | *this = upper_bound_function(points, relative_noise_magnitude, solver_eps); |
| 84 | return; |
| 85 | } |
| 86 | |
| 87 | points.push_back(point); |
| 88 | // add constraints between the new point and the old points |
| 89 | for (size_t i = 0; i < points.size()-1; ++i) |
| 90 | active_constraints.push_back(std::make_pair(i,points.size()-1)); |
| 91 | |
| 92 | learn_params(); |
| 93 | } |
| 94 | |
| 95 | long num_points( |
| 96 | ) const |
no test coverage detected