Changeset 2040 for trunk/Cbc/src/CbcSOS.cpp
 Timestamp:
 Jun 20, 2014 8:44:51 AM (5 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/Cbc/src/CbcSOS.cpp
r1900 r2040 461 461 } 462 462 } 463 assert (lastNonZero  firstNonZero < sosType_) ; 464 for (j = 0; j < firstNonZero; j++) { 463 // Might get here in odd situation if so fix all 464 if (lastNonZero  firstNonZero < sosType_) { 465 for (j = 0; j < firstNonZero; j++) { 465 466 int iColumn = members_[j]; 466 467 solver>setColUpper(iColumn, 0.0); 467 }468 for (j = lastNonZero + 1; j < numberMembers_; j++) {468 } 469 for (j = lastNonZero + 1; j < numberMembers_; j++) { 469 470 int iColumn = members_[j]; 470 471 solver>setColUpper(iColumn, 0.0); 472 } 473 } else { 474 for (j = 0; j < numberMembers_; j++) { 475 int iColumn = members_[j]; 476 solver>setColUpper(iColumn, 0.0); 477 solver>setColLower(iColumn, 1.0); 478 } 471 479 } 472 480 } … … 836 844 const double * weights = set_>weights(); 837 845 OsiSolverInterface * solver = model_>solver(); 838 //const double * lower = solver>getColLower();839 //const double * upper = solver>getColUpper();846 const double * lower = solver>getColLower(); 847 const double * upper = solver>getColUpper(); 840 848 // *** for way  up means fix all those in down section 841 849 if (way_ < 0) { … … 861 869 } 862 870 computeNonzeroRange(); 863 return 0.0; 871 double predictedChange=0.0; 872 for (int i = 0; i < numberMembers; i++) { 873 int iColumn=which[i]; 874 if (lower[iColumn]>upper[iColumn]) 875 predictedChange=COIN_DBL_MAX; 876 } 877 return predictedChange; 864 878 } 865 879 /* Update bounds in solver as in 'branch' and update given bounds.
Note: See TracChangeset
for help on using the changeset viewer.