Ignore:
Timestamp:
Dec 18, 2006 9:39:29 AM (13 years ago)
Author:
forrest
Message:

mostly for rins

File:
1 edited

Legend:

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

    r439 r502  
    6060  fprintf(fp,"0#include \"CbcHeuristicLocal.hpp\"\n");
    6161  fprintf(fp,"3  CbcHeuristicLocal heuristicLocal(*cbcModel);\n");
     62  CbcHeuristic::generateCpp(fp,"heuristicLocal");
    6263  if (swap_!=other.swap_)
    6364    fprintf(fp,"3  heuristicLocal.setSearchType(%d);\n",swap_);
     
    7576  swap_(rhs.swap_)
    7677{
    77   setWhen(rhs.when());
    7878  if (model_&&rhs.used_) {
    7979    int numberColumns = model_->solver()->getNumCols();
     
    8484  }
    8585}
     86
     87// Assignment operator
     88CbcHeuristicLocal &
     89CbcHeuristicLocal::operator=( const CbcHeuristicLocal& rhs)
     90{
     91  if (this!=&rhs) {
     92    CbcHeuristic::operator=(rhs);
     93    matrix_ = rhs.matrix_;
     94    numberSolutions_ = rhs.numberSolutions_;
     95    swap_ = rhs.swap_;
     96    delete [] used_;
     97    if (model_&&rhs.used_) {
     98      int numberColumns = model_->solver()->getNumCols();
     99      used_ = new char[numberColumns];
     100      memcpy(used_,rhs.used_,numberColumns);
     101    } else {
     102      used_=NULL;
     103    }
     104  }
     105  return *this;
     106}
     107
    86108// Resets stuff if model changes
    87109void
     
    132154    }
    133155  }
    134   int returnCode = smallBranchAndBound(newSolver,200,newSolution,objectiveValue,
     156  int returnCode = smallBranchAndBound(newSolver,numberNodes_,newSolution,objectiveValue,
    135157                                         objectiveValue,"CbcHeuristicLocal");
     158  if ((returnCode&2)!=0) {
     159    // could add cut
     160    returnCode &= ~2;
     161  }
    136162
    137163  delete newSolver;
Note: See TracChangeset for help on using the changeset viewer.