| 547 | } |
| 548 | |
| 549 | bool uno_set_variable_upper_bound(void* model, uno_int variable_index, double upper_bound) { |
| 550 | if (model == nullptr) { |
| 551 | WARNING << "Please specify a valid model." << std::endl; |
| 552 | return false; |
| 553 | } |
| 554 | CUserModel* user_model = static_cast<CUserModel*>(model); |
| 555 | // shift the index with the base indexing |
| 556 | variable_index -= user_model->base_indexing; |
| 557 | if (variable_index < 0 || variable_index >= user_model->number_variables) { |
| 558 | WARNING << "Please specify a valid index." << std::endl; |
| 559 | return false; |
| 560 | } |
| 561 | user_model->variables_upper_bounds[static_cast<size_t>(variable_index)] = upper_bound; |
| 562 | return true; |
| 563 | } |
| 564 | |
| 565 | bool uno_set_objective(void* model, uno_int optimization_sense, uno_objective_callback objective_function, |
| 566 | uno_objective_gradient_callback objective_gradient) { |
nothing calls this directly
no outgoing calls
no test coverage detected