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 =
new char[strlen(filename) + 1];
558 spxSnprintf(readbasname, strlen(filename) + 1, filename);
562 else if( strncmp(option,
"writebas=", 9) == 0 )
564 if( writebasname == 0 )
566 char* filename = &option[9];
567 writebasname =
new char[strlen(filename) + 1];
568 spxSnprintf(writebasname, strlen(filename) + 1, filename);
572 else if( strncmp(option,
"writefile=", 10) == 0 )
574 if( writefilename == 0 )
576 char* filename = &option[10];
577 writefilename =
new char[strlen(filename) + 1];
578 spxSnprintf(writefilename, strlen(filename) + 1, filename);
582 else if( strncmp(option,
"writedual=", 10) == 0 )
584 if( writedualfilename == 0 )
586 char* dualfilename = &option[10];
587 writedualfilename =
new char[strlen(dualfilename) + 1];
588 spxSnprintf(writedualfilename, strlen(dualfilename) + 1, dualfilename);
592 else if( strncmp(option,
"loadset=", 8) == 0 )
594 if( loadsetname == 0 )
596 char* filename = &option[8];
597 loadsetname =
new char[strlen(filename) + 1];
598 spxSnprintf(loadsetname, strlen(filename) + 1, filename);
603 goto TERMINATE_FREESTRINGS;
613 else if( strncmp(option,
"saveset=", 8) == 0 )
615 if( savesetname == 0 )
617 char* filename = &option[8];
618 savesetname =
new char[strlen(filename) + 1];
619 spxSnprintf(savesetname, strlen(filename) + 1, filename);
623 else if( strncmp(option,
"diffset=", 8) == 0 )
625 if( diffsetname == 0 )
627 char* filename = &option[8];
628 diffsetname =
new char[strlen(filename) + 1];
629 spxSnprintf(diffsetname, strlen(filename) + 1, filename);
633 else if( strncmp(option,
"readmode=", 9) == 0 )
639 goto TERMINATE_FREESTRINGS;
643 else if( strncmp(option,
"solvemode=", 10) == 0 )
649 goto TERMINATE_FREESTRINGS;
660 else if( strncmp(option,
"extsol=", 7) == 0 )
662 char* input = &option[7];
667 goto TERMINATE_FREESTRINGS;
675 goto TERMINATE_FREESTRINGS;
686 goto TERMINATE_FREESTRINGS;
696 goto TERMINATE_FREESTRINGS;
706 goto TERMINATE_FREESTRINGS;
716 goto TERMINATE_FREESTRINGS;
726 goto TERMINATE_FREESTRINGS;
736 goto TERMINATE_FREESTRINGS;
746 goto TERMINATE_FREESTRINGS;
756 goto TERMINATE_FREESTRINGS;
766 goto TERMINATE_FREESTRINGS;
776 goto TERMINATE_FREESTRINGS;
787 printPrimalRational =
true;
797 printDualRational =
true;
802 displayStatistics =
true;
814 MSG_ERROR( std::cerr <<
"Error printing parameters\n" );
823 goto TERMINATE_FREESTRINGS;
831 if( lpfilename == 0 && savesetname == 0 && diffsetname == 0 )
835 goto TERMINATE_FREESTRINGS;
841 MSG_ERROR( std::cerr <<
"Error: manual synchronization is invalid on command line. Change parameter int:syncmode.\n" );
843 goto TERMINATE_FREESTRINGS;
847 if( savesetname != 0 )
849 MSG_INFO1( soplex->
spxout, soplex->
spxout <<
"Saving parameters to settings file <" << savesetname <<
"> . . .\n" );
852 MSG_ERROR( std::cerr <<
"Error writing parameters to file <" << savesetname <<
">\n" );
855 if( diffsetname != 0 )
857 MSG_INFO1( soplex->
spxout, soplex->
spxout <<
"Saving modified parameters to settings file <" << diffsetname <<
"> . . .\n" );
860 MSG_ERROR( std::cerr <<
"Error writing modified parameters to file <" << diffsetname <<
">\n" );
865 if( lpfilename == 0 )
867 if( loadsetname != 0 || savesetname != 0 || diffsetname != 0 )
871 goto TERMINATE_FREESTRINGS;
875 readingTime->
start();
888 <<
" LP file <" << lpfilename <<
"> . . .\n" );
890 if( !soplex->
readFile(lpfilename, &rownames, &colnames) )
892 MSG_ERROR( std::cerr <<
"Error while reading file <" << lpfilename <<
">.\n" );
894 goto TERMINATE_FREESTRINGS;
898 if( writefilename != 0 )
900 if( !soplex->
writeFileReal(writefilename, &rownames, &colnames) )
902 MSG_ERROR( std::cerr <<
"Error while writing file <" << writefilename <<
">.\n\n" );
904 goto TERMINATE_FREESTRINGS;
913 if( writedualfilename != 0 )
917 MSG_ERROR( std::cerr <<
"Error while writing dual file <" << writedualfilename <<
">.\n\n" );
919 goto TERMINATE_FREESTRINGS;
923 MSG_INFO1( soplex->
spxout, soplex->
spxout <<
"Written dual LP to file <" << writedualfilename <<
">.\n\n" );
928 if( readbasname != 0 )
931 if( !soplex->
readBasisFile(readbasname, &rownames, &colnames) )
933 MSG_ERROR( std::cerr <<
"Error while reading file <" << readbasname <<
">.\n" );
935 goto TERMINATE_FREESTRINGS;
943 soplex->
spxout <<
"Reading took " 944 << std::fixed << std::setprecision(2) << readingTime->
time()
945 << std::scientific << std::setprecision(
int(prec))
946 <<
" seconds.\n\n" );
961 if( displayStatistics )
971 if( writebasname != 0 )
975 MSG_WARNING( soplex->
spxout, soplex->
spxout <<
"No basis information available. Could not write file <" << writebasname <<
">\n\n" );
977 else if( !soplex->
writeBasisFile(writebasname, &rownames, &colnames) )
979 MSG_ERROR( std::cerr <<
"Error while writing file <" << writebasname <<
">.\n\n" );
981 goto TERMINATE_FREESTRINGS;
985 MSG_INFO1( soplex->
spxout, soplex->
spxout <<
"Written basis information to file <" << writebasname <<
">.\n\n" );
991 MSG_ERROR( std::cerr <<
"Exception caught: " << x.
what() <<
"\n" );
993 goto TERMINATE_FREESTRINGS;
996 TERMINATE_FREESTRINGS:
997 freeStrings(readbasname, writebasname, loadsetname, savesetname, diffsetname);
1008 if( 0 != validation )
1015 if( 0 != readingTime )
1067 static bool checkMode =
false;
1076 class MySoPlex :
public SoPlex 1080 MySoPlex(
SPxOut& outstream,
1083 :
SoPlex(outstream, p_type, p_rep)
1090 void displayQuality()
const 1097 MSG_INFO1( (*spxout), (*spxout) <<
"IEXAMP05 Violations (max/sum)" << std::endl; )
1099 m_solver.qualConstraintViolation(maxviol, sumviol);
1101 MSG_INFO1( (*spxout), (*spxout) <<
"IEXAMP06 Constraints :" 1102 << std::setw(16) << maxviol <<
" " 1103 << std::setw(16) << sumviol << std::endl; )
1105 qualConstraintViolation(maxviol, sumviol);
1107 MSG_INFO1( (*spxout), (*spxout) <<
"IEXAMP07 (unscaled) :" 1108 << std::setw(16) << maxviol <<
" " 1109 << std::setw(16) << sumviol << std::endl; )
1111 m_solver.qualBoundViolation(maxviol, sumviol);
1113 MSG_INFO1( (*spxout), (*spxout) <<
"IEXAMP08 Bounds :" 1114 << std::setw(16) << maxviol <<
" " 1115 << std::setw(16) << sumviol << std::endl; )
1117 qualBoundViolation(maxviol, sumviol);
1119 MSG_INFO1( (*spxout), (*spxout) <<
"IEXAMP09 (unscaled) :" 1120 << std::setw(16) << maxviol <<
" " 1121 << std::setw(16) << sumviol << std::endl; )
1125 m_solver.qualSlackViolation(maxviol, sumviol);
1127 MSG_INFO1( (*spxout), (*spxout) <<
"IEXAMP10 Slacks :" 1128 << std::setw(16) << maxviol <<
" " 1129 << std::setw(16) << sumviol << std::endl; )
1131 m_solver.qualRedCostViolation(maxviol, sumviol);
1133 MSG_INFO1( (*spxout), (*spxout) <<
"IEXAMP11 Reduced costs :" 1134 << std::setw(16) << maxviol <<
" " 1135 << std::setw(16) << sumviol << std::endl; )
1137 MSG_INFO1( (*spxout), (*spxout) <<
"IEXAMP12 Proven dual bound:" 1139 << std::setprecision(20)
1140 << m_solver.provedDualbound() << std::endl; )
1146 MSG_INFO1( (*spxout), (*spxout) <<
"Violations (max/sum)" << std::endl; )
1148 m_solver.qualConstraintViolation(maxviol, sumviol);
1150 MSG_INFO1( (*spxout), (*spxout) <<
"Constraints :" 1151 << std::setw(16) << maxviol <<
" " 1152 << std::setw(16) << sumviol << std::endl; )
1154 qualConstraintViolation(maxviol, sumviol);
1156 MSG_INFO1( (*spxout), (*spxout) <<
" (unscaled) :" 1157 << std::setw(16) << maxviol <<
" " 1158 << std::setw(16) << sumviol << std::endl; )
1160 m_solver.qualBoundViolation(maxviol, sumviol);
1162 MSG_INFO1( (*spxout), (*spxout) <<
"Bounds :" 1163 << std::setw(16) << maxviol <<
" " 1164 << std::setw(16) << sumviol << std::endl; )
1166 qualBoundViolation(maxviol, sumviol);
1168 MSG_INFO1( (*spxout), (*spxout) <<
" (unscaled) :" 1169 << std::setw(16) << maxviol <<
" " 1170 << std::setw(16) << sumviol << std::endl; )
1174 m_solver.qualSlackViolation(maxviol, sumviol);
1176 MSG_INFO1( (*spxout), (*spxout) <<
"Slacks :" 1177 << std::setw(16) << maxviol <<
" " 1178 << std::setw(16) << sumviol << std::endl; )
1180 m_solver.qualRedCostViolation(maxviol, sumviol);
1182 MSG_INFO1( (*spxout), (*spxout) <<
"Reduced costs :" 1183 << std::setw(16) << maxviol <<
" " 1184 << std::setw(16) << sumviol << std::endl; )
1186 MSG_INFO1( (*spxout), (*spxout) <<
"Proven dual bound:" 1188 << std::setprecision(20)
1189 << m_solver.provedDualbound() << std::endl; )
1195 void displayInfeasibility()
const 1202 if( m_solver.isProvenInfeasible() )
1203 MSG_INFO1( (*spxout), (*spxout) <<
"IEXAMP13 Infeasibility is proven." << std::endl; )
1205 MSG_INFO1( (*spxout), (*spxout) <<
"IEXAMP13 Infeasibility could not be proven!" << std::endl; )
1209 if ( m_solver.isProvenInfeasible() )
1211 MSG_INFO1( (*spxout), (*spxout) <<
"Infeasibility is proven." << std::endl; )
1215 MSG_INFO1( (*spxout), (*spxout) <<
"Infeasibility could not be proven!" << std::endl; )
1228 void print_version_info()
1230 const char* banner1 =
1231 "************************************************************************\n" 1233 "* SoPlex --- the Sequential object-oriented simPlex. *\n" 1236 const char* banner2 =
1238 "* Copyright (C) 1996-2018 Konrad-Zuse-Zentrum *\n" 1239 "* fuer Informationstechnik Berlin *\n" 1241 "* SoPlex is distributed under the terms of the ZIB Academic Licence. *\n" 1242 "* You should have received a copy of the ZIB Academic License *\n" 1243 "* along with SoPlex; If not email to soplex@zib.de. *\n" 1245 "************************************************************************\n" 1249 std::cout << banner1;
1251 #if (SOPLEX_SUBVERSION > 0) 1253 std::cout <<
"* Version ";
1255 std::cout <<
"SoPlex version ";
1261 << std::setw(13) << std::setiosflags(std::ios::left) <<
getGitHash();
1263 std::cout <<
" *\n" << banner2 << std::endl;
1268 std::cout <<
"* Release ";
1270 std::cout <<
"SoPlex release ";
1275 << std::setw(13) << std::setiosflags(std::ios::left) <<
getGitHash();
1277 std::cout <<
" *\n" << banner2 << std::endl;
1283 std::cout <<
"[NDEBUG:" 1291 std::cout <<
"[WITH_WARNINGS:" 1292 #ifdef WITH_WARNINGS 1299 std::cout <<
"[ENABLE_ADDITIONAL_CHECKS:" 1300 #ifdef ENABLE_ADDITIONAL_CHECKS 1307 std::cout <<
"[ENABLE_CONSISTENCY_CHECKS:" 1308 #ifdef ENABLE_CONSISTENCY_CHECKS 1315 std::cout <<
"[SOPLEX_WITH_GMP:" 1316 #ifdef SOPLEX_WITH_GMP 1321 <<
"]" << std::endl;
1323 std::cout << std::endl;
1328 void print_short_version_info()
1330 const char* banner1 =
1331 "************************************************************************\n" 1332 "* SoPlex --- the Sequential object-oriented simPlex. ";
1333 const char* banner2 =
1334 "* Copyright (C) 1996-2018 Konrad-Zuse-Zentrum *\n" 1335 "* fuer Informationstechnik Berlin *\n" 1336 "************************************************************************\n";
1338 std::cout << banner1;
1339 #if (SOPLEX_SUBVERSION > 0) 1340 std::cout <<
"Version " 1347 std::cout <<
"Release " 1353 std::cout << banner2 << std::endl;
1359 void print_usage_and_exit(
const char*
const argv[] )
1362 "[options] LPfile [Basfile]\n\n" 1363 " LPfile can be either in MPS or LPF format\n\n" 1364 "options: (*) indicates default\n" 1365 " (!) indicates experimental features which may give wrong results\n" 1366 " -e select entering algorithm (default is leaving)\n" 1367 " -r select row wise representation (default is column)\n" 1368 " -i select Eta-update (default is Forest-Tomlin)\n" 1369 " -x output solution vector\n" 1370 " -y output dual multipliers\n" 1371 " -q display solution quality\n" 1372 " -br read file with starting basis from Basfile\n" 1373 " -bw write file with optimal basis to Basfile\n" 1374 " -l set time limit in seconds\n" 1375 " -L set iteration limit\n" 1376 " -f set primal feasibility tolerance\n" 1377 " -o set optimality, i.e., dual feasibility tolerance\n" 1378 " -d set primal and dual feasibility tolerance to same value\n" 1379 " -zz set general zero tolerance\n" 1380 " -zf set factorization zero tolerance\n" 1381 " -zu set update zero tolerance\n" 1382 " -v set verbosity Level: from 0 (ERROR) to 5 (INFO3), default 3 (INFO1)\n" 1383 " -V show program version\n" 1384 " -C check mode (for check scripts)\n" 1385 " -h show this help\n\n" 1386 "Simplifier: Scaler: Starter: Pricer: Ratiotester:\n" 1387 " -s0 none -g0 none -c0 none* -p0 Textbook -t0 Textbook\n" 1388 " -s1 Main* -g1 uni-Equi -c1 Weight -p1 ParMult -t1 Harris\n" 1389 " -g2 bi-Equi* -c2 Sum -p2 Devex -t2 Fast\n" 1390 " -g3 Geo1 -c3 Vector -p3 Hybrid! -t3 Bound Flipping*\n" 1391 " -g4 Geo8 -p4 Steep*\n" 1393 " -p6 SteepExactSetup\n" 1396 std::cerr <<
"usage: " << argv[0] <<
" " << usage << std::endl;
1402 void check_parameter(
const char param,
const char*
const argv[])
1405 print_usage_and_exit( argv );
1410 void print_algorithm_parameters(
1418 MSG_INFO1( (*work.spxout), (*work.spxout)
1419 <<
"IEXAMP12 Feastol = " 1420 << std::setw(16) << work.feastol() << std::endl
1421 <<
"IEXAMP52 Opttol = " 1422 << std::setw(16) << work.opttol() << std::endl
1423 <<
"IEXAMP13 Epsilon Zero = " 1425 <<
"IEXAMP37 Epsilon Factor = " 1427 <<
"IEXAMP38 Epsilon Update = " 1431 <<
" algorithm" << std::endl
1434 <<
" representation" << std::endl
1437 <<
" update" << std::endl; )
1441 MSG_INFO1( (*work.spxout), (*work.spxout)
1442 <<
"SoPlex parameters: " << std::endl
1444 << std::setw(16) << work.feastol() << std::endl
1446 << std::setw(16) << work.opttol() << std::endl
1447 <<
"Epsilon Zero = " 1449 <<
"Epsilon Factor = " 1451 <<
"Epsilon Update = " 1454 <<
"algorithm = " << (work.type() ==
SPxSolver::ENTER ?
"Entering" :
"Leaving")
1456 <<
"representation = " << (representation ==
SPxSolver::ROW ?
"Row" :
"Column")
1458 <<
"update = " << (update ==
SLUFactor::ETA ?
"Eta" :
"Forest-Tomlin")
1495 assert(pricer != 0);
1497 #ifdef PARTIAL_PRICING 1498 MSG_INFO1( (*spxout), (*spxout) <<
"IEXAMP17 " << pricer->
getName() <<
" pricing" 1499 <<
" (partial, size = " << MAX_PRICING_CANDIDATES <<
")" 1502 MSG_INFO1( (*spxout), (*spxout) <<
"IEXAMP17 " << pricer->
getName() <<
" pricing" 1506 #ifdef PARTIAL_PRICING
1508 <<
" (partial, size = " << MAX_PRICING_CANDIDATES <<
")" 1540 assert(ratiotester != 0);
1542 MSG_INFO1( (*spxout), (*spxout) <<
"IEXAMP18 " << ratiotester->
getName() <<
" ratiotest" << std::endl; )
1544 MSG_INFO1( (*spxout), (*spxout) <<
"ratiotest = " << ratiotester->
getName() << std::endl; )
1580 MSG_INFO1( (*spxout), (*spxout) <<
"IEXAMP19 " 1581 << ((postscaler != 0) ? postscaler->
getName() :
"no")
1582 <<
" scaling" << std::endl; )
1586 MSG_INFO1( (*spxout), (*spxout) <<
"scaling = " 1587 << ((postscaler != 0) ? postscaler->
getName() :
"no")
1605 assert(simplifier == 0);
1610 MSG_INFO1( (*spxout), (*spxout) <<
"IEXAMP20 " << ((simplifier == 0) ?
"no" : simplifier->
getName()) <<
" simplifier" << std::endl; )
1612 MSG_INFO1( (*spxout), (*spxout) <<
"simplifier = " << ((simplifier == 0) ?
"no" : simplifier->getName()) << std::endl; )
1639 MSG_INFO1( (*spxout), (*spxout) <<
"IEXAMP21 " << ((starter == 0) ?
"no" : starter->
getName()) <<
" starter" << std::endl; )
1641 MSG_INFO1( (*spxout), (*spxout) <<
"starter = " << ((starter == 0) ?
"no" : starter->getName()) << std::endl; )
1647 #ifdef SEND_ALL_OUTPUT_TO_FILES 1649 void redirect_output(
1650 std::ostream& myerrstream,
1651 std::ostream& myinfostream
1654 myerrstream .setf( std::ios::scientific | std::ios::showpoint );
1655 myinfostream.setf( std::ios::scientific | std::ios::showpoint );
1666 void read_input_file(
1668 const char* filename,
1673 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"IEXAMP22 loading LP file " << filename << std::endl; )
1675 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"\nLoading LP file " << filename << std::endl; )
1680 if ( ! work.readFile(filename, &rownames, &colnames, 0) )
1683 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"EEXAMP23 error while reading file \"" << filename <<
"\"" << std::endl; )
1685 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"error while reading file \"" << filename <<
"\"" << std::endl; )
1688 assert(work.isConsistent());
1694 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"IEXAMP24 LP has " 1695 << work.nRows() <<
" rows " 1696 << work.nCols() <<
" columns " 1697 << work.nNzos() <<
" nonzeros" 1700 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"IEXAMP41 LP reading time: " << timer.
time() << std::endl; )
1704 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"LP has " 1705 << work.nRows() <<
" rows " 1706 << work.nCols() <<
" columns " 1707 << work.nNzos() <<
" nonzeros" 1711 std::streamsize prec = (*work.spxout).precision();
1712 (*work.spxout) <<
"LP reading time: " << std::fixed << std::setprecision(2) << timer.
time();
1713 (*work.spxout) << std::scientific << std::setprecision(
int(prec)) << std::endl; )
1719 void read_basis_file(
1721 const char* filename,
1725 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"Reading basis from file (disables simplifier)" << std::endl; )
1726 if (!work.readBasisFile(filename, rownames, colnames))
1729 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"EEXAMP25 error while reading file \"" << filename <<
"\"" << std::endl; )
1731 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"Error while reading file \"" << filename <<
"\"" << std::endl; )
1738 void solve_LP(MySoPlex& work)
1744 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"IEXAMP26 solving LP" << std::endl; )
1746 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"\nSolving LP ..." << std::endl; )
1751 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"\nSoPlex statistics:\n" << work.statistics(); )
1756 void print_solution_and_status(
1760 const int precision,
1761 const bool print_quality,
1762 const bool print_solution,
1763 const bool print_dual,
1764 const bool write_basis,
1765 const char* basisname
1772 MSG_INFO1( (*work.spxout), (*work.spxout) << std::endl; )
1777 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"IEXAMP29 solution value is: " << std::setprecision( precision ) << work.objValue() << std::endl; )
1779 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"Solution value is: " << std::setprecision( precision ) << work.objValue() << std::endl; )
1781 if ( print_quality )
1782 work.displayQuality();
1784 if ( print_solution )
1790 MSG_INFO1( (*work.spxout), (*work.spxout) << std::endl <<
"Primal solution (name, id, value):" << std::endl; )
1791 for(
int i = 0; i < work.nCols(); ++i )
1793 if (
isNotZero( objx[i], 0.001 * work.feastol() ) )
1794 MSG_INFO1( (*work.spxout), (*work.spxout) << colnames[ work.cId(i) ] <<
"\t" 1797 << std::setprecision( precision )
1798 << objx[i] << std::endl; )
1800 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"All other variables are zero (within " << std::setprecision(1) << 0.001*work.feastol() <<
")." << std::endl; )
1806 bool allzero =
true;
1810 MSG_INFO1( (*work.spxout), (*work.spxout) << std::endl <<
"Dual multipliers (name, id, value):" << std::endl; )
1811 for(
int i = 0; i < work.nRows(); ++i )
1813 if (
isNotZero( objy[i] , 0.001 * work.opttol() ) )
1815 MSG_INFO1( (*work.spxout), (*work.spxout) << rownames[ work.rId(i) ] <<
"\t" 1818 << std::setprecision( precision )
1819 << objy[i] << std::endl; )
1824 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"All " << (allzero ?
"" :
"other ") <<
"dual values are zero (within " 1825 << std::setprecision(1) << 0.001*work.opttol() <<
")." << std::endl; )
1831 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"Minimizing: a positive/negative value corresponds to left-hand (>=) resp. right-hand (<=) side." 1836 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"Maximizing: a positive/negative value corresponds to right-hand (<=) resp. left-hand (>=) side." 1844 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"Writing basis of original problem to file " << basisname << std::endl; )
1845 if ( ! work.writeBasisFile( basisname, &rownames, &colnames ) )
1848 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"EEXAMP30 error while writing file \"" << basisname <<
"\"" << std::endl; )
1850 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"Error while writing file \"" << basisname <<
"\"" << std::endl; )
1856 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"IEXAMP31 LP is unbounded" << std::endl; )
1858 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"LP is unbounded" << std::endl; )
1860 if ( print_solution )
1865 MSG_INFO1( (*work.spxout), (*work.spxout) << std::endl <<
"Primal solution (name, id, value):" << std::endl; )
1866 for(
int i = 0; i < work.nCols(); ++i )
1868 if (
isNotZero( objx[i], 0.001 * work.feastol() ) )
1869 MSG_INFO1( (*work.spxout), (*work.spxout) << colnames[ work.cId(i) ] <<
"\t" 1872 << std::setprecision( precision )
1873 << objx[i] << std::endl; )
1875 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"All other variables are zero (within " << std::setprecision(1) << 0.001*work.feastol() <<
")." << std::endl; )
1878 DVector objcoef(work.nCols());
1882 Real rayobjval = 0.0;
1884 work.getObj(objcoef);
1886 MSG_INFO1( (*work.spxout), (*work.spxout) << std::endl <<
"Primal ray (name, id, value):" << std::endl; )
1887 for(
int i = 0; i < work.nCols(); ++i )
1889 if (
isNotZero( ray[i], 0.001 * work.feastol() ) )
1891 rayobjval += ray[i] * objcoef[i];
1893 MSG_INFO1( (*work.spxout), (*work.spxout) << colnames[ work.cId(i) ] <<
"\t" 1896 << std::setprecision( precision )
1897 << ray[i] << std::endl; )
1900 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"All other variables have zero value (within " << std::setprecision(1) << 0.001*work.feastol() <<
")." << std::endl; )
1901 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"Objective change per unit along primal ray is " << rayobjval <<
"." << std::endl; )
1907 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"IEXAMP32 LP is infeasible" << std::endl; )
1909 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"LP is infeasible" << std::endl; )
1910 if ( print_solution )
1912 DVector farkasx(work.nRows());
1916 DVector proofvec(work.nCols());
1923 for(
int i = 0; i < work.nRows(); ++i )
1925 if (
isNotZero( farkasx[i], 0.001 * work.opttol() ) )
1927 MSG_INFO1( (*work.spxout), (*work.spxout) << rownames[ work.rId(i) ] <<
"\t" 1930 << std::setprecision( precision )
1931 << farkasx[i] <<
"\t"; )
1933 work.getRow(i, row);
1936 MSG_INFO1( (*work.spxout), (*work.spxout) << row.lhs() <<
" <= "; );
1938 for(
int j = 0; j < row.rowVector().size(); ++j )
1940 if( row.rowVector().value(j) > 0 )
1942 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"+"; )
1944 MSG_INFO1( (*work.spxout), (*work.spxout)
1945 << row.rowVector().value(j) <<
" " 1946 << colnames[ work.cId(row.rowVector().index(j)) ]
1951 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"<= " << row.rhs(); );
1953 MSG_INFO1( (*work.spxout), (*work.spxout) << std::endl; )
1954 if( farkasx[i] > 0.0 )
1956 lhs += farkasx[i] * row.lhs();
1957 rhs += farkasx[i] * row.rhs();
1961 lhs += farkasx[i] * row.rhs();
1962 rhs += farkasx[i] * row.lhs();
1970 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"All other row multipliers are zero (within " << std::setprecision(1) << 0.001*work.opttol() <<
")." << std::endl; )
1971 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"Farkas infeasibility proof: \t"; )
1972 MSG_INFO1( (*work.spxout), (*work.spxout) << lhs <<
" <= "; )
1974 bool nonzerofound =
false;
1975 for(
int i = 0; i < work.nCols(); ++i )
1977 if (
isNotZero( proofvec[i], 0.001 * work.opttol() ) )
1979 if( proofvec[i] > 0 )
1981 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"+"; )
1983 MSG_INFO1( (*work.spxout), (*work.spxout) << proofvec[i] <<
" " << colnames[ work.cId(i) ] <<
" "; )
1984 nonzerofound =
true;
1989 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"0 "; );
1991 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"<= " << rhs << std::endl; );
1994 if ( print_quality )
1995 work.displayInfeasibility();
1997 if ( ! work.writeBasisFile( basisname, &rownames, &colnames ) )
2000 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"EEXAMP30 error while writing file \"" << basisname <<
"\"" << std::endl; )
2002 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"Error while writing file \"" << basisname <<
"\"" << std::endl; )
2007 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"EEXAMP40 aborted due to cycling" << std::endl; )
2009 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"Aborted due to cycling" << std::endl; )
2013 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"IEXAMP33 aborted due to time limit" << std::endl; )
2015 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"Aborted due to time limit" << std::endl; )
2019 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"IEXAMP34 aborted due to iteration limit" << std::endl; )
2021 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"Aborted due to iteration limit" << std::endl; )
2025 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"IEXAMP35 aborted due to objective value limit" << std::endl; )
2027 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"Aborted due to objective value limit" << std::endl; )
2031 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"EEXAMP39 basis is singular" << std::endl; )
2033 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"Basis is singular" << std::endl; )
2037 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"EEXAMP36 An error occurred during " <<
"the solution process" << std::endl; )
2039 MSG_INFO1( (*work.spxout), (*work.spxout) <<
"An error occurred during " <<
"the solution process" << std::endl; )
2042 MSG_INFO1( (*work.spxout), (*work.spxout) << std::endl; )
2056 if ( postscaler != 0 )
2061 if ( simplifier != 0 )
2072 assert( pricer != 0 );
2076 assert( ratiotester != 0 );
2080 if ( basisname != 0 )
2081 delete [] basisname;
2089 int main(
int argc,
char* argv[])
2091 const char* filename;
2092 char* basisname = 0;
2111 int simplifying = 1;
2121 bool print_solution =
false;
2122 bool print_dual =
false;
2123 bool print_quality =
false;
2124 bool read_basis =
false;
2125 bool write_basis =
false;
2129 for(optidx = 1; optidx < argc; optidx++)
2131 if (*argv[optidx] !=
'-')
2134 switch(argv[optidx][1])
2137 check_parameter(argv[optidx][2], argv);
2138 if (argv[optidx][2] ==
'r')
2140 if (argv[optidx][2] ==
'w')
2144 check_parameter(argv[optidx][2], argv);
2145 starting = atoi(&argv[optidx][2]);
2148 check_parameter(argv[optidx][2], argv);
2149 delta = atof(&argv[optidx][2]);
2152 check_parameter(argv[optidx][2], argv);
2153 feastol = atof(&argv[optidx][2]);
2156 check_parameter(argv[optidx][2], argv);
2157 opttol = atof(&argv[optidx][2]);
2163 check_parameter(argv[optidx][2], argv);
2164 scaling = atoi(&argv[optidx][2]);
2170 if (argv[optidx][2] ==
'\0' )
2171 print_usage_and_exit( argv );
2172 timelimit = atof(&argv[optidx][2]);
2175 if (argv[optidx][2] ==
'\0' )
2176 print_usage_and_exit( argv );
2177 iterlimit = atoi(&argv[optidx][2]);
2180 check_parameter(argv[optidx][2], argv);
2181 pricing = atoi(&argv[optidx][2]);
2184 print_quality =
true;
2190 check_parameter(argv[optidx][2], argv);
2191 simplifying = atoi(&argv[optidx][2]);
2194 check_parameter(argv[optidx][2], argv);
2195 ratiotest = atoi(&argv[optidx][2]);
2198 check_parameter(argv[optidx][2], argv);
2199 if (argv[optidx][2] >=
'0' && argv[optidx][2] <=
'9')
2200 verbose = argv[optidx][2] -
'0';
2203 print_version_info();
2206 print_solution =
true;
2212 check_parameter(argv[optidx][2], argv);
2213 check_parameter(argv[optidx][3], argv);
2214 switch(argv[optidx][2])
2217 epsilon = atof(&argv[optidx][3]);
2220 epsilon_factor = atof(&argv[optidx][3]);
2223 epsilon_update = atof(&argv[optidx][3]);
2226 print_usage_and_exit( argv );
2234 print_version_info();
2237 print_usage_and_exit( argv );
2242 print_version_info();
2245 if ((argc - optidx) < 1 + (read_basis ? 1 : 0) + (write_basis ? 1 : 0))
2246 print_usage_and_exit( argv );
2247 filename = argv[optidx];
2255 if ( read_basis || write_basis )
2256 basisname = strcpy(
new char[strlen(argv[optidx]) + 1], argv[optidx] );
2265 precision = int(-log10(
MINIMUM(feastol, opttol))) + 1;
2267 std::cout.setf( std::ios::scientific | std::ios::showpoint );
2268 std::cerr.setf( std::ios::scientific | std::ios::showpoint );
2270 #ifdef SEND_ALL_OUTPUT_TO_FILES 2273 std::ofstream myerrstream (
"errwarn.txt" );
2274 std::ofstream myinfostream(
"infos.txt" );
2275 redirect_output(myerrstream, myinfostream);
2279 MySoPlex work( spxout, type, representation );
2280 work.setOutstream ( spxout );
2281 work.setUtype ( update );
2282 work.setFeastol (
MINIMUM(feastol, delta) );
2283 work.setOpttol (
MINIMUM(opttol, delta) );
2284 work.setTerminationTime ( timelimit );
2285 work.setTerminationIter ( iterlimit );
2286 print_algorithm_parameters( work, representation, update );
2287 assert( work.isConsistent() );
2290 work.setPricer ( pricer = get_pricer (pricing, work.spxout) );
2291 work.setStarter ( starter = get_starter (starting, work.spxout) );
2292 work.setSimplifier( simplifier = get_simplifier (simplifying, work.spxout) );
2293 work.setTester ( ratiotester = get_ratio_tester(ratiotest, work.spxout) );
2294 assert(work.isConsistent());
2297 get_scalers(postscaler, scaling, work.spxout);
2298 work.setPostScaler(postscaler);
2299 assert(work.isConsistent());
2302 read_input_file(work, filename, rownames, colnames);
2306 read_basis_file(work, basisname, &rownames, &colnames);
2312 print_solution_and_status(work, rownames, colnames, precision, print_quality,
2313 print_solution, print_dual, write_basis, basisname);
2316 clean_up(postscaler, simplifier, starter, pricer, ratiotester, basisname);
2322 std::cout <<
"exception caught : " << x.
what() << std::endl;
2323 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
int spxSnprintf(char *t, size_t len, const char *s,...)
safe version of snprintf
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.