@@ -373,6 +373,54 @@ highs_getReducedColumnSparse(Highs* h, HighsInt col) {
373373 return std::make_tuple (status, py::cast (solution_vector), solution_num_nz, py::cast (solution_index));
374374}
375375
376+ std::tuple<HighsStatus, bool > highs_getDualRayExist (Highs* h) {
377+ bool has_dual_ray;
378+ HighsStatus status = h->getDualRay (has_dual_ray);
379+ return std::make_tuple (status, has_dual_ray);
380+ }
381+
382+ std::tuple<HighsStatus, bool , dense_array_t <double >> highs_getDualRay (Highs* h) {
383+ HighsInt num_row = h->getNumRow ();
384+ bool has_dual_ray;
385+ HighsStatus status = HighsStatus::kOk ;
386+ std::vector<double > value (num_row);
387+ double * value_ptr = static_cast <double *>(value.data ());
388+ if (num_row > 0 ) status = h->getDualRay (has_dual_ray, value_ptr);
389+ return std::make_tuple (status, has_dual_ray, py::cast (value));
390+ }
391+
392+ std::tuple<HighsStatus, bool > highs_getDualUnboundednessDirectionExist (Highs* h) {
393+ bool has_dual_unboundedness_direction;
394+ HighsStatus status = h->getDualUnboundednessDirection (has_dual_unboundedness_direction);
395+ return std::make_tuple (status, has_dual_unboundedness_direction);
396+ }
397+
398+ std::tuple<HighsStatus, bool , dense_array_t <double >> highs_getDualUnboundednessDirection (Highs* h) {
399+ HighsInt num_col = h->getNumCol ();
400+ bool has_dual_unboundedness_direction;
401+ HighsStatus status = HighsStatus::kOk ;
402+ std::vector<double > value (num_col);
403+ double * value_ptr = static_cast <double *>(value.data ());
404+ if (num_col > 0 ) status = h->getDualUnboundednessDirection (has_dual_unboundedness_direction, value_ptr);
405+ return std::make_tuple (status, has_dual_unboundedness_direction, py::cast (value));
406+ }
407+
408+ std::tuple<HighsStatus, bool > highs_getPrimalRayExist (Highs* h) {
409+ bool has_primal_ray;
410+ HighsStatus status = h->getPrimalRay (has_primal_ray);
411+ return std::make_tuple (status, has_primal_ray);
412+ }
413+
414+ std::tuple<HighsStatus, bool , dense_array_t <double >> highs_getPrimalRay (Highs* h) {
415+ HighsInt num_col = h->getNumCol ();
416+ bool has_primal_ray;
417+ HighsStatus status = HighsStatus::kOk ;
418+ std::vector<double > value (num_col);
419+ double * value_ptr = static_cast <double *>(value.data ());
420+ if (num_col > 0 ) status = h->getPrimalRay (has_primal_ray, value_ptr);
421+ return std::make_tuple (status, has_primal_ray, py::cast (value));
422+ }
423+
376424HighsStatus highs_addRow (Highs* h, double lower, double upper,
377425 HighsInt num_new_nz, dense_array_t <HighsInt> indices,
378426 dense_array_t <double > values) {
@@ -1236,6 +1284,12 @@ PYBIND11_MODULE(_core, m, py::mod_gil_not_used()) {
12361284 .def (" getReducedRowSparse" , &highs_getReducedRowSparse)
12371285 .def (" getReducedColumn" , &highs_getReducedColumn)
12381286 .def (" getReducedColumnSparse" , &highs_getReducedColumnSparse)
1287+ .def (" getDualRayExist" , &highs_getDualRayExist)
1288+ .def (" getDualRay" , &highs_getDualRay)
1289+ .def (" getDualUnboundednessDirectionExist" , &highs_getDualUnboundednessDirectionExist)
1290+ .def (" getDualUnboundednessDirection" , &highs_getDualUnboundednessDirection)
1291+ .def (" getPrimalRayExist" , &highs_getPrimalRayExist)
1292+ .def (" getPrimalRay" , &highs_getPrimalRay)
12391293 .def (" getNumCol" , &Highs::getNumCol)
12401294 .def (" getNumRow" , &Highs::getNumRow)
12411295 .def (" getNumNz" , &Highs::getNumNz)
0 commit comments