Changeset 2547 for trunk


Ignore:
Timestamp:
Apr 9, 2019 9:45:02 AM (5 months ago)
Author:
forrest
Message:

try and improve currentNode_ pointing correctly

Location:
trunk/Cbc/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Cbc/src/CbcModel.cpp

    r2543 r2547  
    39723972          newNode->nodeInfo()->nullParent();
    39733973      }
    3974       delete newNode;
     3974      deleteNode(newNode);
    39753975      newNode = NULL;
    39763976      feasible = false;
     
    52805280      bestObjective_ += 100.0 * increment + 1.0e-3; // only set if we are going to solve
    52815281    setBestSolution(CBC_END_SOLUTION, bestObjective_, bestSolution_, 1);
     5282    currentNode_ = NULL;
    52825283    continuousSolver_->resolve();
    52835284    // Deal with funny variables
     
    58435844  appData_ = NULL;
    58445845  solver_ = rhs.clone();
     5846  ownership_ |= 0x80000000; // model now owns solver
    58455847  handler_ = new CoinMessageHandler();
    58465848  if (!solver_->defaultHandler() && solver_->messageHandler()->logLevel(0) != -1000)
     
    1721617218        if (!node->nodeInfo()->numberBranchesLeft())
    1721717219          node->nodeInfo()->allBranchesGone(); // can clean up
    17218         delete node;
     17220        deleteNode(node);
    1721917221        node = NULL;
    1722017222      } else {
     
    1953119533  return originalModel;
    1953219534}
    19533 
    19534 /* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2
    19535 */
     19535// Delete a node and possibly null out currentNode_
     19536void
     19537CbcModel::deleteNode(CbcNode * node)
     19538{
     19539  delete node;
     19540  if (node==currentNode_)
     19541    currentNode_ = NULL;
     19542}
     19543
  • trunk/Cbc/src/CbcModel.hpp

    r2529 r2547  
    25672567    return currentNode_;
    25682568  }
     2569  /// Delete a node and possibly null out currentNode_
     2570  void deleteNode(CbcNode * node);
    25692571  /// Get a pointer to probing info
    25702572  inline CglTreeProbingInfo *probingInfo() const
  • trunk/Cbc/src/CbcTree.cpp

    r2467 r2547  
    652652    if (node->nodeInfo())
    653653      node->nodeInfo()->throwAway();
    654     delete node;
     654    model->deleteNode(node);
    655655    delete lastws;
    656656  }
Note: See TracChangeset for help on using the changeset viewer.