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

Function uno_set_variable_lower_bound

interfaces/C/Uno_C_API.cpp:533–547  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

531}
532
533bool uno_set_variable_lower_bound(void* model, uno_int variable_index, double lower_bound) {
534 if (model == nullptr) {
535 WARNING << "Please specify a valid model." << std::endl;
536 return false;
537 }
538 CUserModel* user_model = static_cast<CUserModel*>(model);
539 // shift the index with the base indexing
540 variable_index -= user_model->base_indexing;
541 if (variable_index < 0 || variable_index >= user_model->number_variables) {
542 WARNING << "Please specify a valid index." << std::endl;
543 return false;
544 }
545 user_model->variables_lower_bounds[static_cast<size_t>(variable_index)] = lower_bound;
546 return true;
547}
548
549bool uno_set_variable_upper_bound(void* model, uno_int variable_index, double upper_bound) {
550 if (model == nullptr) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected