Changeset 469


Ignore:
Timestamp:
Oct 7, 2004 4:50:41 PM (15 years ago)
Author:
forrest
Message:

presolve to file

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/ClpPresolve.cpp

    r461 r469  
    112112  } else {
    113113    si.restoreModel(saveFile_.c_str());
     114    remove(saveFile_.c_str());
    114115    return 1;
    115116  }
     
    204205    assert (originalModel_==presolvedModel_);
    205206    originalModel_->restoreModel(saveFile_.c_str());
     207    remove(saveFile_.c_str());
    206208    memcpy(originalModel_->primalRowSolution(),acts,nrows0*sizeof(double));
    207209    // delete [] acts;
  • trunk/ClpSimplexNonlinear.cpp

    r451 r469  
    4949    // for moment only if no scaling
    5050    // May be faster if switched off - but can't see why
    51     if (!quadraticObj->fullMatrix()&&!rowScale_) {
     51    if (!quadraticObj->fullMatrix()&&!rowScale_&&objectiveScale_==1.0) {
    5252      saveObjective = objective_;
    5353      objective_=new ClpQuadraticObjective(*quadraticObj,1);
     
    175175  if (numberColumns_)
    176176    objectiveValue_ = nonLinearCost_->feasibleCost()+objective_->nonlinearOffset();
     177  objectiveValue_ /= (objectiveScale_*rhsScale_);
    177178  // clean up
    178179  unflag();
  • trunk/ClpSolve.cpp

    r461 r469  
    9393  ClpPresolve pinfo;
    9494  int presolveOptions = options.getSpecialOption(4);
     95  bool presolveToFile = (presolveOptions&0x40000000)!=0;
     96  presolveOptions &= ~0x40000000;
    9597  if ((presolveOptions&0xffff)!=0)
    9698    pinfo.setPresolveActions(presolveOptions);
     
    213215  // Just do this number of passes in Sprint
    214216  int maxSprintPass=100;
    215   // PreSolve to file - not fully tested
    216   bool presolveToFile=false;
    217217
    218218  if (presolve!=ClpSolve::presolveOff) {
     
    223223    }
    224224    if (presolveToFile) {
    225       printf("***** temp test\n");
    226       pinfo.presolvedModelToFile(*this,"ss.sav",1.0e-8,
     225      // PreSolve to file - not fully tested
     226      printf("Presolving to file - presolve.save\n");
     227      pinfo.presolvedModelToFile(*this,"presolve.save",1.0e-8,
    227228                           false,numberPasses);
    228229      model2=this;
  • trunk/Test/ClpMain.cpp

    r467 r469  
    903903    // set reasonable defaults
    904904    int preSolve=5;
     905    bool preSolveFile=false;
    905906    models->setPerturbation(50);
    906907    models->messageHandler()->setPrefix(false);
     
    13111312    parameters[numberParameters-1].append("off");
    13121313    parameters[numberParameters-1].append("more");
     1314    parameters[numberParameters-1].append("file");
    13131315    parameters[numberParameters-1].setLonghelp
    13141316      (
     
    17781780              else if (action==1)
    17791781                preSolve=0;
     1782              else if (action==2)
     1783                preSolve=10;
    17801784              else
    1781                 preSolve=10;
     1785                preSolveFile=true;
    17821786              break;
    17831787            case CRASH:
     
    18441848              }
    18451849              solveOptions.setSolveType(method);
     1850              if(preSolveFile)
     1851                presolveOptions |= 0x40000000;
    18461852              solveOptions.setSpecialOption(4,presolveOptions);
    18471853              solveOptions.setSpecialOption(5,printOptions);
Note: See TracChangeset for help on using the changeset viewer.