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