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

Method evaluate_objective_gradient

uno/optimization/Evaluations.cpp:46–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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) {

Callers

nothing calls this directly

Calls 4

fillMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected