| 299 | } |
| 300 | |
| 301 | std::tuple<HighsStatus, dense_array_t<double>, HighsInt, |
| 302 | dense_array_t<HighsInt>> |
| 303 | highs_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 | |
| 323 | std::tuple<HighsStatus, dense_array_t<double>> highs_getBasisTransposeSolve( |
| 324 | Highs* h, dense_array_t<double> rhs) { |
nothing calls this directly
no test coverage detected