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

Method evaluate_constraints

interfaces/C/Uno_C_API.cpp:85–94  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

83 }
84
85 void evaluate_constraints(const Vector<double>& x, Vector<double>& constraints) const override {
86 if (this->user_model.constraint_functions != nullptr) {
87 const uno_int return_code = this->user_model.constraint_functions(this->user_model.number_variables,
88 this->user_model.number_constraints, x.data(), constraints.data(), this->user_model.user_data);
89 if (0 < return_code) {
90 throw FunctionEvaluationError();
91 }
92 ++this->number_model_evaluations.constraints;
93 }
94 }
95
96 // dense objective gradient
97 void evaluate_objective_gradient(const Vector<double>& x, Vector<double>& gradient) const override {

Callers

nothing calls this directly

Calls 2

dataMethod · 0.45

Tested by

no test coverage detected