Ignore:
Timestamp:
Jan 14, 2009 4:14:09 PM (11 years ago)
Author:
forrest
Message:

out compiler warnings and stability improvements

File:
1 edited

Legend:

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

    r1310 r1321  
    527527  int numberInRowArray = rowArray->getNumElements();
    528528  // maybe I need one in OsiSimplex
    529   double zeroTolerance = model->factorization()->zeroTolerance();
     529  double zeroTolerance = model->zeroTolerance();
     530#if 0 //def COIN_DEVELOP
     531  if (zeroTolerance!=1.0e-13) {
     532    printf("small element in matrix - zero tolerance %g\n",zeroTolerance);
     533  }
     534#endif
    530535  int numberRows = model->numberRows();
    531 #ifndef NO_RTTI
    532   ClpPackedMatrix* rowCopy =
    533     dynamic_cast< ClpPackedMatrix*>(model->rowCopy());
    534 #else
    535536  ClpPackedMatrix* rowCopy =
    536537    static_cast< ClpPackedMatrix*>(model->rowCopy());
    537 #endif
    538538  bool packed = rowArray->packedMode();
    539539  double factor = (numberRows<100) ? 0.25 : 0.35;
     
    762762  int numberInRowArray = rowArray->getNumElements();
    763763  // maybe I need one in OsiSimplex
    764   double zeroTolerance = model->factorization()->zeroTolerance();
     764  double zeroTolerance = model->zeroTolerance();
    765765  bool packed = rowArray->packedMode();
    766766  // do by column
     
    989989  int numberInRowArray = rowArray->getNumElements();
    990990  // maybe I need one in OsiSimplex
    991   double zeroTolerance = model->factorization()->zeroTolerance();
     991  double zeroTolerance = model->zeroTolerance();
    992992  const int * column = matrix_->getIndices();
    993993  const CoinBigIndex * rowStart = getVectorStarts();
     
    10251025      numberNonZero=0;
    10261026      // and set up mark as char array
    1027       char * marked = (char *) markVector;
     1027      char * marked = reinterpret_cast<char *> (markVector);
    10281028      for (i=0;i<numberOriginal;i++) {
    10291029        int iColumn = index[i];
     
    12791279  }
    12801280  // and set up mark as char array
    1281   char * marked = (char *) (index+output->capacity());
     1281  char * marked = reinterpret_cast<char *> (index+output->capacity());
    12821282  int * lookup = spareVector->getIndices();
    12831283  double value = pi0*scalar;
     
    15341534  double * array = dj1->denseVector();
    15351535  int numberInRowArray = pi1->getNumElements();
    1536   double zeroTolerance = model->factorization()->zeroTolerance();
     1536  double zeroTolerance = model->zeroTolerance();
    15371537  bool packed = pi1->packedMode();
    15381538  // do by column
     
    20362036    rowCopyBase = reverseOrderedCopy();
    20372037  }
    2038 #ifndef NO_RTTI
     2038#ifndef NDEBUG
    20392039  ClpPackedMatrix* rowCopy =
    20402040    dynamic_cast< ClpPackedMatrix*>(rowCopyBase);
     
    21442144    return 1;
    21452145  } else {
    2146       // need to scale
     2146      // need to scale
     2147    if (largest>1.0e13*smallest) {
     2148      // safer to have smaller zero tolerance
     2149      double ratio = smallest/largest;
     2150      ClpSimplex * simplex = static_cast<ClpSimplex *> (model);
     2151      double newTolerance = CoinMax(ratio*0.5,1.0e-18);
     2152      if (simplex->zeroTolerance()>newTolerance)
     2153        simplex->setZeroTolerance(newTolerance);
     2154    }
    21472155    int scalingMethod = model->scalingFlag();
    21482156    if (scalingMethod==4) {
     
    24912499      <<overallLargest
    24922500      <<CoinMessageEol;
     2501    if (overallSmallest<1.0e-13) {
     2502      // Change factorization zero tolerance
     2503      double newTolerance = CoinMax(1.0e-15*(overallSmallest/1.0e-13),
     2504                                             1.0e-18);
     2505      ClpSimplex * simplex = static_cast<ClpSimplex *> (model);
     2506      if (simplex->factorization()->zeroTolerance()>newTolerance)
     2507        simplex->factorization()->zeroTolerance(newTolerance);
     2508      newTolerance = CoinMax(overallSmallest*0.5,1.0e-18);
     2509      simplex->setZeroTolerance(newTolerance);
     2510    }
    24932511    delete [] usefulRow;
    24942512    delete [] usefulColumn;
     
    28302848      matrix_->removeGaps();
    28312849#else
    2832       flags_ |= 2;
     2850      checkGaps();
    28332851#endif
    28342852#ifdef COIN_DEVELOP
     
    31063124{
    31073125  numberWanted=currentWanted_;
    3108   int start = (int) (startFraction*numberActiveColumns_);
    3109   int end = CoinMin((int) (endFraction*numberActiveColumns_+1),numberActiveColumns_);
     3126  int start = static_cast<int> (startFraction*numberActiveColumns_);
     3127  int end = CoinMin(static_cast<int> (endFraction*numberActiveColumns_+1),numberActiveColumns_);
    31103128  const double * element =matrix_->getElements();
    31113129  const int * row = matrix_->getIndices();
     
    33583376  columnCopy_=NULL;
    33593377  flags_ &= ~(4+8);
     3378  checkGaps();
    33603379 }
    33613380// makes sure active columns correct
     
    33973416#endif
    33983417    ClpMatrixBase * rowCopyBase=model->rowCopy();
    3399 #ifndef NO_RTTI
     3418#ifndef NDEBUG
    34003419    ClpPackedMatrix* rowCopy =
    34013420      dynamic_cast< ClpPackedMatrix*>(rowCopyBase);
     
    34893508  numberActiveColumns_ = matrix_->getNumCols();
    34903509  // may now have gaps
    3491   flags_ |= 2;
     3510  checkGaps();
    34923511  matrix_->setExtraGap(0.0);
    34933512}
     
    35013520  numberActiveColumns_ = matrix_->getNumCols();
    35023521  // may now have gaps
    3503   flags_ |= 2;
     3522  checkGaps();
    35043523  matrix_->setExtraGap(0.0);
    35053524}
     
    35203539  numberActiveColumns_ = matrix_->getNumCols();
    35213540  // may now have gaps
    3522   flags_ |= 2;
     3541  checkGaps();
    35233542  clearCopies();
    35243543}
     
    43214340  for (iBlock=0;iBlock<numberBlocks_;iBlock++) {
    43224341    double * dwork = work_+6*iBlock;
    4323     int * iwork = (int *) (dwork+3);
     4342    int * iwork = reinterpret_cast<int *> (dwork+3);
    43244343    if (!dualColumn) {
    43254344#ifndef THREAD
     
    45804599  // even if no blocks do a dummy one
    45814600  numberBlocks_ = CoinMax(numberBlocks_,1);
    4582   block_ = (blockStruct *) new char [numberBlocks_*sizeof(blockStruct)];
     4601  block_ = new blockStruct [numberBlocks_];
    45834602  memset(block_,0,numberBlocks_*sizeof(blockStruct));
    45844603  // Fill in what we can
     
    49014920  int * index = output->getIndices();
    49024921  double * array = output->denseVector();
    4903   double zeroTolerance = model->factorization()->zeroTolerance();
     4922  double zeroTolerance = model->zeroTolerance();
    49044923  double value = 0.0;
    49054924  CoinBigIndex j;
     
    50685087  int * index = output->getIndices();
    50695088  double * array = output->denseVector();
    5070   double zeroTolerance = model->factorization()->zeroTolerance();
     5089  double zeroTolerance = model->zeroTolerance();
    50715090  double value = 0.0;
    50725091  bool killDjs = (scaleFactor==0.0);
Note: See TracChangeset for help on using the changeset viewer.