Skip to content

Commit e6e04e8

Browse files
committed
Added option hipo_system for selecting augmented system or normal equations
1 parent 0f8af1c commit e6e04e8

File tree

3 files changed

+32
-9
lines changed

3 files changed

+32
-9
lines changed

highs/ipm/IpxWrapper.cpp

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -504,13 +504,22 @@ HighsStatus solveLpHipo(const HighsOptions& options, HighsTimer& timer,
504504
hipo_options.parallel = hipo::kOptionParallelChoose;
505505
}
506506

507-
// Highs does not have an option to select NE/AS approach.
508-
// For now use choose, but an option should be added for the user to choose.
509-
hipo_options.nla = hipo::kOptionNlaChoose;
507+
// Parse hipo_system option
508+
if (options.hipo_system == kHipoAugmentedString) {
509+
hipo_options.nla = hipo::kOptionNlaAugmented;
510+
} else if (options.hipo_system == kHipoNormalEqString) {
511+
hipo_options.nla = hipo::kOptionNlaNormEq;
512+
} else if (options.hipo_system == kHighsChooseString) {
513+
hipo_options.nla = hipo::kOptionNlaChoose;
514+
} else {
515+
highsLogUser(options.log_options, HighsLogType::kError,
516+
"Unknown value of option hipo_system\n");
517+
model_status = HighsModelStatus::kSolveError;
518+
return HighsStatus::kError;
519+
}
510520

511521
// ===========================================================================
512522
// TO DO
513-
// - add options for NE/AS
514523
// - consider adding options for parallel tree/node
515524
// - block size for dense factorisation can have large impact on performance
516525
// and depends on the specific architecture. It may be worth exposing it to

highs/lp_data/HighsOptions.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,10 @@ bool commandLineSolverOk(const HighsLogOptions& report_log_options,
8484
return true;
8585
highsLogUser(report_log_options, HighsLogType::kWarning,
8686
"Value \"%s\" for solver option is not one of \"%s\", \"%s\", "
87-
"\"%s\" or \"%s\"\n",
87+
"\"%s\", \"%s\" or \"%s\"\n",
8888
value.c_str(), kSimplexString.c_str(),
8989
kHighsChooseString.c_str(), kIpmString.c_str(),
90-
kPdlpString.c_str());
90+
kHipoString.c_str(), kPdlpString.c_str());
9191
return false;
9292
}
9393

highs/lp_data/HighsOptions.h

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,11 @@ const string kReadSolutionFileString = "read_solution_file";
287287
// String for HiGHS log file option
288288
const string kLogFileString = "log_file";
289289

290+
// Strings for HiPO system option
291+
const string kHipoSystemString = "hipo_system";
292+
const string kHipoAugmentedString = "augmented";
293+
const string kHipoNormalEqString = "normaleq";
294+
290295
struct HighsOptionsStruct {
291296
// Run-time options read from the command line
292297
std::string presolve;
@@ -345,8 +350,9 @@ struct HighsOptionsStruct {
345350
bool log_to_console;
346351
bool timeless_log;
347352

348-
// Options for IPM solver
353+
// Options for IPM solvers
349354
HighsInt ipm_iteration_limit;
355+
std::string hipo_system;
350356

351357
// Options for PDLP solver
352358
bool pdlp_scaling;
@@ -511,6 +517,7 @@ struct HighsOptionsStruct {
511517
log_to_console(false),
512518
timeless_log(false),
513519
ipm_iteration_limit(0),
520+
hipo_system(""),
514521
pdlp_scaling(false),
515522
pdlp_iteration_limit(0),
516523
pdlp_e_restart_method(0),
@@ -668,9 +675,10 @@ class HighsOptions : public HighsOptionsStruct {
668675

669676
record_string = new OptionRecordString(
670677
kSolverString,
671-
"Solver option: \"simplex\", \"choose\", \"hipo\", \"ipm\" or \"pdlp\". "
678+
"Solver option: \"simplex\", \"choose\", \"hipo\", \"ipm\" or "
679+
"\"pdlp\". "
672680
"If "
673-
"\"simplex\"/\"ipm\"/\"pdlp\" is chosen then, for a MIP (QP) the "
681+
"\"simplex\"/\"ipm\"/\"hipo\"/\"pdlp\" is chosen then, for a MIP (QP) the "
674682
"integrality "
675683
"constraint (quadratic term) will be ignored",
676684
advanced, &solver, kHighsChooseString);
@@ -1194,6 +1202,12 @@ class HighsOptions : public HighsOptionsStruct {
11941202
&ipm_iteration_limit, 0, kHighsIInf, kHighsIInf);
11951203
records.push_back(record_int);
11961204

1205+
record_string = new OptionRecordString(
1206+
kHipoSystemString,
1207+
"HiPO Newton system option: \"augmented\", \"normaleq\" or \"choose\".",
1208+
advanced, &hipo_system, kHighsChooseString);
1209+
records.push_back(record_string);
1210+
11971211
record_bool = new OptionRecordBool(
11981212
"pdlp_scaling", "Scaling option for PDLP solver: Default = true",
11991213
advanced, &pdlp_scaling, true);

0 commit comments

Comments
 (0)