Changeset 1410


Ignore:
Timestamp:
Apr 8, 2009 4:06:33 AM (11 years ago)
Author:
pbonami
Message:

Add MSVisualStudio dir

Location:
trunk/Bonmin
Files:
3 added
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/Bonmin/experimental/NotConvex/BonCouenne.cpp

    r1340 r1410  
    6262    /// update time limit (read/preprocessing might have taken some)
    6363    double timeLimit = 0;
    64     bonmin.options () -> GetNumericValue ("time_limit", timeLimit, "bonmin.");
     64    bonmin.options () -> GetNumericValue ("time_limit", timeLimit, bonmin.prefix());
    6565    bonmin.setDoubleParameter (BabSetupBase::MaxTime,
    6666                               timeLimit - (time_start = (CoinCpuTime () - time_start)));
     
    138138
    139139      double timeLimit = 0, obj = bb.model (). getObjValue ();
    140       bonmin.options() -> GetNumericValue ("time_limit", timeLimit, "bonmin.");
     140      bonmin.options() -> GetNumericValue ("time_limit", timeLimit, bonmin.prefix());
    141141
    142142      if (CoinCpuTime () - time_start > timeLimit) {
  • trunk/Bonmin/src/Algorithms/BonBonminSetup.cpp

    r1407 r1410  
    604604      o_name = prefix_ + "nlp_solve_frequency";
    605605      options_->SetIntegerValue(o_name.c_str(), 0, true, true);
     606      o_name = prefix_ + "cutoff_decr";
     607      options_->SetNumericValue(o_name.c_str(), 1e-02, true, true);
    606608      intParam_[BabLogLevel] = 0;
    607609    }
  • trunk/Bonmin/src/Algorithms/BonSolverHelp.cpp

    r1402 r1410  
    119119    delete basis;
    120120    throw CoinError("Fail setWarmStart() after cut installation.",
    121         "generateCuts","OACutGenerator2") ;
     121                    "generateCuts","OACutGenerator2") ;
    122122  }
    123123  delete basis;
  • trunk/Bonmin/src/Algorithms/BonSubMipSolver.cpp

    r1407 r1410  
    7575
    7676     if(clp_){
    77       if (!strategy_)
    78         strategy_ = new CbcStrategyDefault(1,0,0, loglevel);
    79 
     77      if (!strategy_){
     78        CbcStrategyDefault * strat = new CbcStrategyDefault(1,0,0, loglevel);
     79        strat->setupPreProcessing();
     80        strategy_ = strat;
     81      }
    8082      OsiBabSolver empty;
    8183      if (cbc_) delete cbc_;
     
    9799      cbc_->setCutoff(cutoff);
    98100
     101      cbc_->solver()->writeMpsNative("FP.mps", NULL, NULL, 1);
     102     
    99103      cbc_->branchAndBound();
    100104      lowBound_ = cbc_->getBestPossibleObjValue();
     
    165169  {
    166170    if (clp_) {
    167       if (!strategy_)
    168         strategy_ = new CbcStrategyDefault(1,0,0, loglevel);
     171      if (!strategy_){
     172        CbcStrategyDefault * strat = new CbcStrategyDefault(1,0,0, loglevel);
     173        strat->setupPreProcessing();
     174        strategy_ = strat;
     175      }
    169176
    170177      OsiBabSolver empty;
     
    186193      cbc_->setCutoff(cutoff);
    187194
     195      cbc_->solver()->writeMpsNative("FP.mps", NULL, NULL, 1);
    188196      cbc_->branchAndBound();
    189197      lowBound_ = cbc_->getBestPossibleObjValue();
  • trunk/Bonmin/src/Algorithms/OaGenerators/BonFpForMinlp.cpp

    r1407 r1410  
    133133      lp->initialSolve();
    134134      lp->setColUpper(numcols, cutoff);
    135       subMip->find_good_sol(DBL_MAX, parameters_.subMilpLogLevel_,
     135      //subMip->find_good_sol(DBL_MAX, parameters_.subMilpLogLevel_,
     136      subMip->optimize(DBL_MAX, parameters_.subMilpLogLevel_,
    136137          (parameters_.maxLocalSearchTime_ + timeBegin_ - CoinCpuTime()) /* time limit */,
    137138          parameters_.localSearchNodeLimit_);
     
    140141      colsol = subMip->getLastSolution();
    141142      nLocalSearch_++;
    142 
     143      if(milpOptimal)
     144        handler_->message(SOLVED_LOCAL_SEARCH, messages_)
     145        <<subMip->nodeCount()<<subMip->iterationCount()<<CoinMessageEol;
     146      else
     147        handler_->message(LOCAL_SEARCH_ABORT, messages_)
     148        <<subMip->nodeCount()<<subMip->iterationCount()<<CoinMessageEol;
    143149    }
    144150    int numberPasses = 0;
     
    172178      <<dist<<CoinMessageEol;
    173179
    174       if(dist < 1e-06){
     180      if(dist < 1e-05){
    175181         fixIntegers(*nlp_,info, parameters_.cbcIntegerTolerance_, objects_, nObjects_);
    176182
    177183         nlp_->resolve();
     184         bool restart = false;
    178185         if (post_nlp_solve(babInfo, cutoff)) {
     186           restart = true;
    179187           //nlp is solved and feasible
    180188           // Update the cutoff
    181            //cutoff = nlp_->getObjValue() * (1 - 10*parameters_.cbcCutoffIncrement_);
    182            cutoff = nlp_->getObjValue() - parameters_.cbcCutoffIncrement_;
     189           printf("Cutoff increment %g\n", parameters_.cbcCutoffIncrement_);
     190           cutoff = nlp_->getObjValue() -
     191                    parameters_.cbcCutoffIncrement_;
    183192           cutoff = nlp_->getObjValue() - 0.1;
     193           printf("New cutoff value %g\n", cutoff);
    184194           numSols_++;
     195         }
     196         else{
     197           //nlp_->setColLower(savedColLower());
     198           //nlp_->setColUpper(savedColUpper());
     199           //dist = nlp_->solveFeasibilityProblem(indices.size(), x_bar(), indices(), 1, 0, 2);
    185200         }
    186201         nlpSol = const_cast<double *>(nlp_->getColSolution());
    187202         nlp_->getOuterApproximation(cs, nlpSol, 1, NULL,
    188203                                  parameter().global_);
    189          nlp_->setColLower(savedColLower());
    190          nlp_->setColUpper(savedColUpper());
    191          nlp_->resolve();
     204         //if(restart){
     205           nlp_->setColLower(savedColLower());
     206           nlp_->setColUpper(savedColUpper());
     207         if(restart)
     208           nlp_->resolve();
     209         //}
    192210      }
    193211      else {
     
    221239
    222240     
    223         subMip->find_good_sol(DBL_MAX, parameters_.subMilpLogLevel_,
    224             parameters_.maxLocalSearchTime_ + timeBegin_ - CoinCpuTime(),
    225             parameters_.localSearchNodeLimit_);
     241        //subMip->find_good_sol(DBL_MAX, parameters_.subMilpLogLevel_,
     242        subMip->optimize(DBL_MAX, parameters_.subMilpLogLevel_,
     243                         parameters_.maxLocalSearchTime_ + timeBegin_ - CoinCpuTime(),
     244                         parameters_.localSearchNodeLimit_);
    226245        milpOptimal = subMip -> optimal();
    227246        colsol = subMip->getLastSolution();
     247      if(milpOptimal)
     248        handler_->message(SOLVED_LOCAL_SEARCH, messages_)<<subMip->nodeCount()<<subMip->iterationCount()<<CoinMessageEol;
     249      else
     250        handler_->message(LOCAL_SEARCH_ABORT, messages_)<<subMip->nodeCount()<<subMip->iterationCount()<<CoinMessageEol;
    228251      if(colsol)
    229252        handler_->message(FP_MILP_VAL, messages_)
  • trunk/Bonmin/src/Algorithms/OaGenerators/BonOACutGenerator2.cpp

    r1407 r1410  
    3333    std::string prefix = (b.prefix() == bonmin) ? "" : b.prefix();
    3434    prefix += "oa_decomposition.";
    35     b.options()->GetEnumValue("milp_subsolver",ivalue,prefix);
     35    b.options()->GetEnumValue("milp_solver",ivalue,prefix);
    3636    if (ivalue <= 0) {//uses cbc
    3737      //nothing to do?
  • trunk/Bonmin/src/Algorithms/OaGenerators/BonOAMessages.cpp

    r1407 r1410  
    3131    ADD_MSG(PERIODIC_MSG, std_m,1,"After %7.1f seconds, upper bound %10g, lower bound %10g");
    3232    ADD_MSG(FP_DISTANCE, std_m,1,"NLP solution is %g from MILP sol");
    33     ADD_MSG(FP_MILP_VAL, std_m,1,"MILP solution has value w.r.t original objective: %g");
     33    ADD_MSG(FP_MILP_VAL, std_m,1,"MILP solution has value w.r.t original objective: %10g");
    3434  }
    3535
  • trunk/Bonmin/src/Apps/BonMin.cpp

    r1371 r1410  
    2121#include "BonCbc.hpp"
    2222
     23#define CATCH_ERRORS
    2324using namespace Bonmin;
    2425int main (int argc, char *argv[])
Note: See TracChangeset for help on using the changeset viewer.