dense objective gradient
| 95 | |
| 96 | // dense objective gradient |
| 97 | void evaluate_objective_gradient(const Vector<double>& x, Vector<double>& gradient) const override { |
| 98 | if (this->user_model.objective_gradient != nullptr) { |
| 99 | const uno_int return_code = this->user_model.objective_gradient(this->user_model.number_variables, x.data(), |
| 100 | gradient.data(), this->user_model.user_data); |
| 101 | if (0 < return_code) { |
| 102 | throw GradientEvaluationError(); |
| 103 | } |
| 104 | for (size_t variable_index: Range(this->number_variables)) { |
| 105 | gradient[variable_index] *= this->optimization_sense; |
| 106 | } |
| 107 | ++this->number_model_evaluations.objective_gradient; |
| 108 | } |
| 109 | } |
| 110 | |
| 111 | // sparsity patterns of Jacobian and Hessian |
| 112 | void compute_jacobian_sparsity(uno_int* row_indices, uno_int* column_indices, uno_int row_offset, uno_int column_offset, |
nothing calls this directly
no test coverage detected