Changeset 660


Ignore:
Timestamp:
Sep 19, 2005 11:51:56 AM (15 years ago)
Author:
forrest
Message:

stuff

Location:
trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/ClpFactorization.cpp

    r650 r660  
    111111    areaFactor_ *= 1.1;
    112112  }
     113  //int numberPivots=numberPivots_;
    113114#if 0
    114115  if (model->algorithm()>0)
     
    514515          pivotVariable[i]=-1;
    515516        }
     517
    516518        for (i=0;i<numberRows;i++) {
    517519          if (model->getRowStatus(i) == ClpSimplex::basic) {
  • trunk/ClpModel.cpp

    r653 r660  
    33593359  sparseThreshold_ = 0;
    33603360  pivotTolerance_=0.0;
     3361  acceptablePivot_ = 0.0;
    33613362  perturbation_ = 0;
    33623363  forceFactorization_=-1;
     
    33723373  infeasibilityCost_ = rhs.infeasibilityCost_;
    33733374  pivotTolerance_ = rhs.pivotTolerance_;
     3375  acceptablePivot_ = rhs.acceptablePivot_;
    33743376  sparseThreshold_ = rhs.sparseThreshold_;
    33753377  perturbation_ = rhs.perturbation_;
     
    33953397    infeasibilityCost_ = rhs.infeasibilityCost_;
    33963398    pivotTolerance_ = rhs.pivotTolerance_;
     3399    acceptablePivot_ = rhs.acceptablePivot_;
    33973400    sparseThreshold_ = rhs.sparseThreshold_;
    33983401    perturbation_ = rhs.perturbation_;
  • trunk/ClpPackedMatrix.cpp

    r653 r660  
    17521752  double * columnUpper = model->columnUpper();
    17531753  int iColumn, iRow;
     1754  //#define LEAVE_FIXED
    17541755  // mark free rows
    17551756  for (iRow=0;iRow<numberRows;iRow++) {
     1757#ifndef LEAVE_FIXED
    17561758    usefulRow[iRow]=0;
    17571759    if (rowUpper[iRow]<1.0e20||
    17581760        rowLower[iRow]>-1.0e20)
     1761#endif
    17591762      usefulRow[iRow]=1;
    17601763  }
     
    17721775    CoinBigIndex j;
    17731776    char useful=0;
     1777#ifndef LEAVE_FIXED
    17741778    if (columnUpper[iColumn]>
    17751779        columnLower[iColumn]+1.0e-12) {
     1780#endif
    17761781      for (j=columnStart[iColumn];
    17771782           j<columnStart[iColumn]+columnLength[iColumn];j++) {
     
    17831788        }
    17841789      }
    1785     }
     1790#ifndef LEAVE_FIXED
     1791    }
     1792#endif
    17861793    usefulColumn[iColumn]=useful;
    17871794  }
     
    20122019    overallLargest = CoinMin(100.0,overallLargest);
    20132020    overallSmallest=1.0e50;
     2021    //printf("scaling %d\n",model->scalingFlag());
    20142022    for (iColumn=0;iColumn<numberColumns;iColumn++) {
    2015       if (usefulColumn[iColumn]) {
     2023      if (columnUpper[iColumn]>
     2024        columnLower[iColumn]+1.0e-12) {
     2025        //if (usefulColumn[iColumn]) {
    20162026        CoinBigIndex j;
    20172027        largest=1.0e-20;
  • trunk/ClpSimplex.cpp

    r657 r660  
    6969  sumOfRelaxedDualInfeasibilities_(0.0),
    7070  sumOfRelaxedPrimalInfeasibilities_(0.0),
     71  acceptablePivot_(1.0e-8),
    7172  lower_(NULL),
    7273  rowLowerWork_(NULL),
     
    175176  sumOfRelaxedDualInfeasibilities_(0.0),
    176177  sumOfRelaxedPrimalInfeasibilities_(0.0),
     178  acceptablePivot_(1.0e-8),
    177179  lower_(NULL),
    178180  rowLowerWork_(NULL),
     
    16031605  sumOfRelaxedDualInfeasibilities_(0.0),
    16041606  sumOfRelaxedPrimalInfeasibilities_(0.0),
     1607  acceptablePivot_(1.0e-8),
    16051608  lower_(NULL),
    16061609  rowLowerWork_(NULL),
     
    17031706  sumOfRelaxedDualInfeasibilities_(0.0),
    17041707  sumOfRelaxedPrimalInfeasibilities_(0.0),
     1708  acceptablePivot_(1.0e-8),
    17051709  lower_(NULL),
    17061710  rowLowerWork_(NULL),
     
    19241928  sumOfRelaxedDualInfeasibilities_ = rhs.sumOfRelaxedDualInfeasibilities_;
    19251929  sumOfRelaxedPrimalInfeasibilities_ = rhs.sumOfRelaxedPrimalInfeasibilities_;
     1930  acceptablePivot_ = rhs.acceptablePivot_;
    19261931  if (rhs.nonLinearCost_!=NULL)
    19271932    nonLinearCost_ = new ClpNonLinearCost(*rhs.nonLinearCost_);
     
    65886593  saved.perturbation_ = perturbation_;
    65896594  saved.forceFactorization_=forceFactorization_;
     6595  saved.acceptablePivot_ = acceptablePivot_;
    65906596  // Progress indicator
    65916597  delete progress_;
     
    66036609  dualBound_ = saved.dualBound_;
    66046610  forceFactorization_=saved.forceFactorization_;
     6611  acceptablePivot_ = saved.acceptablePivot_;
    66056612  delete progress_;
    66066613  progress_=NULL;
  • trunk/ClpSimplexDual.cpp

    r659 r660  
    980980      // Get good size for pivot
    981981      // Allow first few iterations to take tiny
    982       double acceptablePivot=1.0e-9;
     982      double acceptablePivot=1.0e-1*acceptablePivot_;
    983983      if (numberIterations_>100)
    984         acceptablePivot=1.0e-8;
     984        acceptablePivot=acceptablePivot_;
    985985      if (factorization_->pivots()>10||
    986986          (factorization_->pivots()&&saveSumDual))
    987         acceptablePivot=1.0e-5; // if we have iterated be more strict
     987        acceptablePivot=1.0e+3*acceptablePivot_; // if we have iterated be more strict
    988988      else if (factorization_->pivots()>5)
    989         acceptablePivot=1.0e-6; // if we have iterated be slightly more strict
     989        acceptablePivot=1.0e+2*acceptablePivot_; // if we have iterated be slightly more strict
    990990      else if (factorization_->pivots())
    991         acceptablePivot=1.0e-8; // relax
     991        acceptablePivot=acceptablePivot_; // relax
    992992      double bestPossiblePivot=1.0;
    993993      // get sign for finding row of tableau
     
    14141414          printf("** no column pivot\n");
    14151415#endif
    1416         if (factorization_->pivots()<5) {
     1416        if (factorization_->pivots()<5&&acceptablePivot_<=1.0e-8) {
    14171417          // If not in branch and bound etc save ray
    14181418          if ((specialOptions_&(1024|4096))==0) {
     
    14571457          }
    14581458        }
     1459        if (factorization_->pivots()<5&&acceptablePivot_>1.0e-8)
     1460          acceptablePivot_=1.0e-8;
    14591461        rowArray_[0]->clear();
    14601462        columnArray_[0]->clear();
  • trunk/ClpSimplexPrimal.cpp

    r640 r660  
    638638{
    639639  int dummy; // for use in generalExpanded
     640  // number of pivots done
     641  int numberPivots = factorization_->pivots();
    640642  if (type==2) {
    641643    // trouble - restore solution
     
    691693          } else {
    692694            // no - restore previous basis
     695            // Keep any flagged variables
     696            int i;
     697            for (i=0;i<numberRows_+numberColumns_;i++) {
     698              if (flagged(i))
     699                saveStatus_[i] |= 64; //say flagged
     700            }
    693701            memcpy(status_ ,saveStatus_,(numberColumns_+numberRows_)*sizeof(char));
     702            if (numberPivots<=1) {
     703              // throw out something
     704              if (sequenceIn_>=0&&getStatus(sequenceIn_)!=basic) {
     705                setFlagged(sequenceIn_);
     706              } else if (sequenceOut_>=0&&getStatus(sequenceOut_)!=basic) {
     707                setFlagged(sequenceOut_);
     708              }
     709              double newTolerance = 0.05 + 0.94*CoinDrand48();
     710              factorization_->pivotTolerance(newTolerance);
     711            } else {
     712              // Go to safe
     713              factorization_->pivotTolerance(0.99);
     714            }
    694715            memcpy(rowActivityWork_,savedSolution_+numberColumns_ ,
    695716                   numberRows_*sizeof(double));
     
    701722            forceFactorization_=1; // a bit drastic but ..
    702723            type = 2;
    703             // Go to safe
    704             factorization_->pivotTolerance(0.99);
    705724            if (internalFactorize(1)!=0)
    706725               largestPrimalError_=1.0e4; // force other type
     
    800819    nonLinearCost_->checkInfeasibilities(primalTolerance_);
    801820  }
    802   if (!nonLinearCost_->numberInfeasibilities()&&infeasibilityCost_==1.0e10)
    803     infeasibilityCost_ = 1.0e8; // relax if default
    804821  double trueInfeasibility =nonLinearCost_->sumInfeasibilities();
     822  if (!nonLinearCost_->numberInfeasibilities()&&infeasibilityCost_==1.0e10&&!ifValuesPass) {
     823    // relax if default
     824    infeasibilityCost_ = CoinMin(100.0*sumDualInfeasibilities_,1.0e7);
     825    trueInfeasibility = 1.123456e10;
     826  }
    805827  if (trueInfeasibility>1.0) {
    806828    // If infeasibility going up may change weights
    807829    double testValue = trueInfeasibility-1.0e-4*(10.0+trueInfeasibility);
    808     if(progress->lastInfeasibility()<testValue) {
     830    double lastInf = progress->lastInfeasibility();
     831    if(lastInf<testValue||trueInfeasibility==1.123456e10) {
    809832      if (infeasibilityCost_<1.0e14) {
    810833        infeasibilityCost_ *= 1.5;
     
    11491172
    11501173  double totalThru=0.0; // for when variables flip
    1151   double acceptablePivot=0.5e-8;
    1152   if (factorization_->pivots())
    1153     acceptablePivot=1.0e-5; // if we have iterated be more strict
     1174  // Allow first few iterations to take tiny
     1175  double acceptablePivot=1.0e-1*acceptablePivot_;
     1176  if (numberIterations_>100)
     1177    acceptablePivot=acceptablePivot_;
     1178  if (factorization_->pivots()>10)
     1179    acceptablePivot=1.0e+3*acceptablePivot_; // if we have iterated be more strict
     1180  else if (factorization_->pivots()>5)
     1181    acceptablePivot=1.0e+2*acceptablePivot_; // if we have iterated be slightly more strict
     1182  else if (factorization_->pivots())
     1183    acceptablePivot=acceptablePivot_; // relax
    11541184  double bestEverPivot=acceptablePivot;
    11551185  int lastPivotRow = -1;
     
    24652495        }
    24662496        rowArray_[0]->clear();
    2467         if (!factorization_->pivots()) {
     2497        if (!factorization_->pivots()&&acceptablePivot_<=1.0e-8) {
    24682498          returnCode = 2; //say looks unbounded
    24692499          // do ray
     
    24802510          continue;
    24812511        } else {
     2512          acceptablePivot_=1.0e-8;
    24822513          returnCode = 4; //say looks unbounded but has iterated
    24832514        }
  • trunk/include/ClpFactorization.hpp

    r650 r660  
    104104#ifndef SLIM_CLP
    105105  /// Says if a network basis
    106   bool inline networkBasis() const
     106  inline bool networkBasis() const
    107107  { return (networkBasis_!=NULL);};
    108108#else
    109109  /// Says if a network basis
    110   bool inline networkBasis() const
     110  inline bool networkBasis() const
    111111  { return false;};
    112112#endif
  • trunk/include/ClpModel.hpp

    r653 r660  
    917917  double infeasibilityCost_;
    918918  double pivotTolerance_;
     919  double acceptablePivot_;
    919920  int sparseThreshold_;
    920921  int perturbation_;
  • trunk/include/ClpSimplex.hpp

    r657 r660  
    122122  /// Switch off e.g. if people using presolve
    123123  void deleteAuxiliaryModel();
     124  /// See if we have auxiliary model
     125  inline bool usingAuxiliaryModel() const
     126  { return auxiliaryModel_!=NULL;};
    124127  /// Assignment operator. This copies the data
    125128    ClpSimplex & operator=(const ClpSimplex & rhs);
     
    532535  ClpDataSave saveData() ;
    533536  /// Restore data
    534     void restoreData(ClpDataSave saved);
     537  void restoreData(ClpDataSave saved);
    535538  /// Clean up status
    536539  void cleanStatus();
     
    11131116  /// Sum of Primal infeasibilities using tolerance based on error in primals
    11141117  double sumOfRelaxedPrimalInfeasibilities_;
     1118  /// Acceptable pivot value just after factorization
     1119  double acceptablePivot_;
    11151120  /// Working copy of lower bounds (Owner of arrays below)
    11161121  double * lower_;
Note: See TracChangeset for help on using the changeset viewer.