 Timestamp:
 Mar 10, 2006 10:11:08 AM (14 years ago)
 Location:
 trunk
 Files:

 3 edited
Legend:
 Unmodified
 Added
 Removed

trunk/CbcModel.cpp
r266 r267 767 767 if (feasible) { 768 768 newNode = new CbcNode ; 769 double newObjValue = direction*solver_>getObjValue(); 770 if (newObjValue!=solverCharacteristics_>mipBound()) { 771 newObjValue = CoinMax(newObjValue,solverCharacteristics_>mipBound()); 772 solverCharacteristics_>setMipBound(COIN_DBL_MAX); 773 } 774 newNode>setObjectiveValue(newObjValue); 769 // Set objective value (not so obvious if NLP etc) 770 setObjectiveValue(newNode,NULL); 775 771 anyAction = 1 ; 776 772 // To make depth available we may need a fake node … … 802 798 while (anyAction == 1) 803 799 { 804 newNode>setObjectiveValue(direction*solver_>getObjValue()) ; 800 // Set objective value (not so obvious if NLP etc) 801 setObjectiveValue(newNode,NULL); 805 802 if (numberBeforeTrust_==0 ) { 806 803 anyAction = newNode>chooseBranch(this,NULL,numberPassesLeft) ; … … 1248 1245 if (feasible) { 1249 1246 newNode = new CbcNode ; 1250 double newObjValue = direction*solver_>getObjValue(); 1251 if (newObjValue!=solverCharacteristics_>mipBound()) { 1252 newObjValue = CoinMax(newObjValue,solverCharacteristics_>mipBound()); 1253 solverCharacteristics_>setMipBound(COIN_DBL_MAX); 1254 } 1255 newNode>setObjectiveValue(newObjValue); 1247 // Set objective value (not so obvious if NLP etc) 1248 setObjectiveValue(newNode,node); 1256 1249 anyAction =1 ; 1257 1250 resolved = false ; … … 1263 1256 while (anyAction == 1) 1264 1257 { 1265 newNode>setObjectiveValue(direction*solver_>getObjValue()) ; 1258 // Set objective value (not so obvious if NLP etc) 1259 setObjectiveValue(newNode,node); 1266 1260 if (numberBeforeTrust_==0 ) { 1267 1261 anyAction = newNode>chooseBranch(this,node,numberPassesLeft) ; … … 1293 1287 } 1294 1288 if (feasible) 1295 { newNode>setObjectiveValue(direction* 1296 solver_>getObjValue()) ; 1289 { 1290 // Set objective value (not so obvious if NLP etc) 1291 setObjectiveValue(newNode,node); 1297 1292 reducedCostFix() ; 1298 1299 1293 if (newNode>objectiveValue() >= getCutoff()) 1294 anyAction=2; 1300 1295 } 1301 1296 else … … 2109 2104 if (feasible) { 2110 2105 newNode = new CbcNode ; 2111 double newObjValue = direction*solver_>getObjValue(); 2112 if (newObjValue!=solverCharacteristics_>mipBound()) { 2113 newObjValue = CoinMax(newObjValue,solverCharacteristics_>mipBound()); 2114 solverCharacteristics_>setMipBound(COIN_DBL_MAX); 2115 } 2116 newNode>setObjectiveValue(newObjValue); 2106 // Set objective value (not so obvious if NLP etc) 2107 setObjectiveValue(newNode,NULL); 2117 2108 anyAction = 1 ; 2118 2109 // To make depth available we may need a fake node … … 2144 2135 while (anyAction == 1) 2145 2136 { 2146 newNode>setObjectiveValue(direction*solver_>getObjValue()) ; 2137 // Set objective value (not so obvious if NLP etc) 2138 setObjectiveValue(newNode,NULL); 2147 2139 if (numberBeforeTrust_==0 ) { 2148 2140 anyAction = newNode>chooseBranch(this,NULL,numberPassesLeft) ; … … 2906 2898 if (feasible) { 2907 2899 newNode = new CbcNode ; 2908 double newObjValue = direction*solver_>getObjValue(); 2909 if (newObjValue!=solverCharacteristics_>mipBound()) { 2910 newObjValue = CoinMin(newObjValue,solverCharacteristics_>mipBound()); 2911 solverCharacteristics_>setMipBound(COIN_DBL_MAX); 2912 } 2913 newNode>setObjectiveValue(newObjValue); 2900 // Set objective value (not so obvious if NLP etc) 2901 setObjectiveValue(newNode,node); 2914 2902 anyAction =1 ; 2915 2903 resolved = false ; … … 2921 2909 OsiSolverBranch * branches=NULL; 2922 2910 while (anyAction == 1) { 2923 newNode>setObjectiveValue(direction*solver_>getObjValue()) ; 2911 // Set objective value (not so obvious if NLP etc) 2912 setObjectiveValue(newNode,node); 2924 2913 if (numberBeforeTrust_==0 ) { 2925 2914 anyAction = newNode>chooseBranch(this,node,numberPassesLeft) ; … … 2949 2938 } 2950 2939 if (feasible) { 2951 newNode>setObjectiveValue(direction*solver_>getObjValue()) ; 2940 // Set objective value (not so obvious if NLP etc) 2941 setObjectiveValue(newNode,node); 2952 2942 reducedCostFix() ; 2953 2943 if (newNode>objectiveValue() >= getCutoff()) … … 3058 3048 } 3059 3049 if (feasible) { 3060 newNode2>setObjectiveValue(direction*solver_>getObjValue()) ; 3050 // Set objective value (not so obvious if NLP etc) 3051 setObjectiveValue(newNode2,node); 3061 3052 reducedCostFix() ; 3062 3053 if (newNode2>objectiveValue() >= getCutoff()) … … 8981 8972 strongInfo_[2] ++; 8982 8973 } 8974 /* Set objective value in a node. This is separated out so that 8975 odd solvers can use. It may look at extra information in 8976 solverCharacteriscs_ and will also use bound from parent node 8977 */ 8978 void 8979 CbcModel::setObjectiveValue(CbcNode * thisNode, const CbcNode * parentNode) 8980 { 8981 double newObjValue = solver_>getObjSense()*solver_>getObjValue(); 8982 // If odd solver take its bound 8983 newObjValue = CoinMax(newObjValue,solverCharacteristics_>mipBound()); 8984 // Reset bound anyway (no harm if not odd) 8985 solverCharacteristics_>setMipBound(COIN_DBL_MAX); 8986 // If not root then use max of this and parent 8987 if (parentNode) 8988 newObjValue = CoinMax(newObjValue,parentNode>objectiveValue()); 8989 thisNode>setObjectiveValue(newObjValue); 8990 } 
trunk/CbcNode.cpp
r264 r267 9 9 //#define CHECK_CUT_COUNTS 10 10 //#define CHECK_NODE 11 #define CBC_WEAK_STRONG 11 12 #include <cassert> 12 13 #include <cfloat> 
trunk/include/CbcModel.hpp
r265 r267 1404 1404 */ 1405 1405 void addCuts1(CbcNode * node, CoinWarmStartBasis *&lastws); 1406 /** Set objective value in a node. This is separated out so that 1407 odd solvers can use. It may look at extra information in 1408 solverCharacteriscs_ and will also use bound from parent node 1409 */ 1410 void setObjectiveValue(CbcNode * thisNode, const CbcNode * parentNode); 1406 1411 1407 1412 /** If numberBeforeTrust >0 then we are going to use CbcBranchDynamic.
Note: See TracChangeset
for help on using the changeset viewer.