00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #include <iomanip>
00012 #include <fstream>
00013
00014 #include "CoinPragma.hpp"
00015 #include "BonminConfig.h"
00016 #include "IpoptConfig.h"
00017 #include "CbcConfig.h"
00018 #include "CoinTime.hpp"
00019 #include "SepaSetup.hpp"
00020 #include "BonCbc.hpp"
00021
00022 #define CATCH_ERRORS
00023 int main (int argc, char *argv[])
00024 {
00025 using namespace Ipopt;
00026 char * pbName = NULL;
00027
00028 std::cout<<"Bonmin "
00029 <<BONMIN_VERSION;
00030 std::cout<<" using Cbc "
00031 <<CBC_VERSION;
00032 std::cout<<" and Ipopt "
00033 <<IPOPT_VERSION<<std::endl;
00034 if(argc > 1) {
00035 pbName = new char[strlen(argv[1])+1];
00036 strcpy(pbName, argv[1]);
00037 }
00038 #define CATCH_ERRORS
00039 #ifdef CATCH_ERRORS
00040 try
00041 #endif
00042 {
00043
00044
00045 Sepa::SepaSetup bonmin;
00046 bonmin.initialize(argv);
00047 Bonmin::Bab bb;
00048
00049 bb(bonmin);
00050
00051 }
00052 #ifdef CATCH_ERRORS
00053 catch(Bonmin::TNLPSolver::UnsolvedError *E) {
00054 E->writeDiffFiles();
00055 E->printError(std::cerr);
00056
00057
00058
00059
00060 }
00061 catch(Bonmin::OsiTMINLPInterface::SimpleError &E) {
00062 std::cerr<<E.className()<<"::"<<E.methodName()
00063 <<std::endl
00064 <<E.message()<<std::endl;
00065 }
00066 catch(CoinError &E) {
00067 std::cerr<<E.className()<<"::"<<E.methodName()
00068 <<std::endl
00069 <<E.message()<<std::endl;
00070 }
00071 catch (Ipopt::OPTION_INVALID &E)
00072 {
00073 std::cerr<<"Ipopt exception : "<<E.Message()<<std::endl;
00074 }
00075 catch (Ipopt::IpoptException &E)
00076 {
00077 std::cerr<<"Ipopt exception : "<<E.Message()<<std::endl;
00078 }
00079 catch(...) {
00080 std::cerr<<pbName<<" unrecognized exception"<<std::endl;
00081 std::cerr<<pbName<<"\t Finished \t exception"<<std::endl;
00082 throw;
00083 }
00084 #endif
00085
00086 delete [] pbName;
00087 return 0;
00088 }
00089