Changeset 112


Ignore:
Timestamp:
Feb 5, 2003 1:49:33 PM (17 years ago)
Author:
forrest
Message:

Different tolerances, small element value

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/ClpModel.cpp

    r109 r112  
    6363  ray_(NULL),
    6464  objectiveValue_(0.0),
     65  smallElement_(1.0e-20),
    6566  numberIterations_(0),
    6667  solveType_(0),
     
    324325
    325326  objectiveValue_=rhs.objectiveValue_;
     327  smallElement_ = rhs.smallElement_;
    326328  numberIterations_ = rhs.numberIterations_;
    327329  solveType_ = rhs.solveType_;
  • trunk/ClpSimplex.cpp

    r111 r112  
    4444  largestDualError_(0.0),
    4545  largestSolutionError_(0.0),
    46   dualBound_(1.0e6),
     46  dualBound_(1.0e10),
    4747  lower_(NULL),
    4848  rowLowerWork_(NULL),
     
    9595  forceFactorization_(-1),
    9696  perturbation_(100),
    97   infeasibilityCost_(1.0e7),
     97  infeasibilityCost_(1.0e10),
    9898  nonLinearCost_(NULL),
    9999  specialOptions_(0),
     
    10331033  largestDualError_(0.0),
    10341034  largestSolutionError_(0.0),
    1035   dualBound_(1.0e7),
     1035  dualBound_(1.0e10),
    10361036  lower_(NULL),
    10371037  rowLowerWork_(NULL),
     
    10841084  forceFactorization_(-1),
    10851085  perturbation_(100),
    1086   infeasibilityCost_(1.0e7),
     1086  infeasibilityCost_(1.0e10),
    10871087  nonLinearCost_(NULL),
    10881088  specialOptions_(0),
     
    11241124  largestDualError_(0.0),
    11251125  largestSolutionError_(0.0),
    1126   dualBound_(1.0e7),
     1126  dualBound_(1.0e10),
    11271127  lower_(NULL),
    11281128  rowLowerWork_(NULL),
     
    11751175  forceFactorization_(-1),
    11761176  perturbation_(100),
    1177   infeasibilityCost_(1.0e7),
     1177  infeasibilityCost_(1.0e10),
    11781178  nonLinearCost_(NULL),
    11791179  specialOptions_(0),
     
    16931693    }
    16941694    //check matrix
    1695     if (!matrix_->allElementsInRange(this,1.0e-20,1.0e20)) {
     1695    if (!matrix_->allElementsInRange(this,smallElement_,1.0e20)) {
    16961696      problemStatus_=4;
    16971697      goodMatrix= false;
  • trunk/ClpSimplexPrimal.cpp

    r111 r112  
    333333    } else {
    334334      // in values pass
    335       if (ifValuesPass>0) {
    336         int sequenceIn=nextSuperBasic();
    337         if (sequenceIn<0) {
    338           ifValuesPass=-1; // signal end of values pass after this
    339         } else {
    340           // normal
    341           sequenceIn_ = sequenceIn;
    342           valueIn_=solution_[sequenceIn_];
    343           lowerIn_=lower_[sequenceIn_];
    344           upperIn_=upper_[sequenceIn_];
    345           dualIn_=dj_[sequenceIn_];
    346         }
    347       } else {
     335      int sequenceIn=nextSuperBasic();
     336      if (sequenceIn<0) {
    348337        // end of values pass - initialize weights etc
    349338        primalColumnPivot_->saveWeights(this,5);
    350         ifValuesPass=0;
    351         if(lastGoodIteration_ != numberIterations_) {
    352           problemStatus_=-2; // factorize now
    353           pivotRow_=-1; // say no weights update
    354           returnCode=-4;
    355           break;
    356         }
    357 
    358         // and get variable
    359         primalColumn(rowArray_[1],rowArray_[2],rowArray_[3],
    360                      columnArray_[0],columnArray_[1]);
     339        problemStatus_=-2; // factorize now
     340        pivotRow_=-1; // say no weights update
     341        returnCode=-4;
     342        break;
     343      } else {
     344        // normal
     345        sequenceIn_ = sequenceIn;
     346        valueIn_=solution_[sequenceIn_];
     347        lowerIn_=lower_[sequenceIn_];
     348        upperIn_=upper_[sequenceIn_];
     349        dualIn_=dj_[sequenceIn_];
    361350      }
    362351    }
     
    374363#endif
    375364      // do second half of iteration
    376       returnCode = pivotResult();
     365      returnCode = pivotResult(ifValuesPass);
    377366      if (returnCode<-1&&returnCode>-5) {
    378367        problemStatus_=-2; //
     
    12601249*/
    12611250int
    1262 ClpSimplexPrimal::pivotResult()
     1251ClpSimplexPrimal::pivotResult(int ifValuesPass)
    12631252{
    12641253
    1265   // Say if values pass
    1266   int ifValuesPass=(firstFree_>=0) ? 1 : 0;
    12671254  bool roundAgain=true;
    12681255  int returnCode=-1;
  • trunk/include/ClpModel.hpp

    r109 r112  
    226226   inline int getNumElements() const
    227227     { return matrix_->getNumElements();};
     228   /** Small element value - elements less than this set to zero,
     229      default is 1.0e-20 */
     230   inline double getSmallElementValue() const
     231  { return smallElement_;};
     232  inline void setSmallElementValue(double value)
     233  { smallElement_=value;};
    228234   /// Row Matrix
    229235   inline ClpMatrixBase * rowCopy() const       { return rowCopy_; }
     
    408414  /// Objective value
    409415  double objectiveValue_;
     416  /// Small element value
     417  double smallElement_;
    410418  /// Number of iterations
    411419  int numberIterations_;
  • trunk/include/ClpSimplexPrimal.hpp

    r111 r112  
    152152      Returns ray in ray_
    153153  */
    154   int pivotResult();
     154  int pivotResult(int ifValuesPass=0);
    155155
    156156
Note: See TracChangeset for help on using the changeset viewer.