MCPcopy Create free account
hub / github.com/ERGO-Code/HiGHS / highs_getBasisSolveSparse

Function highs_getBasisSolveSparse

highspy/highs_bindings.cpp:301–321  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

299}
300
301std::tuple<HighsStatus, dense_array_t<double>, HighsInt,
302 dense_array_t<HighsInt>>
303highs_getBasisSolveSparse(Highs* h, dense_array_t<double> rhs) {
304 HighsInt num_row = h->getNumRow();
305
306 py::buffer_info rhs_info = rhs.request();
307 double* rhs_ptr = static_cast<double*>(rhs_info.ptr);
308
309 HighsStatus status = HighsStatus::kOk;
310 HighsInt solution_num_nz = 0;
311 std::vector<double> solution_vector(num_row);
312 std::vector<HighsInt> solution_index(num_row);
313 double* solution_vector_ptr = static_cast<double*>(solution_vector.data());
314 HighsInt* solution_index_ptr = static_cast<HighsInt*>(solution_index.data());
315
316 if (num_row > 0)
317 status = h->getBasisSolve(rhs_ptr, solution_vector_ptr, &solution_num_nz,
318 solution_index_ptr);
319 return std::make_tuple(status, py::cast(solution_vector), solution_num_nz,
320 py::cast(solution_index));
321}
322
323std::tuple<HighsStatus, dense_array_t<double>> highs_getBasisTransposeSolve(
324 Highs* h, dense_array_t<double> rhs) {

Callers

nothing calls this directly

Calls 3

dataMethod · 0.80
getNumRowMethod · 0.45
getBasisSolveMethod · 0.45

Tested by

no test coverage detected