35 #ifdef SOPLEX_WITH_EGLIB 40 #define EGlpNumStart() {} 41 #define EGlpNumClear() {} 47 int main(
int argc,
char* argv[]);
55 " --readbas=<basfile> read starting basis from file\n" 56 " --writebas=<basfile> write terminal basis to file\n" 57 " --writefile=<lpfile> write LP to file in LP or MPS format depending on extension\n" 58 " --writedual=<lpfile> write the dual LP to a file in LP or MPS formal depending on extension\n" 59 " --<type>:<name>=<val> change parameter value using syntax of settings file entries\n" 60 " --loadset=<setfile> load parameters from settings file (overruled by command line parameters)\n" 61 " --saveset=<setfile> save parameters to settings file\n" 62 " --diffset=<setfile> save modified parameters to settings file\n" 63 " --extsol=<value> external solution for soplex to use for validation\n" 65 "limits and tolerances:\n" 66 " -t<s> set time limit to <s> seconds\n" 67 " -i<n> set iteration limit to <n>\n" 68 " -f<eps> set primal feasibility tolerance to <eps>\n" 69 " -o<eps> set dual feasibility (optimality) tolerance to <eps>\n" 70 " -l<eps> set validation tolerance to <eps>\n" 72 "algorithmic settings (* indicates default):\n" 73 " --readmode=<value> choose reading mode for <lpfile> (0* - floating-point, 1 - rational)\n" 74 " --solvemode=<value> choose solving mode (0 - floating-point solve, 1* - auto, 2 - force iterative refinement)\n" 75 " -s<value> choose simplifier/presolver (0 - off, 1* - auto)\n" 76 " -g<value> choose scaling (0 - off, 1 - uni-equilibrium, 2* - bi-equilibrium, 3 - geometric, 4 - iterated geometric, 5 - least squares)\n" 77 " -p<value> choose pricing (0* - auto, 1 - dantzig, 2 - parmult, 3 - devex, 4 - quicksteep, 5 - steep)\n" 78 " -r<value> choose ratio tester (0 - textbook, 1 - harris, 2 - fast, 3* - boundflipping)\n" 81 " -v<level> set verbosity to <level> (0 - error, 3 - normal, 5 - high)\n" 82 " -x print primal solution\n" 83 " -y print dual multipliers\n" 84 " -X print primal solution in rational numbers\n" 85 " -Y print dual multipliers in rational numbers\n" 86 " -q display detailed statistics\n" 87 " -c perform final check of optimal solution in original problem\n" 91 std::cerr <<
"missing input file\n\n";
93 std::cerr <<
"invalid option \"" << argv[idx] <<
"\"\n\n";
95 std::cerr <<
"usage: " << argv[0] <<
" " <<
"[options] <lpfile>\n" 96 #ifdef SOPLEX_WITH_ZLIB 97 <<
" <lpfile> linear program as .mps[.gz] or .lp[.gz] file\n\n" 99 <<
" <lpfile> linear program as .mps or .lp file\n\n" 106 void freeStrings(
char*& s1,
char*& s2,
char*& s3,
char*& s4,
char*& s5)
149 Real maxviol = boundviol > rowviol ? boundviol : rowviol;
151 soplex.
spxout <<
"Primal solution " << (feasible ?
"feasible" :
"infeasible")
152 <<
" in original problem (max. violation = " << std::scientific << maxviol
153 << std::setprecision(8) << std::fixed <<
").\n" 175 Real maxviol = redcostviol > dualviol ? redcostviol : dualviol;
177 soplex.
spxout <<
"Dual solution " << (feasible ?
"feasible" :
"infeasible")
178 <<
" in original problem (max. violation = " << std::scientific << maxviol
179 << std::setprecision(8) << std::fixed <<
").\n" 207 Rational maxviol = boundviol > rowviol ? boundviol : rowviol;
209 soplex.
spxout <<
"Primal solution " << (feasible ?
"feasible" :
"infeasible") <<
" in original problem (max. violation = " <<
rationalToString(maxviol) <<
").\n" 231 Rational maxviol = redcostviol > dualviol ? redcostviol : dualviol;
233 soplex.
spxout <<
"Dual solution " << (feasible ?
"feasible" :
"infeasible") <<
" in original problem (max. violation = " <<
rationalToString(maxviol) <<
").\n" 266 int main(
int argc,
char* argv[])
279 const char* lpfilename = 0;
280 char* readbasname = 0;
281 char* writebasname = 0;
282 char* writefilename = 0;
283 char* writedualfilename = 0;
284 char* loadsetname = 0;
285 char* savesetname = 0;
286 char* diffsetname = 0;
287 bool printPrimal =
false;
288 bool printPrimalRational =
false;
289 bool printDual =
false;
290 bool printDualRational =
false;
291 bool displayStatistics =
false;
292 bool checkSol =
false;
320 for( optidx = 1; optidx < argc; optidx++ )
322 char* option = argv[optidx];
325 if( option[0] !=
'-' )
327 lpfilename = argv[optidx];
333 if( option[0] !=
'-' || option[1] ==
'\0' 334 || ((option[2] ==
'\0') != (option[1] ==
'x' || option[1] ==
'X' || option[1] ==
'y' || option[1] ==
'Y' || option[1] ==
'q' || option[1] ==
'c')) )
338 goto TERMINATE_FREESTRINGS;
348 if( strncmp(option,
"readbas=", 8) == 0 )
350 if( readbasname == 0 )
352 char* filename = &option[8];
353 readbasname = strncpy(
new char[strlen(filename) + 1], filename, strlen(filename) + 1);
357 else if( strncmp(option,
"writebas=", 9) == 0 )
359 if( writebasname == 0 )
361 char* filename = &option[9];
362 writebasname = strncpy(
new char[strlen(filename) + 1], filename, strlen(filename) + 1);
366 else if( strncmp(option,
"writefile=", 10) == 0 )
368 if( writefilename == 0 )
370 char* filename = &option[10];
371 writefilename = strncpy(
new char[strlen(filename) + 1], filename, strlen(filename) + 1);
375 else if( strncmp(option,
"writedual=", 10) == 0 )
377 if( writedualfilename == 0 )
379 char* dualfilename = &option[10];
380 writedualfilename = strncpy(
new char[strlen(dualfilename) + 1], dualfilename, strlen(dualfilename) + 1);
384 else if( strncmp(option,
"loadset=", 8) == 0 )
386 if( loadsetname == 0 )
388 char* filename = &option[8];
389 loadsetname = strncpy(
new char[strlen(filename) + 1], filename, strlen(filename) + 1);
394 goto TERMINATE_FREESTRINGS;
404 else if( strncmp(option,
"saveset=", 8) == 0 )
406 if( savesetname == 0 )
408 char* filename = &option[8];
409 savesetname = strncpy(
new char[strlen(filename) + 1], filename, strlen(filename) + 1);
413 else if( strncmp(option,
"diffset=", 8) == 0 )
415 if( diffsetname == 0 )
417 char* filename = &option[8];
418 diffsetname = strncpy(
new char[strlen(filename) + 1], filename, strlen(filename) + 1);
422 else if( strncmp(option,
"readmode=", 9) == 0 )
428 goto TERMINATE_FREESTRINGS;
432 else if( strncmp(option,
"solvemode=", 10) == 0 )
438 goto TERMINATE_FREESTRINGS;
449 else if( strncmp(option,
"extsol=", 7) == 0 )
451 char* input = &option[7];
456 goto TERMINATE_FREESTRINGS;
464 goto TERMINATE_FREESTRINGS;
475 goto TERMINATE_FREESTRINGS;
485 goto TERMINATE_FREESTRINGS;
495 goto TERMINATE_FREESTRINGS;
505 goto TERMINATE_FREESTRINGS;
515 goto TERMINATE_FREESTRINGS;
525 goto TERMINATE_FREESTRINGS;
535 goto TERMINATE_FREESTRINGS;
545 goto TERMINATE_FREESTRINGS;
555 goto TERMINATE_FREESTRINGS;
565 goto TERMINATE_FREESTRINGS;
576 printPrimalRational =
true;
586 printDualRational =
true;
591 displayStatistics =
true;
603 MSG_ERROR( std::cerr <<
"Error printing parameters\n" );
612 goto TERMINATE_FREESTRINGS;
620 if( lpfilename == 0 && savesetname == 0 && diffsetname == 0 )
624 goto TERMINATE_FREESTRINGS;
630 MSG_ERROR( std::cerr <<
"Error: manual synchronization is invalid on command line. Change parameter int:syncmode.\n" );
632 goto TERMINATE_FREESTRINGS;
636 if( savesetname != 0 )
638 MSG_INFO1( soplex->
spxout, soplex->
spxout <<
"Saving parameters to settings file <" << savesetname <<
"> . . .\n" );
641 MSG_ERROR( std::cerr <<
"Error writing parameters to file <" << savesetname <<
">\n" );
644 if( diffsetname != 0 )
646 MSG_INFO1( soplex->
spxout, soplex->
spxout <<
"Saving modified parameters to settings file <" << diffsetname <<
"> . . .\n" );
649 MSG_ERROR( std::cerr <<
"Error writing modified parameters to file <" << diffsetname <<
">\n" );
654 if( lpfilename == 0 )
656 if( loadsetname != 0 || savesetname != 0 || diffsetname != 0 )
660 goto TERMINATE_FREESTRINGS;
664 readingTime->
start();
677 <<
" LP file <" << lpfilename <<
"> . . .\n" );
679 if( !soplex->
readFile(lpfilename, &rownames, &colnames) )
681 MSG_ERROR( std::cerr <<
"Error while reading file <" << lpfilename <<
">.\n" );
683 goto TERMINATE_FREESTRINGS;
687 if( writefilename != 0 )
689 if( !soplex->
writeFileReal(writefilename, &rownames, &colnames) )
691 MSG_ERROR( std::cerr <<
"Error while writing file <" << writefilename <<
">.\n\n" );
693 goto TERMINATE_FREESTRINGS;
702 if( writedualfilename != 0 )
706 MSG_ERROR( std::cerr <<
"Error while writing dual file <" << writedualfilename <<
">.\n\n" );
708 goto TERMINATE_FREESTRINGS;
712 MSG_INFO1( soplex->
spxout, soplex->
spxout <<
"Written dual LP to file <" << writedualfilename <<
">.\n\n" );
717 if( readbasname != 0 )
720 if( !soplex->
readBasisFile(readbasname, &rownames, &colnames) )
722 MSG_ERROR( std::cerr <<
"Error while reading file <" << readbasname <<
">.\n" );
724 goto TERMINATE_FREESTRINGS;
732 soplex->
spxout <<
"Reading took " 733 << std::fixed << std::setprecision(2) << readingTime->
time()
734 << std::scientific << std::setprecision(
int(prec))
735 <<
" seconds.\n\n" );
746 printwidth = printprec + 10;
759 << std::setw(printwidth)
760 << std::setprecision(printprec)
761 << primal[i] << std::endl; )
765 << std::setprecision(8) << std::fixed <<
")." << std::endl; )
776 << std::setw(printwidth)
777 << std::setprecision(printprec)
778 << primal[i] << std::endl; )
784 << std::setprecision(8) << std::fixed <<
"). Solution has " << nNonzeros <<
" nonzero entries." << std::endl; )
792 if( printPrimalRational )
807 MSG_INFO1( soplex->
spxout, soplex->
spxout <<
"All other variables are zero. Solution has " << nNonzeros <<
" nonzero entries." << std::endl; )
824 << std::setw(printwidth)
825 << std::setprecision(printprec)
826 << dual[i] << std::endl; )
830 << std::setprecision(8) << std::fixed <<
")." << std::endl; )
839 << std::setw(printwidth)
840 << std::setprecision(printprec)
841 << dual[i] << std::endl; )
845 << std::setprecision(8) << std::fixed <<
")." << std::endl; )
853 if( printDualRational )
874 if( displayStatistics )
884 if( writebasname != 0 )
888 MSG_WARNING( soplex->
spxout, soplex->
spxout <<
"No basis information available. Could not write file <" << writebasname <<
">\n\n" );
890 else if( !soplex->
writeBasisFile(writebasname, &rownames, &colnames) )
892 MSG_ERROR( std::cerr <<
"Error while writing file <" << writebasname <<
">.\n\n" );
894 goto TERMINATE_FREESTRINGS;
898 MSG_INFO1( soplex->
spxout, soplex->
spxout <<
"Written basis information to file <" << writebasname <<
">.\n\n" );
904 MSG_ERROR( std::cerr <<
"Exception caught: " << x.
what() <<
"\n" );
906 goto TERMINATE_FREESTRINGS;
909 TERMINATE_FREESTRINGS:
910 freeStrings(readbasname, writebasname, loadsetname, savesetname, diffsetname);
971 static bool checkMode =
false;
980 class MySoPlex :
public SoPlex 984 MySoPlex(
SPxOut& outstream,
987 :
SoPlex(outstream, p_type, p_rep)
994 void displayQuality()
const 1001 MSG_INFO1( (*spxout), (*spxout) <<
"IEXAMP05 Violations (max/sum)" << std::endl; )
1003 m_solver.qualConstraintViolation(maxviol, sumviol);
1005 MSG_INFO1( (*spxout), (*spxout) <<
"IEXAMP06 Constraints :" 1006 << std::setw(16) << maxviol <<
" " 1007 << std::setw(16) << sumviol << std::endl; )
1009 qualConstraintViolation(maxviol, sumviol);
1011 MSG_INFO1( (*spxout), (*spxout) <<
"IEXAMP07 (unscaled) :" 1012 << std::setw(16) << maxviol <<
" " 1013 << std::setw(16) << sumviol << std::endl; )
1015 m_solver.qualBoundViolation(maxviol, sumviol);
1017 MSG_INFO1( (*spxout), (*spxout) <<
"IEXAMP08 Bounds :" 1018 << std::setw(16) << maxviol <<
" " 1019 << std::setw(16) << sumviol << std::endl; )
1021 qualBoundViolation(maxviol, sumviol);
1023 MSG_INFO1( (*spxout), (*spxout) <<
"IEXAMP09 (unscaled) :" 1024 << std::setw(16) << maxviol <<
" " 1025 << std::setw(16) << sumviol << std::endl; )
1029 m_solver.qualSlackViolation(maxviol, sumviol);
1031 MSG_INFO1( (*spxout), (*spxout) <<
"IEXAMP10 Slacks :" 1032 << std::setw(16) << maxviol <<
" " 1033 << std::setw(16) << sumviol << std::endl; )
1035 m_solver.qualRedCostViolation(maxviol, sumviol);
1037 MSG_INFO1( (*spxout), (*spxout) <<
"IEXAMP11 Reduced costs :" 1038 << std::setw(16) << maxviol <<
" " 1039 << std::setw(16) << sumviol << std::endl; )
1041 MSG_INFO1( (*spxout), (*spxout) <<
"IEXAMP12 Proven dual bound:" 1043 << std::setprecision(20)
1044 << m_solver.provedDualbound() << std::endl; )
1050 MSG_INFO1( (*spxout), (*spxout) <<
"Violations (max/sum)" << std::endl; )
1052 m_solver.qualConstraintViolation(maxviol, sumviol);
1054 MSG_INFO1( (*spxout), (*spxout) <<
"Constraints :" 1055 << std::setw(16) << maxviol <<
" " 1056 << std::setw(16) << sumviol << std::endl; )
1058 qualConstraintViolation(maxviol, sumviol);
1060 MSG_INFO1( (*spxout), (*spxout) <<
" (unscaled) :" 1061 << std::setw(16) << maxviol <<
" " 1062 << std::setw(16) << sumviol << std::endl; )
1064 m_solver.qualBoundViolation(maxviol, sumviol);
1066 MSG_INFO1( (*spxout), (*spxout) <<
"Bounds :" 1067 << std::setw(16) << maxviol <<
" " 1068 << std::setw(16) << sumviol << std::endl; )
1070 qualBoundViolation(maxviol, sumviol);
1072 MSG_INFO1( (*spxout), (*spxout) <<
" (unscaled) :" 1073 << std::setw(16) << maxviol <<
" " 1074 << std::setw(16) << sumviol << std::endl; )
1078 m_solver.qualSlackViolation(maxviol, sumviol);
1080 MSG_INFO1( (*spxout), (*spxout) <<
"Slacks :" 1081 << std::setw(16) << maxviol <<
" " 1082 << std::setw(16) << sumviol << std::endl; )
1084 m_solver.qualRedCostViolation(maxviol, sumviol);
1086 MSG_INFO1( (*spxout), (*spxout) <<
"Reduced costs :" 1087 << std::setw(16) << maxviol <<
" " 1088 << std::setw(16) << sumviol << std::endl; )
1090 MSG_INFO1( (*spxout), (*spxout) <<
"Proven dual bound:" 1092 << std::setprecision(20)
1093 << m_solver.provedDualbound() << std::endl; )
1099 void displayInfeasibility()
const 1106 if( m_solver.isProvenInfeasible() )
1107 MSG_INFO1( (*spxout), (*spxout) <<
"IEXAMP13 Infeasibility is proven." << std::endl; )
1109 MSG_INFO1( (*spxout), (*spxout) <<
"IEXAMP13 Infeasibility could not be proven!" << std::endl; )
1113 if ( m_solver.isProvenInfeasible() )
1115 MSG_INFO1( (*spxout), (*spxout) <<
"Infeasibility is proven." << std::endl; )
1119 MSG_INFO1( (*spxout), (*spxout) <<
"Infeasibility could not be proven!" << std::endl; )
1132 void print_version_info()
1134 const char* banner1 =
1135 "************************************************************************\n" 1137 "* SoPlex --- the Sequential object-oriented simPlex. *\n" 1140 const char* banner2 =
1142 "* Copyright (C) 1996-2017 Konrad-Zuse-Zentrum *\n" 1143 "* fuer Informationstechnik Berlin *\n" 1145 "* SoPlex is distributed under the terms of the ZIB Academic Licence. *\n" 1146 "* You should have received a copy of the ZIB Academic License *\n" 1147 "* along with SoPlex; If not email to soplex@zib.de. *\n" 1149 "************************************************************************\n" 1153 std::cout << banner1;
1155 #if (SOPLEX_SUBVERSION > 0) 1157 std::cout <<
"* Version ";
1159 std::cout <<
"SoPlex version ";
1165 << std::setw(13) << std::setiosflags(std::ios::left) <<
getGitHash();
1167 std::cout <<
" *\n" << banner2 << std::endl;
1172 std::cout <<
"* Release ";
1174 std::cout <<
"SoPlex release ";
1179 << std::setw(13) << std::setiosflags(std::ios::left) <<
getGitHash();
1181 std::cout <<
" *\n" << banner2 << std::endl;
1187 std::cout <<
"[NDEBUG:" 1195 std::cout <<
"[WITH_WARNINGS:" 1196 #ifdef WITH_WARNINGS 1203 std::cout <<
"[ENABLE_ADDITIONAL_CHECKS:" 1204 #ifdef ENABLE_ADDITIONAL_CHECKS 1211 std::cout <<
"[ENABLE_CONSISTENCY_CHECKS:" 1212 #ifdef ENABLE_CONSISTENCY_CHECKS 1219 std::cout <<
"[SOPLEX_WITH_GMP:" 1220 #ifdef SOPLEX_WITH_GMP 1225 <<
"]" << std::endl;
1227 std::cout << std::endl;
1232 void print_short_version_info()
1234 const char* banner1 =
1235 "************************************************************************\n" 1236 "* SoPlex --- the Sequential object-oriented simPlex. ";
1237 const char* banner2 =
1238 "* Copyright (C) 1996-2017 Konrad-Zuse-Zentrum *\n" 1239 "* fuer Informationstechnik Berlin *\n" 1240 "************************************************************************\n";
1242 std::cout << banner1;
1243 #if (SOPLEX_SUBVERSION > 0) 1244 std::cout <<
"Version " 1251 std::cout <<
"Release " 1257 std::cout << banner2 << std::endl;
1263 void print_usage_and_exit(
const char*
const argv[] )
1266 "[options] LPfile [Basfile]\n\n" 1267 " LPfile can be either in MPS or LPF format\n\n" 1268 "options: (*) indicates default\n" 1269 " (!) indicates experimental features which may give wrong results\n" 1270 " -e select entering algorithm (default is leaving)\n" 1271 " -r select row wise representation (default is column)\n" 1272 " -i select Eta-update (default is Forest-Tomlin)\n" 1273 " -x output solution vector\n" 1274 " -y output dual multipliers\n" 1275 " -q display solution quality\n" 1276 " -br read file with starting basis from Basfile\n" 1277 " -bw write file with optimal basis to Basfile\n" 1278 " -l set time limit in seconds\n" 1279 " -L set iteration limit\n" 1280 " -f set primal feasibility tolerance\n" 1281 " -o set optimality, i.e., dual feasibility tolerance\n" 1282 " -d set primal and dual feasibility tolerance to same value\n" 1283 " -zz set general zero tolerance\n" 1284 " -zf set factorization zero tolerance\n" 1285 " -zu set update zero tolerance\n" 1286 " -v set verbosity Level: from 0 (ERROR) to 5 (INFO3), default 3 (INFO1)\n" 1287 " -V show program version\n" 1288 " -C check mode (for check scripts)\n" 1289 " -h show this help\n\n" 1290 "Simplifier: Scaler: Starter: Pricer: Ratiotester:\n" 1291 " -s0 none -g0 none -c0 none* -p0 Textbook -t0 Textbook\n" 1292 " -s1 Main* -g1 uni-Equi -c1 Weight -p1 ParMult -t1 Harris\n" 1293 " -g2 bi-Equi* -c2 Sum -p2 Devex -t2 Fast\n" 1294 " -g3 Geo1 -c3 Vector -p3 Hybrid! -t3 Bound Flipping*\n" 1295 " -g4 Geo8 -p4 Steep*\n" 1297 " -p6 SteepExactSetup\n" 1300 std::cerr <<
"usage: " << argv[0] <<
" " << usage << std::endl;
1306 void check_parameter(
const char param,
const char*
const argv[])
1309 print_usage_and_exit( argv );
1314 void print_algorithm_parameters(
1322 MSG_INFO1( (*work.spxout), (*work.spxout)
1323 <<
"IEXAMP12 Feastol = " 1324 << std::setw(16) << work.feastol() << std::endl
1325 <<
"IEXAMP52 Opttol = " 1326 << std::setw(16) << work.opttol() << std::endl
1327 <<
"IEXAMP13 Epsilon Zero = " 1329 <<
"IEXAMP37 Epsilon Factor = " 1331 <<
"IEXAMP38 Epsilon Update = " 1335 <<
" algorithm" << std::endl
1338 <<
" representation" << std::endl
1341 <<
" update" << std::endl; )
1345 MSG_INFO1( (*work.spxout), (*work.spxout)
1346 <<
"SoPlex parameters: " << std::endl
1348 << std::setw(16) << work.feastol() << std::endl
1350 << std::setw(16) << work.opttol() << std::endl
1351 <<
"Epsilon Zero = " 1353 <<
"Epsilon Factor = " 1355 <<
"Epsilon Update = " 1358 <<
"algorithm = " << (work.type() ==
SPxSolver::ENTER ?
"Entering" :
"Leaving")
1360 <<
"representation = " << (representation ==
SPxSolver::ROW ?
"Row" :
"Column")
1362 <<
"update = " << (update ==
SLUFactor::ETA ?
"Eta" :
"Forest-Tomlin")
1399 assert(pricer != 0);
1401 #ifdef PARTIAL_PRICING 1402 MSG_INFO1( (*spxout), (*spxout) <<
"IEXAMP17 " << pricer->
getName() <<
" pricing" 1403 <<
" (partial, size = " << MAX_PRICING_CANDIDATES <<
")" 1406 MSG_INFO1( (*spxout), (*spxout) <<
"IEXAMP17 " << pricer->
getName() <<
" pricing" 1410 #ifdef PARTIAL_PRICING
1412 <<
" (partial, size = " << MAX_PRICING_CANDIDATES <<
")" 1444 assert(ratiotester != 0);
1446 MSG_INFO1( (*spxout), (*spxout) <<
"IEXAMP18 " << ratiotester->
getName() <<
" ratiotest" << std::endl; )
1448 MSG_INFO1( (*spxout), (*spxout) <<
"ratiotest = " << ratiotester->
getName() << std::endl; )
1484 MSG_INFO1( (*spxout), (*spxout) <<
"IEXAMP19 " 1485 << ((postscaler != 0) ? postscaler->
getName() :
"no")
1486 <<
" scaling" << std::endl; )
1490 MSG_INFO1( (*spxout), (*spxout) <<
"scaling = " 1491 << ((postscaler != 0) ? postscaler->
getName() :
"no")
1509 assert(simplifier == 0);
1514 MSG_INFO1( (*spxout), (*spxout) <<
"IEXAMP20 " << ((simplifier == 0) ?
"no" : simplifier->
getName()) <<
" simplifier" << std::endl; )
1516 MSG_INFO1( (*spxout), (*spxout) <<
"simplifier = " << ((simplifier == 0) ?
"no" : simplifier->getName()) << std::endl; )
1543 MSG_INFO1( (*spxout), (*spxout) <<
"IEXAMP21 " << ((starter == 0) ?
"no" : starter->
getName()) <<
" starter" << std::endl; )
1545 MSG_INFO1( (*spxout), (*spxout) <<
"starter = " << ((starter == 0) ?
"no" : starter->getName()) << std::endl; )
1551 #ifdef SEND_ALL_OUTPUT_TO_FILES 1553 void redirect_output(
1554 std::ostream& myerrstream,
1555 std::ostream& myinfostream
1558 myerrstream .setf( std::ios::scientific | std::ios::showpoint );
1559 myinfostream.setf( std::ios::scientific | std::ios::showpoint );
1570 void read_input_file(
1572 const char* filename,
1577 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"IEXAMP22 loading LP file " << filename << std::endl; )
1579 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"\nLoading LP file " << filename << std::endl; )
1584 if ( ! work.readFile(filename, &rownames, &colnames, 0) )
1587 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"EEXAMP23 error while reading file \"" << filename <<
"\"" << std::endl; )
1589 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"error while reading file \"" << filename <<
"\"" << std::endl; )
1592 assert(work.isConsistent());
1598 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"IEXAMP24 LP has " 1599 << work.nRows() <<
" rows " 1600 << work.nCols() <<
" columns " 1601 << work.nNzos() <<
" nonzeros" 1604 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"IEXAMP41 LP reading time: " << timer.
time() << std::endl; )
1608 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"LP has " 1609 << work.nRows() <<
" rows " 1610 << work.nCols() <<
" columns " 1611 << work.nNzos() <<
" nonzeros" 1615 std::streamsize prec = (*work.spxout).precision();
1616 (*work.spxout) <<
"LP reading time: " << std::fixed << std::setprecision(2) << timer.
time();
1617 (*work.spxout) << std::scientific << std::setprecision(
int(prec)) << std::endl; )
1623 void read_basis_file(
1625 const char* filename,
1629 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"Reading basis from file (disables simplifier)" << std::endl; )
1630 if (!work.readBasisFile(filename, rownames, colnames))
1633 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"EEXAMP25 error while reading file \"" << filename <<
"\"" << std::endl; )
1635 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"Error while reading file \"" << filename <<
"\"" << std::endl; )
1642 void solve_LP(MySoPlex& work)
1648 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"IEXAMP26 solving LP" << std::endl; )
1650 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"\nSolving LP ..." << std::endl; )
1655 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"\nSoPlex statistics:\n" << work.statistics(); )
1660 void print_solution_and_status(
1664 const int precision,
1665 const bool print_quality,
1666 const bool print_solution,
1667 const bool print_dual,
1668 const bool write_basis,
1669 const char* basisname
1676 MSG_INFO1( (*work.spxout), (*work.spxout) << std::endl; )
1681 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"IEXAMP29 solution value is: " << std::setprecision( precision ) << work.objValue() << std::endl; )
1683 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"Solution value is: " << std::setprecision( precision ) << work.objValue() << std::endl; )
1685 if ( print_quality )
1686 work.displayQuality();
1688 if ( print_solution )
1694 MSG_INFO1( (*work.spxout), (*work.spxout) << std::endl <<
"Primal solution (name, id, value):" << std::endl; )
1695 for(
int i = 0; i < work.nCols(); ++i )
1697 if (
isNotZero( objx[i], 0.001 * work.feastol() ) )
1698 MSG_INFO1( (*work.spxout), (*work.spxout) << colnames[ work.cId(i) ] <<
"\t" 1701 << std::setprecision( precision )
1702 << objx[i] << std::endl; )
1704 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"All other variables are zero (within " << std::setprecision(1) << 0.001*work.feastol() <<
")." << std::endl; )
1710 bool allzero =
true;
1714 MSG_INFO1( (*work.spxout), (*work.spxout) << std::endl <<
"Dual multipliers (name, id, value):" << std::endl; )
1715 for(
int i = 0; i < work.nRows(); ++i )
1717 if (
isNotZero( objy[i] , 0.001 * work.opttol() ) )
1719 MSG_INFO1( (*work.spxout), (*work.spxout) << rownames[ work.rId(i) ] <<
"\t" 1722 << std::setprecision( precision )
1723 << objy[i] << std::endl; )
1728 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"All " << (allzero ?
"" :
"other ") <<
"dual values are zero (within " 1729 << std::setprecision(1) << 0.001*work.opttol() <<
")." << std::endl; )
1735 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"Minimizing: a positive/negative value corresponds to left-hand (>=) resp. right-hand (<=) side." 1740 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"Maximizing: a positive/negative value corresponds to right-hand (<=) resp. left-hand (>=) side." 1748 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"Writing basis of original problem to file " << basisname << std::endl; )
1749 if ( ! work.writeBasisFile( basisname, &rownames, &colnames ) )
1752 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"EEXAMP30 error while writing file \"" << basisname <<
"\"" << std::endl; )
1754 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"Error while writing file \"" << basisname <<
"\"" << std::endl; )
1760 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"IEXAMP31 LP is unbounded" << std::endl; )
1762 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"LP is unbounded" << std::endl; )
1764 if ( print_solution )
1769 MSG_INFO1( (*work.spxout), (*work.spxout) << std::endl <<
"Primal solution (name, id, value):" << std::endl; )
1770 for(
int i = 0; i < work.nCols(); ++i )
1772 if (
isNotZero( objx[i], 0.001 * work.feastol() ) )
1773 MSG_INFO1( (*work.spxout), (*work.spxout) << colnames[ work.cId(i) ] <<
"\t" 1776 << std::setprecision( precision )
1777 << objx[i] << std::endl; )
1779 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"All other variables are zero (within " << std::setprecision(1) << 0.001*work.feastol() <<
")." << std::endl; )
1782 DVector objcoef(work.nCols());
1786 Real rayobjval = 0.0;
1788 work.getObj(objcoef);
1790 MSG_INFO1( (*work.spxout), (*work.spxout) << std::endl <<
"Primal ray (name, id, value):" << std::endl; )
1791 for(
int i = 0; i < work.nCols(); ++i )
1793 if (
isNotZero( ray[i], 0.001 * work.feastol() ) )
1795 rayobjval += ray[i] * objcoef[i];
1797 MSG_INFO1( (*work.spxout), (*work.spxout) << colnames[ work.cId(i) ] <<
"\t" 1800 << std::setprecision( precision )
1801 << ray[i] << std::endl; )
1804 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"All other variables have zero value (within " << std::setprecision(1) << 0.001*work.feastol() <<
")." << std::endl; )
1805 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"Objective change per unit along primal ray is " << rayobjval <<
"." << std::endl; )
1811 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"IEXAMP32 LP is infeasible" << std::endl; )
1813 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"LP is infeasible" << std::endl; )
1814 if ( print_solution )
1816 DVector farkasx(work.nRows());
1820 DVector proofvec(work.nCols());
1827 for(
int i = 0; i < work.nRows(); ++i )
1829 if (
isNotZero( farkasx[i], 0.001 * work.opttol() ) )
1831 MSG_INFO1( (*work.spxout), (*work.spxout) << rownames[ work.rId(i) ] <<
"\t" 1834 << std::setprecision( precision )
1835 << farkasx[i] <<
"\t"; )
1837 work.getRow(i, row);
1840 MSG_INFO1( (*work.spxout), (*work.spxout) << row.lhs() <<
" <= "; );
1842 for(
int j = 0; j < row.rowVector().size(); ++j )
1844 if( row.rowVector().value(j) > 0 )
1846 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"+"; )
1848 MSG_INFO1( (*work.spxout), (*work.spxout)
1849 << row.rowVector().value(j) <<
" " 1850 << colnames[ work.cId(row.rowVector().index(j)) ]
1855 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"<= " << row.rhs(); );
1857 MSG_INFO1( (*work.spxout), (*work.spxout) << std::endl; )
1858 if( farkasx[i] > 0.0 )
1860 lhs += farkasx[i] * row.lhs();
1861 rhs += farkasx[i] * row.rhs();
1865 lhs += farkasx[i] * row.rhs();
1866 rhs += farkasx[i] * row.lhs();
1874 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"All other row multipliers are zero (within " << std::setprecision(1) << 0.001*work.opttol() <<
")." << std::endl; )
1875 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"Farkas infeasibility proof: \t"; )
1876 MSG_INFO1( (*work.spxout), (*work.spxout) << lhs <<
" <= "; )
1878 bool nonzerofound =
false;
1879 for(
int i = 0; i < work.nCols(); ++i )
1881 if (
isNotZero( proofvec[i], 0.001 * work.opttol() ) )
1883 if( proofvec[i] > 0 )
1885 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"+"; )
1887 MSG_INFO1( (*work.spxout), (*work.spxout) << proofvec[i] <<
" " << colnames[ work.cId(i) ] <<
" "; )
1888 nonzerofound =
true;
1893 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"0 "; );
1895 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"<= " << rhs << std::endl; );
1898 if ( print_quality )
1899 work.displayInfeasibility();
1901 if ( ! work.writeBasisFile( basisname, &rownames, &colnames ) )
1904 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"EEXAMP30 error while writing file \"" << basisname <<
"\"" << std::endl; )
1906 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"Error while writing file \"" << basisname <<
"\"" << std::endl; )
1911 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"EEXAMP40 aborted due to cycling" << std::endl; )
1913 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"Aborted due to cycling" << std::endl; )
1917 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"IEXAMP33 aborted due to time limit" << std::endl; )
1919 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"Aborted due to time limit" << std::endl; )
1923 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"IEXAMP34 aborted due to iteration limit" << std::endl; )
1925 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"Aborted due to iteration limit" << std::endl; )
1929 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"IEXAMP35 aborted due to objective value limit" << std::endl; )
1931 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"Aborted due to objective value limit" << std::endl; )
1935 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"EEXAMP39 basis is singular" << std::endl; )
1937 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"Basis is singular" << std::endl; )
1941 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"EEXAMP36 An error occurred during " <<
"the solution process" << std::endl; )
1943 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"An error occurred during " <<
"the solution process" << std::endl; )
1946 MSG_INFO1( (*work.spxout), (*work.spxout) << std::endl; )
1960 if ( postscaler != 0 )
1965 if ( simplifier != 0 )
1976 assert( pricer != 0 );
1980 assert( ratiotester != 0 );
1984 if ( basisname != 0 )
1985 delete [] basisname;
1993 int main(
int argc,
char* argv[])
1995 const char* filename;
1996 char* basisname = 0;
2015 int simplifying = 1;
2025 bool print_solution =
false;
2026 bool print_dual =
false;
2027 bool print_quality =
false;
2028 bool read_basis =
false;
2029 bool write_basis =
false;
2033 for(optidx = 1; optidx < argc; optidx++)
2035 if (*argv[optidx] !=
'-')
2038 switch(argv[optidx][1])
2041 check_parameter(argv[optidx][2], argv);
2042 if (argv[optidx][2] ==
'r')
2044 if (argv[optidx][2] ==
'w')
2048 check_parameter(argv[optidx][2], argv);
2049 starting = atoi(&argv[optidx][2]);
2052 check_parameter(argv[optidx][2], argv);
2053 delta = atof(&argv[optidx][2]);
2056 check_parameter(argv[optidx][2], argv);
2057 feastol = atof(&argv[optidx][2]);
2060 check_parameter(argv[optidx][2], argv);
2061 opttol = atof(&argv[optidx][2]);
2067 check_parameter(argv[optidx][2], argv);
2068 scaling = atoi(&argv[optidx][2]);
2074 if (argv[optidx][2] ==
'\0' )
2075 print_usage_and_exit( argv );
2076 timelimit = atof(&argv[optidx][2]);
2079 if (argv[optidx][2] ==
'\0' )
2080 print_usage_and_exit( argv );
2081 iterlimit = atoi(&argv[optidx][2]);
2084 check_parameter(argv[optidx][2], argv);
2085 pricing = atoi(&argv[optidx][2]);
2088 print_quality =
true;
2094 check_parameter(argv[optidx][2], argv);
2095 simplifying = atoi(&argv[optidx][2]);
2098 check_parameter(argv[optidx][2], argv);
2099 ratiotest = atoi(&argv[optidx][2]);
2102 check_parameter(argv[optidx][2], argv);
2103 if (argv[optidx][2] >=
'0' && argv[optidx][2] <=
'9')
2104 verbose = argv[optidx][2] -
'0';
2107 print_version_info();
2110 print_solution =
true;
2116 check_parameter(argv[optidx][2], argv);
2117 check_parameter(argv[optidx][3], argv);
2118 switch(argv[optidx][2])
2121 epsilon = atof(&argv[optidx][3]);
2124 epsilon_factor = atof(&argv[optidx][3]);
2127 epsilon_update = atof(&argv[optidx][3]);
2130 print_usage_and_exit( argv );
2138 print_version_info();
2141 print_usage_and_exit( argv );
2146 print_version_info();
2149 if ((argc - optidx) < 1 + (read_basis ? 1 : 0) + (write_basis ? 1 : 0))
2150 print_usage_and_exit( argv );
2151 filename = argv[optidx];
2159 if ( read_basis || write_basis )
2160 basisname = strcpy(
new char[strlen(argv[optidx]) + 1], argv[optidx] );
2169 precision = int(-log10(
MINIMUM(feastol, opttol))) + 1;
2171 std::cout.setf( std::ios::scientific | std::ios::showpoint );
2172 std::cerr.setf( std::ios::scientific | std::ios::showpoint );
2174 #ifdef SEND_ALL_OUTPUT_TO_FILES 2177 std::ofstream myerrstream (
"errwarn.txt" );
2178 std::ofstream myinfostream(
"infos.txt" );
2179 redirect_output(myerrstream, myinfostream);
2183 MySoPlex work( spxout, type, representation );
2184 work.setOutstream ( spxout );
2185 work.setUtype ( update );
2186 work.setFeastol (
MINIMUM(feastol, delta) );
2187 work.setOpttol (
MINIMUM(opttol, delta) );
2188 work.setTerminationTime ( timelimit );
2189 work.setTerminationIter ( iterlimit );
2190 print_algorithm_parameters( work, representation, update );
2191 assert( work.isConsistent() );
2194 work.setPricer ( pricer = get_pricer (pricing, work.spxout) );
2195 work.setStarter ( starter = get_starter (starting, work.spxout) );
2196 work.setSimplifier( simplifier = get_simplifier (simplifying, work.spxout) );
2197 work.setTester ( ratiotester = get_ratio_tester(ratiotest, work.spxout) );
2198 assert(work.isConsistent());
2201 get_scalers(postscaler, scaling, work.spxout);
2202 work.setPostScaler(postscaler);
2203 assert(work.isConsistent());
2206 read_input_file(work, filename, rownames, colnames);
2210 read_basis_file(work, basisname, &rownames, &colnames);
2216 print_solution_and_status(work, rownames, colnames, precision, print_quality,
2217 print_solution, print_dual, write_basis, basisname);
2220 clean_up(postscaler, simplifier, starter, pricer, ratiotester, basisname);
2226 std::cout <<
"exception caught : " << x.
what() << std::endl;
2227 delete [] basisname;
Fast shifting ratio test.
bool isNotZero(Real a, Real eps=Param::epsilon())
returns true iff |a| > eps
virtual void setStream(const Verbosity &verbosity, std::ostream &stream)
Sets the stream for the specified verbosity level.
UpdateType
Specifies how to perform change method.
Bound flipping ratio test ("long step dual") for SoPlex.Class SPxBoundFlippingRT provides an implemen...
#define DEFAULT_EPS_FACTOR
void printVersion() const
prints version and compilation options
bool getDualViolationRational(Rational &maxviol, Rational &sumviol)
gets violation of dual multipliers; returns true on success
int numRowsReal() const
returns number of rows
static void setEpsilon(Real eps)
Devex pricer.The Devex Pricer for SoPlex implements an approximate steepest edge pricing, that does without solving an extra linear system and computing the scalar products.
#define DEFAULT_BND_VIOL
default allowed bound violation
THREADLOCAL const Real infinity
Steepest edge pricer.Class SPxSteepExPR implements a steepest edge pricer to be used with SoPlex...
Geometric mean row/column scaling.This SPxScaler implementation performs geometric mean scaling of th...
apply standard floating-point algorithm
Abstract pricer base class.
bool getPrimalReal(VectorReal &vector)
gets the primal solution vector if available; returns true on success
int numRowsRational() const
returns number of rows
bool writeDualFileReal(const char *filename, const NameSet *rowNames=0, const NameSet *colNames=0, const DIdxSet *intvars=0) const
writes the dual of the real LP to file; LP or MPS format is chosen from the extension in filename; if...
bool getDualRational(VectorRational &vector)
gets the dual solution vector if available; returns true on success
Solution vector based start basis.
time limit in seconds (INFTY if unlimited)
mode for iterative refinement strategy
Representation
LP basis representation.
virtual ~SoPlex()
destructor
LP geometric mean scaling.
primal feasibility tolerance
bool writeBasisFile(const char *filename, const NameSet *rowNames=0, const NameSet *colNames=0, const bool cpxFormat=false) const
writes basis information to filename; if rowNames and colNames are NULL, default names are used; retu...
Abstract ratio test base class.
solve() aborted due to iteration limit.
bool readBasisFile(const char *filename, const NameSet *rowNames=0, const NameSet *colNames=0)
reads basis information from filename and returns true on success; if rowNames and colNames are NULL...
mode for reading LP files
mode for synchronizing real and rational LP
bool getDualFarkasReal(VectorReal &vector)
gets the Farkas proof if available; returns true on success
automatic sync of real and rational LP
iteration limit (-1 if unlimited)
Implementation of Sparse Linear Solver.
Abstract ratio test base class.Class SPxRatioTester is the virtual base class for computing the ratio...
bool getRowViolationReal(Real &maxviol, Real &sumviol)
gets violation of constraints; returns true on success
bool getRowViolationRational(Rational &maxviol, Rational &sumviol)
gets violation of constraints; returns true on success
SoPlex start basis generation base class.SPxStarter is the virtual base class for classes generating ...
bool updateExternalSolution(char *solution)
updates the external solution used for validation
#define DEFAULT_EPS_UPDATE
LP has been proven to be primal infeasible.
General methods in LP preprocessing.
bool readFile(const char *filename, NameSet *rowNames=0, NameSet *colNames=0, DIdxSet *intVars=0)
reads LP file in LP or MPS format according to READMODE parameter; gets row names, column names, and integer variables if desired; returns true on success
int intParam(const IntParam param) const
returns integer parameter value
Wrapper for GMP type mpq_class.We wrap mpq_class so that we can replace it by a double type if GMP is...
static void disableListMem()
disables list memory
void printStatistics(std::ostream &os)
prints complete statistics
std::ostream & getStream(const Verbosity &verbosity) const
Returns the stream for the specified verbosity level.
LP simplification base class.
virtual const std::string what() const
returns exception message
Partial multiple pricing.Class SPxParMultPr is an implementation class for SPxPricer implementing Dan...
Wrapper for different output streams and verbosity levels.
SPxSolver::Status optimize()
optimize the given LP
virtual void start()=0
start timer, resume accounting user, system and real time.
virtual Real stop()=0
stop timer, return accounted user time.
void spx_alloc(T &p, int n=1)
Allocate memory.
Fast shifting ratio test.Class SPxFastRT is an implementation class of SPxRatioTester providing fast ...
standard floating-point parsing
Weighted pricing.Class SPxWeightPR is an implemantation class of SPxPricer that uses weights for colu...
int main(int argc, char *argv[])
runs SoPlex command line
bool getPrimalRayReal(VectorReal &vector)
gets the primal ray if available; returns true on success
bool hasPrimal() const
is a primal feasible solution available?
static void printUsage(const char *const argv[], int idx)
virtual const char * getName() const
get name of simplifier.
void validateSolveReal(SoPlex &soplex)
validates the soplex solution using the external solution
LP simplification abstract base class.Instances of classes derived from SPxSimplifier may be loaded t...
LP has been solved to optimality.
bool hasBasis() const
is an advanced starting basis available?
#define MSG_ERROR(x)
Prints out message x if the verbosity level is at least SPxOut::ERROR.
bool getDualViolationReal(Real &maxviol, Real &sumviol)
gets violation of dual multipliers; returns true on success
Wrapper for several output streams. A verbosity level is used to decide which stream to use and wheth...
virtual Real time() const
solve() aborted due to time limit.
#define DEFAULT_EPS_ZERO
default allowed additive zero: 1.0 + EPS_ZERO == 1.0
virtual void setVerbosity(const Verbosity &v)
static Real epsilonUpdate()
void printUserSettings()
print non-default parameter values
static void checkSolutionRational(SoPlex &soplex)
performs external feasibility check with rational type
int numColsRational() const
returns number of columns
Abstract pricer base class.Class SPxPricer is a pure virtual class defining the interface for pricer ...
bool getPrimalRational(VectorRational &vector)
gets the primal solution vector if available; returns true on success
Solution vector based start basis.This version of SPxWeightST can be used to construct a starting bas...
virtual Real stop()
stop timer, return accounted user time.
Real realParam(const RealParam param) const
returns real parameter value
virtual Real time() const =0
Simple heuristic SPxStarter.
user sync of real and rational LP
bool hasDual() const
is a dual feasible solution available?
bool parseSettingsString(char *line)
parses one setting string and returns true on success; note that string is modified ...
virtual void start()
start timer, resume accounting user, system and real time.
static Timer * createTimer(Timer::TYPE ttype)
create timers and allocate memory for them
(In)equality for LPs.Class LPRowBase provides constraints for linear programs in the form where a is...
virtual const char * getName() const
get name of ratio tester.
Preconfigured SoPlex LP solver.
Bound flipping ratio test (long step dual) for SoPlex.
Debugging, floating point type and parameter definitions.
virtual const char * getName() const
get name of scaler
Set of strings.Class NameSet implements a symbol or name table. It allows to store or remove names (i...
LP least squares scaling.
Hybrid pricer.The hybrid pricer for SoPlex tries to guess the best pricing strategy to use for pricin...
bool validate
should the soplex solution be validated?
Exception base class.This class implements a base class for our SoPlex exceptions We provide a what()...
Everything should be within this namespace.
bool setRealParam(const RealParam param, const Real value, const bool init=true)
sets real parameter value; returns true on success
returns the current git hash of SoPlex
bool loadSettingsFile(const char *filename)
reads settings file; returns true on success
int numNonzerosReal() const
returns number of nonzeros
Dantzig pricer.Class SPxDantzigPR is an implementation class of an SPxPricer implementing Dantzig's d...
bool getRedCostViolationRational(Rational &maxviol, Rational &sumviol)
gets violation of reduced costs; returns true on success
Harris pricing with shifting.
solve() aborted due to detection of cycling.
bool getDualReal(VectorReal &vector)
gets the dual solution vector if available; returns true on success
static void checkSolution(SoPlex &soplex)
performs external feasibility check according to check mode
Steepest edge pricer with exact initialization of weights.
Preconfigured SoPlex LP-solver.
#define MSG_WARNING(spxout, x)
Prints out message x if the verbosity level is at least SPxOut::WARNING.
virtual const char * getName() const
get name of pricer.
std::streamsize precision() const
static void setEpsilonUpdate(Real eps)
bool getBoundViolationReal(Real &maxviol, Real &sumviol)
gets violation of bounds; returns true on success
bool writeFileReal(const char *filename, const NameSet *rowNames=0, const NameSet *colNames=0, const DIdxSet *intvars=0, const bool unscale=true) const
writes real LP to file; LP or MPS format is chosen from the extension in filename; if rowNames and co...
Simple heuristic SPxStarter.Testing version of an SPxVectorST using a very simplistic heuristic to bu...
Weighted start basis.Class SPxWeightST is an implementation of a SPxStarter for generating a Simplex ...
decide according to READMODE
const char * getGitHash()
mode for a posteriori feasibility checks
Partial multiple pricing.
Verbosity
Verbosity level.
~Validation()
default destructor
Textbook ratio test for SoPlex.Class SPxDefaultRT provides an implementation of the textbook ratio te...
void clear()
Set vector to 0.
LP scaler abstract base class.Instances of classes derived from SPxScaler may be loaded to SoPlex in ...
virtual const char * getName() const
get name of starter.
#define MSG_INFO1(spxout, x)
Prints out message x if the verbosity level is at least SPxOut::INFO1.
Validation object for soplex solutions.
bool getRedCostViolationReal(Real &maxviol, Real &sumviol)
gets violation of reduced costs; returns true on success
#define SOPLEX_SUBVERSION
static void freeStrings(char *&s1, char *&s2, char *&s3, char *&s4, char *&s5)
static void setEpsilonFactorization(Real eps)
dual feasibility tolerance
bool setIntParam(const IntParam param, const int value, const bool init=true)
sets integer parameter value; returns true on success
bool saveSettingsFile(const char *filename, const bool onlyChanged=false) const
writes settings file; returns true on success
static void checkSolutionReal(SoPlex &soplex)
performs external feasibility check with real type
std::string rationalToString(const Rational &r, const int precision)
convert rational number to string
Textbook ratio test for SoPlex.
static Real epsilonFactorization()
bool updateValidationTolerance(char *tolerance)
updates the tolerance used for validation
Equilibrium row/column scaling.This SPxScaler implementation performs equilibrium scaling of the LPs ...
int numColsReal() const
returns number of columns
Wrapper for the system time query methods.
solve() aborted due to objective limit.
columnwise representation.
void spx_free(T &p)
Release memory.
Basis is singular, numerical troubles?
Steepest edge pricer.Class SPxSteepPR implements a steepest edge pricer to be used with SoPlex...
Harris pricing with shifting.Class SPxHarrisRT is a stable implementation of a SPxRatioTester class a...
bool getBoundViolationRational(Rational &maxviol, Rational &sumviol)
gets violation of bounds; returns true on success
LP simplifier for removing uneccessary row/columns.This SPxSimplifier is mainly based on the paper "P...
LP has been proven to be primal unbounded.