Skip to content

Commit 6cc4115

Browse files
authored
Merge pull request #2697 from ERGO-Code/fix-2696
Set basic duals to zero
2 parents 4955990 + f464c62 commit 6cc4115

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

highs/simplex/HEkk.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2291,6 +2291,11 @@ bool HEkk::lpFactorRowCompatible(const HighsInt expectedNumRow) const {
22912291
return consistent_num_row;
22922292
}
22932293

2294+
void HEkk::zeroBasicDuals() {
2295+
for (HighsInt iRow = 0; iRow < lp_.num_row_; iRow++)
2296+
info_.workDual_[basis_.basicIndex_[iRow]] = 0;
2297+
}
2298+
22942299
void HEkk::setNonbasicMove() {
22952300
const bool have_solution = false;
22962301
// Don't have a simplex basis since nonbasicMove is not set up.
@@ -3585,6 +3590,7 @@ HighsStatus HEkk::returnFromSolve(const HighsStatus return_status) {
35853590
break;
35863591
}
35873592
}
3593+
this->zeroBasicDuals();
35883594
assert(info_.num_primal_infeasibilities >= 0);
35893595
assert(info_.num_dual_infeasibilities >= 0);
35903596
if (info_.num_primal_infeasibilities == 0) {

highs/simplex/HEkk.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,8 @@ class HEkk {
140140
bool lpFactorRowCompatible() const;
141141
bool lpFactorRowCompatible(const HighsInt expectedNumRow) const;
142142

143+
void zeroBasicDuals();
144+
143145
// Interface methods
144146
void appendColsToVectors(const HighsInt num_new_col,
145147
const vector<double>& colCost,

0 commit comments

Comments
 (0)