MCPcopy Create free account
hub / github.com/cvanaret/Uno / evaluate_objective_gradient

Method evaluate_objective_gradient

interfaces/AMPL/AMPLModel.cpp:145–155  ·  view source on GitHub ↗

dense gradient

Source from the content-addressed store, hash-verified

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 {

Callers

nothing calls this directly

Calls 3

dataMethod · 0.45
scaleMethod · 0.45

Tested by

no test coverage detected