Changeset 1447


Ignore:
Timestamp:
Feb 13, 2019 8:45:17 AM (2 months ago)
Author:
forrest
Message:

simple preprocessing and fix negative SOS values

File:
1 edited

Legend:

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

    r1446 r1447  
    11661166    //minimumLength = tuning;
    11671167  }
    1168   numberSolvers_ = numberPasses;
     1168  if (numberPasses != 99) {
     1169    numberSolvers_ = numberPasses;
     1170  } else {
     1171    numberSolvers_ = 1;
     1172  }
    11691173  model_ = new OsiSolverInterface *[numberSolvers_];
    11701174  modifiedModel_ = new OsiSolverInterface *[numberSolvers_];
     
    11801184  originalColumn_ = NULL;
    11811185  originalRow_ = NULL;
     1186  if (numberPasses==99) {
     1187    // keep very simple
     1188    OsiSolverInterface *presolvedModel;
     1189    OsiPresolve *pinfo = new OsiPresolve();
     1190    int presolveActions = 0;
     1191    // Allow dual stuff on integers
     1192    // Allow stuff which may not unroll cleanly - unless told not to
     1193    if ((tuning & 4096) == 0)
     1194      presolveActions = 1 + 16;
     1195    else
     1196      presolveActions = 16; // actually just switch off duplicate columns for ints
     1197    if ((tuning & 32) != 0)
     1198      presolveActions |= 32;
     1199    presolveActions |= 8;
     1200    pinfo->setPresolveActions(presolveActions);
     1201    if (prohibited_)
     1202      assert(numberProhibited_ == originalModel_->getNumCols());
     1203    presolvedModel =
     1204      pinfo->presolvedModel(*originalModel_, 1.0e-7, true,
     1205                            5, prohibited_, true, rowType_);
     1206    startModel_ = originalModel_;
     1207    if (presolvedModel) {
     1208      // update prohibited and rowType
     1209      update(pinfo, presolvedModel);
     1210      model_[0] = presolvedModel;
     1211      presolve_[0] = pinfo;
     1212      modifiedModel_[0] = presolvedModel->clone();
     1213      createOriginalIndices();
     1214      numberSolvers_ = 99; // mark as odd
     1215      return modifiedModel_[0];
     1216    } else {
     1217      numberSolvers_ = 1;
     1218    }
     1219  }
    11821220  //startModel_=&model;
    11831221  // make clone
     
    35983636      modelM->setWarmStart(&empty);
    35993637    }
     3638    if (numberSolvers_==99) {
     3639      // was simple presolve
     3640      numberSolvers_ = 1;
     3641    }
    36003642    for (int iPass = numberSolvers_ - 1; iPass >= 0; iPass--) {
    36013643      OsiSolverInterface *model = model_[iPass];
     
    36313673            if (columnUpper2[iColumn] > columnLower2[iColumn] && !model->isInteger(iColumn)) {
    36323674              model->setColUpper(iColumn, columnLower[iColumn]);
     3675              model->setColLower(iColumn, columnLower[iColumn]);
    36333676            }
    36343677          }
     
    38383881                columnLower[iColumn], columnUpper[iColumn]);
    38393882#endif
     3883              modelM2->setColLower(jColumn, value);
    38403884              modelM2->setColUpper(jColumn, value);
    38413885            }
     
    39143958        if (columnUpper2[iColumn] > columnLower2[iColumn] && !model->isInteger(iColumn)) {
    39153959          model->setColUpper(iColumn, columnLower[iColumn]);
     3960          model->setColLower(iColumn, columnLower[iColumn]);
    39163961        }
    39173962      }
Note: See TracChangeset for help on using the changeset viewer.