Skip to content

Commit f8672c3

Browse files
committed
Add option for hipo_scaling
1 parent 83afe54 commit f8672c3

File tree

4 files changed

+38
-0
lines changed

4 files changed

+38
-0
lines changed

docs/src/options/definitions.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,11 @@
445445
- Range: {0, 2147483647}
446446
- Default: 128
447447

448+
## hipo\_scaling
449+
- HiPO scaling strategy: "curtis-reid" or "norm"
450+
- Type: string
451+
- Default: "curtis-reid"
452+
448453
## pdlp\_scaling
449454
- Scaling option for PDLP solver: Default = true
450455
- Type: boolean

highs/ipm/IpxWrapper.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -564,6 +564,17 @@ HighsStatus solveLpHipo(const HighsOptions& options, HighsTimer& timer,
564564
}
565565
hipo_options.ordering = options.hipo_ordering;
566566

567+
if (options.hipo_scaling == kHipoCRscaling) {
568+
hipo_options.scaling = hipo::kOptionCRscaling;
569+
} else if (options.hipo_scaling == kHipoNormScaling) {
570+
hipo_options.scaling = hipo::kOptionNormScaling;
571+
} else {
572+
highsLogUser(options.log_options, HighsLogType::kError,
573+
"Unknown value of option %s\n", kHipoScalingString.c_str());
574+
model_status = HighsModelStatus::kSolveError;
575+
return HighsStatus::kError;
576+
}
577+
567578
// block size option
568579
hipo_options.block_size = options.hipo_block_size;
569580

highs/ipm/hipo/ipm/Options.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,21 @@ enum OptionParallel {
3535
kOptionParallelDefault = kOptionParallelChoose
3636
};
3737

38+
enum OptionScaling {
39+
kOptionScalingMin = 0,
40+
kOptionCRscaling = kOptionScalingMin,
41+
kOptionNormScaling,
42+
kOptionScalingMax = kOptionNormScaling,
43+
kOptionScalingDefault = kOptionCRscaling
44+
};
45+
3846
struct Options {
3947
// Solver options
4048
OptionNla nla = kOptionNlaDefault;
4149
OptionCrossover crossover = kOptionCrossoverDefault;
4250
OptionParallel parallel = kOptionParallelDefault;
4351
std::string ordering = kHighsChooseString;
52+
OptionScaling scaling = kOptionScalingDefault;
4453

4554
// Ipm parameters
4655
Int max_iter = kMaxIterDefault;

highs/lp_data/HighsOptions.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,10 @@ const string kHipoMetisString = "metis";
313313
const string kHipoAmdString = "amd";
314314
const string kHipoRcmString = "rcm";
315315

316+
const string kHipoScalingString = "hipo_scaling";
317+
const string kHipoCRscaling = "curtis-reid";
318+
const string kHipoNormScaling = "norm";
319+
316320
struct HighsOptionsStruct {
317321
// Run-time options read from the command line
318322
std::string presolve;
@@ -379,6 +383,7 @@ struct HighsOptionsStruct {
379383
std::string hipo_parallel_type;
380384
std::string hipo_ordering;
381385
HighsInt hipo_block_size;
386+
std::string hipo_scaling;
382387

383388
// Options for PDLP solver
384389
bool pdlp_scaling;
@@ -551,6 +556,7 @@ struct HighsOptionsStruct {
551556
hipo_parallel_type(""),
552557
hipo_ordering(""),
553558
hipo_block_size(0),
559+
hipo_scaling(""),
554560
pdlp_scaling(false),
555561
pdlp_iteration_limit(0),
556562
pdlp_e_restart_method(0),
@@ -1289,6 +1295,13 @@ class HighsOptions : public HighsOptionsStruct {
12891295
advanced, &hipo_block_size, 0, 128, kHighsIInf);
12901296
records.push_back(record_int);
12911297

1298+
record_string =
1299+
new OptionRecordString(kHipoScalingString,
1300+
"HiPO scaling option: \"curtis-reid\" "
1301+
"or \"norm\".",
1302+
advanced, &hipo_scaling, kHipoCRscaling);
1303+
records.push_back(record_string);
1304+
12921305
record_bool = new OptionRecordBool(
12931306
"pdlp_scaling", "Scaling option for PDLP solver: Default = true",
12941307
advanced, &pdlp_scaling, true);

0 commit comments

Comments
 (0)