Changeset 536


Ignore:
Timestamp:
May 11, 2007 4:30:04 AM (12 years ago)
Author:
pbonami
Message:

Fix a few options with new setup:

  • warm start
  • log-level for nlp-solver in B-BB
Location:
trunk/Bonmin
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/Bonmin/examples/CppExample/Makefile.in

    r67 r536  
    5252# Libraries necessary to link with Bonmin
    5353IPOPTLIBDIR = @IPOPTLIBDIR@
     54
     55#Librairies for ASL (needed by Cbc)
     56ASLLIB = @ASLLIB@
     57
     58
    5459LIBS = -L$(COINLIBDIR) \
    5560        -lbonmin -lipopt \
    56        -lCbc -lCgl -lOsiClp -lOsi -lClp -lCoinUtils\
    57         @ADDLIBS@ \
     61       -lCbc -lCgl -lOsiClp -lOsi -lClp -lCoinUtils \
     62        $(ASLLIB) @ADDLIBS@ \
    5863        `cat $(COINLIBDIR)/ipopt_addlibs_cpp.txt` \
    5964        `cat $(COINLIBDIR)/cgl_addlibs.txt` \
  • trunk/Bonmin/examples/CppExample/MyTMINLP.cpp

    r496 r536  
    88// Date :  03/17/2006
    99#include "MyTMINLP.hpp"
    10 
     10#include "BonAmplInterface.hpp"
    1111
    1212bool
  • trunk/Bonmin/experimental/Bcp/BM_pack.cpp

    r530 r536  
    7676      continuous relaxation should not be created.*/
    7777    bonmin_.initializeBonmin(argv, ipopt_content, nl_content, false);
    78     bonmin_.nonlinearSolver()->Set_expose_warm_start(true);
     78    bonmin_.nonlinearSolver()->setExposeWarmStart(true);
    7979    babSolver_.setSolver(bonmin_.nonlinearSolver());
    8080
  • trunk/Bonmin/src/Algorithms/BonBonminSetup.cpp

    r514 r536  
    8484
    8585    use(tminlp);
     86    BabSetupBase::gatherParametersValues(options_);
    8687    Algorithm algo = getAlgorithm();
    8788    if(algo == B_BB)
     
    9495  BonminSetup::initializeBonmin(const OsiTMINLPInterface &nlpSi, bool createContinuousSolver /*= false*/){
    9596    use(nlpSi);
     97    BabSetupBase::gatherParametersValues(options_);
    9698    Algorithm algo = getAlgorithm();
    9799    if(algo == B_BB)
     
    337339    delete extraStuff;
    338340    }
    339    
    340341    Algorithm algo = getAlgorithm();
    341342    if(algo == B_OA){
  • trunk/Bonmin/src/CbcBonmin/BonCbc2.cpp

    r508 r536  
    9797    OsiSolverInterface * solver = s.continuousSolver()->clone();
    9898    model_.assignSolver(solver, true);
     99
     100  //  s.continuousSolver() = model_.solver();
    99101   
    100102   
     
    138140    }
    139141   
     142   
     143    //need to record solver logLevel here
     144    int logLevel = s.continuousSolver()->messageHandler()->logLevel();
     145   
    140146    //Set true branch-and-bound parameters
    141147    model_.setLogLevel(s.getIntParameter(BabSetupBase::BabLogLevel));   
     148   
     149    // Put back solver logLevel
     150    model_.solver()->messageHandler()->setLogLevel(logLevel);
     151   
    142152    model_.setPrintFrequency(s.getIntParameter(BabSetupBase::BabLogInterval));
    143153       
  • trunk/Bonmin/src/Interfaces/BonOsiTMINLPInterface.cpp

    r519 r536  
    299299    veryTiny_(1e-20),
    300300    infty_(1e100),
    301     expose_warm_start_(false),
     301    exposeWarmStart_(false),
    302302    firstSolve_(true)
    303303{
     
    418418    veryTiny_(source.veryTiny_),
    419419    infty_(source.infty_),
    420     expose_warm_start_(source.expose_warm_start_),
     420    exposeWarmStart_(source.exposeWarmStart_),
    421421    firstSolve_(true),
    422422    cut_strengthener_(source.cut_strengthener_)
    423423{
     424      messageHandler()->setLogLevel(source.messageHandler()->logLevel());
    424425  // Copy options from old application
    425426  if(IsValid(source.tminlp_)) {
     
    532533      veryTiny_ = rhs.veryTiny_;
    533534      infty_ = rhs.infty_;
    534       expose_warm_start_ = rhs.expose_warm_start_;
     535      exposeWarmStart_ = rhs.exposeWarmStart_;
    535536
    536537    }
     
    11821183OsiTMINLPInterface::getWarmStart() const
    11831184{
    1184   if (expose_warm_start_) {
     1185  if (exposeWarmStart_) {
    11851186    return app_->getWarmStart(problem_);
    11861187  }
     
    11951196{
    11961197  hasBeenOptimized_ = false;
    1197   if (expose_warm_start_) {
     1198  if (exposeWarmStart_) {
    11981199    return app_->setWarmStart(warmstart, problem_);
    11991200  }
     
    24762477    }
    24772478#endif
     2479   
     2480   
     2481    int exposeWs = false;
     2482    app_->Options()->GetEnumValue("warm_start", exposeWs, "bonmin.");
     2483    setExposeWarmStart(exposeWs > 0);
     2484   
    24782485    app_->Options()->GetIntegerValue("num_retry_unsolved_random_point", numRetryUnsolved_,"bonmin.");
    24792486    app_->Options()->GetIntegerValue("num_resolve_at_root", numRetryInitial_,"bonmin.");
  • trunk/Bonmin/src/Interfaces/BonOsiTMINLPInterface.hpp

    r519 r536  
    529529  virtual bool setWarmStart(const CoinWarmStart* warmstart);
    530530
    531   void Set_expose_warm_start(bool expose_warm_start) {
    532     expose_warm_start_ = expose_warm_start;
     531  void setExposeWarmStart(bool value) {
     532    exposeWarmStart_ = value;
    533533  }
    534534
     
    10371037  /** status of last optimization. */
    10381038  TNLPSolver::ReturnStatus optimization_status_;
    1039   /** Flag indicating if the warm start methods actually do something. \TODO: FIX TO OPTION */
    1040   bool expose_warm_start_;
     1039  /** Flag indicating if the warm start methods actually do something.*/
     1040  bool exposeWarmStart_;
    10411041  /** Is it the first solve (for random starting point at root options).*/
    10421042  bool firstSolve_;
  • trunk/Bonmin/test/InterfaceTest.cpp

    r481 r536  
    273273       bonmin.initializeBonmin(amplSi,const_cast<char **&>(argv));
    274274       OsiTMINLPInterface& si = *bonmin.nonlinearSolver();
    275       si.Set_expose_warm_start(1);
     275      si.setExposeWarmStart(true);
    276276    std::cout<<"---------------------------------------------------------------------------------------------------------------------------------------------------------"
    277277    <<std::endl<<"Testing usefull constructor"<<std::endl
     
    307307      bonmin.initializeBonmin(amplSi,const_cast<char **&>(argv));     
    308308      OsiTMINLPInterface& si1 = *bonmin.nonlinearSolver();
    309       si1.Set_expose_warm_start(1);
     309      si1.setExposeWarmStart(true);
    310310     
    311311      OsiTMINLPInterface si(si1);
     
    329329        bonmin.initializeBonmin(amplSi,const_cast<char **&>(argv));     
    330330        OsiTMINLPInterface& si = *bonmin.nonlinearSolver();
    331         si.Set_expose_warm_start(1);
     331        si.setExposeWarmStart(true);
    332332        std::cout<<"---------------------------------------------------------------------------------------------------------------------------------------------------------"
    333333          <<std::endl<<"Testing outer approximations related methods"<<std::endl
  • trunk/Bonmin/test/Makefile.am

    r481 r536  
    1313########################################################################
    1414
    15 noinst_PROGRAMS = unitTest CppExample
     15noinst_PROGRAMS =
     16
     17if COIN_HAS_ASL
     18noinst_PROGRAMS += unitTest
     19endif
     20
     21noinst_PROGRAMS += CppExample
    1622
    1723unitTest_SOURCES = \
     
    2430        $(IPOPTOBJDIR)/src/Apps/AmplSolver/libamplinterface.la \
    2531        $(IPOPTLIBS) \
    26         $(LIBCBCCOPY) \
    2732        $(COINLIBS) \
    2833        $(ASLLIB) \
     
    3641
    3742# List libraries of COIN projects
    38 CppExample_LDADD = ../src/CbcBonmin/libbonmin.la \
     43CppExample_LDADD = \
     44        ../src/CbcBonmin/libbonminampl.la \
     45        ../src/CbcBonmin/libbonmin.la \
     46        $(IPOPTOBJDIR)/src/Apps/AmplSolver/libamplinterface.la \
    3947        $(IPOPTLIBS) \
    40         $(LIBCBCCOPY) \
    41         $(COINLIBS) \
    42         $(ADDLIBS)
     48        $(COINLIBS)
     49
     50if COIN_HAS_ASL
     51CppExample_LDADD += $(ASLLIB)
     52endif
     53
     54CppExample_LDADD += $(ADDLIBS)
    4355
    4456COINLIBS = \
  • trunk/Bonmin/test/Makefile.in

    r481 r536  
    4343build_triplet = @build@
    4444host_triplet = @host@
    45 noinst_PROGRAMS = unitTest$(EXEEXT) CppExample$(EXEEXT)
    46 @COIN_HAS_CPX_TRUE@am__append_1 = \
     45noinst_PROGRAMS = $(am__EXEEXT_1) CppExample$(EXEEXT)
     46@COIN_HAS_ASL_TRUE@am__append_1 = unitTest
     47@COIN_HAS_ASL_TRUE@am__append_2 = $(ASLLIB)
     48@COIN_HAS_CPX_TRUE@am__append_3 = \
    4749@COIN_HAS_CPX_TRUE@     $(OSIOBJDIR)/src/OsiCpx/libOsiCpx.la \
    4850@COIN_HAS_CPX_TRUE@     $(COINUTILSOBJDIR)/src/libCoinUtils.la \
     
    5961CONFIG_HEADER = $(top_builddir)/inc/config_bonmin.h
    6062CONFIG_CLEAN_FILES = MyBonmin.cpp MyTMINLP.cpp MyTMINLP.hpp
     63@COIN_HAS_ASL_TRUE@am__EXEEXT_1 = unitTest$(EXEEXT)
    6164PROGRAMS = $(noinst_PROGRAMS)
    6265am_CppExample_OBJECTS = MyBonmin.$(OBJEXT) MyTMINLP.$(OBJEXT)
     
    7376        $(OSIOBJDIR)/src/libOsi.la $(CLPOBJDIR)/src/libClp.la \
    7477        $(COINUTILSOBJDIR)/src/libCoinUtils.la $(am__DEPENDENCIES_3)
    75 CppExample_DEPENDENCIES = ../src/CbcBonmin/libbonmin.la \
     78@COIN_HAS_ASL_TRUE@am__DEPENDENCIES_5 = $(am__DEPENDENCIES_2)
     79CppExample_DEPENDENCIES = ../src/CbcBonmin/libbonminampl.la \
     80        ../src/CbcBonmin/libbonmin.la \
     81        $(IPOPTOBJDIR)/src/Apps/AmplSolver/libamplinterface.la \
    7682        $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_4) \
    77         $(am__DEPENDENCIES_2)
     83        $(am__DEPENDENCIES_5) $(am__DEPENDENCIES_2)
    7884am_unitTest_OBJECTS = InterfaceTest.$(OBJEXT)
    7985unitTest_OBJECTS = $(am_unitTest_OBJECTS)
     
    339345        $(IPOPTOBJDIR)/src/Apps/AmplSolver/libamplinterface.la \
    340346        $(IPOPTLIBS) \
    341         $(LIBCBCCOPY) \
    342347        $(COINLIBS) \
    343348        $(ASLLIB) \
     
    350355
    351356# List libraries of COIN projects
    352 CppExample_LDADD = ../src/CbcBonmin/libbonmin.la \
    353         $(IPOPTLIBS) \
    354         $(LIBCBCCOPY) \
    355         $(COINLIBS) \
    356         $(ADDLIBS)
    357 
     357CppExample_LDADD = ../src/CbcBonmin/libbonminampl.la \
     358        ../src/CbcBonmin/libbonmin.la \
     359        $(IPOPTOBJDIR)/src/Apps/AmplSolver/libamplinterface.la \
     360        $(IPOPTLIBS) $(COINLIBS) $(am__append_2) $(ADDLIBS)
    358361COINLIBS = $(CBCOBJDIR)/src/libCbc.la $(CGLOBJDIR)/src/libCgl.la \
    359362        $(OSIOBJDIR)/src/OsiClp/libOsiClp.la \
    360363        $(OSIOBJDIR)/src/libOsi.la $(CLPOBJDIR)/src/libClp.la \
    361         $(COINUTILSOBJDIR)/src/libCoinUtils.la $(am__append_1)
     364        $(COINUTILSOBJDIR)/src/libCoinUtils.la $(am__append_3)
    362365IPOPTLIBS = \
    363366        $(IPOPTOBJDIR)/src/Interfaces/libipopt.la
Note: See TracChangeset for help on using the changeset viewer.