Skip to content

Commit aa291fd

Browse files
committed
Add ldexp to HighsCDouble
1 parent b08c784 commit aa291fd

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

highs/mip/HighsCutGeneration.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -726,7 +726,7 @@ double HighsCutGeneration::scale(double val) {
726726
expshift = std::min(10, expshift);
727727

728728
// Scale rhs
729-
rhs = std::ldexp(static_cast<double>(rhs), expshift);
729+
rhs = ldexp(rhs, expshift);
730730

731731
// Scale row
732732
for (HighsInt i = 0; i != rowlen; ++i)

highs/util/HighsCDouble.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,10 @@ class HighsCDouble {
314314
}
315315

316316
friend HighsCDouble round(const HighsCDouble& x) { return floor(x + 0.5); }
317+
318+
friend HighsCDouble ldexp(const HighsCDouble& v, int exp) {
319+
return HighsCDouble(std::ldexp(v.hi, exp), std::ldexp(v.lo, exp));
320+
}
317321
};
318322

319323
#endif

0 commit comments

Comments
 (0)