Changeset 777


Ignore:
Timestamp:
Sep 4, 2007 5:58:33 AM (12 years ago)
Author:
forrest
Message:

for bonmin

Location:
trunk/Cbc/src
Files:
5 edited

Legend:

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

    r776 r777  
    16371637      int j ;
    16381638      int nNodes = tree_->size() ;
    1639       bestPossibleObjective_ = 1.0e100 ;
    1640       for (j = 0;j < nNodes;j++) {
    1641         CbcNode * node = tree_->nodePointer(j) ;
    1642         if (node&&node->objectiveValue() < bestPossibleObjective_)
    1643           bestPossibleObjective_ = node->objectiveValue() ;
    1644       }
     1639
     1640      //MODIF PIERRE
     1641      bestPossibleObjective_ = tree_->getBestPossibleObjective();
    16451642      unlockThread();
    16461643      if (!intParam_[CbcPrinting]) {
     
    18901887        bool checkingNode=false;
    18911888        if (feasible) {
    1892           newNode = new CbcNode ;
     1889          newNode = new CbcNode ;//Regular node of the tree
    18931890          // Set objective value (not so obvious if NLP etc)
    18941891          setObjectiveValue(newNode,node);
  • trunk/Cbc/src/CbcSolver.cpp

    r776 r777  
    61036103                    }
    61046104                  }
     6105                  // basis
     6106                  CoinWarmStartBasis * basis = dynamic_cast<CoinWarmStartBasis *> (babModel->solver()->getWarmStart());
     6107                  originalSolver->setBasis(*basis);
     6108                  delete basis;
    61056109                }
    61066110                checkSOS(babModel, babModel->solver());
     
    61316135                    }
    61326136                  }
     6137                  // basis
     6138                  CoinWarmStartBasis * basis = dynamic_cast<CoinWarmStartBasis *> (babModel->solver()->getWarmStart());
     6139                  originalSolver->setBasis(*basis);
     6140                  delete basis;
    61336141                }
    61346142              }
  • trunk/Cbc/src/CbcTree.cpp

    r765 r777  
    179179}
    180180
     181double
     182CbcTree::getBestPossibleObjective(){
     183  double r_val = 1e100;
     184  for(int i = 0 ; i < nodes_.size() ; i++){
     185    if(nodes_[i] && nodes_[i]->objectiveValue() < r_val){
     186      r_val = nodes_[i]->objectiveValue();
     187    }
     188    return r_val;
     189  }
     190}
    181191/*! \brief Prune the tree using an objective function cutoff
    182192
  • trunk/Cbc/src/CbcTree.hpp

    r765 r777  
    6565
    6666  /// Return size
    67   inline int size() const
    68   { return nodes_.size();}
    69 
    70   /// [] operator
    71   inline CbcNode * operator [] (int i) const
    72   { return nodes_[i];}
    73 
    74   /// Return a node pointer
    75   inline CbcNode * nodePointer (int i) const
    76   { return nodes_[i];}
     67  virtual int size() const
     68  {return nodes_.size();}
    7769
    7870//@}
     
    8981*/
    9082
    91   void cleanTree(CbcModel * model, double cutoff, double & bestPossibleObjective);
     83  virtual void cleanTree(CbcModel * model, double cutoff, double & bestPossibleObjective);
    9284
    9385  /// Get best on list using alternate method
     
    9688  /// We may have got an intelligent tree so give it one more chance
    9789  virtual void endSearch() {}
     90
     91  /// Get best possible objective function in the tree
     92  virtual double getBestPossibleObjective();
    9893//@}
    9994protected:
  • trunk/Cbc/src/Makefile.in

    r765 r777  
    285285AUX_DIR = @AUX_DIR@
    286286AWK = @AWK@
     287BONMINOBJDIR = @BONMINOBJDIR@
     288BONMINSRCDIR = @BONMINSRCDIR@
    287289BUILDTOOLSDIR = @BUILDTOOLSDIR@
    288290CBCOBJDIR = @CBCOBJDIR@
     
    304306COIN_HAS_ASL_FALSE = @COIN_HAS_ASL_FALSE@
    305307COIN_HAS_ASL_TRUE = @COIN_HAS_ASL_TRUE@
     308COIN_HAS_BONMIN_FALSE = @COIN_HAS_BONMIN_FALSE@
     309COIN_HAS_BONMIN_TRUE = @COIN_HAS_BONMIN_TRUE@
    306310COIN_HAS_CBC_FALSE = @COIN_HAS_CBC_FALSE@
    307311COIN_HAS_CBC_TRUE = @COIN_HAS_CBC_TRUE@
Note: See TracChangeset for help on using the changeset viewer.