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

Function uno_get_primal_solution_component

interfaces/C/Uno_C_API.cpp:1119–1128  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1117}
1118
1119double uno_get_primal_solution_component(void* solver, uno_int index) {
1120 const Result* result = uno_get_result(solver);
1121 // shift the index with the base indexing
1122 index -= result->base_indexing;
1123 const size_t unsigned_index = static_cast<size_t>(index);
1124 if (index < 0 || result->number_variables <= unsigned_index) {
1125 throw std::runtime_error("The index is not valid.");
1126 }
1127 return result->primal_solution[unsigned_index];
1128}
1129
1130double uno_get_constraint_dual_solution_component(void* solver, uno_int index) {
1131 const Result* result = uno_get_result(solver);

Callers

nothing calls this directly

Calls 1

uno_get_resultFunction · 0.85

Tested by

no test coverage detected