Changeset 897 for branches/heur
- Timestamp:
- Mar 12, 2008 4:57:55 PM (13 years ago)
- Location:
- branches/heur/Cbc/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/heur/Cbc/src/CbcBranchBase.hpp
r889 r897 308 308 virtual double branch(OsiSolverInterface * solver) 309 309 { return branch();} 310 311 /** Reset every information so that the branching object appears to point to 312 the previous child. This method does not need to modify anything in any 313 solver. */ 314 virtual void previousBranch() { 315 assert(branchIndex_ > 0); 316 branchIndex_--; 317 way_ = -way_; 318 } 310 319 311 320 using OsiBranchingObject::print ; -
branches/heur/Cbc/src/CbcHeuristic.cpp
r896 r897 168 168 } 169 169 170 void 171 CbcHeuristic::debugNodes() 170 void CbcHeurDebugNodes(CbcModel* model_) 172 171 { 173 172 CbcNode* node = model_->currentNode(); … … 219 218 } 220 219 220 void 221 CbcHeuristic::debugNodes() 222 { 223 CbcHeurDebugNodes(model_); 224 } 225 221 226 bool 222 227 CbcHeuristic::shouldHeurRun() … … 228 233 } 229 234 230 debugNodes();231 return false;235 // debugNodes(); 236 // return false; 232 237 233 238 const int depth = currentNode->depth(); … … 693 698 CbcHeuristicNode::gutsOfConstructor(CbcModel& model) 694 699 { 700 // CbcHeurDebugNodes(&model); 695 701 CbcNode* node = model.currentNode(); 696 brObj_ = new CbcBranchingObject*[node->depth() -1];702 brObj_ = new CbcBranchingObject*[node->depth()]; 697 703 CbcNodeInfo* nodeInfo = node->nodeInfo(); 698 704 int cnt = 0; -
branches/heur/Cbc/src/CbcModel.cpp
r882 r897 2265 2265 if (branchesLeft) { 2266 2266 // set nodenumber correctly 2267 #ifdef CBC_DEBUG_NODENUMBER 2268 printf("CbcModel: numberNodes2_: %i, node->nodeNumber(): %i\n", 2269 numberNodes2_, node->nodeNumber()); 2270 #endif 2267 2271 node->nodeInfo()->setNodeNumber(numberNodes2_); 2268 2272 tree_->push(node) ; … … 11890 11894 if (branchesLeft) { 11891 11895 // set nodenumber correctly 11892 if (node->nodeInfo()) 11896 if (node->nodeInfo()) { 11897 #ifdef CBC_DEBUG_NODENUMBER 11898 printf("CbcModel: numberNodes2_: %i, node->nodeNumber(): %i\n", 11899 numberNodes2_, node->nodeNumber()); 11900 #endif 11893 11901 node->nodeInfo()->setNodeNumber(numberNodes2_); 11902 } 11894 11903 #ifndef CBC_DETERMINISTIC_THREAD 11895 11904 #ifdef PUSH_LATER -
branches/heur/Cbc/src/CbcNode.cpp
r896 r897 71 71 assert(cbcbr); 72 72 parentBranch_ = cbcbr->clone(); 73 parentBranch_->previousBranch(); 73 74 } 74 75 } 75 76 } 76 77 78 #if 0 77 79 // Constructor given parent 78 80 CbcNodeInfo::CbcNodeInfo (CbcNodeInfo * parent) … … 94 96 setParentBasedData(); 95 97 } 98 #endif 99 96 100 // Copy Constructor 97 101 CbcNodeInfo::CbcNodeInfo (const CbcNodeInfo & rhs) … … 179 183 if (!numberLinks) delete parent_; 180 184 } 185 delete parentBranch_; 181 186 } 182 187 … … 497 502 CbcFullNodeInfo::CbcFullNodeInfo(CbcModel * model, 498 503 int numberRowsAtContinuous) : 499 CbcNodeInfo( )504 CbcNodeInfo(NULL, model->currentNode()) 500 505 { 501 506 OsiSolverInterface * solver = model->solver(); … … 672 677 CbcPartialNodeInfo::CbcPartialNodeInfo (const CbcPartialNodeInfo & rhs) 673 678 674 : CbcNodeInfo(rhs .parent_)679 : CbcNodeInfo(rhs) 675 680 676 681 { basisDiff_ = rhs.basisDiff_->clone() ; … … 1114 1119 } 1115 1120 // Set node number 1121 #ifdef CBC_DEBUG_NODENUMBER 1122 printf("CbcNode: model->getNodeCount2(): %i, this->nodeNumber_: %i\n", 1123 model->getNodeCount2(), nodeNumber_); 1124 #endif 1116 1125 nodeInfo_->setNodeNumber(model->getNodeCount2()); 1117 1126 state_ |= 2; // say active … … 1297 1306 } 1298 1307 // Set node number 1308 #ifdef CBC_DEBUG_NODENUMBER 1309 printf("CbcNode: model->getNodeCount2(): %i, this->nodeNumber_: %i\n", 1310 model->getNodeCount2(), nodeNumber_); 1311 #endif 1299 1312 nodeInfo_->setNodeNumber(model->getNodeCount2()); 1300 1313 state_ |= 2; // say active -
branches/heur/Cbc/src/CbcNode.hpp
r896 r897 74 74 CbcNodeInfo ( const CbcNodeInfo &); 75 75 76 76 #if 0 77 77 /** Construct with parent 78 78 … … 81 81 */ 82 82 CbcNodeInfo (CbcNodeInfo * parent); 83 #endif 83 84 84 85 /** Construct with parent and owner
Note: See TracChangeset
for help on using the changeset viewer.