| 44 | } |
| 45 | |
| 46 | void Evaluations::evaluate_objective_gradient(const Model& model, const Vector<double>& primals) { |
| 47 | if (!this->is_objective_gradient_computed) { |
| 48 | this->objective_gradient.fill(0.); |
| 49 | model.evaluate_objective_gradient(primals, this->objective_gradient); |
| 50 | // check finiteness |
| 51 | if (std::any_of(this->objective_gradient.begin(), this->objective_gradient.end(), invalid_value)) { |
| 52 | throw GradientEvaluationError(); |
| 53 | } |
| 54 | this->is_objective_gradient_computed = true; |
| 55 | } |
| 56 | } |
| 57 | |
| 58 | void Evaluations::evaluate_jacobian(const Model& model, const Vector<double>& primals) { |
| 59 | if (!this->is_jacobian_computed && 0 < model.number_constraints) { |
nothing calls this directly
no test coverage detected