16 #include "UtilParameters.h"
20 #include "AlpsDecompModel.h"
22 #include "DecompAlgoC.h"
23 #include "DecompAlgoPC.h"
24 #include "DecompAlgoRC.h"
26 #include "UtilTimer.h"
30 int main(
int argc,
char ** argv){
36 UtilParameters utilParam(argc, argv);
38 bool doCut = utilParam.GetSetting(
"doCut",
false);
39 bool doPriceCut = utilParam.GetSetting(
"doPriceCut",
true);
40 bool doDirect = utilParam.GetSetting(
"doDirect",
false);
44 double timeSetupReal = 0.0;
45 double timeSetupCpu = 0.0;
46 double timeSolveReal = 0.0;
47 double timeSolveCpu = 0.0;
66 DecompAlgo *algo = NULL;
67 assert(doCut + doPriceCut == 1);
73 algo =
new DecompAlgoC(&osdip, &utilParam);
79 std::cout <<
"CREATE NEW DecompAlgoPC" << std::endl;
80 algo =
new DecompAlgoPC(&osdip, &utilParam);
81 std::cout <<
"DONE CREATE NEW DecompAlgoPC" << std::endl;
87 if(doCut && doDirect){
89 timeSetupCpu = timer.getCpuTime();
90 timeSetupReal = timer.getRealTime();
99 timeSolveCpu = timer.getCpuTime();
100 timeSolveReal = timer.getRealTime();
104 timeSetupCpu = timer.getCpuTime();
105 timeSetupReal = timer.getRealTime();
111 AlpsDecompModel alpsModel(utilParam, algo);
117 std::cout << std::endl << std::endl << std::endl << std::endl;
118 std::cout <<
"***************START SOLVE***************" << std::endl;
122 status = alpsModel.solve();
123 std::cout <<
"FINISH SOLVE" << std::endl;
125 timeSolveCpu = timer.getCpuTime();
126 timeSolveReal = timer.getRealTime();
132 std::cout <<
"Status= " << status
133 <<
" BestLB= " << std::setw(10)
134 << UtilDblToStr(alpsModel.getGlobalLB(),5)
135 <<
" BestUB= " << std::setw(10)
136 << UtilDblToStr(alpsModel.getGlobalUB(),5)
137 <<
" Nodes= " << std::setw(6)
138 << alpsModel.getNumNodesProcessed()
139 <<
" SetupCPU= " << timeSetupCpu
140 <<
" SolveCPU= " << timeSolveCpu
141 <<
" TotalCPU= " << timeSetupCpu + timeSolveCpu
142 <<
" SetupReal= " << timeSetupReal
143 <<
" SetupReal= " << timeSolveReal
144 <<
" TotalReal= " << timeSetupReal + timeSetupReal
148 const DecompSolution * solution = alpsModel.getBestSolution();
149 std::cout <<
"Optimal Solution" << std::endl;
152 algo->getMasterOSI()->writeLp(
"finalRestrictedMaster",
"lp", 1
e-30, 5, 10);
162 std::cout <<
"Something went wrong:" << std::endl;
163 std::cout << eclass.
errormsg << std::endl;
167 std::cout <<
"Program terminates normally" << std::endl;
std::string errormsg
errormsg is the error that is causing the exception to be thrown
int main(int argc, char *argv[])
void fint fint fint real fint real real real real real real real real real * e
used for throwing exceptions.