Skip to content

Commit 6eaf6d8

Browse files
committed
Fix issue
1 parent f99b3c3 commit 6eaf6d8

File tree

3 files changed

+9
-21
lines changed

3 files changed

+9
-21
lines changed

highs/ipm/hipo/ipm/Model.cpp

Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -412,8 +412,6 @@ void Model::scale(OptionScaling opt) {
412412
// z -> C * z
413413
// where R is row scaling, C is col scaling.
414414

415-
if (!needScaling()) return;
416-
417415
colscale_.resize(n_, 1.0);
418416
rowscale_.resize(m_, 1.0);
419417

@@ -430,29 +428,20 @@ void Model::scale(OptionScaling opt) {
430428
applyScaling();
431429
}
432430

433-
bool Model::needScaling() {
434-
bool need_scaling = false;
431+
void Model::CRscaling() {
432+
// Curtis-Reid scaling
435433

436-
// check entries of A
434+
bool need_scaling = false;
437435
for (Int col = 0; col < n_; ++col) {
438436
for (Int el = A_.start_[col]; el < A_.start_[col + 1]; ++el) {
439-
if (std::abs(A_.value_[el]) != 1.0) return true;
440-
}
441-
}
442-
443-
// check bounds
444-
for (Int i = 0; i < n_; ++i) {
445-
if (std::isfinite(lower_[i]) && std::isfinite(upper_[i])) {
446-
const double diff = std::abs(lower_[i] - upper_[i]);
447-
if (diff < kSmallBoundDiff || diff > kLargeBoundDiff) return true;
437+
if (std::abs(A_.value_[el]) != 1.0) {
438+
need_scaling = true;
439+
break;
440+
}
448441
}
449442
}
450443

451-
return false;
452-
}
453-
454-
void Model::CRscaling() {
455-
// Curtis-Reid scaling
444+
if (!need_scaling) return;
456445

457446
// Compute exponents for CR scaling of matrix A
458447
std::vector<Int> colexp(n_);

highs/ipm/hipo/ipm/Model.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ class Model {
8282
void computeNorms();
8383

8484
void scale(OptionScaling opt);
85-
bool needScaling();
8685
void applyScaling();
8786
void CRscaling();
8887
void onePassNormScaling();

highs/lp_data/HighsOptions.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1282,7 +1282,7 @@ class HighsOptions : public HighsOptionsStruct {
12821282
new OptionRecordString(kHipoScalingString,
12831283
"HiPO scaling option: \"curtis-reid\" "
12841284
"or \"norm\".",
1285-
advanced, &hipo_scaling, kHipoCRscaling);
1285+
advanced, &hipo_scaling, kHipoNormScaling);
12861286
records.push_back(record_string);
12871287

12881288
record_bool = new OptionRecordBool(

0 commit comments

Comments
 (0)