Changeset 486 for branches


Ignore:
Timestamp:
Nov 9, 2006 10:44:12 AM (13 years ago)
Author:
forrest
Message:

for C and minor change to compare

Location:
branches/devel/Cbc/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/devel/Cbc/src/CbcCompareActual.cpp

    r484 r486  
    142142    saveWeight_(0.0),
    143143    numberSolutions_(0),
    144     treeSize_(0)
     144    treeSize_(0),
     145    breadthDepth_(5)
    145146{
    146147  test_=this;
     
    153154    saveWeight_(0.0),
    154155    numberSolutions_(0),
    155     treeSize_(0)
     156    treeSize_(0),
     157    breadthDepth_(5)
    156158{
    157159  test_=this;
     
    168170  numberSolutions_=rhs.numberSolutions_;
    169171  treeSize_ = rhs.treeSize_;
     172  breadthDepth_ = rhs.breadthDepth_;
    170173}
    171174
     
    187190    numberSolutions_=rhs.numberSolutions_;
    188191    treeSize_ = rhs.treeSize_;
     192    breadthDepth_ = rhs.breadthDepth_;
    189193  }
    190194  return *this;
     
    219223  }
    220224#else
    221   if ((weight_==-1.0&&(y->depth()>7||x->depth()>7))||weight_==-3.0) {
     225  if ((weight_==-1.0&&(y->depth()>breadthDepth_||x->depth()>breadthDepth_))||weight_==-3.0) {
    222226    int adjust =  (weight_==-3.0) ? 10000 : 0;
    223227    // before solution
     
    238242    }
    239243  } else {
    240     // always choose *smallest* depth if <= 7
     244    // always choose *greatest* depth if both <= breadthDepth_ otherwise <= breadthDepth_ if just one
    241245    int depthX = x->depth();
    242246    int depthY = y->depth();
    243     if (depthX<=7||depthY<=7) {
    244       if (depthX!=depthY) {
    245         return depthX < depthY;
     247    if (depthX<=breadthDepth_||depthY<=breadthDepth_) {
     248      if (depthX<=breadthDepth_&&depthY<=breadthDepth_) {
     249        if (depthX!=depthY) {
     250          return depthX < depthY;
     251        }
     252      } else {
     253        if (depthX!=depthY) {
     254          return depthX > depthY;
     255        }
    246256      }
    247257    }
  • branches/devel/Cbc/src/CbcCompareActual.hpp

    r439 r486  
    102102  inline void setWeight(double weight)
    103103  { weight_ = weight;};
     104  // Depth above which want to explore first
     105  inline void setBreadthDepth(int value)
     106  {  breadthDepth_ = value;};
    104107protected:
    105108  // Weight for each infeasibility
     
    111114  // Tree size (at last check)
    112115  int treeSize_;
     116  // Depth above which want to explore first
     117  int breadthDepth_;
    113118};
    114119
  • branches/devel/Cbc/src/Cbc_C_Interface.cpp

    r439 r486  
    217217{
    218218  const char prefix[] = "Cbc_C_Interface::Cbc_newModel(): ";
    219   const int  VERBOSE = 1;
     219  // const int  VERBOSE = 1;
    220220  if (VERBOSE>0) printf("%s begin\n",prefix);
    221221 
     
    236236{
    237237  const char prefix[] = "Cbc_C_Interface::Cbc_deleteModel(): ";
    238   const int  VERBOSE = 1;
     238  // const int  VERBOSE = 1;
    239239  if (VERBOSE>0) printf("%s begin\n",prefix); fflush(stdout);
    240240 
     
    744744
    745745  int result = 0;
    746 // cannot find this in Cbc, Osi, or OsiClp
    747 //tbd  result = model->model_->solver()->maximumIterations();
    748   printf("%s ERROR: NOT IMPLEMENTED\n",prefix);
     746  model->model_->solver()->getIntParam(OsiMaxNumIteration,result);
    749747
    750748  if (VERBOSE>0) printf("%s return %i\n",prefix,result);
     
    758756  if (VERBOSE>0) printf("%s begin\n",prefix);
    759757
    760 // cannot find this in Cbc, Osi, or OsiClp
    761 //tbd  model->model_->setMaximumIterations(value);
    762   printf("%s ERROR: NOT IMPLEMENTED\n",prefix);
     758  model->model_->solver()->setIntParam(OsiMaxNumIteration,value);
    763759
    764760  if (VERBOSE>0) printf("%s return\n",prefix);
     
    22632259{
    22642260  const char prefix[] = "Cbc_C_Interface::Cbc_clone(): ";
    2265   const int  VERBOSE = 1;
     2261  // const int  VERBOSE = 1;
    22662262  if (VERBOSE>0) printf("%s begin\n",prefix);
    22672263 
  • branches/devel/Cbc/src/Cbc_C_Interface.h

    r439 r486  
    115115  COINLIBAPI int COINLINKAGE Cbc_numberIterations(Cbc_Model * model);
    116116  COINLIBAPI void COINLINKAGE Cbc_setNumberIterations(Cbc_Model * model, int numberIterations);
    117   /** Maximum number of iterations */
     117  /** Maximum number of iterations (only useful in initial solve) */
    118118  COINLIBAPI int Cbc_maximumIterations(Cbc_Model * model);
    119119  COINLIBAPI void COINLINKAGE Cbc_setMaximumIterations(Cbc_Model * model, int value);
Note: See TracChangeset for help on using the changeset viewer.