Changeset 82


Ignore:
Timestamp:
Jan 6, 2003 9:26:46 AM (17 years ago)
Author:
forrest
Message:

Improvements for miplib

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/ClpMessage.cpp

    r63 r82  
    6666  {CLP_BAD_BOUNDS,6002,0,"%d bad bound pairs were found - first at %c%d"},
    6767  {CLP_BAD_MATRIX,6003,0,"Matrix has %d large values, first at column %d, row %d is %g"},
    68   {CLP_LOOP,6004,0,"Can't get out of loop - stopping"},
     68  {CLP_LOOP,6004,0,"Can't get out of loop - stopping (Debug) (Don't panic, OsiClpSolverInterface will resolve)"},
    6969  {CLP_IMPORT_RESULT,18,1,"Model was imported from %s in %g seconds"},
    7070  {CLP_IMPORT_ERRORS,3001,1," There were %d errors when importing model from %s"},
  • trunk/ClpModel.cpp

    r77 r82  
    6565  numberIterations_(0),
    6666  problemStatus_(-1),
    67   maximumIterations_(1000000000),
    6867  defaultHandler_(true),
    6968  status_(NULL),
     
    7372  integerType_(NULL)
    7473{
    75   intParam_[ClpMaxNumIteration] = 9999999;
     74  intParam_[ClpMaxNumIteration] = 99999999;
    7675  intParam_[ClpMaxNumIterationHotStart] = 9999999;
    7776
     
    326325  numberIterations_ = rhs.numberIterations_;
    327326  problemStatus_ = rhs.problemStatus_;
    328   maximumIterations_ = rhs.maximumIterations_;
    329327  if (trueCopy) {
    330328    lengthNames_ = rhs.lengthNames_;
     
    777775{
    778776  if(value>=0)
    779     maximumIterations_=value;
     777    intParam_[ClpMaxNumIteration]=value;
    780778}
    781779// Pass in Message handler (not deleted at end)
  • trunk/ClpSimplex.cpp

    r80 r82  
    10401040  handler_->printing(algorithm_>0)<<dualIn_<<theta_;
    10411041  handler_->message()<<CoinMessageEol;
    1042   if (numberIterations_>=maximumIterations_)
     1042  if (numberIterations_>=maximumIterations())
    10431043    return 2;
    10441044  // only time to re-factorize if one before real time
     
    14371437  numberPrimalInfeasibilities_=0;
    14381438  double primalTolerance = primalTolerance_;
    1439   double relaxedTolerance=dualTolerance_;
     1439  double relaxedTolerance=primalTolerance_;
    14401440  // we can't really trust infeasibilities if there is primal error
    14411441  double error = min(1.0e-3,largestPrimalError_);
    1442   relaxedTolerance = max(relaxedTolerance, error);
     1442  // allow tolerance at least slightly bigger than standard
     1443  relaxedTolerance = relaxedTolerance +  error;
    14431444  sumOfRelaxedPrimalInfeasibilities_ = 0.0;
    14441445
     
    15171518  // we can't really trust infeasibilities if there is dual error
    15181519  double error = min(1.0e-3,largestDualError_);
    1519   relaxedTolerance = max(relaxedTolerance, error);
     1520  // allow tolerance at least slightly bigger than standard
     1521  relaxedTolerance = relaxedTolerance +  error;
    15201522  sumOfRelaxedDualInfeasibilities_ = 0.0;
    15211523
     
    17031705      // may return NULL if can't give row copy
    17041706      rowCopy_ = matrix_->reverseOrderedCopy();
     1707#ifdef TAKEOUT
     1708      {
     1709
     1710        ClpPackedMatrix* rowCopy =
     1711          dynamic_cast< ClpPackedMatrix*>(rowCopy_);
     1712        const int * column = rowCopy->getIndices();
     1713        const CoinBigIndex * rowStart = rowCopy->getVectorStarts();
     1714        const double * element = rowCopy->getElements();
     1715        int i;
     1716        for (i=133;i<numberRows_;i++) {
     1717          if (rowStart[i+1]-rowStart[i]==10||rowStart[i+1]-rowStart[i]==15)
     1718            printf("Row %d has %d elements\n",i,rowStart[i+1]-rowStart[i]);
     1719        }
     1720      } 
     1721#endif
    17051722    }
    17061723  }
     
    23332350    scalars.numberIterations = numberIterations_;
    23342351    scalars.problemStatus = problemStatus_;
    2335     scalars.maximumIterations = maximumIterations_;
     2352    scalars.maximumIterations = maximumIterations();
    23362353    scalars.lengthNames = lengthNames_;
    23372354    scalars.numberDualInfeasibilities = numberDualInfeasibilities_;
     
    25262543    numberIterations_ = scalars.numberIterations;
    25272544    problemStatus_ = scalars.problemStatus;
    2528     maximumIterations_ = scalars.maximumIterations;
     2545    setMaximumIterations(scalars.maximumIterations);
    25292546    lengthNames_ = scalars.lengthNames;
    25302547    numberDualInfeasibilities_ = scalars.numberDualInfeasibilities;
  • trunk/ClpSimplexDual.cpp

    r80 r82  
    17351735  double changeCost;
    17361736
    1737   if (problemStatus_>-3) {
     1737  if (problemStatus_>-3||factorization_->pivots()) {
    17381738    // factorize
    17391739    // later on we will need to recover from singularities
     
    17561756        changeBounds(true,rowArray_[2],dummyChangeCost);
    17571757        // throw away change
    1758         rowArray_[2]->clear();
     1758        int i;
     1759        for (i=0;i<4;i++)
     1760          rowArray_[i]->clear();
    17591761        forceFactorization_=1; // a bit drastic but ..
    17601762        type = 2;
    1761         assert (internalFactorize(1)==0);
     1763        //assert (internalFactorize(1)==0);
     1764        if (internalFactorize(1)) {
     1765          memcpy(status_ ,saveStatus_,(numberColumns_+numberRows_)*sizeof(char));
     1766          memcpy(rowActivityWork_,savedSolution_+numberColumns_ ,
     1767                 numberRows_*sizeof(double));
     1768          memcpy(columnActivityWork_,savedSolution_ ,
     1769                 numberColumns_*sizeof(double));
     1770          // debug
     1771          assert (internalFactorize(1)==0);
     1772        }
    17621773      }
    17631774    }
     
    19641975        // for now - recompute all
    19651976        gutsOfSolution(rowActivityWork_,columnActivityWork_);
    1966         assert(numberDualInfeasibilitiesWithoutFree_==0);
     1977        //assert(numberDualInfeasibilitiesWithoutFree_==0);
    19671978        if (numberDualInfeasibilities_) {
    19681979          // bad free variables
  • trunk/Makefile.Clp

    r78 r82  
    7373.DELETE_ON_ERROR:
    7474
    75 .PHONY: install library
     75.PHONY: default install library
     76
     77default: install
    7678
    7779install library:
  • trunk/include/ClpModel.hpp

    r81 r82  
    146146  { numberIterations_ = numberIterations;};
    147147   /// Maximum number of iterations
    148    inline int maximumIterations() const { return maximumIterations_; }
     148   inline int maximumIterations() const { return intParam_[ClpMaxNumIteration]; }
    149149   void setMaximumIterations(int value);
    150150   /** Status of problem:
     
    407407  /// Status of problem
    408408  int problemStatus_;
    409   /// Maximum number of iterations
    410   int maximumIterations_;
    411409  /// Message handler
    412410  CoinMessageHandler * handler_;
Note: See TracChangeset for help on using the changeset viewer.