17 #include "CoinPragma.hpp"
22 #include "CoinTime.hpp"
33 int main (
int argc,
char *argv[])
36 using namespace Ipopt;
37 using namespace Bonmin;
40 char * pbName =
new char[strlen(argv[1])+1];
41 strcpy(pbName, argv[1]);
42 std::string nodeFileName;
45 std::string startingPointFile =
"";
47 startingPointFile = argv[3];
50 char ** myArgv =
new char *[3];
51 myArgv[0]=
new char[strlen(argv[0])+1];
52 strcpy(myArgv[0],argv[0]);
53 myArgv[1]=
new char[strlen(argv[1])+1];
54 strcpy(myArgv[1],argv[1]);
65 nlpSolver.messageHandler()->setLogLevel(2);
69 std::cout<<nodeFileName<<std::endl;
80 nlpSolver.solver()->forceSolverOutput(4);
81 nlpSolver.initialSolve();
84 for(
int i = 0 ; i <nlpSolver.getNumCols() ; i++) {
85 if (nlpSolver.isInteger(i)) {
86 std::cout<<
"x[ "<<i<<
"] = "<<nlpSolver.getColSolution()[i]<<std::endl;
91 std::cerr<<E.className()<<
"::"<<E.methodName()
93 <<E.message()<<std::endl;
96 std::cerr<<E.className()<<
"::"<<E.methodName()
98 <<E.message()<<std::endl;
101 std::cerr<<pbName<<
" unrecognized excpetion"<<std::endl;
102 std::cerr<<pbName<<
"\t Finished \t exception"<<std::endl;
void initialize(char **&argv)
initialize bonmin with ampl model using the command line arguments.
int main(int argc, char *argv[])
This is class provides an Osi interface for a Mixed Integer Linear Program expressed as a TMINLP (so ...
bool readAndApply(OsiTMINLPInterface *solver)
Read warmstart info and apply to an IpoptInterface.
This class reads a file with a starting point for Ipopt initalization.
Error class to throw exceptions from OsiTMINLPInterface.
Reads a file containing change bounds for variables.
void readAndApply(OsiTMINLPInterface *solver)