|
12 | 12 | #include "ipm/IpxWrapper.h" |
13 | 13 | #include "lp_data/HighsSolutionDebug.h" |
14 | 14 | #include "pdlp/CupdlpWrapper.h" |
| 15 | +#include "pdlp/HiPdlpWrapper.h" |
15 | 16 | #include "simplex/HApp.h" |
16 | 17 |
|
17 | 18 | // The method below runs the simplex, IPX, HiPO or PDLP solver on the LP |
@@ -68,7 +69,7 @@ HighsStatus solveLp(HighsLpSolverObject& solver_object, const string message) { |
68 | 69 | return_status = interpretCallStatus(options.log_options, call_status, |
69 | 70 | return_status, "solveUnconstrainedLp"); |
70 | 71 | if (return_status == HighsStatus::kError) return return_status; |
71 | | - } else if (use_only_ipm || options.solver == kPdlpString) { |
| 72 | + } else if (use_only_ipm || usePdlp(options.solver)) { |
72 | 73 | // Use IPM or PDLP |
73 | 74 | if (use_only_ipm) { |
74 | 75 | // Use IPM to solve the LP |
@@ -111,16 +112,26 @@ HighsStatus solveLp(HighsLpSolverObject& solver_object, const string message) { |
111 | 112 | return_status, "solveLpIpx"); |
112 | 113 | } |
113 | 114 | } else { |
114 | | - // Use cuPDLP-C to solve the LP |
| 115 | + // Use cuPDLP-C or HiPDLP to solve the LP |
115 | 116 | sub_solver_call_time.num_call[kSubSolverPdlp]++; |
116 | 117 | sub_solver_call_time.run_time[kSubSolverPdlp] = |
117 | 118 | -solver_object.timer_.read(); |
118 | | - try { |
119 | | - call_status = solveLpCupdlp(solver_object); |
120 | | - } catch (const std::exception& exception) { |
121 | | - highsLogDev(options.log_options, HighsLogType::kError, |
122 | | - "Exception %s in solveLpCupdlp\n", exception.what()); |
123 | | - call_status = HighsStatus::kError; |
| 119 | + if (options.solver == kPdlpString || options.solver == kCuPdlpString) { |
| 120 | + try { |
| 121 | + call_status = solveLpCupdlp(solver_object); |
| 122 | + } catch (const std::exception& exception) { |
| 123 | + highsLogDev(options.log_options, HighsLogType::kError, |
| 124 | + "Exception %s in solveLpCupdlp\n", exception.what()); |
| 125 | + call_status = HighsStatus::kError; |
| 126 | + } |
| 127 | + } else { |
| 128 | + try { |
| 129 | + call_status = solveLpHiPdlp(solver_object); |
| 130 | + } catch (const std::exception& exception) { |
| 131 | + highsLogDev(options.log_options, HighsLogType::kError, |
| 132 | + "Exception %s in solveHiPdlp\n", exception.what()); |
| 133 | + call_status = HighsStatus::kError; |
| 134 | + } |
124 | 135 | } |
125 | 136 | sub_solver_call_time.run_time[kSubSolverPdlp] += |
126 | 137 | solver_object.timer_.read(); |
@@ -588,6 +599,10 @@ bool useIpm(const std::string& solver) { |
588 | 599 | return solver == kIpmString || solver == kHipoString || solver == kIpxString; |
589 | 600 | } |
590 | 601 |
|
| 602 | +bool usePdlp(const std::string& solver) { |
| 603 | + return solver == kPdlpString || solver == kHiPdlpString || solver == kCuPdlpString; |
| 604 | +} |
| 605 | + |
591 | 606 | // Decide whether to use the HiPO IPM solver |
592 | 607 | bool useHipo(const HighsOptions& options, |
593 | 608 | const std::string& specific_solver_option, const HighsLp& lp, |
|
0 commit comments