Skip to content

Commit 1a60d70

Browse files
committed
Fix potential scaling failure
1 parent bc6796e commit 1a60d70

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

highs/ipm/hipo/ipm/Model.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -443,6 +443,14 @@ void Model::scale() {
443443
for (Int i = 0; i < n_; ++i) colscale_[i] = std::ldexp(1.0, colexp[i]);
444444
for (Int i = 0; i < m_; ++i) rowscale_[i] = std::ldexp(1.0, rowexp[i]);
445445

446+
bool scaling_failed = isInfVector(colscale_) || isNanVector(colscale_) ||
447+
isInfVector(rowscale_) || isNanVector(rowscale_);
448+
if (scaling_failed) {
449+
colscale_.clear();
450+
rowscale_.clear();
451+
return;
452+
}
453+
446454
// *********************************************************************
447455
// Apply scaling
448456
// *********************************************************************

0 commit comments

Comments
 (0)