Changeset 1844


Ignore:
Timestamp:
Feb 21, 2012 5:16:15 AM (8 years ago)
Author:
forrest
Message:

fix mini presolve when too much happening and modify invert frequency for awkward problems

Location:
trunk/Clp/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Clp/src/ClpSimplex.cpp

    r1785 r1844  
    20232023          return 1;
    20242024     } else if (numberIterations_ > 1000 + 10 * (numberRows_ + (numberColumns_ >> 2)) && matrix_->type()<15) {
     2025          // A bit worried problem may be cycling - lets factorize at random intervals for a short period
     2026          int numberTooManyIterations = numberIterations_ - 10 * (numberRows_ + (numberColumns_ >> 2));
    20252027          double random = randomNumberGenerator_.randomDouble();
     2028          int window = numberTooManyIterations%5000;
     2029          if (window<2*maximumPivots)
     2030            random = 0.2*random+0.8; // randomly re-factorize but not too soon
     2031          else
     2032            random=1.0; // switch off if not in window of opportunity
    20262033          int maxNumber = (forceFactorization_ < 0) ? maximumPivots : CoinMin(forceFactorization_, maximumPivots);
    20272034          if (factorization_->pivots() >= random * maxNumber) {
  • trunk/Clp/src/ClpSimplexOther.cpp

    r1835 r1844  
    84898489  double * rowUpper = newModel->rowUpper();
    84908490  //double * rowActivity = newModel->primalRowSolution();
    8491   //unsigned char * rowStatus = newModel->statusArray()+numberColumns_;
     8491  unsigned char * rowStatus = newModel->statusArray()+numberColumns_;
     8492  // use top bit of status as marker for whichRows update
     8493  for (int i=0;i<numberRows_;i++)
     8494    rowStatus[i] &= 127;
    84928495  double * columnLower = newModel->columnLower();
    84938496  double * columnUpper = newModel->columnUpper();
     
    86178620        if (rowLength[iRow]==1)  {
    86188621#ifndef CLP_NO_SUBS
    8619           whichRows[numberRowsLook++]=iRow;
     8622          // See if already marked
     8623          if ((rowStatus[iRow]&128)==0) {
     8624            rowStatus[iRow] |= 128;
     8625            whichRows[numberRowsLook++]=iRow;
     8626            assert (numberRowsLook<=numberRows_);
     8627          }
    86208628#endif
    86218629        } else {
     
    86488656      } else if (rowLower[iRow]==rowUpper[iRow]) {
    86498657#ifndef CLP_NO_SUBS
    8650         whichRows[numberRowsLook++]=iRow;
     8658        // See if already marked
     8659        if ((rowStatus[iRow]&128)==0) {
     8660          rowStatus[iRow] |= 128;
     8661          whichRows[numberRowsLook++]=iRow;
     8662          assert (numberRowsLook<=numberRows_);
     8663        }
    86518664#endif
    86528665        CoinBigIndex start = rowStart[iRow];
     
    88588871          if (rowLength2<=1&&rowLength[jRow]>1&&jRow<iRow) {
    88598872            // may be interesting
    8860             whichRows[numberRowsLook++]=jRow;
     8873            // See if already marked
     8874            if ((rowStatus[jRow]&128)==0) {
     8875              rowStatus[jRow] |= 128;
     8876              whichRows[numberRowsLook++]=jRow;
     8877              assert (numberRowsLook<=numberRows_);
     8878            }
    88618879          }
    88628880#endif
     
    89028920#endif
    89038921      int iRow = whichRows[i];
     8922      // unmark
     8923      assert ((rowStatus[iRow]&128)!=0);
     8924      rowStatus[iRow] &= 127;
    89048925      if (rowLength[iRow]==1) {
    89058926        //rowType[iRow]=55;
     
    92419262          // take out of row copy (and put on list)
    92429263          assert (rowType[iRow]<=0&&rowType[iRow]>-2);
    9243           //if (!rowType[iRow]) {
    9244           //rowType[iRow]=-1;
    9245           whichRows[numberRowsLook++]=iRow;
    9246           //}
     9264          // See if already marked (will get to row later in loop
     9265          if ((rowStatus[iRow]&128)==0) {
     9266            rowStatus[iRow] |= 128;
     9267            whichRows[numberRowsLook++]=iRow;
     9268            assert (numberRowsLook<=numberRows_);
     9269          }
    92479270          int start = rowStart[iRow];
    92489271          int put=start;
Note: See TracChangeset for help on using the changeset viewer.