33 #ifdef SOPLEX_WITH_EGLIB 38 #define EGlpNumStart() {} 39 #define EGlpNumClear() {} 45 int main(
int argc,
char* argv[]);
53 " --readbas=<basfile> read starting basis from file\n" 54 " --writebas=<basfile> write terminal basis to file\n" 55 " --writefile=<lpfile> write LP to file in LP or MPS format depending on extension\n" 56 " --writedual=<lpfile> write the dual LP to a file in LP or MPS formal depending on extension\n" 57 " --<type>:<name>=<val> change parameter value using syntax of settings file entries\n" 58 " --loadset=<setfile> load parameters from settings file (overruled by command line parameters)\n" 59 " --saveset=<setfile> save parameters to settings file\n" 60 " --diffset=<setfile> save modified parameters to settings file\n" 62 "limits and tolerances:\n" 63 " -t<s> set time limit to <s> seconds\n" 64 " -i<n> set iteration limit to <n>\n" 65 " -f<eps> set primal feasibility tolerance to <eps>\n" 66 " -o<eps> set dual feasibility (optimality) tolerance to <eps>\n" 68 "algorithmic settings (* indicates default):\n" 69 " --readmode=<value> choose reading mode for <lpfile> (0* - floating-point, 1 - rational)\n" 70 " --solvemode=<value> choose solving mode (0 - floating-point solve, 1* - auto, 2 - force iterative refinement)\n" 71 " -s<value> choose simplifier/presolver (0 - off, 1* - auto)\n" 72 " -g<value> choose scaling (0 - off, 1 - uni-equilibrium, 2* - bi-equilibrium, 3 - geometric, 4 - iterated geometric, 5 - least squares)\n" 73 " -p<value> choose pricing (0* - auto, 1 - dantzig, 2 - parmult, 3 - devex, 4 - quicksteep, 5 - steep)\n" 74 " -r<value> choose ratio tester (0 - textbook, 1 - harris, 2 - fast, 3* - boundflipping)\n" 77 " -v<level> set verbosity to <level> (0 - error, 3 - normal, 5 - high)\n" 78 " -x print primal solution\n" 79 " -y print dual multipliers\n" 80 " -X print primal solution in rational numbers\n" 81 " -Y print dual multipliers in rational numbers\n" 82 " -q display detailed statistics\n" 83 " -c perform final check of optimal solution in original problem\n" 87 std::cerr <<
"missing input file\n\n";
89 std::cerr <<
"invalid option \"" << argv[idx] <<
"\"\n\n";
91 std::cerr <<
"usage: " << argv[0] <<
" " <<
"[options] <lpfile>\n" 92 #ifdef SOPLEX_WITH_ZLIB 93 <<
" <lpfile> linear program as .mps[.gz] or .lp[.gz] file\n\n" 95 <<
" <lpfile> linear program as .mps or .lp file\n\n" 102 void freeStrings(
char*& s1,
char*& s2,
char*& s3,
char*& s4,
char*& s5)
145 Real maxviol = boundviol > rowviol ? boundviol : rowviol;
147 soplex.
spxout <<
"Primal solution " << (feasible ?
"feasible" :
"infeasible")
148 <<
" in original problem (max. violation = " << std::scientific << maxviol
149 << std::setprecision(8) << std::fixed <<
").\n" 171 Real maxviol = redcostviol > dualviol ? redcostviol : dualviol;
173 soplex.
spxout <<
"Dual solution " << (feasible ?
"feasible" :
"infeasible")
174 <<
" in original problem (max. violation = " << std::scientific << maxviol
175 << std::setprecision(8) << std::fixed <<
").\n" 203 Rational maxviol = boundviol > rowviol ? boundviol : rowviol;
205 soplex.
spxout <<
"Primal solution " << (feasible ?
"feasible" :
"infeasible") <<
" in original problem (max. violation = " <<
rationalToString(maxviol) <<
").\n" 227 Rational maxviol = redcostviol > dualviol ? redcostviol : dualviol;
229 soplex.
spxout <<
"Dual solution " << (feasible ?
"feasible" :
"infeasible") <<
" in original problem (max. violation = " <<
rationalToString(maxviol) <<
").\n" 262 int main(
int argc,
char* argv[])
274 const char* lpfilename;
275 char* readbasname = 0;
276 char* writebasname = 0;
277 char* writefilename = 0;
278 char* writedualfilename = 0;
279 char* loadsetname = 0;
280 char* savesetname = 0;
281 char* diffsetname = 0;
282 bool printPrimal =
false;
283 bool printPrimalRational =
false;
284 bool printDual =
false;
285 bool printDualRational =
false;
286 bool displayStatistics =
false;
287 bool checkSol =
false;
311 for( optidx = 1; optidx < argc; optidx++ )
313 char* option = argv[optidx];
316 if( option[0] !=
'-' )
321 if( option[0] !=
'-' || option[1] ==
'\0' 322 || ((option[2] ==
'\0') != (option[1] ==
'x' || option[1] ==
'X' || option[1] ==
'y' || option[1] ==
'Y' || option[1] ==
'q' || option[1] ==
'c')) )
326 goto TERMINATE_FREESTRINGS;
336 if( strncmp(option,
"readbas=", 8) == 0 )
338 if( readbasname == 0 )
340 char* filename = &option[8];
341 readbasname = strncpy(
new char[strlen(filename) + 1], filename, strlen(filename) + 1);
345 else if( strncmp(option,
"writebas=", 9) == 0 )
347 if( writebasname == 0 )
349 char* filename = &option[9];
350 writebasname = strncpy(
new char[strlen(filename) + 1], filename, strlen(filename) + 1);
354 else if( strncmp(option,
"writefile=", 10) == 0 )
356 if( writefilename == 0 )
358 char* filename = &option[10];
359 writefilename = strncpy(
new char[strlen(filename) + 1], filename, strlen(filename) + 1);
363 else if( strncmp(option,
"writedual=", 10) == 0 )
365 if( writedualfilename == 0 )
367 char* dualfilename = &option[10];
368 writedualfilename = strncpy(
new char[strlen(dualfilename) + 1], dualfilename, strlen(dualfilename) + 1);
372 else if( strncmp(option,
"loadset=", 8) == 0 )
374 if( loadsetname == 0 )
376 char* filename = &option[8];
377 loadsetname = strncpy(
new char[strlen(filename) + 1], filename, strlen(filename) + 1);
382 goto TERMINATE_FREESTRINGS;
392 else if( strncmp(option,
"saveset=", 8) == 0 )
394 if( savesetname == 0 )
396 char* filename = &option[8];
397 savesetname = strncpy(
new char[strlen(filename) + 1], filename, strlen(filename) + 1);
401 else if( strncmp(option,
"diffset=", 8) == 0 )
403 if( diffsetname == 0 )
405 char* filename = &option[8];
406 diffsetname = strncpy(
new char[strlen(filename) + 1], filename, strlen(filename) + 1);
410 else if( strncmp(option,
"readmode=", 9) == 0 )
416 goto TERMINATE_FREESTRINGS;
420 else if( strncmp(option,
"solvemode=", 10) == 0 )
426 goto TERMINATE_FREESTRINGS;
441 goto TERMINATE_FREESTRINGS;
452 goto TERMINATE_FREESTRINGS;
462 goto TERMINATE_FREESTRINGS;
472 goto TERMINATE_FREESTRINGS;
482 goto TERMINATE_FREESTRINGS;
492 goto TERMINATE_FREESTRINGS;
502 goto TERMINATE_FREESTRINGS;
512 goto TERMINATE_FREESTRINGS;
522 goto TERMINATE_FREESTRINGS;
532 goto TERMINATE_FREESTRINGS;
543 printPrimalRational =
true;
553 printDualRational =
true;
558 displayStatistics =
true;
571 goto TERMINATE_FREESTRINGS;
579 if( optidx >= argc && savesetname == 0 && diffsetname == 0 )
583 goto TERMINATE_FREESTRINGS;
589 MSG_ERROR( std::cerr <<
"Error: manual synchronization is invalid on command line. Change parameter int:syncmode.\n" );
591 goto TERMINATE_FREESTRINGS;
595 if( savesetname != 0 )
597 MSG_INFO1( soplex->
spxout, soplex->
spxout <<
"Saving parameters to settings file <" << savesetname <<
"> . . .\n" );
600 MSG_ERROR( std::cerr <<
"Error writing parameters to file <" << savesetname <<
">\n" );
603 if( diffsetname != 0 )
605 MSG_INFO1( soplex->
spxout, soplex->
spxout <<
"Saving modified parameters to settings file <" << diffsetname <<
"> . . .\n" );
608 MSG_ERROR( std::cerr <<
"Error writing modified parameters to file <" << diffsetname <<
">\n" );
615 if( loadsetname != 0 || savesetname != 0 || diffsetname != 0 )
619 goto TERMINATE_FREESTRINGS;
623 readingTime->
start();
634 lpfilename = argv[optidx];
637 <<
" LP file <" << lpfilename <<
"> . . .\n" );
639 if( !soplex->
readFile(lpfilename, &rownames, &colnames) )
641 MSG_ERROR( std::cerr <<
"Error while reading file <" << lpfilename <<
">.\n" );
643 goto TERMINATE_FREESTRINGS;
647 if( writefilename != 0 )
649 if( !soplex->
writeFileReal(writefilename, &rownames, &colnames) )
651 MSG_ERROR( std::cerr <<
"Error while writing file <" << writefilename <<
">.\n\n" );
653 goto TERMINATE_FREESTRINGS;
662 if( writedualfilename != 0 )
666 MSG_ERROR( std::cerr <<
"Error while writing dual file <" << writedualfilename <<
">.\n\n" );
668 goto TERMINATE_FREESTRINGS;
672 MSG_INFO1( soplex->
spxout, soplex->
spxout <<
"Written dual LP to file <" << writedualfilename <<
">.\n\n" );
677 if( readbasname != 0 )
680 if( !soplex->
readBasisFile(readbasname, &rownames, &colnames) )
682 MSG_ERROR( std::cerr <<
"Error while reading file <" << readbasname <<
">.\n" );
684 goto TERMINATE_FREESTRINGS;
692 soplex->
spxout <<
"Reading took " 693 << std::fixed << std::setprecision(2) << readingTime->
time()
694 << std::scientific << std::setprecision(
int(prec))
695 <<
" seconds.\n\n" );
706 printwidth = printprec + 10;
719 << std::setw(printwidth)
720 << std::setprecision(printprec)
721 << primal[i] << std::endl; )
725 << std::setprecision(8) << std::fixed <<
")." << std::endl; )
736 << std::setw(printwidth)
737 << std::setprecision(printprec)
738 << primal[i] << std::endl; )
744 << std::setprecision(8) << std::fixed <<
"). Solution has " << nNonzeros <<
" nonzero entries." << std::endl; )
752 if( printPrimalRational )
767 MSG_INFO1( soplex->
spxout, soplex->
spxout <<
"All other variables are zero. Solution has " << nNonzeros <<
" nonzero entries." << std::endl; )
784 << std::setw(printwidth)
785 << std::setprecision(printprec)
786 << dual[i] << std::endl; )
790 << std::setprecision(8) << std::fixed <<
")." << std::endl; )
799 << std::setw(printwidth)
800 << std::setprecision(printprec)
801 << dual[i] << std::endl; )
805 << std::setprecision(8) << std::fixed <<
")." << std::endl; )
813 if( printDualRational )
834 if( displayStatistics )
841 if( writebasname != 0 )
845 MSG_WARNING( soplex->
spxout, soplex->
spxout <<
"No basis information available. Could not write file <" << writebasname <<
">\n\n" );
847 else if( !soplex->
writeBasisFile(writebasname, &rownames, &colnames) )
849 MSG_ERROR( std::cerr <<
"Error while writing file <" << writebasname <<
">.\n\n" );
851 goto TERMINATE_FREESTRINGS;
855 MSG_INFO1( soplex->
spxout, soplex->
spxout <<
"Written basis information to file <" << writebasname <<
">.\n\n" );
861 MSG_ERROR( std::cerr <<
"Exception caught: " << x.
what() <<
"\n" );
863 goto TERMINATE_FREESTRINGS;
866 TERMINATE_FREESTRINGS:
867 freeStrings(readbasname, writebasname, loadsetname, savesetname, diffsetname);
926 static bool checkMode =
false;
935 class MySoPlex :
public SoPlex 939 MySoPlex(
SPxOut& outstream,
942 :
SoPlex(outstream, p_type, p_rep)
949 void displayQuality()
const 956 MSG_INFO1( (*spxout), (*spxout) <<
"IEXAMP05 Violations (max/sum)" << std::endl; )
958 m_solver.qualConstraintViolation(maxviol, sumviol);
960 MSG_INFO1( (*spxout), (*spxout) <<
"IEXAMP06 Constraints :" 961 << std::setw(16) << maxviol <<
" " 962 << std::setw(16) << sumviol << std::endl; )
964 qualConstraintViolation(maxviol, sumviol);
966 MSG_INFO1( (*spxout), (*spxout) <<
"IEXAMP07 (unscaled) :" 967 << std::setw(16) << maxviol <<
" " 968 << std::setw(16) << sumviol << std::endl; )
970 m_solver.qualBoundViolation(maxviol, sumviol);
972 MSG_INFO1( (*spxout), (*spxout) <<
"IEXAMP08 Bounds :" 973 << std::setw(16) << maxviol <<
" " 974 << std::setw(16) << sumviol << std::endl; )
976 qualBoundViolation(maxviol, sumviol);
978 MSG_INFO1( (*spxout), (*spxout) <<
"IEXAMP09 (unscaled) :" 979 << std::setw(16) << maxviol <<
" " 980 << std::setw(16) << sumviol << std::endl; )
984 m_solver.qualSlackViolation(maxviol, sumviol);
986 MSG_INFO1( (*spxout), (*spxout) <<
"IEXAMP10 Slacks :" 987 << std::setw(16) << maxviol <<
" " 988 << std::setw(16) << sumviol << std::endl; )
990 m_solver.qualRedCostViolation(maxviol, sumviol);
992 MSG_INFO1( (*spxout), (*spxout) <<
"IEXAMP11 Reduced costs :" 993 << std::setw(16) << maxviol <<
" " 994 << std::setw(16) << sumviol << std::endl; )
996 MSG_INFO1( (*spxout), (*spxout) <<
"IEXAMP12 Proven dual bound:" 998 << std::setprecision(20)
999 << m_solver.provedDualbound() << std::endl; )
1005 MSG_INFO1( (*spxout), (*spxout) <<
"Violations (max/sum)" << std::endl; )
1007 m_solver.qualConstraintViolation(maxviol, sumviol);
1009 MSG_INFO1( (*spxout), (*spxout) <<
"Constraints :" 1010 << std::setw(16) << maxviol <<
" " 1011 << std::setw(16) << sumviol << std::endl; )
1013 qualConstraintViolation(maxviol, sumviol);
1015 MSG_INFO1( (*spxout), (*spxout) <<
" (unscaled) :" 1016 << std::setw(16) << maxviol <<
" " 1017 << std::setw(16) << sumviol << std::endl; )
1019 m_solver.qualBoundViolation(maxviol, sumviol);
1021 MSG_INFO1( (*spxout), (*spxout) <<
"Bounds :" 1022 << std::setw(16) << maxviol <<
" " 1023 << std::setw(16) << sumviol << std::endl; )
1025 qualBoundViolation(maxviol, sumviol);
1027 MSG_INFO1( (*spxout), (*spxout) <<
" (unscaled) :" 1028 << std::setw(16) << maxviol <<
" " 1029 << std::setw(16) << sumviol << std::endl; )
1033 m_solver.qualSlackViolation(maxviol, sumviol);
1035 MSG_INFO1( (*spxout), (*spxout) <<
"Slacks :" 1036 << std::setw(16) << maxviol <<
" " 1037 << std::setw(16) << sumviol << std::endl; )
1039 m_solver.qualRedCostViolation(maxviol, sumviol);
1041 MSG_INFO1( (*spxout), (*spxout) <<
"Reduced costs :" 1042 << std::setw(16) << maxviol <<
" " 1043 << std::setw(16) << sumviol << std::endl; )
1045 MSG_INFO1( (*spxout), (*spxout) <<
"Proven dual bound:" 1047 << std::setprecision(20)
1048 << m_solver.provedDualbound() << std::endl; )
1054 void displayInfeasibility()
const 1061 if( m_solver.isProvenInfeasible() )
1062 MSG_INFO1( (*spxout), (*spxout) <<
"IEXAMP13 Infeasibility is proven." << std::endl; )
1064 MSG_INFO1( (*spxout), (*spxout) <<
"IEXAMP13 Infeasibility could not be proven!" << std::endl; )
1068 if ( m_solver.isProvenInfeasible() )
1070 MSG_INFO1( (*spxout), (*spxout) <<
"Infeasibility is proven." << std::endl; )
1074 MSG_INFO1( (*spxout), (*spxout) <<
"Infeasibility could not be proven!" << std::endl; )
1087 void print_version_info()
1089 const char* banner1 =
1090 "************************************************************************\n" 1092 "* SoPlex --- the Sequential object-oriented simPlex. *\n" 1095 const char* banner2 =
1097 "* Copyright (C) 1996-2017 Konrad-Zuse-Zentrum *\n" 1098 "* fuer Informationstechnik Berlin *\n" 1100 "* SoPlex is distributed under the terms of the ZIB Academic Licence. *\n" 1101 "* You should have received a copy of the ZIB Academic License *\n" 1102 "* along with SoPlex; If not email to soplex@zib.de. *\n" 1104 "************************************************************************\n" 1108 std::cout << banner1;
1110 #if (SOPLEX_SUBVERSION > 0) 1112 std::cout <<
"* Version ";
1114 std::cout <<
"SoPlex version ";
1120 << std::setw(13) << std::setiosflags(std::ios::left) <<
getGitHash();
1122 std::cout <<
" *\n" << banner2 << std::endl;
1127 std::cout <<
"* Release ";
1129 std::cout <<
"SoPlex release ";
1134 << std::setw(13) << std::setiosflags(std::ios::left) <<
getGitHash();
1136 std::cout <<
" *\n" << banner2 << std::endl;
1142 std::cout <<
"[NDEBUG:" 1150 std::cout <<
"[WITH_WARNINGS:" 1151 #ifdef WITH_WARNINGS 1158 std::cout <<
"[ENABLE_ADDITIONAL_CHECKS:" 1159 #ifdef ENABLE_ADDITIONAL_CHECKS 1166 std::cout <<
"[ENABLE_CONSISTENCY_CHECKS:" 1167 #ifdef ENABLE_CONSISTENCY_CHECKS 1174 std::cout <<
"[SOPLEX_WITH_GMP:" 1175 #ifdef SOPLEX_WITH_GMP 1180 <<
"]" << std::endl;
1182 std::cout << std::endl;
1187 void print_short_version_info()
1189 const char* banner1 =
1190 "************************************************************************\n" 1191 "* SoPlex --- the Sequential object-oriented simPlex. ";
1192 const char* banner2 =
1193 "* Copyright (C) 1996-2017 Konrad-Zuse-Zentrum *\n" 1194 "* fuer Informationstechnik Berlin *\n" 1195 "************************************************************************\n";
1197 std::cout << banner1;
1198 #if (SOPLEX_SUBVERSION > 0) 1199 std::cout <<
"Version " 1206 std::cout <<
"Release " 1212 std::cout << banner2 << std::endl;
1218 void print_usage_and_exit(
const char*
const argv[] )
1221 "[options] LPfile [Basfile]\n\n" 1222 " LPfile can be either in MPS or LPF format\n\n" 1223 "options: (*) indicates default\n" 1224 " (!) indicates experimental features which may give wrong results\n" 1225 " -e select entering algorithm (default is leaving)\n" 1226 " -r select row wise representation (default is column)\n" 1227 " -i select Eta-update (default is Forest-Tomlin)\n" 1228 " -x output solution vector\n" 1229 " -y output dual multipliers\n" 1230 " -q display solution quality\n" 1231 " -br read file with starting basis from Basfile\n" 1232 " -bw write file with optimal basis to Basfile\n" 1233 " -l set time limit in seconds\n" 1234 " -L set iteration limit\n" 1235 " -f set primal feasibility tolerance\n" 1236 " -o set optimality, i.e., dual feasibility tolerance\n" 1237 " -d set primal and dual feasibility tolerance to same value\n" 1238 " -zz set general zero tolerance\n" 1239 " -zf set factorization zero tolerance\n" 1240 " -zu set update zero tolerance\n" 1241 " -v set verbosity Level: from 0 (ERROR) to 5 (INFO3), default 3 (INFO1)\n" 1242 " -V show program version\n" 1243 " -C check mode (for check scripts)\n" 1244 " -h show this help\n\n" 1245 "Simplifier: Scaler: Starter: Pricer: Ratiotester:\n" 1246 " -s0 none -g0 none -c0 none* -p0 Textbook -t0 Textbook\n" 1247 " -s1 Main* -g1 uni-Equi -c1 Weight -p1 ParMult -t1 Harris\n" 1248 " -g2 bi-Equi* -c2 Sum -p2 Devex -t2 Fast\n" 1249 " -g3 Geo1 -c3 Vector -p3 Hybrid! -t3 Bound Flipping*\n" 1250 " -g4 Geo8 -p4 Steep*\n" 1252 " -p6 SteepExactSetup\n" 1255 std::cerr <<
"usage: " << argv[0] <<
" " << usage << std::endl;
1261 void check_parameter(
const char param,
const char*
const argv[])
1264 print_usage_and_exit( argv );
1269 void print_algorithm_parameters(
1277 MSG_INFO1( (*work.spxout), (*work.spxout)
1278 <<
"IEXAMP12 Feastol = " 1279 << std::setw(16) << work.feastol() << std::endl
1280 <<
"IEXAMP52 Opttol = " 1281 << std::setw(16) << work.opttol() << std::endl
1282 <<
"IEXAMP13 Epsilon Zero = " 1284 <<
"IEXAMP37 Epsilon Factor = " 1286 <<
"IEXAMP38 Epsilon Update = " 1290 <<
" algorithm" << std::endl
1293 <<
" representation" << std::endl
1296 <<
" update" << std::endl; )
1300 MSG_INFO1( (*work.spxout), (*work.spxout)
1301 <<
"SoPlex parameters: " << std::endl
1303 << std::setw(16) << work.feastol() << std::endl
1305 << std::setw(16) << work.opttol() << std::endl
1306 <<
"Epsilon Zero = " 1308 <<
"Epsilon Factor = " 1310 <<
"Epsilon Update = " 1313 <<
"algorithm = " << (work.type() ==
SPxSolver::ENTER ?
"Entering" :
"Leaving")
1315 <<
"representation = " << (representation ==
SPxSolver::ROW ?
"Row" :
"Column")
1317 <<
"update = " << (update ==
SLUFactor::ETA ?
"Eta" :
"Forest-Tomlin")
1354 assert(pricer != 0);
1356 #ifdef PARTIAL_PRICING 1357 MSG_INFO1( (*spxout), (*spxout) <<
"IEXAMP17 " << pricer->
getName() <<
" pricing" 1358 <<
" (partial, size = " << MAX_PRICING_CANDIDATES <<
")" 1361 MSG_INFO1( (*spxout), (*spxout) <<
"IEXAMP17 " << pricer->
getName() <<
" pricing" 1365 #ifdef PARTIAL_PRICING
1367 <<
" (partial, size = " << MAX_PRICING_CANDIDATES <<
")" 1399 assert(ratiotester != 0);
1401 MSG_INFO1( (*spxout), (*spxout) <<
"IEXAMP18 " << ratiotester->
getName() <<
" ratiotest" << std::endl; )
1403 MSG_INFO1( (*spxout), (*spxout) <<
"ratiotest = " << ratiotester->
getName() << std::endl; )
1439 MSG_INFO1( (*spxout), (*spxout) <<
"IEXAMP19 " 1440 << ((postscaler != 0) ? postscaler->
getName() :
"no")
1441 <<
" scaling" << std::endl; )
1445 MSG_INFO1( (*spxout), (*spxout) <<
"scaling = " 1446 << ((postscaler != 0) ? postscaler->
getName() :
"no")
1464 assert(simplifier == 0);
1469 MSG_INFO1( (*spxout), (*spxout) <<
"IEXAMP20 " << ((simplifier == 0) ?
"no" : simplifier->
getName()) <<
" simplifier" << std::endl; )
1471 MSG_INFO1( (*spxout), (*spxout) <<
"simplifier = " << ((simplifier == 0) ?
"no" : simplifier->getName()) << std::endl; )
1498 MSG_INFO1( (*spxout), (*spxout) <<
"IEXAMP21 " << ((starter == 0) ?
"no" : starter->
getName()) <<
" starter" << std::endl; )
1500 MSG_INFO1( (*spxout), (*spxout) <<
"starter = " << ((starter == 0) ?
"no" : starter->getName()) << std::endl; )
1506 #ifdef SEND_ALL_OUTPUT_TO_FILES 1508 void redirect_output(
1509 std::ostream& myerrstream,
1510 std::ostream& myinfostream
1513 myerrstream .setf( std::ios::scientific | std::ios::showpoint );
1514 myinfostream.setf( std::ios::scientific | std::ios::showpoint );
1525 void read_input_file(
1527 const char* filename,
1532 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"IEXAMP22 loading LP file " << filename << std::endl; )
1534 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"\nLoading LP file " << filename << std::endl; )
1539 if ( ! work.readFile(filename, &rownames, &colnames, 0) )
1542 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"EEXAMP23 error while reading file \"" << filename <<
"\"" << std::endl; )
1544 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"error while reading file \"" << filename <<
"\"" << std::endl; )
1547 assert(work.isConsistent());
1553 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"IEXAMP24 LP has " 1554 << work.nRows() <<
" rows " 1555 << work.nCols() <<
" columns " 1556 << work.nNzos() <<
" nonzeros" 1559 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"IEXAMP41 LP reading time: " << timer.
time() << std::endl; )
1563 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"LP has " 1564 << work.nRows() <<
" rows " 1565 << work.nCols() <<
" columns " 1566 << work.nNzos() <<
" nonzeros" 1570 std::streamsize prec = (*work.spxout).precision();
1571 (*work.spxout) <<
"LP reading time: " << std::fixed << std::setprecision(2) << timer.
time();
1572 (*work.spxout) << std::scientific << std::setprecision(
int(prec)) << std::endl; )
1578 void read_basis_file(
1580 const char* filename,
1584 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"Reading basis from file (disables simplifier)" << std::endl; )
1585 if (!work.readBasisFile(filename, rownames, colnames))
1588 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"EEXAMP25 error while reading file \"" << filename <<
"\"" << std::endl; )
1590 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"Error while reading file \"" << filename <<
"\"" << std::endl; )
1597 void solve_LP(MySoPlex& work)
1603 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"IEXAMP26 solving LP" << std::endl; )
1605 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"\nSolving LP ..." << std::endl; )
1610 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"\nSoPlex statistics:\n" << work.statistics(); )
1615 void print_solution_and_status(
1619 const int precision,
1620 const bool print_quality,
1621 const bool print_solution,
1622 const bool print_dual,
1623 const bool write_basis,
1624 const char* basisname
1631 MSG_INFO1( (*work.spxout), (*work.spxout) << std::endl; )
1636 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"IEXAMP29 solution value is: " << std::setprecision( precision ) << work.objValue() << std::endl; )
1638 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"Solution value is: " << std::setprecision( precision ) << work.objValue() << std::endl; )
1640 if ( print_quality )
1641 work.displayQuality();
1643 if ( print_solution )
1649 MSG_INFO1( (*work.spxout), (*work.spxout) << std::endl <<
"Primal solution (name, id, value):" << std::endl; )
1650 for(
int i = 0; i < work.nCols(); ++i )
1652 if (
isNotZero( objx[i], 0.001 * work.feastol() ) )
1653 MSG_INFO1( (*work.spxout), (*work.spxout) << colnames[ work.cId(i) ] <<
"\t" 1656 << std::setprecision( precision )
1657 << objx[i] << std::endl; )
1659 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"All other variables are zero (within " << std::setprecision(1) << 0.001*work.feastol() <<
")." << std::endl; )
1665 bool allzero =
true;
1669 MSG_INFO1( (*work.spxout), (*work.spxout) << std::endl <<
"Dual multipliers (name, id, value):" << std::endl; )
1670 for(
int i = 0; i < work.nRows(); ++i )
1672 if (
isNotZero( objy[i] , 0.001 * work.opttol() ) )
1674 MSG_INFO1( (*work.spxout), (*work.spxout) << rownames[ work.rId(i) ] <<
"\t" 1677 << std::setprecision( precision )
1678 << objy[i] << std::endl; )
1683 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"All " << (allzero ?
"" :
"other ") <<
"dual values are zero (within " 1684 << std::setprecision(1) << 0.001*work.opttol() <<
")." << std::endl; )
1690 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"Minimizing: a positive/negative value corresponds to left-hand (>=) resp. right-hand (<=) side." 1695 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"Maximizing: a positive/negative value corresponds to right-hand (<=) resp. left-hand (>=) side." 1703 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"Writing basis of original problem to file " << basisname << std::endl; )
1704 if ( ! work.writeBasisFile( basisname, &rownames, &colnames ) )
1707 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"EEXAMP30 error while writing file \"" << basisname <<
"\"" << std::endl; )
1709 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"Error while writing file \"" << basisname <<
"\"" << std::endl; )
1715 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"IEXAMP31 LP is unbounded" << std::endl; )
1717 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"LP is unbounded" << std::endl; )
1719 if ( print_solution )
1724 MSG_INFO1( (*work.spxout), (*work.spxout) << std::endl <<
"Primal solution (name, id, value):" << std::endl; )
1725 for(
int i = 0; i < work.nCols(); ++i )
1727 if (
isNotZero( objx[i], 0.001 * work.feastol() ) )
1728 MSG_INFO1( (*work.spxout), (*work.spxout) << colnames[ work.cId(i) ] <<
"\t" 1731 << std::setprecision( precision )
1732 << objx[i] << std::endl; )
1734 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"All other variables are zero (within " << std::setprecision(1) << 0.001*work.feastol() <<
")." << std::endl; )
1737 DVector objcoef(work.nCols());
1741 Real rayobjval = 0.0;
1743 work.getObj(objcoef);
1745 MSG_INFO1( (*work.spxout), (*work.spxout) << std::endl <<
"Primal ray (name, id, value):" << std::endl; )
1746 for(
int i = 0; i < work.nCols(); ++i )
1748 if (
isNotZero( ray[i], 0.001 * work.feastol() ) )
1750 rayobjval += ray[i] * objcoef[i];
1752 MSG_INFO1( (*work.spxout), (*work.spxout) << colnames[ work.cId(i) ] <<
"\t" 1755 << std::setprecision( precision )
1756 << ray[i] << std::endl; )
1759 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"All other variables have zero value (within " << std::setprecision(1) << 0.001*work.feastol() <<
")." << std::endl; )
1760 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"Objective change per unit along primal ray is " << rayobjval <<
"." << std::endl; )
1766 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"IEXAMP32 LP is infeasible" << std::endl; )
1768 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"LP is infeasible" << std::endl; )
1769 if ( print_solution )
1771 DVector farkasx(work.nRows());
1775 DVector proofvec(work.nCols());
1782 for(
int i = 0; i < work.nRows(); ++i )
1784 if (
isNotZero( farkasx[i], 0.001 * work.opttol() ) )
1786 MSG_INFO1( (*work.spxout), (*work.spxout) << rownames[ work.rId(i) ] <<
"\t" 1789 << std::setprecision( precision )
1790 << farkasx[i] <<
"\t"; )
1792 work.getRow(i, row);
1795 MSG_INFO1( (*work.spxout), (*work.spxout) << row.lhs() <<
" <= "; );
1797 for(
int j = 0; j < row.rowVector().size(); ++j )
1799 if( row.rowVector().value(j) > 0 )
1801 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"+"; )
1803 MSG_INFO1( (*work.spxout), (*work.spxout)
1804 << row.rowVector().value(j) <<
" " 1805 << colnames[ work.cId(row.rowVector().index(j)) ]
1810 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"<= " << row.rhs(); );
1812 MSG_INFO1( (*work.spxout), (*work.spxout) << std::endl; )
1813 if( farkasx[i] > 0.0 )
1815 lhs += farkasx[i] * row.lhs();
1816 rhs += farkasx[i] * row.rhs();
1820 lhs += farkasx[i] * row.rhs();
1821 rhs += farkasx[i] * row.lhs();
1829 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"All other row multipliers are zero (within " << std::setprecision(1) << 0.001*work.opttol() <<
")." << std::endl; )
1830 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"Farkas infeasibility proof: \t"; )
1831 MSG_INFO1( (*work.spxout), (*work.spxout) << lhs <<
" <= "; )
1833 bool nonzerofound =
false;
1834 for(
int i = 0; i < work.nCols(); ++i )
1836 if (
isNotZero( proofvec[i], 0.001 * work.opttol() ) )
1838 if( proofvec[i] > 0 )
1840 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"+"; )
1842 MSG_INFO1( (*work.spxout), (*work.spxout) << proofvec[i] <<
" " << colnames[ work.cId(i) ] <<
" "; )
1843 nonzerofound =
true;
1848 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"0 "; );
1850 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"<= " << rhs << std::endl; );
1853 if ( print_quality )
1854 work.displayInfeasibility();
1856 if ( ! work.writeBasisFile( basisname, &rownames, &colnames ) )
1859 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"EEXAMP30 error while writing file \"" << basisname <<
"\"" << std::endl; )
1861 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"Error while writing file \"" << basisname <<
"\"" << std::endl; )
1866 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"EEXAMP40 aborted due to cycling" << std::endl; )
1868 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"Aborted due to cycling" << std::endl; )
1872 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"IEXAMP33 aborted due to time limit" << std::endl; )
1874 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"Aborted due to time limit" << std::endl; )
1878 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"IEXAMP34 aborted due to iteration limit" << std::endl; )
1880 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"Aborted due to iteration limit" << std::endl; )
1884 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"IEXAMP35 aborted due to objective value limit" << std::endl; )
1886 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"Aborted due to objective value limit" << std::endl; )
1890 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"EEXAMP39 basis is singular" << std::endl; )
1892 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"Basis is singular" << std::endl; )
1896 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"EEXAMP36 An error occurred during " <<
"the solution process" << std::endl; )
1898 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"An error occurred during " <<
"the solution process" << std::endl; )
1901 MSG_INFO1( (*work.spxout), (*work.spxout) << std::endl; )
1915 if ( postscaler != 0 )
1920 if ( simplifier != 0 )
1931 assert( pricer != 0 );
1935 assert( ratiotester != 0 );
1939 if ( basisname != 0 )
1940 delete [] basisname;
1948 int main(
int argc,
char* argv[])
1950 const char* filename;
1951 char* basisname = 0;
1970 int simplifying = 1;
1980 bool print_solution =
false;
1981 bool print_dual =
false;
1982 bool print_quality =
false;
1983 bool read_basis =
false;
1984 bool write_basis =
false;
1988 for(optidx = 1; optidx < argc; optidx++)
1990 if (*argv[optidx] !=
'-')
1993 switch(argv[optidx][1])
1996 check_parameter(argv[optidx][2], argv);
1997 if (argv[optidx][2] ==
'r')
1999 if (argv[optidx][2] ==
'w')
2003 check_parameter(argv[optidx][2], argv);
2004 starting = atoi(&argv[optidx][2]);
2007 check_parameter(argv[optidx][2], argv);
2008 delta = atof(&argv[optidx][2]);
2011 check_parameter(argv[optidx][2], argv);
2012 feastol = atof(&argv[optidx][2]);
2015 check_parameter(argv[optidx][2], argv);
2016 opttol = atof(&argv[optidx][2]);
2022 check_parameter(argv[optidx][2], argv);
2023 scaling = atoi(&argv[optidx][2]);
2029 if (argv[optidx][2] ==
'\0' )
2030 print_usage_and_exit( argv );
2031 timelimit = atof(&argv[optidx][2]);
2034 if (argv[optidx][2] ==
'\0' )
2035 print_usage_and_exit( argv );
2036 iterlimit = atoi(&argv[optidx][2]);
2039 check_parameter(argv[optidx][2], argv);
2040 pricing = atoi(&argv[optidx][2]);
2043 print_quality =
true;
2049 check_parameter(argv[optidx][2], argv);
2050 simplifying = atoi(&argv[optidx][2]);
2053 check_parameter(argv[optidx][2], argv);
2054 ratiotest = atoi(&argv[optidx][2]);
2057 check_parameter(argv[optidx][2], argv);
2058 if (argv[optidx][2] >=
'0' && argv[optidx][2] <=
'9')
2059 verbose = argv[optidx][2] -
'0';
2062 print_version_info();
2065 print_solution =
true;
2071 check_parameter(argv[optidx][2], argv);
2072 check_parameter(argv[optidx][3], argv);
2073 switch(argv[optidx][2])
2076 epsilon = atof(&argv[optidx][3]);
2079 epsilon_factor = atof(&argv[optidx][3]);
2082 epsilon_update = atof(&argv[optidx][3]);
2085 print_usage_and_exit( argv );
2093 print_version_info();
2096 print_usage_and_exit( argv );
2101 print_version_info();
2104 if ((argc - optidx) < 1 + (read_basis ? 1 : 0) + (write_basis ? 1 : 0))
2105 print_usage_and_exit( argv );
2106 filename = argv[optidx];
2114 if ( read_basis || write_basis )
2115 basisname = strcpy(
new char[strlen(argv[optidx]) + 1], argv[optidx] );
2124 precision = int(-log10(
MINIMUM(feastol, opttol))) + 1;
2126 std::cout.setf( std::ios::scientific | std::ios::showpoint );
2127 std::cerr.setf( std::ios::scientific | std::ios::showpoint );
2129 #ifdef SEND_ALL_OUTPUT_TO_FILES 2132 std::ofstream myerrstream (
"errwarn.txt" );
2133 std::ofstream myinfostream(
"infos.txt" );
2134 redirect_output(myerrstream, myinfostream);
2138 MySoPlex work( spxout, type, representation );
2139 work.setOutstream ( spxout );
2140 work.setUtype ( update );
2141 work.setFeastol (
MINIMUM(feastol, delta) );
2142 work.setOpttol (
MINIMUM(opttol, delta) );
2143 work.setTerminationTime ( timelimit );
2144 work.setTerminationIter ( iterlimit );
2145 print_algorithm_parameters( work, representation, update );
2146 assert( work.isConsistent() );
2149 work.setPricer ( pricer = get_pricer (pricing, work.spxout) );
2150 work.setStarter ( starter = get_starter (starting, work.spxout) );
2151 work.setSimplifier( simplifier = get_simplifier (simplifying, work.spxout) );
2152 work.setTester ( ratiotester = get_ratio_tester(ratiotest, work.spxout) );
2153 assert(work.isConsistent());
2156 get_scalers(postscaler, scaling, work.spxout);
2157 work.setPostScaler(postscaler);
2158 assert(work.isConsistent());
2161 read_input_file(work, filename, rownames, colnames);
2165 read_basis_file(work, basisname, &rownames, &colnames);
2171 print_solution_and_status(work, rownames, colnames, precision, print_quality,
2172 print_solution, print_dual, write_basis, basisname);
2175 clean_up(postscaler, simplifier, starter, pricer, ratiotester, basisname);
2181 std::cout <<
"exception caught : " << x.
what() << std::endl;
2182 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...
static Real epsilonUpdate()
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
static Real epsilonFactorization()
SoPlex start basis generation base class.SPxStarter is the virtual base class for classes generating ...
#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
bool writeFileReal(const char *filename, const NameSet *rowNames=0, const NameSet *colNames=0, const DIdxSet *intvars=0, const bool unscale=false) const
writes real LP to file; LP or MPS format is chosen from the extension in filename; if rowNames and co...
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.
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)
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...
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
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.
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.
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.
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.