Changeset 468


Ignore:
Timestamp:
Oct 7, 2004 2:13:58 PM (15 years ago)
Author:
forrest
Message:

to make sbb faster

Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/ClpPackedMatrix.cpp

    r466 r468  
    17701770   probably expect no zeros.  Code can modify matrix to get rid of
    17711771   small elements.
     1772   check bits (can be turned off to save time) :
     1773   1 - check if matrix has gaps
     1774   2 - check if zero elements
     1775   4 - check and compress duplicates
     1776   8 - report on large and small
    17721777*/
    17731778bool
    17741779ClpPackedMatrix::allElementsInRange(ClpModel * model,
    1775                                     double smallest, double largest)
     1780                                    double smallest, double largest,
     1781                                    int check)
    17761782{
    17771783  int iColumn;
     
    17911797  int numberRows = matrix_->getNumRows();
    17921798  int numberColumns = matrix_->getNumCols();
     1799  // Say no gaps
     1800  hasGaps_=false;
     1801  if (check==14) {
     1802    for (iColumn=0;iColumn<numberColumns;iColumn++) {
     1803      CoinBigIndex start = columnStart[iColumn];
     1804      CoinBigIndex end = start + columnLength[iColumn];
     1805      if (end!=columnStart[iColumn+1]) {
     1806        hasGaps_=true;
     1807        break;
     1808      }
     1809    }
     1810    return true;
     1811  }
     1812  assert (check=15);
    17931813  int * mark = new int [numberRows];
    17941814  int i;
    1795   // Say no gaps
    1796   hasGaps_=false;
    17971815  for (i=0;i<numberRows;i++)
    17981816    mark[i]=-1;
  • trunk/ClpQuadraticObjective.cpp

    r463 r468  
    382382      double direction = model->optimizationDirection()*model->objectiveScale();
    383383      // direction is actually scale out not scale in
    384       if (direction)
    385         direction = 1.0/direction;
     384      //if (direction)
     385      //direction = 1.0/direction;
    386386      const int * columnQuadratic = quadraticObjective_->getIndices();
    387387      const CoinBigIndex * columnQuadraticStart = quadraticObjective_->getVectorStarts();
     
    462462      }
    463463    }
    464     offset *= model->optimizationDirection()*model->objectiveScale();
     464    offset *= model->optimizationDirection();
    465465    return gradient_;
    466466  }
  • trunk/ClpSimplex.cpp

    r460 r468  
    22492249    }
    22502250  }
     2251  bool doSanityCheck=true;
    22512252  if ((what&(16+32))!=0) {
     2253    // We may want to switch stuff off for speed
     2254    if ((specialOptions_&256)!=0)
     2255      makeRowCopy=false; // no row copy
     2256    if ((specialOptions_&128)!=0)
     2257      doSanityCheck=false; // no sanity check
    22522258    // move information to work arrays
    22532259    double direction = optimizationDirection_;
     
    23112317    if (!matrix_)
    23122318      matrix_=new ClpPackedMatrix();
    2313     if (!matrix_->allElementsInRange(this,smallElement_,1.0e20)) {
     2319    int checkType=(doSanityCheck) ? 15 : 14;
     2320    if (!matrix_->allElementsInRange(this,smallElement_,1.0e20,checkType)) {
    23142321      problemStatus_=4;
    23152322      goodMatrix= false;
     
    25402547  }
    25412548 
    2542   if ((what&16)!=0) {
     2549  if ((what&16)!=0&&doSanityCheck) {
    25432550    // check rim of problem okay
    25442551    if (!sanityCheck())
     
    55035510  saved.pivotTolerance_ = factorization_->pivotTolerance();
    55045511  saved.perturbation_ = perturbation_;
     5512  saved.forceFactorization_=forceFactorization_;
    55055513  // Progress indicator
    55065514  delete progress_;
     
    55175525  infeasibilityCost_ = saved.infeasibilityCost_;
    55185526  dualBound_ = saved.dualBound_;
     5527  forceFactorization_=saved.forceFactorization_;
    55195528  delete progress_;
    55205529  progress_=NULL;
  • trunk/include/ClpMatrixBase.hpp

    r461 r468  
    9999      probably expect no zeros.  Code can modify matrix to get rid of
    100100      small elements.
     101      check bits (can be turned off to save time) :
     102      1 - check if matrix has gaps
     103      2 - check if zero elements
     104      4 - check and compress duplicates
     105      8 - report on large and small
    101106  */
    102107  virtual bool allElementsInRange(ClpModel * model,
    103                                   double smallest, double largest)
     108                                  double smallest, double largest,
     109                                  int check=15)
    104110  { return true;};
    105111  /** Returns largest and smallest elements of both signs.
  • trunk/include/ClpModel.hpp

    r464 r468  
    701701  int sparseThreshold_;
    702702  int perturbation_;
     703  int forceFactorization_;
    703704
    704705  //@}
  • trunk/include/ClpPackedMatrix.hpp

    r461 r468  
    9999      probably expect no zeros.  Code can modify matrix to get rid of
    100100      small elements.
     101      check bits (can be turned off to save time) :
     102      1 - check if matrix has gaps
     103      2 - check if zero elements
     104      4 - check and compress duplicates
     105      8 - report on large and small
    101106  */
    102107  virtual bool allElementsInRange(ClpModel * model,
    103                                   double smallest, double largest);
     108                                  double smallest, double largest,
     109                                  int check=15);
    104110  /** Returns largest and smallest elements of both signs.
    105111      Largest refers to largest absolute value.
  • trunk/include/ClpSimplex.hpp

    r451 r468  
    806806      32 -Clean up with primal before strong branching
    807807      64 -Treat problem as feasible until last minute (i.e. minimize infeasibilities)
     808      128 - Switch off all matrix sanity checks
     809      256 - No row copy
    808810  */
    809811  inline unsigned int specialOptions() const
Note: See TracChangeset for help on using the changeset viewer.