Changeset 1650 for trunk/Clp


Ignore:
Timestamp:
Dec 20, 2010 7:39:29 AM (9 years ago)
Author:
forrest
Message:

save some memory

File:
1 edited

Legend:

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

    r1612 r1650  
    421421     if (!status_)
    422422          allSlackBasis();
    423      ClpPresolve pinfo;
    424      pinfo.setSubstitution(options.substitution());
     423     ClpPresolve * pinfo = new ClpPresolve();
     424     pinfo->setSubstitution(options.substitution());
    425425     int presolveOptions = options.presolveActions();
    426426     bool presolveToFile = (presolveOptions & 0x40000000) != 0;
    427427     presolveOptions &= ~0x40000000;
    428428     if ((presolveOptions & 0xffff) != 0)
    429           pinfo.setPresolveActions(presolveOptions);
     429          pinfo->setPresolveActions(presolveOptions);
    430430     // switch off singletons to slacks
    431      //pinfo.setDoSingletonColumn(false); // done by bits
     431     //pinfo->setDoSingletonColumn(false); // done by bits
    432432     int printOptions = options.getSpecialOption(5);
    433433     if ((printOptions & 1) != 0)
    434           pinfo.statistics();
     434          pinfo->statistics();
    435435     double timePresolve = 0.0;
    436436     double timeIdiot = 0.0;
     
    463463               costedSlacks = true;
    464464               // switch on singletons to slacks
    465                pinfo.setDoSingletonColumn(true);
     465               pinfo->setDoSingletonColumn(true);
    466466               // gub stuff for testing
    467                //pinfo.setDoGubrow(true);
     467               //pinfo->setDoGubrow(true);
    468468          }
    469469#ifndef CLP_NO_STD
     
    471471               // PreSolve to file - not fully tested
    472472               printf("Presolving to file - presolve.save\n");
    473                pinfo.presolvedModelToFile(*this, "presolve.save", dblParam_[ClpPresolveTolerance],
     473               pinfo->presolvedModelToFile(*this, "presolve.save", dblParam_[ClpPresolveTolerance],
    474474                                          false, numberPasses);
    475475               model2 = this;
    476476          } else {
    477477#endif
    478                model2 = pinfo.presolvedModel(*this, dblParam_[ClpPresolveTolerance],
     478               model2 = pinfo->presolvedModel(*this, dblParam_[ClpPresolveTolerance],
    479479                                             false, numberPasses, true, costedSlacks);
    480480#ifndef CLP_NO_STD
     
    494494               problemStatus_ = 1; // may be unbounded but who cares
    495495               if (options.infeasibleReturn() || (moreSpecialOptions_ & 1) != 0) {
     496                 delete pinfo;
    496497                    return -1;
    497498               }
     
    503504              if (rcode==2) {
    504505                  delete model2;
     506                 delete pinfo;
    505507                  return -2;
    506508              } else if (rcode==3) {
    507509                  delete model2;
     510                 delete pinfo;
    508511                  return -3;
    509512              }
    510513          }
     514          model2->setMoreSpecialOptions(model2->moreSpecialOptions()&(~1024));
    511515          model2->eventHandler()->setSimplex(model2);
    512516          // We may be better off using original (but if dual leave because of bounds)
     
    24692473          else
    24702474               setLogLevel(CoinMin(0, saveLevel));
    2471           pinfo.postsolve(true);
     2475          pinfo->postsolve(true);
     2476          delete pinfo;
     2477          pinfo = NULL;
    24722478          factorization_->areaFactor(model2->factorization()->adjustedAreaFactor());
    24732479          time2 = CoinCpuTime();
     
    25772583     }
    25782584     eventHandler()->event(ClpEventHandler::presolveEnd);
     2585     delete pinfo;
    25792586     return finalStatus;
    25802587}
     
    27012708{
    27022709}
    2703 // See header file for deatils
     2710// See header file for details
    27042711void
    27052712ClpSolve::setSpecialOption(int which, int value, int extraInfo)
Note: See TracChangeset for help on using the changeset viewer.