Changeset 1445


Ignore:
Timestamp:
Jan 27, 2019 11:51:56 AM (3 months ago)
Author:
forrest
Message:

fix sign

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Cgl/src/CglPreProcess/CglPreProcess.cpp

    r1441 r1445  
    20262026              jColumn, move, move * rhs);
    20272027#endif
    2028           offset -= move * multiply * rhs;
     2028          offset += move * multiply * rhs;
    20292029          for (CoinBigIndex j = rowStart[iRow]; j < rowStart[iRow] + rowLength[iRow]; j++) {
    20302030            int iColumn = column[j];
     
    20752075    //presolveActions |= 2;
    20762076    // allow transfer of costs
    2077     // presolveActions |= 4;
     2077    //presolveActions |= 4; can be slow
    20782078    // If trying for SOS don't allow some transfers
    20792079    if (makeEquality == 2 || makeEquality == 3)
     
    20982098    oldModel->messageHandler()->setLogLevel(saveLogLevel);
    20992099    if (presolvedModel) {
     2100      //#define MAKE_LESS_THAN
     2101#ifdef MAKE_LESS_THAN
     2102      {
     2103        int numberRows = presolvedModel->getNumRows();
     2104        int numberColumns = presolvedModel->getNumCols();
     2105        CoinPackedMatrix *matrix = presolvedModel->getMutableMatrixByCol();
     2106        const int *row = matrix->getIndices();
     2107        const CoinBigIndex *columnStart = matrix->getVectorStarts();
     2108        const int *columnLength = matrix->getVectorLengths();
     2109        double *element = const_cast< double * >(matrix->getElements());
     2110        const double *rowLower = presolvedModel->getRowLower();
     2111        const double *rowUpper = presolvedModel->getRowUpper();
     2112        for (int iColumn = 0; iColumn < numberColumns; iColumn++) {
     2113          for (CoinBigIndex j = columnStart[iColumn];
     2114               j < columnStart[iColumn] + columnLength[iColumn]; j++) {
     2115            int iRow = row[j];
     2116            if (rowUpper[iRow] == COIN_DBL_MAX)
     2117              element[j] = -element[j];
     2118          }
     2119        }
     2120        for (int iRow = 0; iRow < numberRows; iRow++) {
     2121          if (rowUpper[iRow] == COIN_DBL_MAX) {
     2122            presolvedModel->setRowUpper(iRow, -rowLower[iRow]);
     2123            presolvedModel->setRowLower(iRow, -COIN_DBL_MAX);
     2124          }
     2125        }
     2126      }
     2127#endif
    21002128      presolvedModel->messageHandler()->setLogLevel(saveLogLevel);
    21012129      //presolvedModel->writeMps("new");
     
    24032431      else
    24042432        presolveActions = 16; // actually just switch off duplicate columns for ints
     2433      if ((tuning & 32) != 0)
     2434        presolveActions |= 32;
    24052435      // Do not allow all +1 to be tampered with
    24062436      //if (allPlusOnes)
     
    51525182          int saveMaxProbe = probingCut->getMaxProbeRoot();
    51535183          int saveMaxLook = probingCut->getMaxLookRoot();
    5154           if (!iBigPass && !iPass /*&&(options_&(16|64))!=0*/) {
     5184          if ((!iBigPass||(options_&64)!=0)&&!iPass&&(options_&(16|64))!=0) {
     5185            //if (/*!iBigPass &&*/ !iPass /*&&(options_&(16|64))!=0*/) {
    51555186            noStrengthening = true;
    51565187            numberPasses = 1;
Note: See TracChangeset for help on using the changeset viewer.