| 531 | } |
| 532 | |
| 533 | bool 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 | |
| 549 | bool uno_set_variable_upper_bound(void* model, uno_int variable_index, double upper_bound) { |
| 550 | if (model == nullptr) { |
nothing calls this directly
no outgoing calls
no test coverage detected