Changeset 438


Ignore:
Timestamp:
Sep 15, 2004 1:25:46 PM (15 years ago)
Author:
forrest
Message:

stuff

Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/ClpModel.cpp

    r410 r438  
    17161716  infeasibilityCost_ = 0.0;
    17171717  sparseThreshold_ = 0;
     1718  pivotTolerance_=0.0;
    17181719  perturbation_ = 0;
    17191720}
     
    17261727  dualBound_ = rhs.dualBound_;
    17271728  infeasibilityCost_ = rhs.infeasibilityCost_;
     1729  pivotTolerance_ = rhs.pivotTolerance_;
    17281730  sparseThreshold_ = rhs.sparseThreshold_;
    17291731  perturbation_ = rhs.perturbation_;
     
    17471749    dualBound_ = rhs.dualBound_;
    17481750    infeasibilityCost_ = rhs.infeasibilityCost_;
     1751    pivotTolerance_ = rhs.pivotTolerance_;
    17491752    sparseThreshold_ = rhs.sparseThreshold_;
    17501753    perturbation_ = rhs.perturbation_;
  • trunk/ClpPrimalColumnSteepest.cpp

    r399 r438  
    28912891      } else {
    28922892        // Just clean up
    2893         alternateWeights_->clear();
     2893        if (alternateWeights_)
     2894          alternateWeights_->clear();
    28942895      }
    28952896    }
  • trunk/ClpSimplex.cpp

    r432 r438  
    54195419  saved.infeasibilityCost_ = infeasibilityCost_;
    54205420  saved.sparseThreshold_ = factorization_->sparseThreshold();
     5421  saved.pivotTolerance_ = factorization_->pivotTolerance();
    54215422  saved.perturbation_ = perturbation_;
    54225423  // Progress indicator
     
    54305431{
    54315432  factorization_->sparseThreshold(saved.sparseThreshold_);
     5433  factorization_->pivotTolerance(saved.pivotTolerance_);
    54325434  perturbation_ = saved.perturbation_;
    54335435  infeasibilityCost_ = saved.infeasibilityCost_;
     
    58795881  return iterationNumber_[CLP_PROGRESS-1-back];
    58805882}
     5883// clears iteration numbers (to switch off panic)
     5884void
     5885ClpSimplexProgress::clearIterationNumbers()
     5886{
     5887  for (int i=0;i<CLP_PROGRESS;i++)
     5888    iterationNumber_[i]=-1;
     5889}
    58815890// Start check at beginning of whileIterating
    58825891void
  • trunk/ClpSimplexDual.cpp

    r407 r438  
    665665      else if (factorization_->pivots()>5)
    666666        acceptablePivot=1.0e-6; // if we have iterated be slightly more strict
     667      //if ((specialOptions_&64)!=0)
     668      //acceptablePivot=1.0e-7; // relax
    667669      // get sign for finding row of tableau
    668670      if (candidate<0) {
     
    996998#endif
    997999        if (factorization_->pivots()<5) {
    998           problemStatus_=-4; //say looks infeasible
    999           // create ray anyway
    1000           delete [] ray_;
    1001           ray_ = new double [ numberRows_];
    1002           rowArray_[0]->expand(); // in case packed
    1003           ClpDisjointCopyN(rowArray_[0]->denseVector(),numberRows_,ray_);
     1000          // If special option set - put off as long as possible
     1001          if ((specialOptions_&64)==0) {
     1002            problemStatus_=-4; //say looks infeasible
     1003            // create ray anyway
     1004            delete [] ray_;
     1005            ray_ = new double [ numberRows_];
     1006            rowArray_[0]->expand(); // in case packed
     1007            ClpDisjointCopyN(rowArray_[0]->denseVector(),numberRows_,ray_);
     1008          } else {
     1009            // flag
     1010            char x = isColumn(sequenceOut_) ? 'C' :'R';
     1011            handler_->message(CLP_SIMPLEX_FLAG,messages_)
     1012              <<x<<sequenceWithin(sequenceOut_)
     1013              <<CoinMessageEol;
     1014            setFlagged(sequenceOut_);
     1015            if (!factorization_->pivots()) {
     1016              rowArray_[0]->clear();
     1017              columnArray_[0]->clear();
     1018              continue;
     1019            }
     1020          }
    10041021        }
    10051022        rowArray_[0]->clear();
     
    10451062      } else {
    10461063        problemStatus_=-3;
     1064        // Force to re-factorize early next time
     1065        int numberPivots = factorization_->pivots();
     1066        forceFactorization_=CoinMin(forceFactorization_,(numberPivots+1)>>1);
    10471067      }
    10481068      returnCode=0;
     
    17211741 
    17221742  double totalThru=0.0; // for when variables flip
     1743  //double saveAcceptable=acceptablePivot;
     1744  //acceptablePivot=1.0e-9;
    17231745
    17241746  double bestEverPivot=acceptablePivot;
     
    23382360           (numberColumns_-marker[i][1])*sizeof(double));
    23392361  }
     2362  //if (fabs(alpha_)<saveAcceptable)
     2363  //printf("iteration %d in %d alpha %g acceptable %g\n",
     2364  //   numberIterations_,sequenceIn_,alpha_,saveAcceptable);
    23402365}
    23412366/* Checks if tentative optimal actually means unbounded
     
    25092534      numberPrimalInfeasibilities_ = 0;
    25102535      sumPrimalInfeasibilities_ = 0.0;
     2536    }
     2537  }
     2538  // Up tolerance if looks a bit odd
     2539  if (numberIterations_>CoinMax(1000,numberRows_>>4)&&(specialOptions_&64)!=0) {
     2540    if (sumPrimalInfeasibilities_&&sumPrimalInfeasibilities_<1.0e5) {
     2541      int backIteration = progress->lastIterationNumber(CLP_PROGRESS-1);
     2542      if (backIteration>0&&numberIterations_-backIteration<9*CLP_PROGRESS) {
     2543        if (factorization_->pivotTolerance()<0.9) {
     2544          // up tolerance
     2545          factorization_->pivotTolerance(CoinMin(factorization_->pivotTolerance()*1.05+0.02,0.91));
     2546          //printf("tol now %g\n",factorization_->pivotTolerance());
     2547          progress->clearIterationNumbers();
     2548        }
     2549      }
    25112550    }
    25122551  }
     
    29122951    dualRowPivot_->saveWeights(this,3);
    29132952  // unflag all variables (we may want to wait a bit?)
    2914   if (tentativeStatus!=-2&&unflagVariables) {
     2953  if ((tentativeStatus!=-2&&tentativeStatus!=-1)&&unflagVariables) {
    29152954    int iRow;
    29162955    int numberFlagged=0;
    29172956    for (iRow=0;iRow<numberRows_;iRow++) {
    29182957      int iPivot=pivotVariable_[iRow];
    2919       if (flagged(iPivot))
     2958      if (flagged(iPivot)) {
    29202959        numberFlagged++;
    2921       clearFlagged(iPivot);
    2922     }
     2960        clearFlagged(iPivot);
     2961      }
     2962    }
     2963#if 0
     2964    if (numberFlagged) {
     2965      printf("unflagging %d variables - status %d ninf %d nopt %d\n",numberFlagged,tentativeStatus,
     2966             numberPrimalInfeasibilities_,
     2967             numberTimesOptimal_);
     2968    }
     2969#endif
    29232970    unflagVariables = numberFlagged>0;
    29242971    if (numberFlagged&&!numberPivots) {
  • trunk/ClpSimplexPrimal.cpp

    r401 r438  
    588588      if (nonLinearCost_->numberInfeasibilities())
    589589        problemStatus_=-4; // might be infeasible
     590      // Force to re-factorize early next time
     591      int numberPivots = factorization_->pivots();
     592      forceFactorization_=CoinMin(forceFactorization_,(numberPivots+1)>>1);
    590593      returnCode=0;
    591594      break;
  • trunk/include/ClpModel.hpp

    r410 r438  
    697697  double dualBound_;
    698698  double infeasibilityCost_;
     699  double pivotTolerance_;
    699700  int sparseThreshold_;
    700701  int perturbation_;
  • trunk/include/ClpSimplex.hpp

    r437 r438  
    10721072  /// Returns previous iteration number (if -1) - current if (0)
    10731073  int lastIterationNumber(int back=1) const;
     1074  /// clears all iteration numbers (to switch off panic)
     1075  void clearIterationNumbers();
    10741076  /// Odd state
    10751077  inline void newOddState()
Note: See TracChangeset for help on using the changeset viewer.