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 using namespace Bonmin;
00024 int main (int argc, char *argv[])
00025 {
00026 using namespace Ipopt;
00027 char * pbName = NULL;
00028
00029 std::cout<<"Bonmin "
00030 <<BONMIN_VERSION;
00031 std::cout<<" using Cbc "
00032 <<CBC_VERSION;
00033 std::cout<<" and Ipopt "
00034 <<IPOPT_VERSION<<std::endl;
00035 if(argc > 1) {
00036 pbName = new char[strlen(argv[1])+1];
00037 strcpy(pbName, argv[1]);
00038 }
00039 #define CATCH_ERRORS
00040 #ifdef CATCH_ERRORS
00041 try
00042 #endif
00043 {
00044
00045
00046 SepaSetup bonmin;
00047 bonmin.initialize(argv);
00048 Bab bb;
00049
00050 bb(bonmin);
00051
00052 }
00053 #ifdef CATCH_ERRORS
00054 catch(TNLPSolver::UnsolvedError *E) {
00055 E->writeDiffFiles();
00056 E->printError(std::cerr);
00057
00058
00059
00060
00061 }
00062 catch(OsiTMINLPInterface::SimpleError &E) {
00063 std::cerr<<E.className()<<"::"<<E.methodName()
00064 <<std::endl
00065 <<E.message()<<std::endl;
00066 }
00067 catch(CoinError &E) {
00068 std::cerr<<E.className()<<"::"<<E.methodName()
00069 <<std::endl
00070 <<E.message()<<std::endl;
00071 }
00072 catch (Ipopt::OPTION_INVALID &E)
00073 {
00074 std::cerr<<"Ipopt exception : "<<E.Message()<<std::endl;
00075 }
00076 catch (Ipopt::IpoptException &E)
00077 {
00078 std::cerr<<"Ipopt exception : "<<E.Message()<<std::endl;
00079 }
00080 catch(...) {
00081 std::cerr<<pbName<<" unrecognized exception"<<std::endl;
00082 std::cerr<<pbName<<"\t Finished \t exception"<<std::endl;
00083 throw;
00084 }
00085 #endif
00086
00087 delete [] pbName;
00088 return 0;
00089 }
00090