dense gradient
| 143 | |
| 144 | // dense gradient |
| 145 | void AMPLModel::evaluate_objective_gradient(const Vector<double>& x, Vector<double>& gradient) const { |
| 146 | fint error_flag = 0; |
| 147 | this->asl->p.Objgrd(this->asl, 0, const_cast<double*>(x.data()), gradient.data(), &error_flag); |
| 148 | if (0 < error_flag) { |
| 149 | throw GradientEvaluationError(); |
| 150 | } |
| 151 | if (this->optimization_sense != 1.) { |
| 152 | gradient.scale(this->optimization_sense); |
| 153 | } |
| 154 | ++this->number_model_evaluations.objective_gradient; |
| 155 | } |
| 156 | |
| 157 | void AMPLModel::compute_jacobian_sparsity(uno_int* row_indices, uno_int* column_indices, uno_int row_offset, |
| 158 | uno_int column_offset, uno_int solver_indexing, MatrixOrder matrix_order) const { |
nothing calls this directly
no test coverage detected