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, 6 - geometric-equilibrium)\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" 271 printwidth = printprec + 10;
284 << std::setw(printwidth) << std::setprecision(printprec)
285 << primal[i] << std::endl; )
290 << std::setprecision(8) << std::fixed
291 <<
")." << std::endl; )
302 << std::setw(printwidth) << std::setprecision(printprec)
303 << primal[i] << std::endl; )
309 << std::setprecision(8) << std::fixed
310 <<
"). Solution has " << nNonzeros <<
" nonzero entries." << std::endl; )
327 << std::setw(printwidth) << std::setprecision(printprec)
328 << primal[i] << std::endl; )
347 << nNonzeros <<
" nonzero entries." << std::endl; )
361 printwidth = printprec + 10;
374 << std::setw(printwidth) << std::setprecision(printprec)
375 << dual[i] << std::endl; )
380 << std::setprecision(8) << std::fixed <<
")." << std::endl; )
390 << std::setw(printwidth) << std::setprecision(printprec)
391 << dual[i] << std::endl; )
396 << std::setprecision(8) << std::fixed <<
")." << std::endl; )
407 << std::setw(printwidth) << std::setprecision(printprec)
408 << redcost[i] << std::endl; )
413 << std::setprecision(8) << std::fixed <<
")." << std::endl; )
431 << std::setw(printwidth)
432 << std::setprecision(printprec)
433 << dual[i] << std::endl; )
468 int main(
int argc,
char* argv[])
476 Timer* readingTime = 0;
480 const char* lpfilename = 0;
481 char* readbasname = 0;
482 char* writebasname = 0;
483 char* writefilename = 0;
484 char* writedualfilename = 0;
485 char* loadsetname = 0;
486 char* savesetname = 0;
487 char* diffsetname = 0;
488 bool printPrimal =
false;
489 bool printPrimalRational =
false;
490 bool printDual =
false;
491 bool printDualRational =
false;
492 bool displayStatistics =
false;
493 bool checkSol =
false;
524 for( optidx = 1; optidx < argc; optidx++ )
526 char* option = argv[optidx];
529 if( option[0] !=
'-' )
531 lpfilename = argv[optidx];
537 if( option[0] !=
'-' || option[1] ==
'\0' 538 || ((option[2] ==
'\0') != (option[1] ==
'x' || option[1] ==
'X' || option[1] ==
'y' || option[1] ==
'Y' || option[1] ==
'q' || option[1] ==
'c')) )
542 goto TERMINATE_FREESTRINGS;
552 if( strncmp(option,
"readbas=", 8) == 0 )
554 if( readbasname == 0 )
556 char* filename = &option[8];
557 readbasname = strncpy(
new char[strlen(filename) + 1], filename, strlen(filename) + 1);
561 else if( strncmp(option,
"writebas=", 9) == 0 )
563 if( writebasname == 0 )
565 char* filename = &option[9];
566 writebasname = strncpy(
new char[strlen(filename) + 1], filename, strlen(filename) + 1);
570 else if( strncmp(option,
"writefile=", 10) == 0 )
572 if( writefilename == 0 )
574 char* filename = &option[10];
575 writefilename = strncpy(
new char[strlen(filename) + 1], filename, strlen(filename) + 1);
579 else if( strncmp(option,
"writedual=", 10) == 0 )
581 if( writedualfilename == 0 )
583 char* dualfilename = &option[10];
584 writedualfilename = strncpy(
new char[strlen(dualfilename) + 1], dualfilename, strlen(dualfilename) + 1);
588 else if( strncmp(option,
"loadset=", 8) == 0 )
590 if( loadsetname == 0 )
592 char* filename = &option[8];
593 loadsetname = strncpy(
new char[strlen(filename) + 1], filename, strlen(filename) + 1);
598 goto TERMINATE_FREESTRINGS;
608 else if( strncmp(option,
"saveset=", 8) == 0 )
610 if( savesetname == 0 )
612 char* filename = &option[8];
613 savesetname = strncpy(
new char[strlen(filename) + 1], filename, strlen(filename) + 1);
617 else if( strncmp(option,
"diffset=", 8) == 0 )
619 if( diffsetname == 0 )
621 char* filename = &option[8];
622 diffsetname = strncpy(
new char[strlen(filename) + 1], filename, strlen(filename) + 1);
626 else if( strncmp(option,
"readmode=", 9) == 0 )
632 goto TERMINATE_FREESTRINGS;
636 else if( strncmp(option,
"solvemode=", 10) == 0 )
642 goto TERMINATE_FREESTRINGS;
653 else if( strncmp(option,
"extsol=", 7) == 0 )
655 char* input = &option[7];
660 goto TERMINATE_FREESTRINGS;
668 goto TERMINATE_FREESTRINGS;
679 goto TERMINATE_FREESTRINGS;
689 goto TERMINATE_FREESTRINGS;
699 goto TERMINATE_FREESTRINGS;
709 goto TERMINATE_FREESTRINGS;
719 goto TERMINATE_FREESTRINGS;
729 goto TERMINATE_FREESTRINGS;
739 goto TERMINATE_FREESTRINGS;
749 goto TERMINATE_FREESTRINGS;
759 goto TERMINATE_FREESTRINGS;
769 goto TERMINATE_FREESTRINGS;
780 printPrimalRational =
true;
790 printDualRational =
true;
795 displayStatistics =
true;
807 MSG_ERROR( std::cerr <<
"Error printing parameters\n" );
816 goto TERMINATE_FREESTRINGS;
824 if( lpfilename == 0 && savesetname == 0 && diffsetname == 0 )
828 goto TERMINATE_FREESTRINGS;
834 MSG_ERROR( std::cerr <<
"Error: manual synchronization is invalid on command line. Change parameter int:syncmode.\n" );
836 goto TERMINATE_FREESTRINGS;
840 if( savesetname != 0 )
842 MSG_INFO1( soplex->
spxout, soplex->
spxout <<
"Saving parameters to settings file <" << savesetname <<
"> . . .\n" );
845 MSG_ERROR( std::cerr <<
"Error writing parameters to file <" << savesetname <<
">\n" );
848 if( diffsetname != 0 )
850 MSG_INFO1( soplex->
spxout, soplex->
spxout <<
"Saving modified parameters to settings file <" << diffsetname <<
"> . . .\n" );
853 MSG_ERROR( std::cerr <<
"Error writing modified parameters to file <" << diffsetname <<
">\n" );
858 if( lpfilename == 0 )
860 if( loadsetname != 0 || savesetname != 0 || diffsetname != 0 )
864 goto TERMINATE_FREESTRINGS;
868 readingTime->
start();
881 <<
" LP file <" << lpfilename <<
"> . . .\n" );
883 if( !soplex->
readFile(lpfilename, &rownames, &colnames) )
885 MSG_ERROR( std::cerr <<
"Error while reading file <" << lpfilename <<
">.\n" );
887 goto TERMINATE_FREESTRINGS;
891 if( writefilename != 0 )
893 if( !soplex->
writeFileReal(writefilename, &rownames, &colnames) )
895 MSG_ERROR( std::cerr <<
"Error while writing file <" << writefilename <<
">.\n\n" );
897 goto TERMINATE_FREESTRINGS;
906 if( writedualfilename != 0 )
910 MSG_ERROR( std::cerr <<
"Error while writing dual file <" << writedualfilename <<
">.\n\n" );
912 goto TERMINATE_FREESTRINGS;
916 MSG_INFO1( soplex->
spxout, soplex->
spxout <<
"Written dual LP to file <" << writedualfilename <<
">.\n\n" );
921 if( readbasname != 0 )
924 if( !soplex->
readBasisFile(readbasname, &rownames, &colnames) )
926 MSG_ERROR( std::cerr <<
"Error while reading file <" << readbasname <<
">.\n" );
928 goto TERMINATE_FREESTRINGS;
936 soplex->
spxout <<
"Reading took " 937 << std::fixed << std::setprecision(2) << readingTime->
time()
938 << std::scientific << std::setprecision(
int(prec))
939 <<
" seconds.\n\n" );
954 if( displayStatistics )
964 if( writebasname != 0 )
968 MSG_WARNING( soplex->
spxout, soplex->
spxout <<
"No basis information available. Could not write file <" << writebasname <<
">\n\n" );
970 else if( !soplex->
writeBasisFile(writebasname, &rownames, &colnames) )
972 MSG_ERROR( std::cerr <<
"Error while writing file <" << writebasname <<
">.\n\n" );
974 goto TERMINATE_FREESTRINGS;
978 MSG_INFO1( soplex->
spxout, soplex->
spxout <<
"Written basis information to file <" << writebasname <<
">.\n\n" );
984 MSG_ERROR( std::cerr <<
"Exception caught: " << x.
what() <<
"\n" );
986 goto TERMINATE_FREESTRINGS;
989 TERMINATE_FREESTRINGS:
990 freeStrings(readbasname, writebasname, loadsetname, savesetname, diffsetname);
1001 if( 0 != validation )
1008 if( 0 != readingTime )
1060 static bool checkMode =
false;
1069 class MySoPlex :
public SoPlex 1073 MySoPlex(
SPxOut& outstream,
1076 :
SoPlex(outstream, p_type, p_rep)
1083 void displayQuality()
const 1090 MSG_INFO1( (*spxout), (*spxout) <<
"IEXAMP05 Violations (max/sum)" << std::endl; )
1092 m_solver.qualConstraintViolation(maxviol, sumviol);
1094 MSG_INFO1( (*spxout), (*spxout) <<
"IEXAMP06 Constraints :" 1095 << std::setw(16) << maxviol <<
" " 1096 << std::setw(16) << sumviol << std::endl; )
1098 qualConstraintViolation(maxviol, sumviol);
1100 MSG_INFO1( (*spxout), (*spxout) <<
"IEXAMP07 (unscaled) :" 1101 << std::setw(16) << maxviol <<
" " 1102 << std::setw(16) << sumviol << std::endl; )
1104 m_solver.qualBoundViolation(maxviol, sumviol);
1106 MSG_INFO1( (*spxout), (*spxout) <<
"IEXAMP08 Bounds :" 1107 << std::setw(16) << maxviol <<
" " 1108 << std::setw(16) << sumviol << std::endl; )
1110 qualBoundViolation(maxviol, sumviol);
1112 MSG_INFO1( (*spxout), (*spxout) <<
"IEXAMP09 (unscaled) :" 1113 << std::setw(16) << maxviol <<
" " 1114 << std::setw(16) << sumviol << std::endl; )
1118 m_solver.qualSlackViolation(maxviol, sumviol);
1120 MSG_INFO1( (*spxout), (*spxout) <<
"IEXAMP10 Slacks :" 1121 << std::setw(16) << maxviol <<
" " 1122 << std::setw(16) << sumviol << std::endl; )
1124 m_solver.qualRedCostViolation(maxviol, sumviol);
1126 MSG_INFO1( (*spxout), (*spxout) <<
"IEXAMP11 Reduced costs :" 1127 << std::setw(16) << maxviol <<
" " 1128 << std::setw(16) << sumviol << std::endl; )
1130 MSG_INFO1( (*spxout), (*spxout) <<
"IEXAMP12 Proven dual bound:" 1132 << std::setprecision(20)
1133 << m_solver.provedDualbound() << std::endl; )
1139 MSG_INFO1( (*spxout), (*spxout) <<
"Violations (max/sum)" << std::endl; )
1141 m_solver.qualConstraintViolation(maxviol, sumviol);
1143 MSG_INFO1( (*spxout), (*spxout) <<
"Constraints :" 1144 << std::setw(16) << maxviol <<
" " 1145 << std::setw(16) << sumviol << std::endl; )
1147 qualConstraintViolation(maxviol, sumviol);
1149 MSG_INFO1( (*spxout), (*spxout) <<
" (unscaled) :" 1150 << std::setw(16) << maxviol <<
" " 1151 << std::setw(16) << sumviol << std::endl; )
1153 m_solver.qualBoundViolation(maxviol, sumviol);
1155 MSG_INFO1( (*spxout), (*spxout) <<
"Bounds :" 1156 << std::setw(16) << maxviol <<
" " 1157 << std::setw(16) << sumviol << std::endl; )
1159 qualBoundViolation(maxviol, sumviol);
1161 MSG_INFO1( (*spxout), (*spxout) <<
" (unscaled) :" 1162 << std::setw(16) << maxviol <<
" " 1163 << std::setw(16) << sumviol << std::endl; )
1167 m_solver.qualSlackViolation(maxviol, sumviol);
1169 MSG_INFO1( (*spxout), (*spxout) <<
"Slacks :" 1170 << std::setw(16) << maxviol <<
" " 1171 << std::setw(16) << sumviol << std::endl; )
1173 m_solver.qualRedCostViolation(maxviol, sumviol);
1175 MSG_INFO1( (*spxout), (*spxout) <<
"Reduced costs :" 1176 << std::setw(16) << maxviol <<
" " 1177 << std::setw(16) << sumviol << std::endl; )
1179 MSG_INFO1( (*spxout), (*spxout) <<
"Proven dual bound:" 1181 << std::setprecision(20)
1182 << m_solver.provedDualbound() << std::endl; )
1188 void displayInfeasibility()
const 1195 if( m_solver.isProvenInfeasible() )
1196 MSG_INFO1( (*spxout), (*spxout) <<
"IEXAMP13 Infeasibility is proven." << std::endl; )
1198 MSG_INFO1( (*spxout), (*spxout) <<
"IEXAMP13 Infeasibility could not be proven!" << std::endl; )
1202 if ( m_solver.isProvenInfeasible() )
1204 MSG_INFO1( (*spxout), (*spxout) <<
"Infeasibility is proven." << std::endl; )
1208 MSG_INFO1( (*spxout), (*spxout) <<
"Infeasibility could not be proven!" << std::endl; )
1221 void print_version_info()
1223 const char* banner1 =
1224 "************************************************************************\n" 1226 "* SoPlex --- the Sequential object-oriented simPlex. *\n" 1229 const char* banner2 =
1231 "* Copyright (C) 1996-2017 Konrad-Zuse-Zentrum *\n" 1232 "* fuer Informationstechnik Berlin *\n" 1234 "* SoPlex is distributed under the terms of the ZIB Academic Licence. *\n" 1235 "* You should have received a copy of the ZIB Academic License *\n" 1236 "* along with SoPlex; If not email to soplex@zib.de. *\n" 1238 "************************************************************************\n" 1242 std::cout << banner1;
1244 #if (SOPLEX_SUBVERSION > 0) 1246 std::cout <<
"* Version ";
1248 std::cout <<
"SoPlex version ";
1254 << std::setw(13) << std::setiosflags(std::ios::left) <<
getGitHash();
1256 std::cout <<
" *\n" << banner2 << std::endl;
1261 std::cout <<
"* Release ";
1263 std::cout <<
"SoPlex release ";
1268 << std::setw(13) << std::setiosflags(std::ios::left) <<
getGitHash();
1270 std::cout <<
" *\n" << banner2 << std::endl;
1276 std::cout <<
"[NDEBUG:" 1284 std::cout <<
"[WITH_WARNINGS:" 1285 #ifdef WITH_WARNINGS 1292 std::cout <<
"[ENABLE_ADDITIONAL_CHECKS:" 1293 #ifdef ENABLE_ADDITIONAL_CHECKS 1300 std::cout <<
"[ENABLE_CONSISTENCY_CHECKS:" 1301 #ifdef ENABLE_CONSISTENCY_CHECKS 1308 std::cout <<
"[SOPLEX_WITH_GMP:" 1309 #ifdef SOPLEX_WITH_GMP 1314 <<
"]" << std::endl;
1316 std::cout << std::endl;
1321 void print_short_version_info()
1323 const char* banner1 =
1324 "************************************************************************\n" 1325 "* SoPlex --- the Sequential object-oriented simPlex. ";
1326 const char* banner2 =
1327 "* Copyright (C) 1996-2017 Konrad-Zuse-Zentrum *\n" 1328 "* fuer Informationstechnik Berlin *\n" 1329 "************************************************************************\n";
1331 std::cout << banner1;
1332 #if (SOPLEX_SUBVERSION > 0) 1333 std::cout <<
"Version " 1340 std::cout <<
"Release " 1346 std::cout << banner2 << std::endl;
1352 void print_usage_and_exit(
const char*
const argv[] )
1355 "[options] LPfile [Basfile]\n\n" 1356 " LPfile can be either in MPS or LPF format\n\n" 1357 "options: (*) indicates default\n" 1358 " (!) indicates experimental features which may give wrong results\n" 1359 " -e select entering algorithm (default is leaving)\n" 1360 " -r select row wise representation (default is column)\n" 1361 " -i select Eta-update (default is Forest-Tomlin)\n" 1362 " -x output solution vector\n" 1363 " -y output dual multipliers\n" 1364 " -q display solution quality\n" 1365 " -br read file with starting basis from Basfile\n" 1366 " -bw write file with optimal basis to Basfile\n" 1367 " -l set time limit in seconds\n" 1368 " -L set iteration limit\n" 1369 " -f set primal feasibility tolerance\n" 1370 " -o set optimality, i.e., dual feasibility tolerance\n" 1371 " -d set primal and dual feasibility tolerance to same value\n" 1372 " -zz set general zero tolerance\n" 1373 " -zf set factorization zero tolerance\n" 1374 " -zu set update zero tolerance\n" 1375 " -v set verbosity Level: from 0 (ERROR) to 5 (INFO3), default 3 (INFO1)\n" 1376 " -V show program version\n" 1377 " -C check mode (for check scripts)\n" 1378 " -h show this help\n\n" 1379 "Simplifier: Scaler: Starter: Pricer: Ratiotester:\n" 1380 " -s0 none -g0 none -c0 none* -p0 Textbook -t0 Textbook\n" 1381 " -s1 Main* -g1 uni-Equi -c1 Weight -p1 ParMult -t1 Harris\n" 1382 " -g2 bi-Equi* -c2 Sum -p2 Devex -t2 Fast\n" 1383 " -g3 Geo1 -c3 Vector -p3 Hybrid! -t3 Bound Flipping*\n" 1384 " -g4 Geo8 -p4 Steep*\n" 1386 " -p6 SteepExactSetup\n" 1389 std::cerr <<
"usage: " << argv[0] <<
" " << usage << std::endl;
1395 void check_parameter(
const char param,
const char*
const argv[])
1398 print_usage_and_exit( argv );
1403 void print_algorithm_parameters(
1411 MSG_INFO1( (*work.spxout), (*work.spxout)
1412 <<
"IEXAMP12 Feastol = " 1413 << std::setw(16) << work.feastol() << std::endl
1414 <<
"IEXAMP52 Opttol = " 1415 << std::setw(16) << work.opttol() << std::endl
1416 <<
"IEXAMP13 Epsilon Zero = " 1418 <<
"IEXAMP37 Epsilon Factor = " 1420 <<
"IEXAMP38 Epsilon Update = " 1424 <<
" algorithm" << std::endl
1427 <<
" representation" << std::endl
1430 <<
" update" << std::endl; )
1434 MSG_INFO1( (*work.spxout), (*work.spxout)
1435 <<
"SoPlex parameters: " << std::endl
1437 << std::setw(16) << work.feastol() << std::endl
1439 << std::setw(16) << work.opttol() << std::endl
1440 <<
"Epsilon Zero = " 1442 <<
"Epsilon Factor = " 1444 <<
"Epsilon Update = " 1447 <<
"algorithm = " << (work.type() ==
SPxSolver::ENTER ?
"Entering" :
"Leaving")
1449 <<
"representation = " << (representation ==
SPxSolver::ROW ?
"Row" :
"Column")
1451 <<
"update = " << (update ==
SLUFactor::ETA ?
"Eta" :
"Forest-Tomlin")
1488 assert(pricer != 0);
1490 #ifdef PARTIAL_PRICING 1491 MSG_INFO1( (*spxout), (*spxout) <<
"IEXAMP17 " << pricer->
getName() <<
" pricing" 1492 <<
" (partial, size = " << MAX_PRICING_CANDIDATES <<
")" 1495 MSG_INFO1( (*spxout), (*spxout) <<
"IEXAMP17 " << pricer->
getName() <<
" pricing" 1499 #ifdef PARTIAL_PRICING
1501 <<
" (partial, size = " << MAX_PRICING_CANDIDATES <<
")" 1533 assert(ratiotester != 0);
1535 MSG_INFO1( (*spxout), (*spxout) <<
"IEXAMP18 " << ratiotester->
getName() <<
" ratiotest" << std::endl; )
1537 MSG_INFO1( (*spxout), (*spxout) <<
"ratiotest = " << ratiotester->
getName() << std::endl; )
1573 MSG_INFO1( (*spxout), (*spxout) <<
"IEXAMP19 " 1574 << ((postscaler != 0) ? postscaler->
getName() :
"no")
1575 <<
" scaling" << std::endl; )
1579 MSG_INFO1( (*spxout), (*spxout) <<
"scaling = " 1580 << ((postscaler != 0) ? postscaler->
getName() :
"no")
1598 assert(simplifier == 0);
1603 MSG_INFO1( (*spxout), (*spxout) <<
"IEXAMP20 " << ((simplifier == 0) ?
"no" : simplifier->
getName()) <<
" simplifier" << std::endl; )
1605 MSG_INFO1( (*spxout), (*spxout) <<
"simplifier = " << ((simplifier == 0) ?
"no" : simplifier->getName()) << std::endl; )
1632 MSG_INFO1( (*spxout), (*spxout) <<
"IEXAMP21 " << ((starter == 0) ?
"no" : starter->
getName()) <<
" starter" << std::endl; )
1634 MSG_INFO1( (*spxout), (*spxout) <<
"starter = " << ((starter == 0) ?
"no" : starter->getName()) << std::endl; )
1640 #ifdef SEND_ALL_OUTPUT_TO_FILES 1642 void redirect_output(
1643 std::ostream& myerrstream,
1644 std::ostream& myinfostream
1647 myerrstream .setf( std::ios::scientific | std::ios::showpoint );
1648 myinfostream.setf( std::ios::scientific | std::ios::showpoint );
1659 void read_input_file(
1661 const char* filename,
1666 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"IEXAMP22 loading LP file " << filename << std::endl; )
1668 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"\nLoading LP file " << filename << std::endl; )
1673 if ( ! work.readFile(filename, &rownames, &colnames, 0) )
1676 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"EEXAMP23 error while reading file \"" << filename <<
"\"" << std::endl; )
1678 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"error while reading file \"" << filename <<
"\"" << std::endl; )
1681 assert(work.isConsistent());
1687 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"IEXAMP24 LP has " 1688 << work.nRows() <<
" rows " 1689 << work.nCols() <<
" columns " 1690 << work.nNzos() <<
" nonzeros" 1693 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"IEXAMP41 LP reading time: " << timer.
time() << std::endl; )
1697 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"LP has " 1698 << work.nRows() <<
" rows " 1699 << work.nCols() <<
" columns " 1700 << work.nNzos() <<
" nonzeros" 1704 std::streamsize prec = (*work.spxout).precision();
1705 (*work.spxout) <<
"LP reading time: " << std::fixed << std::setprecision(2) << timer.
time();
1706 (*work.spxout) << std::scientific << std::setprecision(
int(prec)) << std::endl; )
1712 void read_basis_file(
1714 const char* filename,
1718 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"Reading basis from file (disables simplifier)" << std::endl; )
1719 if (!work.readBasisFile(filename, rownames, colnames))
1722 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"EEXAMP25 error while reading file \"" << filename <<
"\"" << std::endl; )
1724 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"Error while reading file \"" << filename <<
"\"" << std::endl; )
1731 void solve_LP(MySoPlex& work)
1737 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"IEXAMP26 solving LP" << std::endl; )
1739 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"\nSolving LP ..." << std::endl; )
1744 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"\nSoPlex statistics:\n" << work.statistics(); )
1749 void print_solution_and_status(
1753 const int precision,
1754 const bool print_quality,
1755 const bool print_solution,
1756 const bool print_dual,
1757 const bool write_basis,
1758 const char* basisname
1765 MSG_INFO1( (*work.spxout), (*work.spxout) << std::endl; )
1770 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"IEXAMP29 solution value is: " << std::setprecision( precision ) << work.objValue() << std::endl; )
1772 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"Solution value is: " << std::setprecision( precision ) << work.objValue() << std::endl; )
1774 if ( print_quality )
1775 work.displayQuality();
1777 if ( print_solution )
1783 MSG_INFO1( (*work.spxout), (*work.spxout) << std::endl <<
"Primal solution (name, id, value):" << std::endl; )
1784 for(
int i = 0; i < work.nCols(); ++i )
1786 if (
isNotZero( objx[i], 0.001 * work.feastol() ) )
1787 MSG_INFO1( (*work.spxout), (*work.spxout) << colnames[ work.cId(i) ] <<
"\t" 1790 << std::setprecision( precision )
1791 << objx[i] << std::endl; )
1793 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"All other variables are zero (within " << std::setprecision(1) << 0.001*work.feastol() <<
")." << std::endl; )
1799 bool allzero =
true;
1803 MSG_INFO1( (*work.spxout), (*work.spxout) << std::endl <<
"Dual multipliers (name, id, value):" << std::endl; )
1804 for(
int i = 0; i < work.nRows(); ++i )
1806 if (
isNotZero( objy[i] , 0.001 * work.opttol() ) )
1808 MSG_INFO1( (*work.spxout), (*work.spxout) << rownames[ work.rId(i) ] <<
"\t" 1811 << std::setprecision( precision )
1812 << objy[i] << std::endl; )
1817 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"All " << (allzero ?
"" :
"other ") <<
"dual values are zero (within " 1818 << std::setprecision(1) << 0.001*work.opttol() <<
")." << std::endl; )
1824 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"Minimizing: a positive/negative value corresponds to left-hand (>=) resp. right-hand (<=) side." 1829 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"Maximizing: a positive/negative value corresponds to right-hand (<=) resp. left-hand (>=) side." 1837 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"Writing basis of original problem to file " << basisname << std::endl; )
1838 if ( ! work.writeBasisFile( basisname, &rownames, &colnames ) )
1841 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"EEXAMP30 error while writing file \"" << basisname <<
"\"" << std::endl; )
1843 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"Error while writing file \"" << basisname <<
"\"" << std::endl; )
1849 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"IEXAMP31 LP is unbounded" << std::endl; )
1851 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"LP is unbounded" << std::endl; )
1853 if ( print_solution )
1858 MSG_INFO1( (*work.spxout), (*work.spxout) << std::endl <<
"Primal solution (name, id, value):" << std::endl; )
1859 for(
int i = 0; i < work.nCols(); ++i )
1861 if (
isNotZero( objx[i], 0.001 * work.feastol() ) )
1862 MSG_INFO1( (*work.spxout), (*work.spxout) << colnames[ work.cId(i) ] <<
"\t" 1865 << std::setprecision( precision )
1866 << objx[i] << std::endl; )
1868 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"All other variables are zero (within " << std::setprecision(1) << 0.001*work.feastol() <<
")." << std::endl; )
1871 DVector objcoef(work.nCols());
1875 Real rayobjval = 0.0;
1877 work.getObj(objcoef);
1879 MSG_INFO1( (*work.spxout), (*work.spxout) << std::endl <<
"Primal ray (name, id, value):" << std::endl; )
1880 for(
int i = 0; i < work.nCols(); ++i )
1882 if (
isNotZero( ray[i], 0.001 * work.feastol() ) )
1884 rayobjval += ray[i] * objcoef[i];
1886 MSG_INFO1( (*work.spxout), (*work.spxout) << colnames[ work.cId(i) ] <<
"\t" 1889 << std::setprecision( precision )
1890 << ray[i] << std::endl; )
1893 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"All other variables have zero value (within " << std::setprecision(1) << 0.001*work.feastol() <<
")." << std::endl; )
1894 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"Objective change per unit along primal ray is " << rayobjval <<
"." << std::endl; )
1900 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"IEXAMP32 LP is infeasible" << std::endl; )
1902 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"LP is infeasible" << std::endl; )
1903 if ( print_solution )
1905 DVector farkasx(work.nRows());
1909 DVector proofvec(work.nCols());
1916 for(
int i = 0; i < work.nRows(); ++i )
1918 if (
isNotZero( farkasx[i], 0.001 * work.opttol() ) )
1920 MSG_INFO1( (*work.spxout), (*work.spxout) << rownames[ work.rId(i) ] <<
"\t" 1923 << std::setprecision( precision )
1924 << farkasx[i] <<
"\t"; )
1926 work.getRow(i, row);
1929 MSG_INFO1( (*work.spxout), (*work.spxout) << row.lhs() <<
" <= "; );
1931 for(
int j = 0; j < row.rowVector().size(); ++j )
1933 if( row.rowVector().value(j) > 0 )
1935 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"+"; )
1937 MSG_INFO1( (*work.spxout), (*work.spxout)
1938 << row.rowVector().value(j) <<
" " 1939 << colnames[ work.cId(row.rowVector().index(j)) ]
1944 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"<= " << row.rhs(); );
1946 MSG_INFO1( (*work.spxout), (*work.spxout) << std::endl; )
1947 if( farkasx[i] > 0.0 )
1949 lhs += farkasx[i] * row.lhs();
1950 rhs += farkasx[i] * row.rhs();
1954 lhs += farkasx[i] * row.rhs();
1955 rhs += farkasx[i] * row.lhs();
1963 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"All other row multipliers are zero (within " << std::setprecision(1) << 0.001*work.opttol() <<
")." << std::endl; )
1964 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"Farkas infeasibility proof: \t"; )
1965 MSG_INFO1( (*work.spxout), (*work.spxout) << lhs <<
" <= "; )
1967 bool nonzerofound =
false;
1968 for(
int i = 0; i < work.nCols(); ++i )
1970 if (
isNotZero( proofvec[i], 0.001 * work.opttol() ) )
1972 if( proofvec[i] > 0 )
1974 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"+"; )
1976 MSG_INFO1( (*work.spxout), (*work.spxout) << proofvec[i] <<
" " << colnames[ work.cId(i) ] <<
" "; )
1977 nonzerofound =
true;
1982 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"0 "; );
1984 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"<= " << rhs << std::endl; );
1987 if ( print_quality )
1988 work.displayInfeasibility();
1990 if ( ! work.writeBasisFile( basisname, &rownames, &colnames ) )
1993 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"EEXAMP30 error while writing file \"" << basisname <<
"\"" << std::endl; )
1995 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"Error while writing file \"" << basisname <<
"\"" << std::endl; )
2000 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"EEXAMP40 aborted due to cycling" << std::endl; )
2002 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"Aborted due to cycling" << std::endl; )
2006 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"IEXAMP33 aborted due to time limit" << std::endl; )
2008 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"Aborted due to time limit" << std::endl; )
2012 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"IEXAMP34 aborted due to iteration limit" << std::endl; )
2014 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"Aborted due to iteration limit" << std::endl; )
2018 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"IEXAMP35 aborted due to objective value limit" << std::endl; )
2020 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"Aborted due to objective value limit" << std::endl; )
2024 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"EEXAMP39 basis is singular" << std::endl; )
2026 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"Basis is singular" << std::endl; )
2030 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"EEXAMP36 An error occurred during " <<
"the solution process" << std::endl; )
2032 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"An error occurred during " <<
"the solution process" << std::endl; )
2035 MSG_INFO1( (*work.spxout), (*work.spxout) << std::endl; )
2049 if ( postscaler != 0 )
2054 if ( simplifier != 0 )
2065 assert( pricer != 0 );
2069 assert( ratiotester != 0 );
2073 if ( basisname != 0 )
2074 delete [] basisname;
2082 int main(
int argc,
char* argv[])
2084 const char* filename;
2085 char* basisname = 0;
2104 int simplifying = 1;
2114 bool print_solution =
false;
2115 bool print_dual =
false;
2116 bool print_quality =
false;
2117 bool read_basis =
false;
2118 bool write_basis =
false;
2122 for(optidx = 1; optidx < argc; optidx++)
2124 if (*argv[optidx] !=
'-')
2127 switch(argv[optidx][1])
2130 check_parameter(argv[optidx][2], argv);
2131 if (argv[optidx][2] ==
'r')
2133 if (argv[optidx][2] ==
'w')
2137 check_parameter(argv[optidx][2], argv);
2138 starting = atoi(&argv[optidx][2]);
2141 check_parameter(argv[optidx][2], argv);
2142 delta = atof(&argv[optidx][2]);
2145 check_parameter(argv[optidx][2], argv);
2146 feastol = atof(&argv[optidx][2]);
2149 check_parameter(argv[optidx][2], argv);
2150 opttol = atof(&argv[optidx][2]);
2156 check_parameter(argv[optidx][2], argv);
2157 scaling = atoi(&argv[optidx][2]);
2163 if (argv[optidx][2] ==
'\0' )
2164 print_usage_and_exit( argv );
2165 timelimit = atof(&argv[optidx][2]);
2168 if (argv[optidx][2] ==
'\0' )
2169 print_usage_and_exit( argv );
2170 iterlimit = atoi(&argv[optidx][2]);
2173 check_parameter(argv[optidx][2], argv);
2174 pricing = atoi(&argv[optidx][2]);
2177 print_quality =
true;
2183 check_parameter(argv[optidx][2], argv);
2184 simplifying = atoi(&argv[optidx][2]);
2187 check_parameter(argv[optidx][2], argv);
2188 ratiotest = atoi(&argv[optidx][2]);
2191 check_parameter(argv[optidx][2], argv);
2192 if (argv[optidx][2] >=
'0' && argv[optidx][2] <=
'9')
2193 verbose = argv[optidx][2] -
'0';
2196 print_version_info();
2199 print_solution =
true;
2205 check_parameter(argv[optidx][2], argv);
2206 check_parameter(argv[optidx][3], argv);
2207 switch(argv[optidx][2])
2210 epsilon = atof(&argv[optidx][3]);
2213 epsilon_factor = atof(&argv[optidx][3]);
2216 epsilon_update = atof(&argv[optidx][3]);
2219 print_usage_and_exit( argv );
2227 print_version_info();
2230 print_usage_and_exit( argv );
2235 print_version_info();
2238 if ((argc - optidx) < 1 + (read_basis ? 1 : 0) + (write_basis ? 1 : 0))
2239 print_usage_and_exit( argv );
2240 filename = argv[optidx];
2248 if ( read_basis || write_basis )
2249 basisname = strcpy(
new char[strlen(argv[optidx]) + 1], argv[optidx] );
2258 precision = int(-log10(
MINIMUM(feastol, opttol))) + 1;
2260 std::cout.setf( std::ios::scientific | std::ios::showpoint );
2261 std::cerr.setf( std::ios::scientific | std::ios::showpoint );
2263 #ifdef SEND_ALL_OUTPUT_TO_FILES 2266 std::ofstream myerrstream (
"errwarn.txt" );
2267 std::ofstream myinfostream(
"infos.txt" );
2268 redirect_output(myerrstream, myinfostream);
2272 MySoPlex work( spxout, type, representation );
2273 work.setOutstream ( spxout );
2274 work.setUtype ( update );
2275 work.setFeastol (
MINIMUM(feastol, delta) );
2276 work.setOpttol (
MINIMUM(opttol, delta) );
2277 work.setTerminationTime ( timelimit );
2278 work.setTerminationIter ( iterlimit );
2279 print_algorithm_parameters( work, representation, update );
2280 assert( work.isConsistent() );
2283 work.setPricer ( pricer = get_pricer (pricing, work.spxout) );
2284 work.setStarter ( starter = get_starter (starting, work.spxout) );
2285 work.setSimplifier( simplifier = get_simplifier (simplifying, work.spxout) );
2286 work.setTester ( ratiotester = get_ratio_tester(ratiotest, work.spxout) );
2287 assert(work.isConsistent());
2290 get_scalers(postscaler, scaling, work.spxout);
2291 work.setPostScaler(postscaler);
2292 assert(work.isConsistent());
2295 read_input_file(work, filename, rownames, colnames);
2299 read_basis_file(work, basisname, &rownames, &colnames);
2305 print_solution_and_status(work, rownames, colnames, precision, print_quality,
2306 print_solution, print_dual, write_basis, basisname);
2309 clean_up(postscaler, simplifier, starter, pricer, ratiotester, basisname);
2315 std::cout <<
"exception caught : " << x.
what() << std::endl;
2316 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
bool getRedCostRational(VectorRational &vector)
gets the vector of reduced cost values if available; returns true on success
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
bool isDualFeasible() const
is stored dual solution feasible?
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
bool isPrimalFeasible() const
is stored primal solution feasible?
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
static void printPrimalSolution(SoPlex &soplex, NameSet &colnames, NameSet &rownames, bool real=true, bool rational=false)
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.
bool getRedCostReal(VectorReal &vector)
gets the vector of reduced cost values if available; returns true on success
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
static void printDualSolution(SoPlex &soplex, NameSet &colnames, NameSet &rownames, bool real=true, bool rational=false)
(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.
bool getDualFarkasRational(VectorRational &vector)
gets the Farkas proof if LP is infeasible; returns true on success
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)
bool getPrimalRayRational(VectorRational &vector)
gets the primal ray if LP is unbounded; returns true on success
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.