Skip to content

Commit

Permalink
get ready to use more b&b info in clp
Browse files Browse the repository at this point in the history
  • Loading branch information
jjhforrest committed Mar 28, 2024
1 parent 9f4b5a8 commit e39a7ec
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/ClpModel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1185,7 +1185,6 @@ class CLPLIB_EXPORT ClpModel {
2097152 - ray even if >2 pivots AND if problem is "crunched"
4194304 - don't scale integer variables
8388608 - Idiot when not really sure about it
16777216 - zero costs!
NOTE - many applications can call Clp but there may be some short cuts
which are taken which are not guaranteed safe from all applications.
Vetted applications will have a bit set and the code may test this
Expand All @@ -1195,6 +1194,7 @@ class CLPLIB_EXPORT ClpModel {
repository. See COIN_CLP_VETTED comments.
0x01000000 is Cbc (and in branch and bound)
0x02000000 is in a different branch and bound
0x04000000 - zero costs!
*/
inline unsigned int specialOptions() const
{
Expand Down
10 changes: 5 additions & 5 deletions src/ClpSimplexDual.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1327,7 +1327,7 @@ int ClpSimplexDual::whileIterating(double *&givenDuals, int ifValuesPass)
problemStatus_=1;
}
#if CAN_HAVE_ZERO_OBJ > 1
if ((specialOptions_ & 16777216) != 0)
if ((specialOptions_ & 0x04000000) != 0)
theta_ = 0.0;
#endif
} else {
Expand Down Expand Up @@ -1505,7 +1505,7 @@ int ClpSimplexDual::whileIterating(double *&givenDuals, int ifValuesPass)
//columnArray_[0]->cleanAndPackSafe(1.0e-60);
if (candidate == -1) {
#if CLP_CAN_HAVE_ZERO_OBJ > 1
if ((specialOptions_ & 16777216) == 0) {
if ((specialOptions_ & 0x04000000) == 0) {
#endif
// make sure incoming doesn't count
Status saveStatus = getStatus(sequenceIn_);
Expand Down Expand Up @@ -5603,7 +5603,7 @@ void ClpSimplexDual::statusOfProblemInDual(int &lastCleaned, int type,
}
if (lastCleaned < numberIterations_ && numberTimesOptimal_ < 4 && (numberChanged_ || (specialOptions_ & 4096) == 0)) {
#if CLP_CAN_HAVE_ZERO_OBJ
if ((specialOptions_ & 16777216) == 0) {
if ((specialOptions_ & 0x04000000) == 0) {
#endif
doOriginalTolerance = 2;
numberTimesOptimal_++;
Expand Down Expand Up @@ -5881,7 +5881,7 @@ void ClpSimplexDual::statusOfProblemInDual(int &lastCleaned, int type,
if (givenDuals)
dualTolerance_ = 1.0e50;
#if CLP_CAN_HAVE_ZERO_OBJ > 1
if ((specialOptions_ & 16777216) == 0) {
if ((specialOptions_ & 0x04000000) == 0) {
#endif
updateDualsInDual(rowArray_[0], columnArray_[0], rowArray_[1],
0.0, objectiveChange, true);
Expand Down Expand Up @@ -5923,7 +5923,7 @@ void ClpSimplexDual::statusOfProblemInDual(int &lastCleaned, int type,
if (givenDuals)
dualTolerance_ = 1.0e50;
#if CLP_CAN_HAVE_ZERO_OBJ > 1
if ((specialOptions_ & 16777216) == 0) {
if ((specialOptions_ & 0x04000000) == 0) {
#endif
updateDualsInDual(rowArray_[0], columnArray_[0], rowArray_[1],
0.0, objectiveChange, true);
Expand Down
10 changes: 5 additions & 5 deletions src/ClpSimplexOther.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4395,7 +4395,7 @@ int ClpSimplexOther::whileIterating(parametricsData &paramData, double /*reportI
//rowArray_[0]->cleanAndPackSafe(1.0e-60);
//columnArray_[0]->cleanAndPackSafe(1.0e-60);
#if CLP_CAN_HAVE_ZERO_OBJ
if ((specialOptions_ & 16777216) == 0) {
if ((specialOptions_ & 0x04000000) == 0) {
#endif
nswapped = reinterpret_cast< ClpSimplexDual * >(this)->updateDualsInDual(rowArray_[0], columnArray_[0],
rowArray_[2], theta_,
Expand Down Expand Up @@ -4575,7 +4575,7 @@ int ClpSimplexOther::whileIterating(parametricsData &paramData, double /*reportI
}
// update primal solution
#if CLP_CAN_HAVE_ZERO_OBJ
if ((specialOptions_ & 16777216) != 0)
if ((specialOptions_ & 0x04000000) != 0)
theta_ = 0.0;
#endif
if (theta_ < 0.0) {
Expand Down Expand Up @@ -4644,7 +4644,7 @@ int ClpSimplexOther::whileIterating(parametricsData &paramData, double /*reportI
}
objectiveChange = 0.0;
#if CLP_CAN_HAVE_ZERO_OBJ
if ((specialOptions_ & 16777216) == 0) {
if ((specialOptions_ & 0x04000000) == 0) {
#endif
for (int i = 0; i < numberTotal; i++)
objectiveChange += solution_[i] * cost_[i];
Expand All @@ -4662,7 +4662,7 @@ int ClpSimplexOther::whileIterating(parametricsData &paramData, double /*reportI
dj_[sequenceOut_] = theta_;
#if CLP_CAN_HAVE_ZERO_OBJ > 1
#ifdef COIN_REUSE_RANDOM
if ((specialOptions_ & 16777216) != 0) {
if ((specialOptions_ & 0x04000000) != 0) {
dj_[sequenceOut_] = 1.0e-9 * (1.0 + CoinDrand48());
;
}
Expand All @@ -4673,7 +4673,7 @@ int ClpSimplexOther::whileIterating(parametricsData &paramData, double /*reportI
dj_[sequenceOut_] = -theta_;
#if CLP_CAN_HAVE_ZERO_OBJ > 1
#ifdef COIN_REUSE_RANDOM
if ((specialOptions_ & 16777216) != 0) {
if ((specialOptions_ & 0x04000000) != 0) {
dj_[sequenceOut_] = -1.0e-9 * (1.0 + CoinDrand48());
;
}
Expand Down
4 changes: 2 additions & 2 deletions src/ClpSimplexPrimal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ int ClpSimplexPrimal::primal(int ifValuesPass, int startFinishOptions)
// initialize - maybe values pass and algorithm_ is +1
#if 0
// if so - put in any superbasic costed slacks
if (ifValuesPass && specialOptions_ < 0x01000000) {
if (ifValuesPass && (specialOptions_&0x03000000)==0) {
// Get column copy
const CoinPackedMatrix * columnCopy = matrix();
const int * row = columnCopy->getIndices();
Expand Down Expand Up @@ -3998,7 +3998,7 @@ int ClpSimplexPrimal::lexSolve()
// if so - put in any superbasic costed slacks
// Start can skip some things in transposeTimes
specialOptions_ |= 131072;
if (ifValuesPass && specialOptions_ < 0x01000000) {
if (ifValuesPass && (specialOptions_&0x03000000)==0) {
// Get column copy
const CoinPackedMatrix * columnCopy = matrix();
const int * row = columnCopy->getIndices();
Expand Down

0 comments on commit e39a7ec

Please sign in to comment.