Ignore:
Timestamp:
Sep 28, 2006 2:19:58 PM (13 years ago)
Author:
pbonami
Message:

Did some space for other NLP solver
1 - Created new OsiTMINLPInterface as base class for interfaces
2 - Created new TNLPSolver as base class for the interface to a solver capable of solving a TNLP
3 - derived the classes for Ipopt
4 - Start putting some namespace Bonmin around

Location:
branches/devel/Bonmin/test
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/devel/Bonmin/test/InterfaceTest.cpp

    r49 r53  
    1313#include "AmplTMINLP.hpp"
    1414#include "IpIpoptApplication.hpp"
     15
     16using namespace Bonmin;
    1517/** Test function for the Osi interface to Ipopt (or any nlp solver). <br>
    1618    If Solver passes all the test then it should have everything needed to be integrated into bonmin. */
     
    148150}
    149151
    150 void testOa(BonminAmplInterface &si)
     152void testOa(Bonmin::AmplInterface &si)
    151153{
    152154        CoinRelFltEq eq(1e-07);// to test equality of doubles   
     
    208210}
    209211
    210 void testFp(BonminAmplInterface &si)
     212void testFp(Bonmin::AmplInterface &si)
    211213{
    212214        CoinRelFltEq eq(1e-07);// to test equality of doubles
     
    243245        //Setup Ipopt should be replaced if solver is changed
    244246        using namespace Ipopt;
    245       SmartPtr<Ipopt::IpoptApplication> app = new Ipopt::IpoptApplication();
     247      SmartPtr<Bonmin::IpoptSolver> app = new Bonmin::IpoptSolver();
    246248       const char * args[3] ={"name","mytoy",NULL}; //Ugly, but I don't know how to do differently
    247249       const char ** argv = args;
    248       SmartPtr<Ipopt::TMINLP> ampl_tminlp = new Ipopt::AmplTMINLP(ConstPtr(app->Jnlst()), app->Options(), const_cast<char**&>(argv));
     250      SmartPtr<TMINLP> ampl_tminlp = new AmplTMINLP(ConstPtr(app->getIpoptApp().Jnlst()), app->Options(), const_cast<char**&>(argv));
    249251      IpoptInterface si(ampl_tminlp);
    250252    std::cout<<"---------------------------------------------------------------------------------------------------------------------------------------------------------"
     
    277279      const char * args[3] ={"name","mytoy",NULL}; //Ugly, but I don't know how to do differently
    278280      const char ** argv = args;
    279       SmartPtr<Ipopt::TMINLP> ampl_tminlp = new Ipopt::AmplTMINLP(ConstPtr(app->Jnlst()),  app->Options(), const_cast<char**&>(argv));
     281      SmartPtr<TMINLP> ampl_tminlp = new AmplTMINLP(ConstPtr(app->Jnlst()),  app->Options(), const_cast<char**&>(argv));
    280282      IpoptInterface si1(ampl_tminlp);
    281283     
     
    296298        const char * args[3] ={"name","mytoy",NULL}; //Ugly, but I don't know how to do differently
    297299        const char ** argv = args;
    298       BonminAmplInterface si(const_cast<char**&>(argv));
     300      Bonmin::AmplInterface si(const_cast<char**&>(argv));
    299301      std::cout<<"---------------------------------------------------------------------------------------------------------------------------------------------------------"
    300302               <<std::endl<<"Testing outer approximations related methods"<<std::endl
     
    310312//    char * args[3] ={"name","toy3",NULL}; //Ugly, but I don't know how to do differently
    311313//    char ** argv = args;
    312 //    SmartPtr<Ipopt::TMINLP> ampl_tminlp = new Ipopt::AmplTMINLP(ConstPtr(app->Jnlst()),  app->Options(), argv);
    313 //    BonminAmplInterface si(ampl_tminlp);
     314//    SmartPtr<TMINLP> ampl_tminlp = new AmplTMINLP(ConstPtr(app->Jnlst()),  app->Options(), argv);
     315//    Bonmin::AmplInterface si(ampl_tminlp);
    314316//    std::cout<<"---------------------------------------------------------------------------------------------------------------------------------------------------------"
    315317//           <<std::endl<<"Testing optimization of some distance over feasible set"<<std::endl
  • branches/devel/Bonmin/test/Makefile.am

    r49 r53  
    7575        -I`$(CYGPATH_W) $(IPOPTSRCDIR)/src/LinAlg` \
    7676        -I`$(CYGPATH_W) $(COINUTILSSRCDIR)/src` \
     77        -I`$(CYGPATH_W) $(COINUTILSOBJDIR)/inc` \
    7778        -I`$(CYGPATH_W) $(OSISRCDIR)/src` \
    7879        -I`$(CYGPATH_W) $(OSISRCDIR)/src/OsiClp` \
  • branches/devel/Bonmin/test/Makefile.in

    r49 r53  
    363363        -I`$(CYGPATH_W) $(IPOPTSRCDIR)/src/LinAlg` \
    364364        -I`$(CYGPATH_W) $(COINUTILSSRCDIR)/src` \
     365        -I`$(CYGPATH_W) $(COINUTILSOBJDIR)/inc` \
    365366        -I`$(CYGPATH_W) $(OSISRCDIR)/src` \
    366367        -I`$(CYGPATH_W) $(OSISRCDIR)/src/OsiClp` \
Note: See TracChangeset for help on using the changeset viewer.