Skip to content

Commit 832b459

Browse files
committed
ray if dual infeasible and no rows
1 parent 9557251 commit 832b459

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

Clp/src/ClpModel.cpp

+13
Original file line numberDiff line numberDiff line change
@@ -3735,6 +3735,8 @@ int ClpModel::emptyProblem(int * infeasNumber, double * infeasSum, bool printMes
37353735
}
37363736
}
37373737
objectiveValue_ = 0.0;
3738+
int badColumn=-1;
3739+
double badValue=0.0;
37383740
if (numberColumns_) {
37393741
const double * cost = objective();
37403742
for (int i = 0; i < numberColumns_; i++) {
@@ -3759,6 +3761,8 @@ int ClpModel::emptyProblem(int * infeasNumber, double * infeasSum, bool printMes
37593761
status_[i] = 2;
37603762
numberDualInfeasibilities++;;
37613763
sumDualInfeasibilities += fabs(objValue);
3764+
badColumn=i;
3765+
badValue=-1.0;
37623766
returnCode |= 2;
37633767
}
37643768
objectiveValue_ += columnActivity_[i] * objValue;
@@ -3771,6 +3775,8 @@ int ClpModel::emptyProblem(int * infeasNumber, double * infeasSum, bool printMes
37713775
status_[i] = 3;
37723776
numberDualInfeasibilities++;;
37733777
sumDualInfeasibilities += fabs(objValue);
3778+
badColumn=i;
3779+
badValue=1.0;
37743780
returnCode |= 2;
37753781
}
37763782
objectiveValue_ += columnActivity_[i] * objValue;
@@ -3807,6 +3813,13 @@ int ClpModel::emptyProblem(int * infeasNumber, double * infeasSum, bool printMes
38073813
}
38083814
if (returnCode == 3)
38093815
returnCode = 4;
3816+
if (returnCode == 2) {
3817+
// create ray
3818+
delete [] ray_;
3819+
ray_ = new double [numberColumns_];
3820+
CoinZeroN(ray_, numberColumns_);
3821+
ray_[badColumn]=badValue;
3822+
}
38103823
return returnCode;
38113824
}
38123825
#ifndef SLIM_NOIO

0 commit comments

Comments
 (0)