function evaluations
| 69 | |
| 70 | // function evaluations |
| 71 | [[nodiscard]] double evaluate_objective(const Vector<double>& x) const override { |
| 72 | double objective_value{0.}; |
| 73 | if (this->user_model.objective_function != nullptr) { |
| 74 | const uno_int return_code = this->user_model.objective_function(this->user_model.number_variables, x.data(), |
| 75 | &objective_value, this->user_model.user_data); |
| 76 | if (0 < return_code) { |
| 77 | throw FunctionEvaluationError(); |
| 78 | } |
| 79 | objective_value *= this->optimization_sense; |
| 80 | ++this->number_model_evaluations.objective; |
| 81 | } |
| 82 | return objective_value; |
| 83 | } |
| 84 | |
| 85 | void evaluate_constraints(const Vector<double>& x, Vector<double>& constraints) const override { |
| 86 | if (this->user_model.constraint_functions != nullptr) { |
nothing calls this directly
no test coverage detected