Changeset 57


Ignore:
Timestamp:
Sep 29, 2006 1:32:48 PM (13 years ago)
Author:
pbonami
Message:

Rename file with Bon prefix part II

Location:
branches/devel/Bonmin/src
Files:
9 edited
23 moved

Legend:

Unmodified
Added
Removed
  • branches/devel/Bonmin/src/Apps/BonMin.cpp

    r53 r57  
    1919#include "CoinTime.hpp"
    2020
    21 #include "BonminAmplInterface.hpp"
    22 #include "CbcBonmin.hpp"
     21#include "BonAmplInterface.hpp"
     22#include "BonCbc.hpp"
    2323
    2424using namespace Bonmin;
     
    135135  nlpSolver = new AmplInterface(argv);
    136136    BonminCbcParam par;
    137     BonminBB bb;
    138     par(*nlpSolver);
    139     bb(*nlpSolver, par);//do branch and bound
     137    Bab bb;
     138    par(nlpSolver);
     139    bb(nlpSolver, par);//do branch and bound
    140140
    141141    std::cout.precision(10);
     
    144144    std::string message;
    145145    std::string status;
    146     if(bb.mipStatus()==BonminBB::FeasibleOptimal) {
     146    if(bb.mipStatus()==Bab::FeasibleOptimal) {
    147147      status = "\t\"Finished\"";
    148148      message = "\nbonmin: Optimal";
    149149    }
    150     else if(bb.mipStatus()==BonminBB::ProvenInfeasible) {
     150    else if(bb.mipStatus()==Bab::ProvenInfeasible) {
    151151      status = "\t\"Finished\"";
    152152      message = "\nbonmin: Infeasible problem";
    153153    }
    154     else if(bb.mipStatus()==BonminBB::Feasible) {
     154    else if(bb.mipStatus()==Bab::Feasible) {
    155155      status = "\t\"Not finished\"";
    156156      message = "\n Optimization not finished.";
    157157    }
    158     else if(bb.mipStatus()==BonminBB::NoSolutionKnown) {
     158    else if(bb.mipStatus()==Bab::NoSolutionKnown) {
    159159      status = "\t\"Not finished\"";
    160160      message = "\n Optimization not finished.";
     
    172172
    173173  }
    174   catch(IpoptInterface::UnsolvedError &E) {
    175      E.printError(std::cerr);
     174  catch(IpoptInterface::UnsolvedError *E) {
     175     E->printError(std::cerr);
    176176    //There has been a failure to solve a problem with Ipopt.
    177177    //And we will output file with information on what has been changed in the problem to make it fail.
  • branches/devel/Bonmin/src/Apps/Makefile.am

    r44 r57  
    5555########################################################################
    5656
    57 bonmin_SOURCES = bonmin.cpp
     57bonmin_SOURCES = BonMin.cpp
    5858
    5959bonmin_LDADD = \
  • branches/devel/Bonmin/src/Apps/Makefile.in

    r44 r57  
    8282binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
    8383PROGRAMS = $(bin_PROGRAMS)
    84 am_bonmin_OBJECTS = bonmin.$(OBJEXT)
     84am_bonmin_OBJECTS = BonMin.$(OBJEXT)
    8585bonmin_OBJECTS = $(am_bonmin_OBJECTS)
    8686am__DEPENDENCIES_1 = $(IPOPTOBJDIR)/src/Interfaces/libipopt.la
     
    355355#                                bonmin                                #
    356356########################################################################
    357 bonmin_SOURCES = bonmin.cpp
     357bonmin_SOURCES = BonMin.cpp
    358358bonmin_LDADD = \
    359359        ../BonminAmplInterface/libamplinterface.la\
     
    519519        -rm -f *.tab.c
    520520
     521@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/BonMin.Po@am__quote@
    521522@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CbcBranchUser.Plo@am__quote@
    522523@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CbcCompareUser.Plo@am__quote@
    523 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bonmin.Po@am__quote@
    524524@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nodeSolver.Po@am__quote@
    525525
  • branches/devel/Bonmin/src/Apps/nodeSolver.cpp

    r53 r57  
    1919
    2020
    21 #include "BonminAmplInterface.hpp"
     21#include "BonAmplInterface.hpp"
    2222
    23 #include "BoundsReader.hpp"
    24 #include "IpCbcStartPointReader.hpp"
     23#include "BonBoundsReader.hpp"
     24#include "BonStartPointReader.hpp"
    2525
    2626#include "CoinTime.hpp"
     
    7272      }
    7373      if(argc>3) {
    74         Bonmin::IpCbcStartPointReader init(startingPointFile);
    75         init.readAndApply(nlpSolver);
     74        Bonmin::StartPointReader init(startingPointFile);
     75        init.readAndApply(&nlpSolver);
    7676      }
    7777     
  • branches/devel/Bonmin/src/BonminAmplInterface/BonAmplInterface.cpp

    r53 r57  
    1 #include "BonminAmplInterface.hpp"
     1#include "BonAmplInterface.hpp"
    22#include <string>
    33#include <sstream>
  • branches/devel/Bonmin/src/BonminAmplInterface/BonAmplInterface.hpp

    r53 r57  
    11#ifndef BonminAmplInterface_H
    22#define BonminAmplInterface_H
    3 #include "IpoptInterface.hpp"
    4 #include "AmplTMINLP.hpp"
     3#include "BonIpoptInterface.hpp"
     4#include "BonAmplTMINLP.hpp"
    55
    66namespace Bonmin {
  • branches/devel/Bonmin/src/BonminAmplInterface/BonAmplTMINLP.cpp

    r53 r57  
    1212
    1313#include "AmplTNLP.hpp"
    14 #include "AmplTMINLP.hpp"
     14#include "BonAmplTMINLP.hpp"
    1515#include <iostream>
    1616
  • branches/devel/Bonmin/src/BonminAmplInterface/BonAmplTMINLP.hpp

    r53 r57  
    1313#define __IPAMPLTMINLP_HPP__
    1414
    15 #include "TMINLP.hpp"
     15#include "BonTMINLP.hpp"
    1616#include "IpSmartPtr.hpp"
    1717#include "CoinPackedMatrix.hpp"
  • branches/devel/Bonmin/src/BonminAmplInterface/Makefile.am

    r26 r57  
    1818# List all source files, including headers
    1919libamplinterface_la_SOURCES = \
    20         BonminAmplInterface.cpp BonminAmplInterface.hpp \
    21         AmplTMINLP.cpp AmplTMINLP.hpp \
     20        BonAmplInterface.cpp BonAmplInterface.hpp \
     21        BonAmplTMINLP.cpp BonAmplTMINLP.hpp \
    2222        sos_kludge.cpp
    2323
  • branches/devel/Bonmin/src/BonminAmplInterface/Makefile.in

    r26 r57  
    5757LTLIBRARIES = $(noinst_LTLIBRARIES)
    5858libamplinterface_la_LIBADD =
    59 am_libamplinterface_la_OBJECTS = BonminAmplInterface.lo AmplTMINLP.lo \
     59am_libamplinterface_la_OBJECTS = BonAmplInterface.lo BonAmplTMINLP.lo \
    6060        sos_kludge.lo
    6161libamplinterface_la_OBJECTS = $(am_libamplinterface_la_OBJECTS)
     
    308308# List all source files, including headers
    309309libamplinterface_la_SOURCES = \
    310         BonminAmplInterface.cpp BonminAmplInterface.hpp \
    311         AmplTMINLP.cpp AmplTMINLP.hpp \
     310        BonAmplInterface.cpp BonAmplInterface.hpp \
     311        BonAmplTMINLP.cpp BonAmplTMINLP.hpp \
    312312        sos_kludge.cpp
    313313
     
    401401        -rm -f *.tab.c
    402402
    403 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AmplTMINLP.Plo@am__quote@
    404 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/BonminAmplInterface.Plo@am__quote@
     403@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/BonAmplInterface.Plo@am__quote@
     404@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/BonAmplTMINLP.Plo@am__quote@
    405405@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sos_kludge.Plo@am__quote@
    406406
  • branches/devel/Bonmin/src/CbcBonmin/BonCbc.cpp

    r53 r57  
    88// Date : 03/15/2006
    99
     10
     11//Bonmin heaader files
    1012#include "BonminConfig.h"
    11 
    12 #include "CbcBonmin.hpp"
     13#include "BonCbc.hpp"
     14#include "BonCbcLpStrategy.hpp"
     15#include "BonCbcNlpStrategy.hpp"
     16#include "OsiTMINLPInterface.hpp"
     17
     18#include "BonCbcParam.hpp"
     19
     20//OA machinery
     21#include "BonDummyHeuristic.hpp"
     22#include "BonOACutGenerator2.hpp"
     23#include "BonOACutGenerator.hpp"
     24
     25
     26// Cbc Header file
    1327#include "CbcModel.hpp"
    1428#include "CbcBranchActual.hpp"
    1529#include "CbcCutGenerator.hpp"
    16 #include "IpoptInterface.hpp"
     30
     31//Osi Header files
    1732#include "OsiClpSolverInterface.hpp"
    18 
    19 #include "BonminCbcLpStrategy.hpp"
    20 #include "BonminCbcNlpStrategy.hpp"
     33#include "OsiAuxInfo.hpp"
    2134
    2235#ifdef COIN_HAS_CPX
     
    2538
    2639
    27 //MILP machinery
     40
     41// Cut generators
    2842#include "CglGomory.hpp"
    2943#include "CglProbing.hpp"
     
    3549#include "CglTwomir.hpp"
    3650#include "CglPreProcess.hpp"
     51
     52// Node selection
    3753#include "CbcCompareUser.hpp"
    3854#include "CbcCompareActual.hpp"
     55
    3956#include "CbcBranchUser.hpp"
    4057
    4158
    42 //OA machinery
    43 #include "IpCbcDummyHeuristic.hpp"
    44 #include "IpCbcOACutGenerator2.hpp"
    45 #include "IpCbcOACutGenerator.hpp"
    46 
    47 #include "BonminCbcParam.hpp"
    48 
    49 #include "OsiAuxInfo.hpp"
    50 
    51 
     59// Code to enable user interuption
    5260static CbcModel * currentBranchModel = NULL;
    53 static Bonmin::IpCbcOACutGenerator2 * currentOA = NULL;
     61static Bonmin::OACutGenerator2 * currentOA = NULL;
    5462CbcModel * OAModel = NULL;
    5563
     
    7179namespace Bonmin {
    7280/** Constructor.*/
    73 BonminBB::BonminBB():
     81Bab::Bab():
    7482    bestSolution_(NULL),
    7583    mipStatus_(),
     
    8290
    8391/** Destructor.*/
    84 BonminBB::~BonminBB()
     92Bab::~Bab()
    8593{
    8694  if(bestSolution_) delete [] bestSolution_;
     
    8997/** Perform a branch-and-bound on given IpoptInterface using passed parameters.*/
    9098void
    91 BonminBB::branchAndBound(IpoptInterface &nlpSolver,
     99Bab::branchAndBound(OsiTMINLPInterface *nlpSolver,
    92100    const BonminCbcParam &par)
    93101{
     
    97105
    98106
    99   nlpSolver.messageHandler()->setLogLevel(par.nlpLogLevel);
     107  nlpSolver->messageHandler()->setLogLevel(par.nlpLogLevel);
    100108
    101109  if (par.algo > 0) //OA based
    102110  {
    103111    si = new OsiClpSolverInterface;
    104     nlpSolver.extractLinearRelaxation(*si);
     112    nlpSolver->extractLinearRelaxation(*si);
    105113    // say bound dubious, does cuts at solution
    106114    OsiBabSolver * extraStuff = new OsiBabSolver(3);
     
    109117  }
    110118  else {
    111     si = &nlpSolver;
    112     nlpSolver.ignoreFailures();
     119    si = nlpSolver;
     120    nlpSolver->ignoreFailures();
    113121    OsiBabSolver * extraStuff = new OsiBabSolver(2);
    114122    si->setAuxiliaryInfo(extraStuff);
     
    124132    specOpt = 16;
    125133    model.setSpecialOptions(specOpt);
    126     BonminCbcNlpStrategy strat(par.maxFailures, par.maxInfeasible, par.failureBehavior);
     134    CbcNlpStrategy strat(par.maxFailures, par.maxInfeasible, par.failureBehavior);
    127135    model.setStrategy(strat);
    128136  }
     
    143151
    144152  //Resolution of nlp relaxations
    145   IpCbcOACutGenerator oaGen(&nlpSolver);
     153  OACutGenerator oaGen(nlpSolver);
    146154  oaGen.setMaxDepth(100000);
    147155  oaGen.setLogLevel(par.oaLogLevel);
     
    160168    OsiCpxSolverInterface * cpxSolver = new OsiCpxSolverInterface;
    161169    localSearchSolver = cpxSolver;
    162     nlpSolver.extractLinearRelaxation(*localSearchSolver);
     170    nlpSolver->extractLinearRelaxation(*localSearchSolver);
    163171#else
    164172
     
    182190                                );
    183191  }
    184   IpCbcOACutGenerator2 oaDec(&nlpSolver, localSearchSolver, strategy, par.cutoffDecr, par.intTol, 0,1);
     192  OACutGenerator2 oaDec(nlpSolver, localSearchSolver, strategy, par.cutoffDecr, par.intTol, 0,1);
    185193  if(par.algo>0) {
    186194    oaDec.setLocalSearchNodeLimit(1000000);
     
    193201  }
    194202  //Setup solver for checking validity of integral solutions
    195   IpCbcOACutGenerator2 feasCheck(&nlpSolver, model.solver(),
     203  OACutGenerator2 feasCheck(nlpSolver, model.solver(),
    196204      NULL,
    197205      par.cutoffDecr, par.intTol,
     
    202210    feasCheck.setMaxLocalSearchPerNode(100000);
    203211  }
    204   IpCbcDummyHeuristic oaHeu(model, &nlpSolver);
     212  DummyHeuristic oaHeu(model, nlpSolver);
    205213
    206214  if(par.algo>0) {
     
    234242      {
    235243        model.addCutGenerator(&oaDec,1,"Outer Approximation local enumerator");     
    236         IpCbcOACutGenerator2 * oaDecCopy = dynamic_cast<IpCbcOACutGenerator2 *>
     244        OACutGenerator2 * oaDecCopy = dynamic_cast<OACutGenerator2 *>
    237245          (model.cutGenerators()[numGen]->generator());
    238246        assert(oaDecCopy);
     
    258266  {
    259267    //set priorities, prefered directions...
    260     const int * priorities = nlpSolver.getPriorities();
    261     const double * upPsCosts = nlpSolver.getUpPsCosts();
    262     const double * downPsCosts = nlpSolver.getDownPsCosts();
    263     const int * directions = nlpSolver.getBranchingDirections();
     268    const int * priorities = nlpSolver->getPriorities();
     269    const double * upPsCosts = nlpSolver->getUpPsCosts();
     270    const double * downPsCosts = nlpSolver->getDownPsCosts();
     271    const int * directions = nlpSolver->getBranchingDirections();
    264272    bool hasPseudo = (upPsCosts!=NULL);
    265273    model.findIntegers(true,hasPseudo);
     
    284292
    285293  // Now pass user set Sos constraints (code inspired from CoinSolve.cpp)
    286   const TMINLP::SosInfo * sos = nlpSolver.model()->sosConstraints();
     294  const TMINLP::SosInfo * sos = nlpSolver->model()->sosConstraints();
    287295  if(!par.disableSos && sos && sos->num > 0) //we have some sos constraints
    288296  {
     
    295303    //verify if model has user set priorities
    296304    bool hasPriorities = false;
    297     const int * varPriorities = nlpSolver.getPriorities();
     305    const int * varPriorities = nlpSolver->getPriorities();
    298306    int numberObjects = model.numberObjects();
    299307    if(varPriorities)
     
    409417  if(par.algo==0)//Did we continue branching on a failure
    410418  {
    411     BonminCbcNlpStrategy * nlpStrategy = dynamic_cast<BonminCbcNlpStrategy *>(model.strategy());
     419    CbcNlpStrategy * nlpStrategy = dynamic_cast<CbcNlpStrategy *>(model.strategy());
    412420    if(nlpStrategy)
    413421      hasFailed = nlpStrategy->hasFailed();
     
    416424  }
    417425  else
    418     hasFailed = nlpSolver.hasContinuedOnAFailure();
     426    hasFailed = nlpSolver->hasContinuedOnAFailure();
    419427
    420428
     
    432440    if(bestSolution_)
    433441      delete [] bestSolution_;
    434     bestSolution_ = new double[nlpSolver.getNumCols()];
    435     CoinCopyN(model.bestSolution(), nlpSolver.getNumCols(), bestSolution_);
     442    bestSolution_ = new double[nlpSolver->getNumCols()];
     443    CoinCopyN(model.bestSolution(), nlpSolver->getNumCols(), bestSolution_);
    436444  }
    437445  if(!model.status()) {
     
    465473/** return the best known lower bound on the objective value*/
    466474double
    467 BonminBB::bestBound()
     475Bab::bestBound()
    468476{
    469477  if(mipStatus_ == FeasibleOptimal) return bestObj_;
  • branches/devel/Bonmin/src/CbcBonmin/BonCbc.hpp

    r53 r57  
    22#define BonminBB_hpp
    33
    4 #include "BonminCbcParam.hpp"
     4#include "BonCbcParam.hpp"
    55
    66
     
    88
    99namespace Bonmin{
    10 class IpoptInterface;
     10class OsiTMINLPInterface;
    1111/** Class which performs optimization of an MINLP stored in an IpoptInterface. */
    12 class BonminBB
     12class Bab
    1313{
    1414public:
     
    1919      NoSolutionKnown/** No feasible solution to the problem is known*/};
    2020  /** Constructor.*/
    21   BonminBB();
     21  Bab();
    2222  /** destructor.*/
    23   virtual ~BonminBB();
     23  virtual ~Bab();
    2424  /** Perform a branch-and-bound on given IpoptInterface using passed parameters.*/
    25   void branchAndBound(IpoptInterface &ip,
     25  void branchAndBound(OsiTMINLPInterface * nlp,
    2626      const BonminCbcParam&par);
    2727
    2828  /**operator() performs the branchAndBound*/
    29   void operator()(IpoptInterface &ip, const BonminCbcParam& par)
     29  void operator()(OsiTMINLPInterface * nlp, const BonminCbcParam& par)
    3030  {
    31     branchAndBound(ip,par);
     31    branchAndBound(nlp,par);
    3232  }
    3333
  • branches/devel/Bonmin/src/CbcBonmin/BonCbcLpStrategy.cpp

    r53 r57  
    88// Date : 03/15/2006
    99
    10 #include "BonminCbcLpStrategy.hpp"
     10#include "BonCbcLpStrategy.hpp"
    1111
     12
     13// Cut generators
    1214#include "CglGomory.hpp"
    1315#include "CglProbing.hpp"
     
    2022#include "CglPreProcess.hpp"
    2123
     24
     25// Node selection
    2226#include "CbcCompareUser.hpp"
    2327#include "CbcCompareActual.hpp"
     28
     29#include "CbcBranchUser.hpp"
    2430
    2531
  • branches/devel/Bonmin/src/CbcBonmin/BonCbcNlpStrategy.cpp

    r53 r57  
    1919#include "OsiSolverInterface.hpp"
    2020#include "CbcModel.hpp"
    21 #include "BonminCbcNlpStrategy.hpp"
    22 #include "BonminCbcNode.hpp"
     21#include "BonCbcNlpStrategy.hpp"
     22#include "BonCbcNode.hpp"
    2323
    24 #include "IpoptInterface.hpp"
     24#include "OsiTMINLPInterface.hpp"
    2525namespace Bonmin{
    2626// Default Constructor
    27 BonminCbcNlpStrategy::BonminCbcNlpStrategy(int maxFailures,
     27CbcNlpStrategy::CbcNlpStrategy(int maxFailures,
    2828    int maxInfeasibles,
    2929    int pretendFailIsInfeasible)
     
    3939
    4040// Destructor
    41 BonminCbcNlpStrategy::~BonminCbcNlpStrategy ()
     41CbcNlpStrategy::~CbcNlpStrategy ()
    4242{}
    4343
    4444// Clone
    4545CbcStrategy *
    46 BonminCbcNlpStrategy::clone() const
     46CbcNlpStrategy::clone() const
    4747{
    48   return new BonminCbcNlpStrategy(*this);
     48  return new CbcNlpStrategy(*this);
    4949}
    5050
    5151// Copy constructor
    52 BonminCbcNlpStrategy::BonminCbcNlpStrategy(const BonminCbcNlpStrategy & rhs)
     52CbcNlpStrategy::CbcNlpStrategy(const CbcNlpStrategy & rhs)
    5353    :
    5454    hasFailed_(false),
     
    5959// Return a new Full node information pointer (descendant of CbcFullNodeInfo)
    6060CbcNodeInfo *
    61 BonminCbcNlpStrategy::fullNodeInfo(CbcModel * model,int numberRowsAtContinuous) const
     61CbcNlpStrategy::fullNodeInfo(CbcModel * model,int numberRowsAtContinuous) const
    6262{
    6363  return new CbcFullNodeInfo(model,numberRowsAtContinuous);
     
    6565// Return a new Partial node information pointer (descendant of CbcPartialNodeInfo)
    6666CbcNodeInfo *
    67 BonminCbcNlpStrategy::partialNodeInfo(CbcModel * model, CbcNodeInfo * parent, CbcNode * owner,
     67CbcNlpStrategy::partialNodeInfo(CbcModel * model, CbcNodeInfo * parent, CbcNode * owner,
    6868    int numberChangedBounds,const int * variables,
    6969    const double * boundChanges,
    7070    const CoinWarmStartDiff *basisDiff) const
    7171{
    72   return new BonminCbcPartialNodeInfo(model,parent, owner, numberChangedBounds, variables,
     72  return new BonCbcPartialNodeInfo(model,parent, owner, numberChangedBounds, variables,
    7373      boundChanges,basisDiff);
    7474}
     
    8080*/
    8181int
    82 BonminCbcNlpStrategy::status(CbcModel * model, CbcNodeInfo * parent,int whereFrom)
     82CbcNlpStrategy::status(CbcModel * model, CbcNodeInfo * parent,int whereFrom)
    8383{
    8484  OsiSolverInterface * solver = model->solver();//get solver
     
    8686  bool solved = true;
    8787  int returnStatus = -1;
    88   BonminCbcPartialNodeInfo * bmNodeInfo = dynamic_cast<BonminCbcPartialNodeInfo *>(parent);
     88  BonCbcPartialNodeInfo * bmNodeInfo = dynamic_cast<BonCbcPartialNodeInfo *>(parent);
    8989  if(!bmNodeInfo) return -1;
    9090
     
    121121    <<seqOfInfeasiblesSize<<std::endl;
    122122    // Have to make sure that we will branch
    123     IpoptInterface * ipopt = dynamic_cast<IpoptInterface *>(solver);
     123    OsiTMINLPInterface * ipopt = dynamic_cast<OsiTMINLPInterface *>(solver);
    124124    ipopt->forceBranchable();
    125125    //change objective value
     
    132132    std::cout<<"Branching on unsolved node, sequence of unsolved size "<<seqOfUnsolvedSize<<std::endl;
    133133    // Have to make sure that we will branch
    134     IpoptInterface * ipopt = dynamic_cast<IpoptInterface *>(solver);
     134    OsiTMINLPInterface * ipopt = dynamic_cast<OsiTMINLPInterface *>(solver);
    135135    ipopt->forceBranchable();     //      feasible=1;
    136136    returnStatus = 0;
     
    140140      seqOfUnsolvedSize > maxFailure_) {
    141141    hasFailed_ = true;
    142     IpoptInterface * ipopt = dynamic_cast<IpoptInterface *>(solver);
     142    OsiTMINLPInterface * ipopt =
     143      dynamic_cast<OsiTMINLPInterface *>(solver);
    143144    if(pretendFailIsInfeasible_) {
    144145      //force infeasible
     
    147148    }
    148149    else
    149       throw ipopt->newUnsolvedError(ipopt->getOptStatus());
     150      throw ipopt->newUnsolvedError(0);
    150151  }
    151152  return returnStatus;
     
    153154
    154155void
    155 BonminCbcNlpStrategy::setupCutGenerators(CbcModel &model)
     156CbcNlpStrategy::setupCutGenerators(CbcModel &model)
    156157{}
    157158
    158159void
    159 BonminCbcNlpStrategy::setupHeuristics(CbcModel &model)
     160CbcNlpStrategy::setupHeuristics(CbcModel &model)
    160161{}
    161162
    162163void
    163 BonminCbcNlpStrategy::setupPrinting(CbcModel &model, int toto)
     164CbcNlpStrategy::setupPrinting(CbcModel &model, int toto)
    164165{}
    165166
    166167void
    167 BonminCbcNlpStrategy::setupOther(CbcModel &model)
     168CbcNlpStrategy::setupOther(CbcModel &model)
    168169{}
    169170}
  • branches/devel/Bonmin/src/CbcBonmin/BonCbcNlpStrategy.hpp

    r53 r57  
    99// Date : 03/15/2006
    1010
    11 #ifndef BonminCbcNlpStrategy_H
    12 #define BonminCbcNlpStrategy_H
     11#ifndef BonCbcNlpStrategy_H
     12#define BonCbcNlpStrategy_H
    1313
    1414#include "CbcStrategy.hpp"
     
    2020
    2121namespace Bonmin{
    22 class BonminCbcNlpStrategy : public CbcStrategy
     22class CbcNlpStrategy : public CbcStrategy
    2323{
    2424public:
    2525
    2626  // Default Constructor
    27   BonminCbcNlpStrategy (int maxFailures,
     27  CbcNlpStrategy (int maxFailures,
    2828      int maxInfeasibles,
    2929      int pretendFailIsInfeasible);
    3030
    3131  // Copy constructor
    32   BonminCbcNlpStrategy ( const BonminCbcNlpStrategy &);
     32  CbcNlpStrategy ( const CbcNlpStrategy &);
    3333
    3434  // Destructor
    35   virtual ~BonminCbcNlpStrategy ();
     35  virtual ~CbcNlpStrategy ();
    3636
    3737  /// Clone
     
    9090private:
    9191  /// Illegal Assignment operator
    92   BonminCbcNlpStrategy & operator=(const BonminCbcNlpStrategy& rhs);
     92  CbcNlpStrategy & operator=(const CbcNlpStrategy& rhs);
    9393
    9494};
  • branches/devel/Bonmin/src/CbcBonmin/BonCbcNode.cpp

    r53 r57  
    2020#include "CoinWarmStartBasis.hpp"
    2121#include "CbcModel.hpp"
    22 #include "BonminCbcNode.hpp"
    23 #include "IpoptInterface.hpp"
    24 #include "IpoptWarmStart.hpp"
     22#include "BonCbcNode.hpp"
     23#include "OsiTMINLPInterface.hpp"
     24#include "BonminIpoptWarmStart.hpp"
     25#include "BonIpoptInterface.hpp"
    2526
    2627using namespace std;
     
    2930namespace Bonmin{
    3031//Default constructor
    31 BonminCbcFullNodeInfo::BonminCbcFullNodeInfo()
     32BonCbcFullNodeInfo::BonCbcFullNodeInfo()
    3233    :
    3334    CbcFullNodeInfo(),
     
    3637{}
    3738
    38 BonminCbcFullNodeInfo::BonminCbcFullNodeInfo(CbcModel * model,
     39BonCbcFullNodeInfo::BonCbcFullNodeInfo(CbcModel * model,
    3940    int numberRowsAtContinuous) :
    4041    CbcFullNodeInfo(model, numberRowsAtContinuous),
     
    4546
    4647// Copy constructor
    47 BonminCbcFullNodeInfo::BonminCbcFullNodeInfo ( const BonminCbcFullNodeInfo &other):
     48BonCbcFullNodeInfo::BonCbcFullNodeInfo ( const BonCbcFullNodeInfo &other):
    4849    CbcFullNodeInfo(other),
    4950    sequenceOfInfeasiblesSize_(other.sequenceOfInfeasiblesSize_),
     
    5455
    5556void
    56 BonminCbcFullNodeInfo::allBranchesGone()
     57BonCbcFullNodeInfo::allBranchesGone()
    5758{
    5859  IpoptWarmStart * ipws = dynamic_cast<IpoptWarmStart *>(basis_);
     
    6162}
    6263
    63 BonminCbcFullNodeInfo::~BonminCbcFullNodeInfo()
     64BonCbcFullNodeInfo::~BonCbcFullNodeInfo()
    6465{}
    6566
    6667CbcNodeInfo *
    67 BonminCbcFullNodeInfo::clone() const
     68BonCbcFullNodeInfo::clone() const
    6869{
    69   return new BonminCbcFullNodeInfo(*this);
     70  return new BonCbcFullNodeInfo(*this);
    7071}
    7172/****************************************************************************************************/
    7273
    7374// Default constructor
    74 BonminCbcPartialNodeInfo::BonminCbcPartialNodeInfo ()
     75BonCbcPartialNodeInfo::BonCbcPartialNodeInfo ()
    7576    : CbcPartialNodeInfo(),
    7677    sequenceOfInfeasiblesSize_(0),
     
    7980}
    8081// Constructor from current state
    81 BonminCbcPartialNodeInfo::BonminCbcPartialNodeInfo (CbcModel * model,CbcNodeInfo *parent, CbcNode *owner,
     82BonCbcPartialNodeInfo::BonCbcPartialNodeInfo (CbcModel * model,CbcNodeInfo *parent, CbcNode *owner,
    8283    int numberChangedBounds,
    8384    const int *variables,
     
    9394  Ipopt::ApplicationReturnStatus optimization_status
    9495  = ipopt->getOptStatus();
    95   BonminCbcPartialNodeInfo * nlpParent = dynamic_cast<BonminCbcPartialNodeInfo *> (parent);
     96  BonCbcPartialNodeInfo * nlpParent = dynamic_cast<BonCbcPartialNodeInfo *> (parent);
    9697  int numberInfeasible = 0;
    9798  int numberUnsolved = 0;
     
    106107  }
    107108  else {
    108     BonminCbcFullNodeInfo * nlpRoot = dynamic_cast<BonminCbcFullNodeInfo *> (parent);
     109    BonCbcFullNodeInfo * nlpRoot = dynamic_cast<BonCbcFullNodeInfo *> (parent);
    109110    if(nlpRoot) {
    110111      numberInfeasible = nlpRoot->getSequenceOfInfeasiblesSize();
     
    124125}
    125126
    126 BonminCbcPartialNodeInfo::BonminCbcPartialNodeInfo (const BonminCbcPartialNodeInfo & rhs)
     127BonCbcPartialNodeInfo::BonCbcPartialNodeInfo (const BonCbcPartialNodeInfo & rhs)
    127128
    128129    : CbcPartialNodeInfo(rhs),
     
    133134
    134135CbcNodeInfo *
    135 BonminCbcPartialNodeInfo::clone() const
     136BonCbcPartialNodeInfo::clone() const
    136137{
    137   return (new BonminCbcPartialNodeInfo(*this));
     138  return (new BonCbcPartialNodeInfo(*this));
    138139}
    139140
    140141void
    141 BonminCbcPartialNodeInfo::allBranchesGone()
     142BonCbcPartialNodeInfo::allBranchesGone()
    142143{
    143144  IpoptWarmStartDiff * ipws = dynamic_cast<IpoptWarmStartDiff *>(basisDiff_);
     
    146147}
    147148
    148 BonminCbcPartialNodeInfo::~BonminCbcPartialNodeInfo ()
     149BonCbcPartialNodeInfo::~BonCbcPartialNodeInfo ()
    149150{}
    150151}
  • branches/devel/Bonmin/src/CbcBonmin/BonCbcNode.hpp

    r53 r57  
    2424*/
    2525
    26 class BonminCbcFullNodeInfo : public CbcFullNodeInfo
     26class BonCbcFullNodeInfo : public CbcFullNodeInfo
    2727{
    2828
    2929public:
    30   friend class BonminCbcPartialNodeInfo;
     30  friend class BonCbcPartialNodeInfo;
    3131  // Default Constructor
    32   BonminCbcFullNodeInfo ();
     32  BonCbcFullNodeInfo ();
    3333
    3434  // Constructor from current state
    35   BonminCbcFullNodeInfo (CbcModel * model, int numberRowsAtContinuous);
     35  BonCbcFullNodeInfo (CbcModel * model, int numberRowsAtContinuous);
    3636
    3737  // Copy constructor
    38   BonminCbcFullNodeInfo ( const BonminCbcFullNodeInfo &);
     38  BonCbcFullNodeInfo ( const BonCbcFullNodeInfo &);
    3939
    4040  // Destructor
    41   ~BonminCbcFullNodeInfo ();
     41  ~BonCbcFullNodeInfo ();
    4242
    4343  /// Clone
     
    6767
    6868  /// Illegal Assignment operator
    69   BonminCbcFullNodeInfo & operator=(const BonminCbcFullNodeInfo& rhs);
     69  BonCbcFullNodeInfo & operator=(const BonCbcFullNodeInfo& rhs);
    7070};
    7171
    7272/** \brief Holds information for recreating a subproblem by incremental change
    73            from the parent for Bonmin
     73           from the parent for
    7474
    75   A BonminBonminCbcPartialNodeInfo object contains changes to the bounds and basis, and
     75  A BonminCbcPartialNodeInfo object contains changes to the bounds and basis, and
    7676  additional cuts, required to recreate a subproblem by modifying and
    7777  augmenting the parent subproblem.
    7878*/
    7979
    80 class BonminCbcPartialNodeInfo : public CbcPartialNodeInfo
     80class BonCbcPartialNodeInfo : public CbcPartialNodeInfo
    8181{
    8282
    8383public:
    8484  // Default Constructor
    85   BonminCbcPartialNodeInfo ();
     85  BonCbcPartialNodeInfo ();
    8686
    8787  // Constructor from current state
    88   BonminCbcPartialNodeInfo (CbcModel * model, CbcNodeInfo * parent, CbcNode * owner,
     88  BonCbcPartialNodeInfo (CbcModel * model, CbcNodeInfo * parent, CbcNode * owner,
    8989      int numberChangedBounds,const int * variables,
    9090      const double * boundChanges,
     
    9292
    9393  // Copy constructor
    94   BonminCbcPartialNodeInfo ( const BonminCbcPartialNodeInfo &);
     94  BonCbcPartialNodeInfo ( const BonCbcPartialNodeInfo &);
    9595
    9696  // Destructor
    97   ~BonminCbcPartialNodeInfo ();
     97  ~BonCbcPartialNodeInfo ();
    9898
    9999  /// Clone
     
    123123
    124124  /// Illegal Assignment operator
    125   BonminCbcPartialNodeInfo & operator=(const BonminCbcPartialNodeInfo& rhs);
     125  BonCbcPartialNodeInfo & operator=(const Bonmin::BonCbcPartialNodeInfo& rhs);
    126126};
    127127}
  • branches/devel/Bonmin/src/CbcBonmin/BonCbcParam.cpp

    r53 r57  
    99// Date : 03/15/2006
    1010
    11 #include "IpoptInterface.hpp"
    12 #include "BonminCbcParam.hpp"
     11#include "OsiTMINLPInterface.hpp"
     12#include "BonCbcParam.hpp"
    1313
    1414namespace Bonmin {
    1515bool
    16 BonminCbcParam::extractParams(IpoptInterface &solver)
     16BonminCbcParam::extractParams(OsiTMINLPInterface * solver)
    1717{
    1818  bool success = true;
    1919
    20   Ipopt::SmartPtr<Ipopt::OptionsList> Options = solver.retrieve_options();
     20  Ipopt::SmartPtr<Ipopt::OptionsList> Options = solver->retrieve_options();
    2121
    2222  //extract IpoptInterface special params
    23   solver.extractInterfaceParams();
     23  solver->extractInterfaceParams();
    2424
    2525  //log levels
  • branches/devel/Bonmin/src/CbcBonmin/BonCbcParam.hpp

    r53 r57  
    1212#define BonminCbcParam_H
    1313
    14 #include "IpoptInterface.hpp"
     14#include "OsiTMINLPInterface.hpp"
    1515namespace Bonmin {
    1616class BonminCbcParam
     
    135135  {}
    136136  ///Process parameter file and extract MIP options.
    137   bool extractParams(IpoptInterface &solver);
     137  bool extractParams(OsiTMINLPInterface * solver);
    138138  ///operator() will extractParameters from IpoptInterface.
    139   bool operator()(IpoptInterface &solver)
     139  bool operator()(OsiTMINLPInterface * solver)
    140140  {
    141141    return extractParams(solver);
    142142  }
    143143};
    144 }
     144} //end namespace Bonmin
    145145#endif
    146146
  • branches/devel/Bonmin/src/CbcBonmin/Makefile.am

    r1 r57  
    1818# List all source files, including headers
    1919libbonminbb_la_SOURCES = \
    20         CbcBonmin.cpp CbcBonmin.hpp \
    21         BonminCbcLpStrategy.cpp BonminCbcLpStrategy.hpp \
    22         BonminCbcNlpStrategy.cpp BonminCbcNlpStrategy.hpp \
    23         BonminCbcNode.cpp BonminCbcNode.hpp \
    24         BonminCbcParam.cpp BonminCbcParam.hpp
     20        BonCbc.cpp BonCbc.hpp \
     21        BonCbcLpStrategy.cpp BonCbcLpStrategy.hpp \
     22        BonCbcNlpStrategy.cpp BonCbcNlpStrategy.hpp \
     23        BonCbcNode.cpp BonCbcNode.hpp \
     24        BonCbcParam.cpp BonCbcParam.hpp
    2525
    2626# This is for libtool (on Windows)
     
    7171
    7272include_HEADERS = \
    73         CbcBonmin.hpp \
    74         BonminCbcParam.hpp
     73        BonCbc.hpp \
     74        BonCbcParam.hpp
    7575
    7676########################################################################
     
    8080# Here repeat all source files, with "bak" appended
    8181ASTYLE_FILES = \
    82         BonminCbcParam.cppbak BonminCbcParam.hppbak \
    83         CbcBonmin.cppbak CbcBonmin.hppbak \
    84         BonminCbcLpStrategy.cppbak BonminCbcLpStrategy.hppbak \
    85         BonminCbcNlpStrategy.cppbak BonminCbcNlpStrategy.hppbak \
    86         BonminCbcNode.cppbak BonminCbcNode.hppbak
     82        BonCbcParam.cppbak BonCbcParam.hppbak \
     83        BonCbc.cppbak BonCbc.hppbak \
     84        BonCbcLpStrategy.cppbak BonCbcLpStrategy.hppbak \
     85        BonCbcNlpStrategy.cppbak BonCbcNlpStrategy.hppbak \
     86        BonCbcNode.cppbak BonCbcNode.hppbak
    8787
    8888ASTYLE = @ASTYLE@
  • branches/devel/Bonmin/src/CbcBonmin/Makefile.in

    r1 r57  
    6161LTLIBRARIES = $(noinst_LTLIBRARIES)
    6262libbonminbb_la_LIBADD =
    63 am_libbonminbb_la_OBJECTS = CbcBonmin.lo BonminCbcLpStrategy.lo \
    64         BonminCbcNlpStrategy.lo BonminCbcNode.lo BonminCbcParam.lo
     63am_libbonminbb_la_OBJECTS = BonCbc.lo BonCbcLpStrategy.lo \
     64        BonCbcNlpStrategy.lo BonCbcNode.lo BonCbcParam.lo
    6565libbonminbb_la_OBJECTS = $(am_libbonminbb_la_OBJECTS)
    6666depcomp = $(SHELL) $(top_srcdir)/../depcomp
     
    312312# List all source files, including headers
    313313libbonminbb_la_SOURCES = \
    314         CbcBonmin.cpp CbcBonmin.hpp \
    315         BonminCbcLpStrategy.cpp BonminCbcLpStrategy.hpp \
    316         BonminCbcNlpStrategy.cpp BonminCbcNlpStrategy.hpp \
    317         BonminCbcNode.cpp BonminCbcNode.hpp \
    318         BonminCbcParam.cpp BonminCbcParam.hpp
     314        BonCbc.cpp BonCbc.hpp \
     315        BonCbcLpStrategy.cpp BonCbcLpStrategy.hpp \
     316        BonCbcNlpStrategy.cpp BonCbcNlpStrategy.hpp \
     317        BonCbcNode.cpp BonCbcNode.hpp \
     318        BonCbcParam.cpp BonCbcParam.hpp
    319319
    320320
     
    354354########################################################################
    355355include_HEADERS = \
    356         CbcBonmin.hpp \
    357         BonminCbcParam.hpp
     356        BonCbc.hpp \
     357        BonCbcParam.hpp
    358358
    359359
     
    364364# Here repeat all source files, with "bak" appended
    365365ASTYLE_FILES = \
    366         BonminCbcParam.cppbak BonminCbcParam.hppbak \
    367         CbcBonmin.cppbak CbcBonmin.hppbak \
    368         BonminCbcLpStrategy.cppbak BonminCbcLpStrategy.hppbak \
    369         BonminCbcNlpStrategy.cppbak BonminCbcNlpStrategy.hppbak \
    370         BonminCbcNode.cppbak BonminCbcNode.hppbak
     366        BonCbcParam.cppbak BonCbcParam.hppbak \
     367        BonCbc.cppbak BonCbc.hppbak \
     368        BonCbcLpStrategy.cppbak BonCbcLpStrategy.hppbak \
     369        BonCbcNlpStrategy.cppbak BonCbcNlpStrategy.hppbak \
     370        BonCbcNode.cppbak BonCbcNode.hppbak
    371371
    372372CLEANFILES = $(ASTYLE_FILES)
     
    423423        -rm -f *.tab.c
    424424
    425 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/BonminCbcLpStrategy.Plo@am__quote@
    426 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/BonminCbcNlpStrategy.Plo@am__quote@
    427 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/BonminCbcNode.Plo@am__quote@
    428 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/BonminCbcParam.Plo@am__quote@
    429 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CbcBonmin.Plo@am__quote@
     425@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/BonCbc.Plo@am__quote@
     426@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/BonCbcLpStrategy.Plo@am__quote@
     427@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/BonCbcNlpStrategy.Plo@am__quote@
     428@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/BonCbcNode.Plo@am__quote@
     429@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/BonCbcParam.Plo@am__quote@
    430430
    431431.cpp.o:
  • branches/devel/Bonmin/src/OaInterface/BonDummyHeuristic.cpp

    r53 r57  
    88// Date : 05/26/2005
    99
    10 #include "IpCbcDummyHeuristic.hpp"
     10#include "BonDummyHeuristic.hpp"
    1111#include "CoinHelperFunctions.hpp"
    1212#include "CbcModel.hpp"
     
    1515namespace Bonmin{
    1616/// Default constructor
    17 IpCbcDummyHeuristic::IpCbcDummyHeuristic(CbcModel &model,
    18     IpoptInterface * si)
     17DummyHeuristic::DummyHeuristic(CbcModel &model,
     18    OsiTMINLPInterface * si)
    1919    :
    2020    CbcHeuristic(model),
     
    2222{}
    2323
    24 IpCbcDummyHeuristic::IpCbcDummyHeuristic(IpoptInterface * si)
     24DummyHeuristic::DummyHeuristic(OsiTMINLPInterface * si)
    2525    :
    2626    CbcHeuristic(),
    2727    nlp_(si)
    2828{}
    29 /// Assign an IpoptInterface
     29/// Assign an OsiTMINLPInterface
    3030void
    31 IpCbcDummyHeuristic::assignInterface(IpoptInterface * si)
     31DummyHeuristic::assignInterface(OsiTMINLPInterface * si)
    3232{
    3333  nlp_ = si;
     
    3535/// heuristic method
    3636int
    37 IpCbcDummyHeuristic::solution(double &solutionValue, double *betterSolution)
     37DummyHeuristic::solution(double &solutionValue, double *betterSolution)
    3838{
    3939  OsiBabSolver * babSolver = dynamic_cast<OsiBabSolver *>
  • branches/devel/Bonmin/src/OaInterface/BonDummyHeuristic.hpp

    r53 r57  
    88// Date :  05/26/2005
    99
    10 #ifndef IpCbcDummyHeuristic_HPP
    11 #define IpCbcDummyHeuristic_HPP
    12 #include "IpoptInterface.hpp"
     10#ifndef BonDummyHeuristic_HPP
     11#define BonDummyHeuristic_HPP
     12#include "OsiTMINLPInterface.hpp"
    1313
    1414#include "CbcHeuristic.hpp"
    1515namespace Bonmin{
    16 class  IpCbcDummyHeuristic : public CbcHeuristic
     16class  DummyHeuristic : public CbcHeuristic
    1717{
    1818public:
    1919  /// Default constructor
    20   IpCbcDummyHeuristic(IpoptInterface * si = NULL);
     20  DummyHeuristic(OsiTMINLPInterface * si = NULL);
    2121  /// Usefull constructor
    22   IpCbcDummyHeuristic(CbcModel &model, IpoptInterface * si = NULL);
     22  DummyHeuristic(CbcModel &model, OsiTMINLPInterface * si = NULL);
    2323  ///Copy constructor
    24   IpCbcDummyHeuristic( const IpCbcDummyHeuristic &copy):
     24  DummyHeuristic( const DummyHeuristic &copy):
    2525      CbcHeuristic(copy),
    2626      nlp_(copy.nlp_),
    2727      knowsSolution(copy.knowsSolution)
    2828  {}
    29   /// Assign an IpoptInterface
    30   void assignInterface(IpoptInterface * si);
     29  /// Assign an OsiTMINLPInterface
     30  void assignInterface(OsiTMINLPInterface * si);
    3131  /// heuristic method
    3232  virtual int solution(double &solutionValue, double *betterSolution);
     
    3737  virtual CbcHeuristic * clone()const
    3838  {
    39     return new IpCbcDummyHeuristic(*this);
     39    return new DummyHeuristic(*this);
    4040  }
    4141  virtual void resetModel(CbcModel*)
     
    4343private:
    4444  /// Pointer to the Ipopt interface
    45   IpoptInterface * nlp_;
     45  OsiTMINLPInterface * nlp_;
    4646  /// Do I have a solution?
    4747  bool knowsSolution;
  • branches/devel/Bonmin/src/OaInterface/BonOACutGenerator.cpp

    r53 r57  
    88// Date :  05/26/2005
    99
    10 #include "IpCbcOACutGenerator.hpp"
     10#include "BonOACutGenerator.hpp"
    1111#include "OsiAuxInfo.hpp"
    1212
    1313namespace Bonmin{
    1414/// Default constructor
    15 IpCbcOACutGenerator::IpCbcOACutGenerator(IpoptInterface * si,
     15OACutGenerator::OACutGenerator(OsiTMINLPInterface * si,
    1616    int maxDepth)
    1717    :
     
    2525  messages_ = OaMessages();
    2626}
    27 /// Assign an IpoptInterface
     27/// Assign an OsiTMINLPInterface
    2828void
    29 IpCbcOACutGenerator::assignInterface(IpoptInterface * si)
     29OACutGenerator::assignInterface(OsiTMINLPInterface * si)
    3030
    3131{
     
    3535/// cut generation method
    3636void
    37 IpCbcOACutGenerator::generateCuts( const OsiSolverInterface & si, OsiCuts & cs,
     37OACutGenerator::generateCuts( const OsiSolverInterface & si, OsiCuts & cs,
    3838    const CglTreeInfo info) const
    3939{
     
    142142  else if(nlp_->isAbandoned() || nlp_->isIterationLimitReached()) {
    143143    std::cerr<<"Unsolved NLP ... exit"<<std::endl;
    144     nlp_->turnOnIpoptOutput();
     144    //    nlp_->turnOnIpoptOutput();
    145145    nlp_->resolve();
    146146    throw -1;
  • branches/devel/Bonmin/src/OaInterface/BonOACutGenerator.hpp

    r53 r57  
    88// Date :  05/26/2005
    99
    10 #ifndef IpCbcOACutGenerator_HPP
    11 #define IpCbcOACutGenerator_HPP
     10#ifndef BonOACutGenerator_HPP
     11#define BonOACutGenerator_HPP
    1212#include "CglCutGenerator.hpp"
    13 #include "IpoptInterface.hpp"
    14 #include "OaMessages.hpp"
     13#include "OsiTMINLPInterface.hpp"
     14#include "OAMessages.hpp"
    1515namespace Bonmin{
    16 class IpCbcOACutGenerator : public CglCutGenerator
     16class OACutGenerator : public CglCutGenerator
    1717{
    1818public:
    1919  /// Default constructor
    20   IpCbcOACutGenerator(IpoptInterface * si = NULL,
     20  OACutGenerator(OsiTMINLPInterface * si = NULL,
    2121      int maxDepth = 10);
    2222  /// Copy constructor
    23   IpCbcOACutGenerator(const IpCbcOACutGenerator &copy)
     23  OACutGenerator(const OACutGenerator &copy)
    2424      :
    2525      nlp_(copy.nlp_),
     
    3434  virtual CglCutGenerator * clone() const
    3535  {
    36     return new IpCbcOACutGenerator(*this);
     36    return new OACutGenerator(*this);
    3737  }
    3838
    3939  /** Desctructor */
    40   virtual ~IpCbcOACutGenerator()
     40  virtual ~OACutGenerator()
    4141  {
    4242    delete handler_;
    4343  }
    4444
    45   /// Assign an IpoptInterface
    46   void assignInterface(IpoptInterface * si);
     45  /// Assign an OsiTMINLPInterface
     46  void assignInterface(OsiTMINLPInterface * si);
    4747  /// cut generation method
    4848  virtual void generateCuts( const OsiSolverInterface & si, OsiCuts & cs,
     
    6666private:
    6767  /// Pointer to the Ipopt interface
    68   IpoptInterface * nlp_;
     68  OsiTMINLPInterface * nlp_;
    6969
    7070  /** maximum depth at which generate cuts*/
  • branches/devel/Bonmin/src/OaInterface/BonOACutGenerator2.cpp

    r53 r57  
    1111#include "BonminConfig.h"
    1212
    13 #include "IpCbcOACutGenerator2.hpp"
     13#include "BonOACutGenerator2.hpp"
    1414#include "OsiClpSolverInterface.hpp"
    1515
     
    2525namespace Bonmin{
    2626/// Default constructor
    27 IpCbcOACutGenerator2::IpCbcOACutGenerator2():
     27OACutGenerator2::OACutGenerator2():
    2828    CglCutGenerator(),
    2929    nlp_(NULL),
     
    5353
    5454
    55 IpCbcOACutGenerator2::IpCbcOACutGenerator2
    56 (IpoptInterface * nlp,
     55OACutGenerator2::OACutGenerator2
     56(OsiTMINLPInterface * nlp,
    5757 OsiSolverInterface * si,
    5858 CbcStrategy * strategy,
     
    9090}
    9191
    92 IpCbcOACutGenerator2::~IpCbcOACutGenerator2()
     92OACutGenerator2::~OACutGenerator2()
    9393{
    9494  delete handler_;
     
    9696    delete strategy_;
    9797}
    98 /// Assign an IpoptInterface
     98/// Assign an OsiTMINLPInterface
    9999void
    100 IpCbcOACutGenerator2::assignNlpInterface(IpoptInterface * nlp)
     100OACutGenerator2::assignNlpInterface(OsiTMINLPInterface * nlp)
    101101{
    102102  nlp_ = nlp;
    103103}
    104104
    105 /// Assign an IpoptInterface
     105/// Assign an OsiTMINLPInterface
    106106void
    107 IpCbcOACutGenerator2::assignLpInterface(OsiSolverInterface * si)
     107OACutGenerator2::assignLpInterface(OsiSolverInterface * si)
    108108{
    109109  si_ = si;
     
    113113}
    114114
    115 double IpCbcOACutGenerator2::siBestObj(CbcModel * model) const
     115double OACutGenerator2::siBestObj(CbcModel * model) const
    116116{
    117117  if(model == NULL) {
     
    123123    if(shortSolverName == "cbc") {
    124124      throw CoinError("OsiCbc is not supported for doing local searches use OsiClpSolverInterface instead",
    125           "IpCbcOACutGenerator2","setTheNodeLimit");
     125          "OACutGenerator2","setTheNodeLimit");
    126126    }
    127127    else if(solverName == "cplex") {
     
    131131      int status = CPXgetbestobjval(cpx->getEnvironmentPtr(),cpx->getLpPtr(OsiCpxSolverInterface::KEEPCACHED_ALL), &value);
    132132      if(status)
    133         throw CoinError("Error in getting CPLEX best bound","IpCbcOACutGenerator2","siBestObj");
     133        throw CoinError("Error in getting CPLEX best bound","OACutGenerator2","siBestObj");
    134134      return value;
    135135#else
    136136
    137137      throw CoinError("You have to define COIN_HAS_CPX at compilation to be able to use cplex for local searches",
    138           "IpCbcOACutGenerator2","siBestObj");
     138          "OACutGenerator2","siBestObj");
    139139#endif
    140140
     
    145145      mesg +=" for local searches, you should use Cbc or Cplex";
    146146      throw CoinError(mesg,
    147           "IpCbcOACutGenerator2","assignLpInterface");
     147          "OACutGenerator2","assignLpInterface");
    148148    }
    149149  }
     
    151151    return model->getBestPossibleObjValue();
    152152}
    153 void IpCbcOACutGenerator2::setTheNodeLimit()
     153void OACutGenerator2::setTheNodeLimit()
    154154{
    155155  //Check solver name to see if local searches can be performed
     
    161161  if(shortSolverName == "cbc") {
    162162    throw CoinError("OsiCbc is not supported for doing local searches use OsiClpSolverInterface instead",
    163         "IpCbcOACutGenerator2","setTheNodeLimit");
     163        "OACutGenerator2","setTheNodeLimit");
    164164  }
    165165  else if(solverName == "cplex") {
     
    170170
    171171    throw CoinError("You have to define COIN_HAS_CPX at compilation to be able to use cplex for local searches",
    172         "IpCbcOACutGenerator2","setTheNodeLimit");
     172        "OACutGenerator2","setTheNodeLimit");
    173173#endif
    174174
     
    182182    mesg +=" for local searches, you should use Cbc or Cplex";
    183183    throw CoinError(mesg,
    184         "IpCbcOACutGenerator2","setTheNodeLimit");
    185   }
    186 }
    187 
    188 
    189 void IpCbcOACutGenerator2::setTimeLimit(double time) const
     184        "OACutGenerator2","setTheNodeLimit");
     185  }
     186}
     187
     188
     189void OACutGenerator2::setTimeLimit(double time) const
    190190{
    191191  //Check solver name to see if local searches can be performed
     
    196196  if(shortSolverName == "cbc") {
    197197    throw CoinError("OsiCbc is not supported for doing local searches use OsiClpSolverInterface instead",
    198         "IpCbcOACutGenerator2","setTheNodeLimit");
     198        "OACutGenerator2","setTheNodeLimit");
    199199  }
    200200  else if(solverName == "cplex") {
     
    205205
    206206    throw CoinError("You have to define COIN_HAS_CPX at compilation to be able to use cplex for local searches",
    207         "IpCbcOACutGenerator2","setTheNodeLimit");
     207        "OACutGenerator2","setTheNodeLimit");
    208208#endif
    209209
     
    217217    mesg +=" for local searches, you should use Cbc or Cplex";
    218218    throw CoinError(mesg,
    219         "IpCbcOACutGenerator2","setTheNodeLimit");
    220   }
    221 }
    222 
    223 void IpCbcOACutGenerator2::setCutoff(double bestKnown) const
     219        "OACutGenerator2","setTheNodeLimit");
     220  }
     221}
     222
     223void OACutGenerator2::setCutoff(double bestKnown) const
    224224{
    225225  //Check solver name to see if local searches can be performed
     
    231231  if(shortSolverName == "cbc") {
    232232    throw CoinError("OsiCbc is not supported for doing local searches use OsiClpSolverInterface instead",
    233         "IpCbcOACutGenerator2","setTheNodeLimit");
     233        "OACutGenerator2","setTheNodeLimit");
    234234  }
    235235  else if(solverName == "cplex") {
     
    240240
    241241    throw CoinError("You have to define COIN_HAS_CPX at compilation to be able to use cplex for local searches",
    242         "IpCbcOACutGenerator2","setTheNodeLimit");
     242        "OACutGenerator2","setTheNodeLimit");
    243243#endif
    244244
     
    252252    mesg +=" for local searches, you should use Cbc or Cplex";
    253253    throw CoinError(mesg,
    254         "IpCbcOACutGenerator2","setTheNodeLimit");
     254        "OACutGenerator2","setTheNodeLimit");
    255255  }
    256256}/// cut generation method
    257257void
    258 IpCbcOACutGenerator2::generateCuts( const OsiSolverInterface & si, OsiCuts & cs,
     258OACutGenerator2::generateCuts( const OsiSolverInterface & si, OsiCuts & cs,
    259259    const CglTreeInfo info) const
    260260{
     
    379379    else if (numberCutsToAdd < 0)//Oups some error
    380380    {
    381       std::cerr<<"Internal error in IpCbcOACutGenerator2 : number of cuts wrong"<<std::endl;
     381      std::cerr<<"Internal error in OACutGenerator2 : number of cuts wrong"<<std::endl;
    382382    }
    383383
     
    393393      delete warm;
    394394      throw CoinError("Fail installing the warm start in the subproblem",
    395           "generateCuts","IpCbcOACutGenerator2") ;
     395          "generateCuts","OACutGenerator2") ;
    396396    }
    397397    delete warm;
     
    417417#ifdef NO_NULL_SI
    418418    throw CoinError("Not allowed to modify si in a cutGenerator",
    419         "IpCbcOACutGenerator2","generateCuts");
     419        "OACutGenerator2","generateCuts");
    420420#else //Seems that nobody wants to allow me to do this
    421421    if(leaveSiUnchanged_)
     
    656656        delete basis;
    657657        throw CoinError("Fail setWarmStart() after cut installation.",
    658             "generateCuts","IpCbcOACutGenerator2") ;
     658            "generateCuts","OACutGenerator2") ;
    659659      }
    660660      delete basis;
     
    855855        if(si_->setWarmStart(saveWarmStart)==false) {
    856856          throw CoinError("Fail restoring the warm start at the end of procedure",
    857               "generateCuts","IpCbcOACutGenerator2") ;
     857              "generateCuts","OACutGenerator2") ;
    858858        }
    859859        delete saveWarmStart;
  • branches/devel/Bonmin/src/OaInterface/BonOACutGenerator2.hpp

    r53 r57  
    99
    1010
    11 #ifndef IpCbcOACutGenerator2_HPP
    12 #define IpCbcOACutGenerator2_HPP
     11#ifndef BonOACutGenerator2_HPP
     12#define BonOACutGenerator2_HPP
    1313#include "CglCutGenerator.hpp"
    14 #include "IpoptInterface.hpp"
    15 #include "OaMessages.hpp"
     14#include "OsiTMINLPInterface.hpp"
     15#include "OAMessages.hpp"
    1616#include "CbcModel.hpp"
    1717
     
    2121
    2222namespace Bonmin{
    23 class IpCbcOACutGenerator2 : public CglCutGenerator
     23class OACutGenerator2 : public CglCutGenerator
    2424{
    2525public:
    2626  typedef enum subSolver {Clp, Cbc, Cplex, Other};
    2727  /// Default constructor
    28   IpCbcOACutGenerator2();
     28  OACutGenerator2();
    2929  /// Usefull constructor
    30   IpCbcOACutGenerator2(IpoptInterface * nlp = NULL,
     30  OACutGenerator2(OsiTMINLPInterface * nlp = NULL,
    3131      OsiSolverInterface * si = NULL,
    3232      CbcStrategy * strategy = NULL,
     
    3838
    3939  /// Copy constructor
    40   IpCbcOACutGenerator2(const IpCbcOACutGenerator2 &copy)
     40  OACutGenerator2(const OACutGenerator2 &copy)
    4141      :nlp_(copy.nlp_),
    4242      si_(copy.si_),
     
    6363  }
    6464  /// Destructor
    65   ~IpCbcOACutGenerator2();
     65  ~OACutGenerator2();
    6666
    67   /// Assign an IpoptInterface
    68   void assignNlpInterface(IpoptInterface * nlp);
     67  /// Assign an OsiTMINLPInterface
     68  void assignNlpInterface(OsiTMINLPInterface * nlp);
    6969
    70   /// Assign an IpoptInterface
     70  /// Assign an OsiTMINLPInterface
    7171  void assignLpInterface(OsiSolverInterface * si);
    7272
     
    8383  virtual CglCutGenerator * clone() const
    8484  {
    85     return new IpCbcOACutGenerator2(*this);
     85    return new OACutGenerator2(*this);
    8686  }
    8787
     
    147147  double siBestObj(CbcModel * model=NULL) const;
    148148  /// Pointer to the Ipopt interface
    149   IpoptInterface * nlp_;
     149  OsiTMINLPInterface * nlp_;
    150150  ///Number of NLP resolution done
    151151  mutable int nSolve_;
  • branches/devel/Bonmin/src/OaInterface/Makefile.am

    r1 r57  
    1818# List all source files, including headers
    1919liboainterface_la_SOURCES = \
    20         IpCbcDummyHeuristic.cpp IpCbcDummyHeuristic.hpp \
    21         IpCbcOACutGenerator.cpp IpCbcOACutGenerator.hpp \
    22         IpCbcOACutGenerator2.cpp IpCbcOACutGenerator2.hpp \
    23         OaMessages.cpp OaMessages.hpp
     20        BonDummyHeuristic.cpp BonDummyHeuristic.hpp \
     21        BonOACutGenerator.cpp BonOACutGenerator.hpp \
     22        BonOACutGenerator2.cpp BonOACutGenerator2.hpp \
     23        OAMessages.cpp OAMessages.hpp
    2424
    2525# This is for libtool (on Windows)
     
    5959# Here repeat all source files, with "bak" appended
    6060ASTYLE_FILES = \
    61         IpCbcDummyHeuristic.cppbak IpCbcDummyHeuristic.hppbak \
    62         IpCbcOACutGenerator.cppbak IpCbcOACutGenerator.hppbak \
    63         IpCbcOACutGenerator2.cppbak IpCbcOACutGenerator2.hppbak \
    64         OaMessages.cppbak OaMessages.hppbak
     61        BonDummyHeuristic.cppbak BonDummyHeuristic.hppbak \
     62        BonOACutGenerator.cppbak BonOACutGenerator.hppbak \
     63        BonOACutGenerator2.cppbak BonOACutGenerator2.hppbak \
     64        BonOaMessages.cppbak BonOaMessages.hppbak
    6565
    6666ASTYLE = @ASTYLE@
  • branches/devel/Bonmin/src/OaInterface/Makefile.in

    r1 r57  
    5959LTLIBRARIES = $(noinst_LTLIBRARIES)
    6060liboainterface_la_LIBADD =
    61 am_liboainterface_la_OBJECTS = IpCbcDummyHeuristic.lo \
    62         IpCbcOACutGenerator.lo IpCbcOACutGenerator2.lo OaMessages.lo
     61am_liboainterface_la_OBJECTS = BonDummyHeuristic.lo \
     62        BonOACutGenerator.lo BonOACutGenerator2.lo OAMessages.lo
    6363liboainterface_la_OBJECTS = $(am_liboainterface_la_OBJECTS)
    6464depcomp = $(SHELL) $(top_srcdir)/../depcomp
     
    301301# List all source files, including headers
    302302liboainterface_la_SOURCES = \
    303         IpCbcDummyHeuristic.cpp IpCbcDummyHeuristic.hpp \
    304         IpCbcOACutGenerator.cpp IpCbcOACutGenerator.hpp \
    305         IpCbcOACutGenerator2.cpp IpCbcOACutGenerator2.hpp \
    306         OaMessages.cpp OaMessages.hpp
     303        BonDummyHeuristic.cpp BonDummyHeuristic.hpp \
     304        BonOACutGenerator.cpp BonOACutGenerator.hpp \
     305        BonOACutGenerator2.cpp BonOACutGenerator2.hpp \
     306        OAMessages.cpp OAMessages.hpp
    307307
    308308
     
    334334# Here repeat all source files, with "bak" appended
    335335ASTYLE_FILES = \
    336         IpCbcDummyHeuristic.cppbak IpCbcDummyHeuristic.hppbak \
    337         IpCbcOACutGenerator.cppbak IpCbcOACutGenerator.hppbak \
    338         IpCbcOACutGenerator2.cppbak IpCbcOACutGenerator2.hppbak \
    339         OaMessages.cppbak OaMessages.hppbak
     336        BonDummyHeuristic.cppbak BonDummyHeuristic.hppbak \
     337        BonOACutGenerator.cppbak BonOACutGenerator.hppbak \
     338        BonOACutGenerator2.cppbak BonOACutGenerator2.hppbak \
     339        BonOaMessages.cppbak BonOaMessages.hppbak
    340340
    341341CLEANFILES = $(ASTYLE_FILES)
     
    392392        -rm -f *.tab.c
    393393
    394 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/IpCbcDummyHeuristic.Plo@am__quote@
    395 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/IpCbcOACutGenerator.Plo@am__quote@
    396 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/IpCbcOACutGenerator2.Plo@am__quote@
    397 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OaMessages.Plo@am__quote@
     394@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/BonDummyHeuristic.Plo@am__quote@
     395@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/BonOACutGenerator.Plo@am__quote@
     396@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/BonOACutGenerator2.Plo@am__quote@
     397@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OAMessages.Plo@am__quote@
    398398
    399399.cpp.o:
  • branches/devel/Bonmin/src/OaInterface/OAMessages.cpp

    r52 r57  
    99
    1010
    11 #include "OaMessages.hpp"
     11#include "OAMessages.hpp"
     12
     13namespace Bonmin{
    1214
    1315OaMessages::OaMessages():
     
    2628  addMessage(PERIODIC_MSG, CoinOneMessage(10,1,"After %7.1f seconds, upper bound %10g, lower bound %10g"));
    2729}
     30
     31}//end namespace Bonmin
  • branches/devel/Bonmin/src/OaInterface/OAMessages.hpp

    r52 r57  
    1212#include "CoinMessage.hpp"
    1313
     14namespace Bonmin {
    1415enum OA_Message{
    1516  FEASIBLE_NLP,
     
    3233  OaMessages();
    3334};
     35
     36} //end namespace Bonmin
    3437#endif
Note: See TracChangeset for help on using the changeset viewer.