Changeset 105


Ignore:
Timestamp:
Nov 3, 2006 2:31:19 PM (12 years ago)
Author:
pbonami
Message:

Update FP code

Location:
branches/devel/Bonmin
Files:
2 added
18 edited
1 moved

Legend:

Unmodified
Added
Removed
  • branches/devel/Bonmin/Makefile.am

    r88 r105  
    1515# Here list all subdirectories into which to recurse
    1616SUBDIRS = src/Interfaces \
    17         src/OaInterface \
     17        src/OaAlgorithms \
    1818        src/CbcBonmin \
    1919        src/Apps
  • branches/devel/Bonmin/Makefile.in

    r88 r105  
    9393ETAGS = etags
    9494CTAGS = ctags
    95 DIST_SUBDIRS = src/Interfaces src/OaInterface src/CbcBonmin src/Apps \
     95DIST_SUBDIRS = src/Interfaces src/OaAlgorithms src/CbcBonmin src/Apps \
    9696        experimental/FP experimental/Bcp test
    9797DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
     
    322322
    323323# Here list all subdirectories into which to recurse
    324 SUBDIRS = src/Interfaces src/OaInterface src/CbcBonmin src/Apps \
     324SUBDIRS = src/Interfaces src/OaAlgorithms src/CbcBonmin src/Apps \
    325325        $(am__append_1) $(am__append_2) $(am__append_3)
    326326
  • branches/devel/Bonmin/configure

    r88 r105  
    2192121921##############################################################################
    2192221922
    21923                                                                                                                         ac_config_files="$ac_config_files Makefile src/Apps/Makefile experimental/Bcp/Makefile src/CbcBonmin/Makefile src/Interfaces/Makefile src/Interfaces/Ipopt/Makefile src/Interfaces/Filter/Makefile src/Interfaces/Ampl/Makefile src/OaInterface/Makefile experimental/FP/Makefile test/Makefile examples/CppExample/Makefile"
     21923                                                                                                                        ac_config_files="$ac_config_files Makefile src/Apps/Makefile experimental/Bcp/Makefile src/CbcBonmin/Makefile src/Interfaces/Makefile src/Interfaces/Ipopt/Makefile src/Interfaces/Filter/Makefile src/Interfaces/Ampl/Makefile src/OaAlgorithms/Makefile experimental/FP/Makefile test/Makefile examples/CppExample/Makefile"
    2192421924
    2192521925
     
    2267322673  "src/Interfaces/Filter/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/Interfaces/Filter/Makefile" ;;
    2267422674  "src/Interfaces/Ampl/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/Interfaces/Ampl/Makefile" ;;
    22675   "src/OaInterface/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/OaInterface/Makefile" ;;
     22675  "src/OaAlgorithms/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/OaAlgorithms/Makefile" ;;
    2267622676  "experimental/FP/Makefile" ) CONFIG_FILES="$CONFIG_FILES experimental/FP/Makefile" ;;
    2267722677  "test/Makefile" ) CONFIG_FILES="$CONFIG_FILES test/Makefile" ;;
  • branches/devel/Bonmin/configure.ac

    r88 r105  
    130130                 src/Interfaces/Filter/Makefile
    131131                 src/Interfaces/Ampl/Makefile
    132                  src/OaInterface/Makefile
     132                 src/OaAlgorithms/Makefile
    133133                 experimental/FP/Makefile
    134134                 test/Makefile
  • branches/devel/Bonmin/experimental/Bcp/Makefile.am

    r102 r105  
    9393# "cygpath" stuff is necessary to compile with native compilers on Windows
    9494AM_CPPFLAGS = \
    95         -I`$(CYGPATH_W) $(srcdir)/../../src/OaInterface` \
     95        -I`$(CYGPATH_W) $(srcdir)/../../src/OaAlgorithms` \
    9696        -I`$(CYGPATH_W) $(srcdir)/../../src/Interfaces` \
    9797        -I`$(CYGPATH_W) $(srcdir)/../../src/Interfaces/Ipopt` \
  • branches/devel/Bonmin/experimental/Bcp/Makefile.in

    r102 r105  
    350350# Here list all include flags, relative to this "srcdir" directory.  This
    351351# "cygpath" stuff is necessary to compile with native compilers on Windows
    352 AM_CPPFLAGS = -I`$(CYGPATH_W) $(srcdir)/../../src/OaInterface` \
     352AM_CPPFLAGS = -I`$(CYGPATH_W) $(srcdir)/../../src/OaAlgorithms` \
    353353        -I`$(CYGPATH_W) $(srcdir)/../../src/Interfaces` \
    354354        -I`$(CYGPATH_W) $(srcdir)/../../src/Interfaces/Ipopt` \
     
    676676        sed -e 's/CFLAGS =/CFLAGS = -DNO_FUNCADD/g' $(AMPL_SRC)/makefile.u > makefile.u ; \
    677677        eval `grep ASLMAKEFLAGS ../../../../ThirdParty/ASL/config.log | tail -1`; \
    678         $(MAKE) $ASLMAKEFLAGS -f makefile.u ; \
     678        $(MAKE) $$ASLMAKEFLAGS -f makefile.u ; \
    679679        cp amplsolver.a ..
    680         rm -rf solvers
    681680# Tell versions [3.59,3.63) of GNU make to not export all variables.
    682681# Otherwise a system limit (for SysV at least) may be exceeded.
  • branches/devel/Bonmin/experimental/FP/FP.cpp

    r26 r105  
    2020#include "CoinTime.hpp"
    2121
    22 #include "BonminAmplInterface.hpp"
    23 #include "BonminCbcParam.hpp"
    24 #include "CbcBonmin.hpp"
    25 #include "AmplTMINLP.hpp"
     22#include "BonAmplInterface.hpp"
     23#include "BonCbcParam.hpp"
     24#include "BonCbc.hpp"
     25#include "BonAmplTMINLP.hpp"
    2626#include "AmplTNLP.hpp"
    2727#include "FP.hpp"
     28#include "BonIpoptSolver.hpp"
     29
    2830void register_ALL_options( SmartPtr<RegisteredOptions> roptions );
    2931void set_ipopt_minlp_default(SmartPtr<OptionsList> Option);
     
    3133
    3234
    33 class AmplFP : public Ipopt::AmplTMINLP
     35class AmplFP : public Bonmin::AmplTMINLP
    3436{
    3537  public:
     
    7678};
    7779
    78 class FPInterface : public BonminAmplInterface
     80class FPInterface : public Bonmin::AmplInterface
    7981{
    8082public:
    81   FPInterface(char **& argv):BonminAmplInterface()
     83  FPInterface(char **& argv):Bonmin::AmplInterface()
    8284  {
    8385    readAmplNlFile2(argv);
    8486  }
    8587  FPInterface(const FPInterface &other):
    86   BonminAmplInterface(other)
    87   {std::cout<<"Holla soy aqui"<<std::endl;}
     88  Bonmin::AmplInterface(other)
     89  {}
    8890  virtual OsiSolverInterface * clone()
    8991  { return new FPInterface(*this);}
     
    105107                  )
    106108  {
    107     app_ = new Ipopt::IpoptApplication();
     109    app_ = new Bonmin::IpoptSolver();
    108110    SmartPtr<RegisteredOptions> roptions = app_->RegOptions();
    109111    register_ALL_options(roptions);
     
    121123    delete [] pbName;
    122124   
    123     // set the default options... expect_infeasible, etc...
    124     set_ipopt_minlp_default(app_->Options());
    125125   
    126126    if(!IsValid(tminlp_)) {
     
    130130    }
    131131    else {
    132       AmplTMINLP * amplTMINLP = dynamic_cast<AmplTMINLP *> (GetRawPtr(tminlp_));
     132      Bonmin::AmplTMINLP * amplTMINLP = dynamic_cast<Bonmin::AmplTMINLP *> (GetRawPtr(tminlp_));
    133133      if(amplTMINLP) {
    134         AmplTMINLP * newAmpl = amplTMINLP->createEmpty();
     134        Bonmin::AmplTMINLP * newAmpl = amplTMINLP->createEmpty();
    135135        newAmpl->Initialize(ConstPtr(app_->Jnlst()), app_->Options(), filename,
    136136                            NULL, appName() , NULL);
     
    144144      }
    145145    }
    146     problem_ = new Ipopt::TMINLP2TNLP(tminlp_, *app_->Options());
     146    problem_ = new Bonmin::TMINLP2TNLP(tminlp_);
    147147   
    148148    bool print_options_documentation;
     
    164164    extractInterfaceParams();
    165165    hasBeenOptimized_ = false;
    166     feasibilityProblem_ = new Ipopt::TNLP2FPNLP
     166    feasibilityProblem_ = new Bonmin::TNLP2FPNLP
    167167      (Ipopt::SmartPtr<Ipopt::TNLP>(Ipopt::GetRawPtr(problem_)));
    168168  }
    169169};
    170170
    171 int iteratedFP(BonminAmplInterface &nlpSolver,
     171int iteratedFP(Bonmin::AmplInterface &nlpSolver,
    172172               bool standAlone,
    173173               double *&solution);
    174174
    175 int enhancedOA(BonminAmplInterface &nlpSolver,
     175int enhancedOA(Bonmin::AmplInterface &nlpSolver,
    176176               bool doFP,
    177177               double *&solution);
     
    209209   
    210210  }
    211   catch(IpoptInterface::UnsolvedError &E) {
     211  catch(Bonmin::TNLPSolver::UnsolvedError *E) {
     212     E->printError(std::cerr);
    212213    //There has been a failure to solve a problem with Ipopt.
    213214    //And we will output file with information on what has been changed in the problem to make it fail.
     
    216217
    217218  }
    218   catch(IpoptInterface::SimpleError &E) {
     219  catch(Bonmin::OsiTMINLPInterface::SimpleError &E) {
    219220    std::cerr<<E.className()<<"::"<<E.methodName()
    220221    <<std::endl
  • branches/devel/Bonmin/experimental/FP/Makefile.am

    r26 r105  
    2929        $(CPXLIB)
    3030endif
     31if COIN_HAS_FSQP
     32COINLIBS += $(FSQPLIB)
     33endif
    3134
    3235IPOPTLIBS = \
     
    3942# "cygpath" stuff is necessary to compile with native compilers on Windows
    4043AM_CPPFLAGS = \
    41         -I`$(CYGPATH_W) $(srcdir)/../../src/OaInterface` \
    42         -I`$(CYGPATH_W) $(srcdir)/../../src/IpoptInterface` \
    43         -I`$(CYGPATH_W) $(srcdir)/../../src/BonminAmplInterface` \
     44        -I`$(CYGPATH_W) $(srcdir)/../../src/OaAlgorithms` \
     45        -I`$(CYGPATH_W) $(srcdir)/../../src/Interfaces` \
     46        -I`$(CYGPATH_W) $(srcdir)/../../src/Interfaces/Ipopt` \
     47        -I`$(CYGPATH_W) $(srcdir)/../../src/Interfaces/Ampl` \
    4448        -I`$(CYGPATH_W) $(srcdir)/../../src/CbcBonmin` \
    4549        -I`$(CYGPATH_W) $(IPOPTOBJDIR)/inc` \
     
    9498oa_fp_LDADD = \
    9599        ../../src/Apps/libbonmin.la \
    96         ../../src/BonminAmplInterface/libamplinterface.la\
    97         $(IPOPTOBJDIR)/src/Apps/AmplSolver/libamplinterface.la \
     100        ../../src/Interfaces/Ampl/libamplinterface.la \
     101        $(IPOPTOBJDIR)/src/Apps/AmplSolver/libamplinterface.la \
    98102        $(IPOPTLIBS) \
    99103        $(ASLLIB) \
  • branches/devel/Bonmin/experimental/FP/Makefile.in

    r64 r105  
    4949@COIN_HAS_CPX_TRUE@     $(CPXLIB)
    5050
    51 @COIN_HAS_CPX_TRUE@am__append_2 = \
     51@COIN_HAS_FSQP_TRUE@am__append_2 = $(FSQPLIB)
     52@COIN_HAS_CPX_TRUE@am__append_3 = \
    5253@COIN_HAS_CPX_TRUE@     -I`$(CYGPATH_W) $(OSISRCDIR)/src/OsiCpx` \
    5354@COIN_HAS_CPX_TRUE@     -I`$(CYGPATH_W) $(CPXINCDIR)`
     
    7475@COIN_HAS_CPX_TRUE@     $(COINUTILSOBJDIR)/src/libCoinUtils.la \
    7576@COIN_HAS_CPX_TRUE@     $(am__DEPENDENCIES_2)
    76 am__DEPENDENCIES_4 = $(CBCOBJDIR)/src/libCbc.la \
     77@COIN_HAS_FSQP_TRUE@am__DEPENDENCIES_4 = $(am__DEPENDENCIES_2)
     78am__DEPENDENCIES_5 = $(CBCOBJDIR)/src/libCbc.la \
    7779        $(CGLOBJDIR)/src/libCgl.la \
    7880        $(OSIOBJDIR)/src/OsiClp/libOsiClp.la \
    7981        $(OSIOBJDIR)/src/libOsi.la $(CLPOBJDIR)/src/libClp.la \
    80         $(COINUTILSOBJDIR)/src/libCoinUtils.la $(am__DEPENDENCIES_3)
     82        $(COINUTILSOBJDIR)/src/libCoinUtils.la $(am__DEPENDENCIES_3) \
     83        $(am__DEPENDENCIES_4)
    8184oa_fp_DEPENDENCIES = ../../src/Apps/libbonmin.la \
    82         ../../src/BonminAmplInterface/libamplinterface.la \
     85        ../../src/Interfaces/Ampl/libamplinterface.la \
    8386        $(IPOPTOBJDIR)/src/Apps/AmplSolver/libamplinterface.la \
    8487        $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) \
    85         $(am__DEPENDENCIES_4)
     88        $(am__DEPENDENCIES_5)
    8689DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/inc
    8790depcomp = $(SHELL) $(top_srcdir)/../depcomp
     
    322325        $(OSIOBJDIR)/src/OsiClp/libOsiClp.la \
    323326        $(OSIOBJDIR)/src/libOsi.la $(CLPOBJDIR)/src/libClp.la \
    324         $(COINUTILSOBJDIR)/src/libCoinUtils.la $(am__append_1)
     327        $(COINUTILSOBJDIR)/src/libCoinUtils.la $(am__append_1) \
     328        $(am__append_2)
    325329IPOPTLIBS = \
    326330        $(IPOPTOBJDIR)/src/Interfaces/libipopt.la
     
    329333# Here list all include flags, relative to this "srcdir" directory.  This
    330334# "cygpath" stuff is necessary to compile with native compilers on Windows
    331 AM_CPPFLAGS = -I`$(CYGPATH_W) $(srcdir)/../../src/OaInterface` \
    332         -I`$(CYGPATH_W) $(srcdir)/../../src/IpoptInterface` \
    333         -I`$(CYGPATH_W) $(srcdir)/../../src/BonminAmplInterface` \
     335AM_CPPFLAGS = -I`$(CYGPATH_W) $(srcdir)/../../src/OaAlgorithms` \
     336        -I`$(CYGPATH_W) $(srcdir)/../../src/Interfaces` \
     337        -I`$(CYGPATH_W) $(srcdir)/../../src/Interfaces/Ipopt` \
     338        -I`$(CYGPATH_W) $(srcdir)/../../src/Interfaces/Ampl` \
    334339        -I`$(CYGPATH_W) $(srcdir)/../../src/CbcBonmin` -I`$(CYGPATH_W) \
    335340        $(IPOPTOBJDIR)/inc` -I`$(CYGPATH_W) $(IPOPTSRCDIR)/src/Common` \
     
    353358        $(CGLSRCDIR)/src/CglKnapsackCover` -I`$(CYGPATH_W) \
    354359        $(CGLSRCDIR)/src/CglPreProcess` -I`$(CYGPATH_W) \
    355         $(CGLSRCDIR)/src` $(am__append_2)
     360        $(CGLSRCDIR)/src` $(am__append_3)
    356361
    357362########################################################################
     
    361366oa_fp_LDADD = \
    362367        ../../src/Apps/libbonmin.la \
    363         ../../src/BonminAmplInterface/libamplinterface.la\
    364         $(IPOPTOBJDIR)/src/Apps/AmplSolver/libamplinterface.la \
     368        ../../src/Interfaces/Ampl/libamplinterface.la \
     369        $(IPOPTOBJDIR)/src/Apps/AmplSolver/libamplinterface.la \
    365370        $(IPOPTLIBS) \
    366371        $(ASLLIB) \
  • branches/devel/Bonmin/experimental/FP/OAFeasibilityPump.cpp

    r26 r105  
    3737#include "CbcCutGenerator.hpp"
    3838//#include "CbcHeuristicUser.hpp"
    39 #include "BonminAmplInterface.hpp"
    40 #include "IpCbcDummyHeuristic.hpp"
    41 #include "IpCbcOACutGenerator.hpp"
    42 #include "IpCbcOACutGenerator2.hpp"
     39#include "BonAmplInterface.hpp"
     40#include "BonDummyHeuristic.hpp"
     41#include "BonOACutGenerator.hpp"
     42#include "BonOACutGenerator2.hpp"
    4343
    4444//Use heuristics
     
    4646#include "CbcHeuristicGreedy.hpp"
    4747
    48 #include "AmplTMINLP.hpp"
     48#include "BonAmplTMINLP.hpp"
    4949
    5050#include "CglGomory.hpp"
     
    6666#include "CoinTime.hpp"
    6767#include "FP.hpp"
     68
     69using namespace Bonmin;
     70
    6871OptParam params;
    6972static double BeginTimeGLOB;
     
    138141
    139142void
    140 writeBoundFiles(BonminAmplInterface& nlp, const double * originalLower, const double * originalUpper)
     143writeBoundFiles(AmplInterface& nlp, const double * originalLower, const double * originalUpper)
    141144{
    142145  const double * currentLower = nlp.getColLower();
     
    177180
    178181
    179 double FP(BonminAmplInterface &nlp,
     182double FP(AmplInterface &nlp,
    180183          OsiSolverInterface &linearModel,
    181184          int numIntCols, int * inds, double * vals,
     
    393396      nlp.setColSolution(nlp.getColSolution());
    394397      nlp.setRowPrice(nlp.getRowPrice());
    395       nlp.setWarmStartOptions();
     398      nlp.solver()->enableWarmStart();
    396399      //Resolve the NLP with fixed variables and original objective function
    397400      for(int i = 0; i < numIntCols; i++) {
     
    399402        nlp.setColUpper(inds[i], vals[i]);
    400403      }
    401       //nlp.turnOnIpoptOutput();
     404      //nlp.turnOnSolverOutput();
    402405      nlp.initialSolve();
    403406      if(nlp.isProvenOptimal()) {
     
    464467  strcpy(pbName, argv[1]);
    465468  BonminAmplInterface solver1(argv);
    466   solver1.turnOnIpoptOutput();
     469  solver1.turnOnSolverOutput();
    467470  bool doFp=true;
    468471
     
    604607      solver1.setColUpper(inds[i], x[i]);
    605608    }
    606     solver1.turnOnIpoptOutput();
     609    solver1.turnOnSolverOutput();
    607610    solver1.initialSolve();
    608611    if(solver1.isProvenOptimal()) {
     
    639642    else if(solver1.isAbandoned() || solver1.isIterationLimitReached()) {
    640643      writeBoundFiles(solver1, solver.getColLower(), solver.getColUpper());
    641       solver1.turnOnIpoptOutput();
     644      solver1.turnOnSolverOutput();
    642645      solver1.initialSolve();
    643646
     
    714717
    715718/** Enhanced OA code */
    716 int enhancedOA(BonminAmplInterface & solver1, bool doFp,
     719int enhancedOA(AmplInterface & solver1, bool doFp,
    717720               double *& solution)
    718721{
     
    910913        solver1.setColUpper(inds[i], x[i]);
    911914      }
    912       solver1.turnOnIpoptOutput();
     915      solver1.turnOnSolverOutput();
    913916      solver1.initialSolve();
    914917      if(solver1.isProvenOptimal()) {
     
    10971100      break;
    10981101    }
    1099     solver1.turnOnIpoptOutput();
     1102    solver1.turnOnSolverOutput();
    11001103    solver1.initialSolve();
    11011104    if(solver1.isProvenOptimal()) {
     
    11261129    else if(solver1.isAbandoned() || solver1.isIterationLimitReached()) {
    11271130      writeBoundFiles(solver1, solver.getColLower(), solver.getColUpper());
    1128       solver1.turnOnIpoptOutput();
     1131      solver1.turnOnSolverOutput();
    11291132      solver1.initialSolve();
    11301133
     
    12051208
    12061209/** Iterated feasibility pump.*/
    1207 int iteratedFP (BonminAmplInterface& solver1, bool standAlone,
     1210int iteratedFP (AmplInterface& solver1, bool standAlone,
    12081211                double * &solution)
    12091212{
     
    13671370          solver1.setColUpper(inds[i], x[i]);
    13681371        }
    1369         solver1.turnOnIpoptOutput();
     1372        solver1.turnOnSolverOutput();
    13701373        solver1.initialSolve();
    13711374        if(solver1.isProvenOptimal()) {
     
    14311434
    14321435
    1433 double FPGeneralIntegers(BonminAmplInterface &nlp, OsiSolverInterface &linearModel,int numIntCols, int * inds, double * vals, double maxTime, ResolutionInformation& info, double ub, bool &provenInfeas)
     1436double FPGeneralIntegers(AmplInterface &nlp, OsiSolverInterface &linearModel,
     1437                         int numIntCols, int * inds, double * vals, double maxTime,
     1438                         ResolutionInformation& info, double ub, bool &provenInfeas)
     1439
    14341440{
    14351441  provenInfeas=0;
     
    16561662      nlp.setColSolution(nlp.getColSolution());
    16571663      nlp.setRowPrice(nlp.getRowPrice());
    1658       nlp.setWarmStartOptions();
     1664      nlp.solver()->enableWarmStart();
    16591665      //Resolve the NLP with fixed variables and original objective function
    16601666      for(int i = 0; i < numIntCols; i++) {
     
    16621668        nlp.setColUpper(inds[i], vals[i]);
    16631669      }
    1664       //nlp.turnOnIpoptOutput();
     1670      //nlp.turnOnSolverOutput();
    16651671      nlp.initialSolve();
    16661672      if(nlp.isProvenOptimal()) {
  • branches/devel/Bonmin/src/Apps/Makefile.am

    r93 r105  
    2626libbonmin_la_LIBADD = \
    2727        ../CbcBonmin/libbonminbb.la \
    28         ../OaInterface/liboainterface.la \
     28        ../OaAlgorithms/liboainterface.la \
    2929        ../Interfaces/libbonmininterfaces.la
    3030
  • branches/devel/Bonmin/src/Apps/Makefile.in

    r93 r105  
    7777LTLIBRARIES = $(lib_LTLIBRARIES)
    7878libbonmin_la_DEPENDENCIES = ../CbcBonmin/libbonminbb.la \
    79         ../OaInterface/liboainterface.la \
     79        ../OaAlgorithms/liboainterface.la \
    8080        ../Interfaces/libbonmininterfaces.la
    8181am_libbonmin_la_OBJECTS =
     
    349349libbonmin_la_LIBADD = \
    350350        ../CbcBonmin/libbonminbb.la \
    351         ../OaInterface/liboainterface.la \
     351        ../OaAlgorithms/liboainterface.la \
    352352        ../Interfaces/libbonmininterfaces.la
    353353
  • branches/devel/Bonmin/src/CbcBonmin/Makefile.am

    r98 r105  
    3131# "cygpath" stuff is necessary to compile with native compilers on Windows
    3232AM_CPPFLAGS = \
    33         -I`$(CYGPATH_W) $(srcdir)/../OaInterface` \
     33        -I`$(CYGPATH_W) $(srcdir)/../OaAlgorithms` \
    3434        -I`$(CYGPATH_W) $(srcdir)/../Interfaces` \
    3535        -I`$(CYGPATH_W) $(srcdir)/../Interfaces/Ipopt` \
  • branches/devel/Bonmin/src/CbcBonmin/Makefile.in

    r98 r105  
    330330# Here list all include flags, relative to this "srcdir" directory.  This
    331331# "cygpath" stuff is necessary to compile with native compilers on Windows
    332 AM_CPPFLAGS = -I`$(CYGPATH_W) $(srcdir)/../OaInterface` \
     332AM_CPPFLAGS = -I`$(CYGPATH_W) $(srcdir)/../OaAlgorithms` \
    333333        -I`$(CYGPATH_W) $(srcdir)/../Interfaces` -I`$(CYGPATH_W) \
    334334        $(srcdir)/../Interfaces/Ipopt` -I`$(CYGPATH_W) \
  • branches/devel/Bonmin/src/Interfaces/BonOsiTMINLPInterface.hpp

    r98 r105  
    745745   */
    746746  //@{
    747   void turnOffIpoptOutput();
    748   void turnOnIpoptOutput();
     747  void turnOffSolverOutput(){
     748  app_->turnOffOutput();}
     749  void turnOnSolverOutput(){
     750  app_->turnOnOutput();}
    749751  //@}
    750752
  • branches/devel/Bonmin/src/OaAlgorithms/BonOACutGenerator2.cpp

    r67 r105  
    271271    // this information is stored in babInfo
    272272    OsiBabSolver * babInfo = dynamic_cast<OsiBabSolver *> (si.getAuxiliaryInfo());
    273 #if 1
     273#if 0
    274274    //if algorithms would converge this should never happen and it seems very dangerous if somebody forgot to reset the bound
    275275    if (babInfo)
     
    335335    bool milpOptimal = 1;
    336336
    337 #ifdef NO_NULL_SI
     337#if 0
    338338    if (si_ == NULL) {
    339339      std::cerr<<"Error in cut generator for outer approximation no lp solver interface assigned"<<std::endl;
     
    416416    }
    417417    else {
    418 #ifdef NO_NULL_SI
     418#if 1
    419419      throw CoinError("Not allowed to modify si in a cutGenerator",
    420420          "OACutGenerator2","generateCuts");
     
    866866    delete strategy;
    867867}
     868
     869CbcModel *
     870OACutGenerator2::setupNewCbc(OsiClpSolverInterface *clp,
     871                             CbcStrategy * strategy,
     872                             double cutoff){
     873          OsiBabSolver empty;
     874        CbcModel * model = new CbcModel(*clp); // which clones
     875        OAModel = model;
     876        model->solver()->setAuxiliaryInfo(&empty);
     877
     878        //Change Cbc messages prefixes
     879        strcpy(model->messagesPointer()->source_,"OaCbc");
     880
     881        if (!strategy)
     882          strategy = new CbcStrategyDefault(1,0,0,subMilpLogLevel_);
     883
     884        clp->resolve();
     885        model->setLogLevel(subMilpLogLevel_);
     886        model->solver()->messageHandler()->setLogLevel(0);
     887        model->setStrategy(*strategy);
     888        model->setMaximumNodes(localSearchNodeLimit_);
     889        model->setMaximumSeconds(maxLocalSearchTime_ + timeBegin_ - CoinCpuTime());
     890        model->setCutoff(cutoff);
     891        return model;
    868892}
     893}/* End namespace Bonmin. */
  • branches/devel/Bonmin/src/OaAlgorithms/BonOACutGenerator2.hpp

    r62 r105  
    1919
    2020#include "CoinTime.hpp"
     21
     22class OsiClpSolverInterface;
    2123
    2224namespace Bonmin
     
    9193      return nSolve_;
    9294    }
     95
    9396    /// Set value for cutoff increment
    9497    void setcbcCutoffIncrement (double value)
     
    138141      subMilpLogLevel_ = value;
    139142    }
     143
     144  protected:
     145    ///Setup a new instance of Cbc with correct parameters
     146    CbcModel * setupNewCbc(OsiClpSolverInterface *clp,
     147                           CbcStrategy * strategy,
     148                           double cutoff);
     149
    140150  private:
    141151    /// Set the node limit to the interface
  • branches/devel/Bonmin/src/OaAlgorithms/Makefile.in

    r83 r105  
    4747@COIN_HAS_CPX_TRUE@     -I`$(CYGPATH_W) $(CPXINCDIR)`
    4848
    49 subdir = src/OaInterface
     49subdir = src/OaAlgorithms
    5050DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
    5151ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
     
    357357          esac; \
    358358        done; \
    359         echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  src/OaInterface/Makefile'; \
     359        echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  src/OaAlgorithms/Makefile'; \
    360360        cd $(top_srcdir) && \
    361           $(AUTOMAKE) --foreign  src/OaInterface/Makefile
     361          $(AUTOMAKE) --foreign  src/OaAlgorithms/Makefile
    362362.PRECIOUS: Makefile
    363363Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
Note: See TracChangeset for help on using the changeset viewer.