34 #define SET_MAX_LINE_LEN 500 36 #define DEFAULT_REFACTOR_INTERVAL 200 39 #define strncasecmp _strnicmp 49 "should lifting be used to reduce range of nonzero matrix coefficients?";
60 "should dual infeasibility be tested in order to try to return a dual solution even if primal infeasible?";
66 "should a rational factorization be performed after iterative refinement?";
73 "should the decomposition based dual simplex be used to solve the LP?";
84 "should the dual of the complementary problem be used in the decomposition simplex?";
91 "Should violations of the original problem be explicitly computed in the decomposition simplex?";
97 "should cycling solutions be accepted during iterative refinement?";
108 "round scaling factors for iterative refinement to powers of two?";
114 "continue iterative refinement with exact basic solution if not optimal?";
135 "re-optimize the original problem to get a proof (ray) of infeasibility/unboundedness?";
151 "type of computational form (0 - auto, 1 - column representation, 2 - row representation)";
166 "type of LU update (0 - eta update, 1 - Forrest-Tomlin update)";
174 "maximum number of LU updates without fresh factorization (0 - auto)";
210 "verbosity level (0 - error, 1 - warning, 2 - debug, 3 - normal, 4 - high, 5 - full)";
226 "scaling (0 - off, 1 - uni-equilibrium, 2 - bi-equilibrium, 3 - geometric, 4 - iterated geometric, 5 - least squares, 6 - geometric-equilibrium)";
234 "crash basis generated when starting from scratch (0 - none, 1 - weight, 2 - sum, 3 - vector)";
242 "pricing method (0 - auto, 1 - dantzig, 2 - parmult, 3 - devex, 4 - quicksteep, 5 - steep)";
250 "method for ratio test (0 - textbook, 1 - harris, 2 - fast, 3 - boundflipping)";
258 "mode for synchronizing real and rational LP (0 - store only real LP, 1 - auto, 2 - manual)";
273 "mode for iterative refinement strategy (0 - floating-point solve, 1 - auto, 2 - exact rational solve)";
281 "mode for a posteriori feasibility checks (0 - floating-point check, 1 - auto, 2 - exact rational check)";
289 "type of timer (1 - cputime, aka. usertime, 2 - wallclock time, 0 - no timing)";
297 "mode for hyper sparse pricing (0 - off, 1 - auto, 2 - always)";
305 "minimum number of stalling refinements since last pivot to trigger rational factorization";
313 "maximum number of conjugate gradient iterations in least square scaling";
321 "mode for solution polishing (0 - off, 1 - max basic slack, 2 - min basic slack)";
329 "the number of iterations before the decomposition simplex initialisation solve is terminated";
337 "maximum number of rows that are added to the reduced problem when using the decomposition based simplex";
345 "the frequency that the decomposition based simplex status output is displayed.";
353 "the verbosity of decomposition based simplex (0 - error, 1 - warning, 2 - debug, 3 - normal, 4 - high, 5 - full).";
361 "print condition number during the solve (0 - off, 1 - ratio estimate , 2 - sum estimate, 3 - product estimate, 4 - exact)";
447 "working tolerance for feasibility in floating-point solver during iterative refinement";
455 "working tolerance for optimality in floating-point solver during iterative refinement";
470 "lower threshold in lifting (nonzero matrix coefficients with smaller absolute value will be reformulated)";
478 "lower threshold in lifting (nonzero matrix coefficients with smaller absolute value will be reformulated)";
486 "sparse pricing threshold (#violations < dimension * SPARSITY_THRESHOLD activates sparse pricing)";
494 "threshold on number of rows vs. number of columns for switching from column to row representations in auto mode";
509 "minimal reduction (sum of removed rows/cols) to continue simplification";
517 "refactor threshold for nonzeros in last factorized basis matrix compared to updated basis matrix";
525 "refactor threshold for fill-in in current factor update compared to fill-in in last factorization";
533 "refactor threshold for memory growth in factorization since last refactorization";
541 "accuracy of conjugate gradient method in least squares scaling (higher value leads to more iterations)";
554 #ifdef SOPLEX_WITH_RATIONALPARAM 555 SoPlex::Settings::RationalParam::RationalParam() {}
569 #ifdef SOPLEX_WITH_RATIONALPARAM
571 for(
int i = 0; i < SoPlex::RATIONALPARAM_COUNT; i++)
572 _rationalParamValues[i] = rationalParam.defaultValue[i];
593 #ifdef SOPLEX_WITH_RATIONALPARAM
595 for(
int i = 0; i < SoPlex::RATIONALPARAM_COUNT; i++)
596 _rationalParamValues[i] = settings._rationalParamValues[i];
606 #ifdef SOPLEX_WITH_RATIONALPARAM 607 SoPlex::Settings::RationalParam SoPlex::Settings::rationalParam;
1135 assert(ncols ==
_solver.
nCols() || (ncols == 0 && intInfo == NULL));
1768 if(i < _rationalLP->nRows())
1796 for(
int i = 0; i < oldsize; i++)
1865 if(i < _rationalLP->nCols())
1893 for(
int i = 0; i < oldsize; i++)
2001 #ifdef SOPLEX_WITH_GMP 2004 const int rowSize,
const mpq_t* rhs)
2026 const int* rowStarts,
const int* rowLengths,
const int numRows,
const int numValues,
2034 _rationalLP->
addRows(lhs, rowValues, rowIndices, rowStarts, rowLengths, numRows, numValues, rhs);
2091 #ifdef SOPLEX_WITH_GMP 2094 const int* colIndices,
const int colSize,
const mpq_t* upper)
2117 const int* colIndices,
const int* colStarts,
const int* colLengths,
const int numCols,
2118 const int numValues,
const mpq_t* upper)
2125 _rationalLP->
addCols(obj, lower, colValues, colIndices, colStarts, colLengths, numCols, numValues,
2226 #ifdef SOPLEX_WITH_GMP 2268 #ifdef SOPLEX_WITH_GMP 2277 for(
int i = 0; i < rhsSize; i++)
2351 #ifdef SOPLEX_WITH_GMP 2432 #ifdef SOPLEX_WITH_GMP 2493 #ifdef SOPLEX_WITH_GMP 2554 #ifdef SOPLEX_WITH_GMP 2611 #ifdef SOPLEX_WITH_GMP 2648 #ifdef SOPLEX_WITH_GMP 2678 if(i < _rationalLP->nRows())
2707 for(
int i = 0; i < oldsize; i++)
2778 if(i < _rationalLP->nCols())
2807 for(
int i = 0; i < oldsize; i++)
2951 #ifdef SOPLEX_DEBUG // this check will remove scaling of the realLP 2962 #ifdef ENABLE_ADDITIONAL_CHECKS 2970 #ifdef ENABLE_ADDITIONAL_CHECKS 2978 #ifdef ENABLE_ADDITIONAL_CHECKS 3176 Real viol = lower - primal[i];
3186 viol = primal[i] - upper;
3222 Real viol = lhs - activity[i];
3232 viol = activity[i] - rhs;
3269 sumviol += -redcost[c];
3271 if(redcost[c] < -maxviol)
3272 maxviol = -redcost[c];
3277 sumviol += redcost[c];
3279 if(redcost[c] > maxviol)
3280 maxviol = redcost[c];
3287 sumviol += redcost[c];
3289 if(redcost[c] > maxviol)
3290 maxviol = redcost[c];
3295 sumviol += -redcost[c];
3297 if(redcost[c] < -maxviol)
3298 maxviol = -redcost[c];
3329 sumviol += -dual[r];
3331 if(dual[r] < -maxviol)
3339 if(dual[r] > maxviol)
3349 if(dual[r] > maxviol)
3355 sumviol += -dual[r];
3357 if(dual[r] < -maxviol)
3645 sumviol += -redcost[c];
3647 if(redcost[c] < -maxviol)
3649 MSG_DEBUG(std::cout <<
"increased reduced cost violation for column " << c <<
3651 maxviol = -redcost[c];
3657 sumviol += redcost[c];
3659 if(redcost[c] > maxviol)
3661 MSG_DEBUG(std::cout <<
"increased reduced cost violation for column " << c <<
3663 maxviol = redcost[c];
3671 sumviol += redcost[c];
3673 if(redcost[c] > maxviol)
3675 MSG_DEBUG(std::cout <<
"increased reduced cost violation for column " << c <<
3677 maxviol = redcost[c];
3683 sumviol += -redcost[c];
3685 if(redcost[c] < -maxviol)
3687 MSG_DEBUG(std::cout <<
"increased reduced cost violation for column " << c <<
3689 maxviol = -redcost[c];
3740 sumviol += -dual[r];
3742 if(dual[r] < -maxviol)
3744 MSG_DEBUG(std::cout <<
"increased dual violation for row " << r <<
" not on upper bound: " <<
3758 if(dual[r] > maxviol)
3760 MSG_DEBUG(std::cout <<
"increased dual violation for row " << r <<
" not on lower bound: " <<
3776 if(dual[r] > maxviol)
3778 MSG_DEBUG(std::cout <<
"increased dual violation for row " << r <<
" not on upper bound: " <<
3790 sumviol += -dual[r];
3792 if(dual[r] < -maxviol)
3794 MSG_DEBUG(std::cout <<
"increased dual violation for row " << r <<
" not on lower bound: " <<
3811 #ifdef SOPLEX_WITH_GMP 4308 int size = x.
size();
4311 for(
int i = 0; i < size; i++)
4325 "> while computing basis inverse row.\n");
4330 if(ninds != 0 && inds != 0)
4336 for(
int i = 0; i < *ninds; ++i)
4387 for(
int i = 0; i < rhs.size(); ++i)
4413 "> while computing basis inverse row.\n");
4432 coef[rowindex] = y[i];
4442 assert(coef[index] == 0.0);
4496 int size = x.
size();
4498 for(
int i = 0; i < size; i++)
4522 "> while computing basis inverse row.\n");
4527 if(ninds != 0 && inds != 0)
4533 for(
int i = 0; i < *ninds; ++i)
4573 if(bind[i] < 0 && -bind[i]-1 == c)
4599 int size = x.
size();
4602 for(
int i = 0; i < size; i++)
4604 int idx = bind[x.
index(i)];
4626 "> while computing basis inverse column.\n");
4648 coef[i] = - (r_unscaled * x);
4713 for(
int i = 0; i < v.
dim(); ++i)
4724 for(
int i = 0; i < x.
dim(); i++)
4747 "> while solving with basis matrix.\n");
4781 rowrhs.add(i,
spxLdexp(v[idx], scaleExp));
4788 assert(rowrhs[i] == 0.0);
4800 "> while solving with basis matrix.\n");
4838 x[i] =
spxLdexp(y[index], scaleExp);
4878 for(
int i = 0; i < basisdim; ++i)
4887 vec[i] =
spxLdexp(vec[i], scaleExp);
4893 for(
int i = 0; i < basisdim; ++i)
4896 vec[i] =
spxLdexp(vec[i], -scaleExp);
4911 Vector x(colbasisdim, vec);
4921 for(
int i = 0; i < colbasisdim; ++i)
4993 for(
int i = 0; i < basisdim; ++i)
4998 vec[i] =
spxLdexp(vec[i], scaleExp);
5004 for(
int i = 0; i < basisdim; ++i)
5013 vec[i] =
spxLdexp(vec[i], scaleExp);
5027 Vector x(colbasisdim, vec);
5037 for(
int i = 0; i < colbasisdim; ++i)
5143 "> while computing rational basis inverse row.\n");
5169 "> while computing rational basis inverse column.\n");
5196 "> during right solve with rational basis inverse.\n");
5265 std::stringstream s;
5267 <<
" Time spent : " << std::setw(10) << std::fixed << std::setprecision(
5271 <<
"Solution time : " << std::setw(10) << std::fixed << std::setprecision(
5273 <<
"Iterations : " << std::setw(10) <<
numIterations() << std::endl;
5333 bool success =
false;
5336 success =
_readFileReal(filename, rowNames, colNames, intVars);
5351 const DIdxSet* intVars,
const bool unscale)
const 5362 origLP->writeFile(filename, rowNames, colNames, intVars);
5363 origLP->~SPxLPReal();
5405 dualLP.
writeFile(filename, colNames, rowNames);
5418 assert(filename != 0);
5445 assert(filename != 0);
5461 const NameSet* colNamesPtr = colNames;
5466 std::stringstream name;
5469 tmpColNames =
new(tmpColNames)
NameSet();
5470 tmpColNames->
reMax(numCols);
5472 for(
int j = 0; j < numCols; ++j)
5475 tmpColNames->
add(name.str().c_str());
5478 colNamesPtr = tmpColNames;
5482 const NameSet* rowNamesPtr = rowNames;
5485 if(rowNamesPtr == 0)
5487 std::stringstream name;
5490 tmpRowNames =
new(tmpRowNames)
NameSet();
5491 tmpRowNames->
reMax(numRows);
5493 for(
int i = 0; i < numRows; ++i)
5496 tmpRowNames->
add(name.str().c_str());
5499 rowNamesPtr = tmpRowNames;
5506 for(
int i = 0; i < numRows; i++)
5509 for(
int i = 0; i < numCols; i++)
5532 if(mps.
field0() != 0 && !strcmp(mps.
field0(),
"ENDATA"))
5550 if(!strcmp(mps.
field1(),
"XU"))
5561 else if(!strcmp(mps.
field1(),
"XL"))
5572 else if(!strcmp(mps.
field1(),
"UL"))
5576 else if(!strcmp(mps.
field1(),
"LL"))
5614 const bool cpxFormat)
const 5616 assert(filename != 0);
5622 std::ofstream file(filename);
5627 file.setf(std::ios::left);
5628 file <<
"NAME " << filename <<
"\n";
5642 for(
int col = 0; col < numCols; col++)
5649 for(; row < numRows; row++)
5657 assert(row != numRows);
5665 file << std::setw(8);
5667 if(colNames != 0 && colNames->
has(col))
5668 file << (*colNames)[col];
5674 if(rowNames != 0 && rowNames->
has(row))
5675 file << (*rowNames)[row];
5688 file << std::setw(8);
5690 if(colNames != 0 && colNames->
has(col))
5691 file << (*colNames)[col];
5705 for(; row < numRows; row++)
5721 const bool cpxFormat)
const 5726 ofname = std::string(filename) +
".set";
5730 ofname = std::string(filename) + ((cpxFormat) ?
".lp" :
".mps");
5734 ofname = std::string(filename) +
".bas";
5743 const NameSet* colNames,
const bool cpxFormat)
const 5748 ofname = std::string(filename) +
".set";
5752 ofname = std::string(filename) + ((cpxFormat) ?
".lp" :
".mps");
5756 ofname = std::string(filename) +
".bas";
5792 #ifdef SOPLEX_WITH_RATIONALPARAM 5794 Rational SoPlex::rationalParam(
const RationalParam param)
const 5797 assert(param < RATIONALPARAM_COUNT);
5891 if(!init && value ==
intParam(param))
5895 if(value < _currentSettings->
intParam.lower[param]
6319 if(value < _currentSettings->
realParam.lower[param]
6324 Real tmp_value = value;
6330 #ifndef SOPLEX_WITH_GMP 6346 #ifndef SOPLEX_WITH_GMP 6475 #ifdef SOPLEX_WITH_RATIONALPARAM 6477 bool SoPlex::setRationalParam(
const RationalParam param,
const Rational value,
const bool init)
6480 assert(param < RATIONALPARAM_COUNT);
6483 if(!init && value == rationalParam(param))
6486 if(value < _currentSettings->rationalParam.lower[param]
6509 bool success =
true;
6522 #ifdef SOPLEX_WITH_RATIONALPARAM 6524 for(
int i = 0; i < SoPlex::RATIONALPARAM_COUNT; i++)
6525 success &= setRationalParam((RationalParam)i,
_currentSettings->_rationalParamValues[i], init);
6546 #ifdef SOPLEX_WITH_RATIONALPARAM 6548 for(
int i = 0; i < SoPlex::RATIONALPARAM_COUNT; i++)
6549 success &= setRationalParam((RationalParam)i,
_currentSettings->rationalParam.defaultValue[i],
6559 bool printedValue =
false;
6570 printedValue =
true;
6580 printedValue =
true;
6592 printedValue =
true;
6595 #ifdef SOPLEX_WITH_RATIONALPARAM 6597 for(
int i = 0; i < SoPlex::RATIONALPARAM_COUNT; i++)
6604 printedValue =
true;
6612 printedValue =
true;
6624 assert(filename != 0);
6626 std::ofstream file(filename);
6632 file.setf(std::ios::left);
6638 #if SOPLEX_SUBVERSION > 0 6652 "true\n" :
"false\n");
6689 #ifdef SOPLEX_WITH_RATIONALPARAM 6691 for(
int i = 0; i < SoPlex::RATIONALPARAM_COUNT; i++)
6701 <<
"], default " <<
_currentSettings->rationalParam.defaultValue[i] <<
"\n";
6711 file <<
"# initial random seed used for perturbation\n";
6724 assert(filename != 0);
6743 bool readError =
false;
6744 bool parseError =
false;
6746 while(!readError && !parseError)
6749 readError = !file.getline(line,
sizeof(line));
6755 readError = readError && !file.eof();
6776 assert(
string != 0);
6784 char* line = parseString;
6787 while(*line ==
' ' || *line ==
'\t' || *line ==
'\r')
6790 if(*line ==
'\0' || *line ==
'\n' || *line ==
'#')
6793 char* paramTypeString = line;
6796 while(*line !=
' ' && *line !=
'\t' && *line !=
'\r' && *line !=
'\n' && *line !=
'#' 6797 && *line !=
'\0' && *line !=
':')
6811 while(*line ==
' ' || *line ==
'\t' || *line ==
'\r')
6817 "Error parsing setting string: no ':' separating parameter type and name.\n");
6825 while(*line ==
' ' || *line ==
'\t' || *line ==
'\r')
6828 if(*line ==
'\0' || *line ==
'\n' || *line ==
'#')
6834 char* paramName = line;
6837 while(*line !=
' ' && *line !=
'\t' && *line !=
'\r' && *line !=
'\n' && *line !=
'#' 6838 && *line !=
'\0' && *line !=
'=')
6852 while(*line ==
' ' || *line ==
'\t' || *line ==
'\r')
6865 while(*line ==
' ' || *line ==
'\t' || *line ==
'\r')
6868 if(*line ==
'\0' || *line ==
'\n' || *line ==
'#')
6874 char* paramValueString = line;
6877 while(*line !=
' ' && *line !=
'\t' && *line !=
'\r' && *line !=
'\n' && *line !=
'#' 6887 while(*line ==
' ' || *line ==
'\t' || *line ==
'\r')
6890 if(*line !=
'\0' && *line !=
'\n' && *line !=
'#')
6893 "' after parameter value.\n");
6899 if(strncmp(paramTypeString,
"bool", 4) == 0)
6901 for(
int param = 0; ; param++)
6905 MSG_INFO1(
spxout,
spxout <<
"Error parsing setting string: unknown parameter name <" << paramName <<
6911 if(strncasecmp(paramValueString,
"true", 4) == 0
6912 || strncasecmp(paramValueString,
"TRUE", 4) == 0
6913 || strncasecmp(paramValueString,
"t", 4) == 0
6914 || strncasecmp(paramValueString,
"T", 4) == 0
6915 || strtol(paramValueString, NULL, 4) == 1)
6920 else if(strncasecmp(paramValueString,
"false", 5) == 0
6921 || strncasecmp(paramValueString,
"FALSE", 5) == 0
6922 || strncasecmp(paramValueString,
"f", 5) == 0
6923 || strncasecmp(paramValueString,
"F", 5) == 0
6924 || strtol(paramValueString, NULL, 5) == 0)
6932 "> for bool parameter <" << paramName <<
">.\n");
6942 if(strncmp(paramTypeString,
"int", 3) == 0)
6944 for(
int param = 0; ; param++)
6948 MSG_INFO1(
spxout,
spxout <<
"Error parsing setting string: unknown parameter name <" << paramName <<
6955 value = std::stoi(paramValueString);
6962 "> for int parameter <" << paramName <<
">.\n");
6972 if(strncmp(paramTypeString,
"real", 4) == 0)
6974 for(
int param = 0; ; param++)
6978 MSG_INFO1(
spxout,
spxout <<
"Error parsing setting string: unknown parameter name <" << paramName <<
6985 #ifdef WITH_LONG_DOUBLE 6986 value = std::stold(paramValueString);
6989 value = std::stof(paramValueString);
6991 value = std::stod(paramValueString);
7000 "> for real parameter <" << paramName <<
">.\n");
7009 #ifdef SOPLEX_WITH_RATIONALPARAM 7012 if(strncmp(paramTypeString,
"rational", 8) == 0)
7014 for(
int param = 0; ; param++)
7016 if(param >= SoPlex::RATIONALPARAM_COUNT)
7018 MSG_INFO1(
spxout,
spxout <<
"Error parsing setting string: unknown parameter name <" << paramName <<
7022 else if(strncmp(paramName,
_currentSettings->rationalParam.name[param].c_str(),
7028 && setRationalParam((SoPlex::RationalParam)param, value))
7033 "> for rational parameter <" << paramName <<
">.\n");
7045 if(strncmp(paramTypeString,
"uint", 4) == 0)
7047 if(strncmp(paramName,
"random_seed", 11) == 0)
7050 unsigned long parseval;
7052 parseval = std::stoul(paramValueString);
7054 if(parseval > UINT_MAX)
7060 value = (
unsigned int) parseval;
7071 paramTypeString <<
"> for parameter <" << paramName <<
">.\n");
7086 os <<
"Solution (real) : \n" 7091 os <<
"Solution (rational) : \n" 7093 os <<
"Size (base 2/10) : \n" 7106 os <<
"Solution : \n" 7107 <<
" Objective value : -\n";
7117 os <<
"Violation (rational): \n";
7123 os <<
" Max/sum bound : - / -\n";
7129 os <<
" Max/sum row : - / -\n";
7135 os <<
" Max/sum redcost : - / -\n";
7141 os <<
" Max/sum dual : - / -\n";
7148 os <<
"Violations (real) : \n";
7151 os <<
" Max/sum bound : " << maxviol <<
" / " << sumviol <<
"\n";
7153 os <<
" Max/sum bound : - / -\n";
7156 os <<
" Max/sum row : " << maxviol <<
" / " << sumviol <<
"\n";
7158 os <<
" Max/sum row : - / -\n";
7161 os <<
" Max/sum redcost : " << maxviol <<
" / " << sumviol <<
"\n";
7163 os <<
" Max/sum redcost : - / -\n";
7166 os <<
" Max/sum dual : " << maxviol <<
" / " << sumviol <<
"\n";
7168 os <<
" Max/sum dual : - / -\n";
7202 os <<
"Original problem : \n";
7215 "minimize\n" :
"maximize\n");
7223 os <<
"SoPlex status : ";
7228 os <<
"error [unspecified]";
7232 os <<
"error [no ratiotester loaded]";
7236 os <<
"error [no pricer loaded]";
7240 os <<
"error [no linear solver loaded]";
7244 os <<
"error [not initialized]";
7248 os <<
"solving aborted [cycling]";
7252 os <<
"solving aborted [time limit reached]";
7256 os <<
"solving aborted [iteration limit reached]";
7260 os <<
"solving aborted [objective limit reached]";
7264 os <<
"no problem loaded";
7268 os <<
"basis is regular";
7272 os <<
"basis is singular";
7276 os <<
"problem is solved [optimal]";
7280 os <<
"problem is solved [unbounded]";
7284 os <<
"problem is solved [infeasible]";
7288 os <<
"problem is solved [infeasible or unbounded]";
7292 os <<
"problem is solved [optimal with unscaled violations]";
7310 #if (SOPLEX_SUBVERSION > 0) 7329 #ifdef SOPLEX_WITH_GMP 7350 bool nRowsMatch =
true;
7351 bool nColsMatch =
true;
7352 bool rhsDimMatch =
true;
7353 bool lhsDimMatch =
true;
7354 bool maxObjDimMatch =
true;
7355 bool upperDimMatch =
true;
7356 bool lowerDimMatch =
true;
7362 "The number of Rows in the Real LP does not match the one in the Rational LP." 7372 "The number of Columns in the Real LP does not match the one in the Rational LP." 7382 "The number of nonZeros in the Real LP does not match the one in the Rational LP." 7391 "The dimension of the right hand side vector of the Real LP does not match the one of the Rational LP." 7395 rhsDimMatch =
false;
7403 "The dimension of the left hand side vector of the Real LP does not match the one of the Rational LP." 7407 lhsDimMatch =
false;
7414 "The dimension of the objective function vector of the Real LP does not match the one of the Rational LP." 7418 maxObjDimMatch =
false;
7425 "The objective function sense of the Real LP does not match the one of the Rational LP." 7436 "The dimension of the upper bound vector of the Real LP does not match the one of the Rational LP." 7440 upperDimMatch =
false;
7447 "The dimension of the lower bound vector of the Real LP does not match the one of the Rational LP." 7451 lowerDimMatch =
false;
7457 bool rhsValMatch =
true;
7458 bool lhsValMatch =
true;
7459 bool maxObjValMatch =
true;
7460 bool upperValMatch =
true;
7461 bool lowerValMatch =
true;
7466 for(
int i = 0; i <
_realLP->
rhs().dim(); i++)
7474 MSG_INFO1(
spxout,
spxout <<
"Entries number " << i <<
" of the right hand side vectors don't match." 7478 rhsValMatch =
false;
7483 if(!rhsValMatch && quiet)
7492 for(
int i = 0; i <
_realLP->
lhs().dim(); i++)
7505 lhsValMatch =
false;
7510 if(!lhsValMatch && quiet)
7526 " of the objective function vectors don't match." 7531 maxObjValMatch =
false;
7536 if(!maxObjValMatch && quiet)
7560 upperValMatch =
false;
7565 if(!upperValMatch && quiet)
7589 lowerValMatch =
false;
7594 if(!lowerValMatch && quiet)
7602 if(checkMatVals && nRowsMatch && nColsMatch)
7604 bool matrixValMatch =
true;
7616 i)[j] << std::endl);
7619 matrixValMatch =
false;
7625 if(!matrixValMatch && quiet)
7655 assert(newmax > vec.
size());
7667 assert(idxSize >= 0);
7669 assert(permSize >= 0);
7671 for(
int i = 0; i < permSize; i++)
7674 for(
int i = 0; i < idxSize; i++)
7676 assert(idx[i] >= 0);
7677 assert(idx[i] < permSize);
7688 assert(permSize >= 0);
7690 for(
int i = 0; i < permSize; i++)
7691 perm[i] = (i < start || i > end) ? i : -1;
7735 return stoppedTime || stoppedIter;
7743 assert(lower <= upper);
7756 else if(lower == upper)
7768 assert(lower <= upper);
7781 else if(lower == upper)
7929 for(
int i = 0; i < lpcolset.
num(); i++)
8345 else if(perm[i] >= 0 && perm[i] != i)
8348 assert(perm[perm[i]] < 0);
8409 else if(perm[i] >= 0 && perm[i] != i)
8412 assert(perm[perm[i]] < 0);
8684 bool success =
_realLP->
readFile(filename, rowNames, colNames, intVars);
8902 while(*line ==
' ' || *line ==
'\t' || *line ==
'\r')
8905 if(*line ==
'\0' || *line ==
'\n' || *line ==
'#')
8908 char* paramTypeString = line;
8911 while(*line !=
' ' && *line !=
'\t' && *line !=
'\r' && *line !=
'\n' && *line !=
'#' 8912 && *line !=
'\0' && *line !=
':')
8926 while(*line ==
' ' || *line ==
'\t' || *line ==
'\r')
8932 "Error parsing settings file: no ':' separating parameter type and name in line " << lineNumber <<
8941 while(*line ==
' ' || *line ==
'\t' || *line ==
'\r')
8944 if(*line ==
'\0' || *line ==
'\n' || *line ==
'#')
8951 char* paramName = line;
8954 while(*line !=
' ' && *line !=
'\t' && *line !=
'\r' && *line !=
'\n' && *line !=
'#' 8955 && *line !=
'\0' && *line !=
'=')
8969 while(*line ==
' ' || *line ==
'\t' || *line ==
'\r')
8975 lineNumber <<
".\n");
8983 while(*line ==
' ' || *line ==
'\t' || *line ==
'\r')
8986 if(*line ==
'\0' || *line ==
'\n' || *line ==
'#')
8988 MSG_INFO1(
spxout,
spxout <<
"Error parsing settings file: no parameter value in line " << lineNumber
8993 char* paramValueString = line;
8996 while(*line !=
' ' && *line !=
'\t' && *line !=
'\r' && *line !=
'\n' && *line !=
'#' 9006 while(*line ==
' ' || *line ==
'\t' || *line ==
'\r')
9009 if(*line !=
'\0' && *line !=
'\n' && *line !=
'#')
9012 "' after parameter value in line " << lineNumber <<
".\n");
9018 if(strncmp(paramTypeString,
"bool", 4) == 0)
9020 for(
int param = 0; ; param++)
9025 "> in line " << lineNumber <<
".\n");
9030 if(strncasecmp(paramValueString,
"true", 4) == 0
9031 || strncasecmp(paramValueString,
"TRUE", 4) == 0
9032 || strncasecmp(paramValueString,
"t", 4) == 0
9033 || strncasecmp(paramValueString,
"T", 4) == 0
9034 || strtol(paramValueString, NULL, 4) == 1)
9039 else if(strncasecmp(paramValueString,
"false", 5) == 0
9040 || strncasecmp(paramValueString,
"FALSE", 5) == 0
9041 || strncasecmp(paramValueString,
"f", 5) == 0
9042 || strncasecmp(paramValueString,
"F", 5) == 0
9043 || strtol(paramValueString, NULL, 5) == 0)
9051 "> for bool parameter <" << paramName <<
"> in line " << lineNumber <<
".\n");
9061 if(strncmp(paramTypeString,
"int", 3) == 0)
9063 for(
int param = 0; ; param++)
9068 "> in line " << lineNumber <<
".\n");
9074 value = std::stoi(paramValueString);
9081 "> for int parameter <" << paramName <<
"> in line " << lineNumber <<
".\n");
9091 if(strncmp(paramTypeString,
"real", 4) == 0)
9093 for(
int param = 0; ; param++)
9098 "> in line " << lineNumber <<
".\n");
9105 #ifdef WITH_LONG_DOUBLE 9106 value = std::stold(paramValueString);
9109 value = std::stof(paramValueString);
9111 value = std::stod(paramValueString);
9120 "> for real parameter <" << paramName <<
"> in line " << lineNumber <<
".\n");
9129 #ifdef SOPLEX_WITH_RATIONALPARAM 9132 if(strncmp(paramTypeString,
"rational", 8) == 0)
9134 for(
int param = 0; ; param++)
9136 if(param >= SoPlex::RATIONALPARAM_COUNT)
9139 "> in line " << lineNumber <<
".\n");
9142 else if(strncmp(paramName,
_currentSettings->rationalParam.name[param].c_str(),
9148 && setRationalParam((SoPlex::RationalParam)param, value))
9153 "> for rational parameter <" << paramName <<
"> in line " << lineNumber <<
".\n");
9165 if(strncmp(paramTypeString,
"uint", 4) == 0)
9167 if(strncmp(paramName,
"random_seed", 11) == 0)
9170 unsigned long parseval;
9172 parseval = std::stoul(paramValueString);
9174 if(parseval > UINT_MAX)
9180 value = (
unsigned int) parseval;
9191 paramTypeString <<
"> for parameter <" << paramName <<
"> in line " << lineNumber <<
".\n");
const VectorBase< R > & rhs() const
Returns right hand side vector.
void changeLhsRational(const VectorRational &lhs)
changes left-hand side vector for constraints to lhs
virtual void buildDualProblem(SPxLPBase< R > &dualLP, SPxRowId primalRowIds[]=0, SPxColId primalColIds[]=0, SPxRowId dualRowIds[]=0, SPxColId dualColIds[]=0, int *nprimalrows=0, int *nprimalcols=0, int *ndualrows=0, int *ndualcols=0)
Building the dual problem from a given LP.
const VectorRational & rhsRational() const
returns right-hand side vector
bool isNotZero(Real a, Real eps=Param::epsilon())
returns true iff |a| > eps
RangeType
type of bounds and sides
SPxLPBase< Real > SPxLPReal
const char * getRatiotesterName()
name of currently loaded ratiotester
void getRowsRational(int start, int end, LPRowSetRational &lprowset) const
gets rows start, ..., end.
const VectorReal & maxObjRealInternal() const
returns objective function vector after transformation to a maximization problem; since this is how i...
void _computeBasisInverseRational()
computes rational inverse of basis matrix as defined by _rationalLUSolverBind
int getSolveCount() const
number of solves performed
bool multBasisTranspose(Real *vec, bool unscale=true)
multiply with transpose of basis matrix; vec * B^T (inplace)
void _changeUpperReal(const VectorReal &upper)
changes vector of upper bounds to upper and adjusts basis
bool getDual(VectorBase< R > &vector) const
gets the dual solution vector; returns true on success
void getRhsUnscaled(VectorBase< Real > &vec) const
Gets unscaled right hand side vector.
accuracy of conjugate gradient method in least squares scaling (higher value leads to more iterations...
Vector & multWithBase(Vector &x) const
Vector-basis product.
virtual void removeRow(int i)
Removes i 'th row.
int iterations() const
get number of iterations of current solution.
zero tolerance used in factorization
void getRow(int i, LPRowBase< R > &row) const
Gets i 'th row.
void getUpperReal(DVectorReal &upper) const
gets upper bound vector
Rational _rationalMaxscaleincr
free variable fixed to zero.
int totalSizeDual(const int base=2) const
returns total size of dual solution
#define DEFAULT_EPS_FACTOR
void printVersion() const
prints version and compilation options
SoPlex()
default constructor
bool getDualViolationRational(Rational &maxviol, Rational &sumviol)
gets violation of dual multipliers; returns true on success
bool GE(Real a, Real b, Real eps=Param::epsilon())
returns true iff a >= b + eps
standard floating-point parsing
void printSolutionStatistics(std::ostream &os)
prints solution statistics
refactor threshold for memory growth in factorization since last refactorization
DVectorBase< R > _dualFarkas
Timer * syncTime
time for synchronization between real and rational LP (included in solving time)
void setRep(Representation p_rep)
switch to ROW or COLUMN representation if not already used.
No matrix has yet been loaded.
void coSolve(Vector &x, const Vector &rhs)
Cosolves linear system with basis matrix.
bool getDualNorms(int &nnormsRow, int &nnormsCol, Real *norms) const
gets steepest edge norms and returns false if they are not available
const VectorBase< R > & lower() const
void _addColReal(const LPColReal &lpcol)
adds a single column to the real LP and adjusts basis
int numRowsReal() const
returns number of rows
bool getBasisInverseRowReal(int r, Real *coef, int *inds=NULL, int *ninds=NULL, bool unscale=true)
computes row r of basis inverse; returns true on success
Rational minAbsNonzeroRational() const
returns smallest non-zero element in absolute value
static void setEpsilon(Real eps)
SPxBasis::SPxStatus getBasisStatus() const
gets basis status
void removeRowsRational(int perm[])
removes all rows with an index i such that perm[i] < 0; upon completion, perm[i] >= 0 indicates the n...
type of starter used to create crash basis
void removeColsReal(int perm[])
removes all columns with an index i such that perm[i] < 0; upon completion, perm[i] >= 0 indicates th...
bool getDualNorms(int &nnormsRow, int &nnormsCol, Real *norms) const
get dual norms
The time limit has been hit.
const VectorBase< R > & upper() const
Returns upper bound vector.
void _optimizeReal()
solves real LP
const Settings & settings() const
returns current parameter settings
upper limit on objective value
geometric mean scaling on rows and columns, max 8 rounds
void getNdualNorms(int &nnormsRow, int &nnormsCol) const
get number of dual norms
void _changeElementReal(int i, int j, const Real &val)
changes matrix entry in row i and column j to val and adjusts basis
virtual R minAbsNzo(bool unscaled=true) const
Absolute smallest non-zero element in (possibly scaled) LP.
steepest edge pricer with exact initialization of norms
THREADLOCAL const Real infinity
void getRows(int start, int end, LPRowSetBase< R > &set) const
Gets rows start, ... end.
mode for solution polishing
void setOutstream(SPxOut &newOutstream)
Real _realParamValues[SoPlex::REALPARAM_COUNT]
array of current real parameter values
void _changeRangeReal(const VectorReal &lhs, const VectorReal &rhs)
changes left- and right-hand side vectors and adjusts basis
const SPxRatioTester * ratiotester() const
return loaded SPxRatioTester.
void removeColReal(int i)
removes column i
maximum increase of scaling factors between refinements
virtual void getRowUnscaled(const SPxLPBase< Real > &lp, int i, DSVector &vec) const
returns unscaled row i
SPxMainSM _simplifierMainSM
Real maxAbsNonzeroReal() const
returns biggest non-zero element in absolute value
LP has beed solved to optimality but unscaled solution contains violations.
continue iterative refinement with exact basic solution if not optimal?
void setBasis(const VarStatus rows[], const VarStatus cols[])
set the lp solver's basis.
const SVectorReal & colVectorRealInternal(int i) const
returns vector of col i, ignoring scaling
void setMaxUpdates(int maxUp)
change maximum number of iterations until a refactorization is performed
void resetCounters()
reset timers and counters
number of real parameters
type of computational form, i.e., column or row representation
int stallRefinements
number of refinement steps without pivots
int totalSizePrimal(const int base=2) const
returns total size of primal solution
void changeColRational(int i, const LPColRational &lpcol)
replaces column i with lpcol
bool getBasisIndRational(DataArray< int > &bind)
gets an array of indices for the columns of the rational basis matrix; bind[i] >= 0 means that the i-...
bool getPrimalReal(VectorReal &vector)
gets the primal solution vector if available; returns true on success
T * get_ptr()
get a C pointer to the data.
void reMax(int newmax=0)
resets max() to newmax.
int size() const
Number of used indices.
pivot zero tolerance used in factorization
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
refinement limit (-1 if unlimited)
void setSolutionPolishing(SolutionPolish _polishObj)
set objective of solution polishing (0: off, 1: max_basic_slack, 2: min_basic_slack) ...
class of parameter settings
SPxLPRational * _rationalLP
void printShortStatistics(std::ostream &os)
prints short statistics
Status getBasis(VarStatus rows[], VarStatus cols[], const int rowsSize=-1, const int colsSize=-1) const
get current basis, and return solver status.
Real coefReal(int row, int col) const
returns (unscaled) coefficient
bool getSlacksRational(VectorRational &vector)
gets the vector of slack values if available; returns true on success
minimize number of basic slack variables, i.e. more variables in between bounds
bool multBasis(Real *vec, bool unscale=true)
multiply with basis matrix; B * vec (inplace)
void getColsRational(int start, int end, LPColSetRational &lpcolset) const
gets columns start, ..., end
bool hasSol() const
is a solution available (not neccessarily feasible)?
bool getSlacks(VectorBase< R > &vector) const
gets the vector of slack values; returns true on success
int totalSizePrimalRational(const int base=2)
get size of primal solution
void _addColsReal(const LPColSetReal &lpcolset)
adds multiple columns to the real LP and adjusts basis
Forrest-Tomlin type update.
Real feastol() const
allowed primal feasibility tolerance.
unsigned int randomSeed() const
returns the current random seed of the solver instance
virtual void setBasisSolver(SLinSolver *slu, const bool destroy=false)
setup linear solver to use. If destroy is true, slusolver will be freed in destructor.
Real sumDualDegeneracy()
get the sum of dual degeneracy
time limit in seconds (INFTY if unlimited)
mode for iterative refinement strategy
void changeRangeReal(const VectorReal &lhs, const VectorReal &rhs)
changes left- and right-hand side vectors
virtual bool readFile(const char *filename, NameSet *rowNames=0, NameSet *colNames=0, DIdxSet *intVars=0)
Reads LP from a file.
Rational _rationalFeastol
void writeStateReal(const char *filename, const NameSet *rowNames=0, const NameSet *colNames=0, const bool cpxFormat=false) const
writes internal LP, basis information, and parameter settings; if rowNames and colNames are NULL...
DVectorBase< R > _primalRay
bool isScaled() const
Returns true if and only if the LP is scaled.
minimize number of basic slack variables, i.e. more variables between bounds
void setUtype(UpdateType tp)
sets update type.
R rhsUnscaled(int i) const
Returns unscaled right hand side of row number i.
void _removeColsReal(int perm[])
removes all columns with an index i such that perm[i] < 0; upon completion, perm[i] >= 0 indicates th...
virtual void changeCol(int n, const LPColBase< R > &newCol, bool scale=false)
Replaces i 'th column of LP with newCol. scale determines whether the new data should be scaled...
virtual ~SoPlex()
destructor
virtual void removeCols(int perm[])
Removes multiple columns.
bool getRedCostRational(VectorRational &vector)
gets the vector of reduced cost values if available; returns true on success
bool LE(Real a, Real b, Real eps=Param::epsilon())
returns true iff a <= b + eps
DVectorBase< R > _redCost
Real getFactorTime() const
time spent in factorizations
primal feasibility tolerance
static struct soplex::SoPlex::Settings::RealParam realParam
void getObj(VectorBase< R > &pobj) const
Gets objective vector.
bool LT(Real a, Real b, Real eps=Param::epsilon())
returns true iff a < b + eps
void setType(Type tp)
set LEAVE or ENTER algorithm.
void setFillFactor(Real f)
set refactor threshold for fill-in in current factor update compared to fill-in in last factorization...
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...
void _addRowReal(const LPRowReal &lprow)
adds a single row to the real LP and adjusts basis
bool defaultValue[SoPlex::BOOLPARAM_COUNT]
array of default values for boolean parameters
solve() aborted due to iteration limit.
R rhs() const
Right-hand side value.
std::string name[SoPlex::BOOLPARAM_COUNT]
array of names for boolean parameters
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...
void changeRangeRational(const VectorRational &lhs, const VectorRational &rhs)
changes left- and right-hand side vectors
mode for reading LP files
crash basis from a greedy solution
mode for synchronizing real and rational LP
apply standard floating-point algorithm
void _syncLPReal(bool time=true)
synchronizes real LP with rational LP, i.e., copies (rounded) rational LP into real LP...
bool hasDualFarkas() const
is a dual farkas ray available?
void _optimizeRational()
solves rational LP
No Problem has been loaded.
bool getDualFarkasReal(VectorReal &vector)
gets the Farkas proof if available; returns true on success
void resetSettings(const bool quiet=false, const bool init=true)
resets default parameter settings
void _recomputeRangeTypesRational()
recomputes range types from scratch using rational LP
iteration limit (-1 if unlimited)
int number(const SPxRowId &id) const
Returns the row number of the row with identifier id.
void changeObjReal(const VectorReal &obj)
changes objective function vector to obj
void changeRowRational(int i, const LPRowRational &lprow)
replaces row i with lprow
void useBoundFlipsRow(bool bf)
bool getRowViolationReal(Real &maxviol, Real &sumviol)
gets violation of constraints; returns true on success
re-optimize the original problem to get a proof (ray) of infeasibility/unboundedness?
SPxFastRT _ratiotesterFast
should cycling solutions be accepted during iterative refinement?
void _disableSimplifierAndScaler()
disables simplifier and scaler
bool getRowViolationRational(Rational &maxviol, Rational &sumviol)
gets violation of constraints; returns true on success
static struct soplex::SoPlex::Settings::IntParam intParam
should the decomposition based dual simplex be used to solve the LP? Setting this to true forces the ...
void add(const LPColBase< R > &pcol)
Real lowerReal(int i) const
returns lower bound of column i
bool getBasisInverseRowRational(const int r, SSVectorRational &vec)
computes row r of basis inverse; performs rational factorization if not available; returns true on su...
Vector & multBaseWith(Vector &x) const
void _removeRowReal(int i)
removes row i and adjusts basis
lower bound is finite, upper bound is infinite
bool _readFileReal(const char *filename, NameSet *rowNames=0, NameSet *colNames=0, DIdxSet *intVars=0)
reads real LP in LP or MPS format from file and returns true on success; gets row names...
UnitVectorBase< Rational > UnitVectorRational
bool getRedCost(VectorBase< R > &vector) const
gets the vector of reduced cost values if available; returns true on success
Timer * simplexTime
simplex time
int luSolvesReal
number of (forward and backward) solves with basis matrix in real precision
Real upperReal(int i) const
returns upper bound of column i
void getColRational(int i, LPColRational &lpcol) const
gets column i
int refinements
number of refinement steps
const char * getStarterName()
name of starter
void clear()
remove all elements.
variable fixed to identical bounds.
int luFactorizationsReal
number of basis matrix factorizations in real precision
Real getFastCondition(int type=0)
int getFactorCount() const
number of factorizations performed
#define DEFAULT_EPS_UPDATE
virtual void removeCol(int i)
Removes i 'th column.
LP has been proven to be primal infeasible.
void setComputeDegenFlag(bool computeDegen)
sets whether the degeneracy is computed at each iteration
Real defaultValue[SoPlex::REALPARAM_COUNT]
array of default values for real parameters
void _checkBasisScaling()
check correctness of (un)scaled basis matrix operations
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
void setSparsePricingFactor(Real fac)
int intParam(const IntParam param) const
returns integer parameter value
void setOpttol(Real d)
set parameter opttol.
void _ensureRationalLP()
ensures that the rational LP is available; performs no sync
minimum number of stalling refinements since last pivot to trigger rational factorization ...
minimal reduction (sum of removed rows/cols) to continue simplification
void getRowVectorReal(int i, DSVectorReal &row) const
gets vector of row i
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 setScientific(std::ostream &stream, int precision=8)
Sets the precision of the stream to 16 and the floatfield to scientifix.
bool setSettings(const Settings &newSettings, const bool init=true)
sets parameter settings; returns true on success
void _changeRhsReal(const VectorReal &rhs)
changes right-hand side vector to rhs and adjusts basis
void changeElementReal(int i, int j, const Real &val)
changes matrix entry in row i and column j to val
void printStatistics(std::ostream &os)
prints complete statistics
std::string name[SoPlex::REALPARAM_COUNT]
array of names for real parameters
Real rhsReal(int i) const
returns right-hand side of row i
std::ostream & getStream(const Verbosity &verbosity) const
Returns the stream for the specified verbosity level.
should a rational factorization be performed after iterative refinement?
const SPxPricer * pricer() const
return loaded SPxPricer.
virtual bool readBasisFile(const char *filename, const NameSet *rowNames, const NameSet *colNames)
mode for hyper sparse pricing
void getRhsReal(DVectorReal &rhs) const
gets right-hand side vector
void add(const LPRowBase< R > &row)
bool setDualNorms(int nnormsRow, int nnormsCol, Real *norms)
set dual norms
maximum number of updates without fresh factorization
int dlcmSizeDual(const int base=2) const
returns size of least common multiple of denominators in dual solution
void removeColRangeRational(int start, int end, int perm[]=0)
removes columns start to end including both; an array perm of size numColsRational() may be passed as...
virtual void setTerminationTime(Real time=infinity)
set time limit.
standard Harris ratio test
void changeUpperRational(const VectorRational &upper)
changes vector of upper bounds to upper
bool _boolParamValues[SoPlex::BOOLPARAM_COUNT]
array of current boolean parameter values
Rational _rationalPosInfty
number of integer parameters
bool getPrimal(VectorBase< R > &vector) const
gets the primal solution vector; returns true on success
virtual void changeObjOffset(const R &o)
bool setDualNorms(int nnormsRow, int nnormsCol, Real *norms)
sets steepest edge norms and returns false if that's not possible
static struct soplex::SoPlex::Settings::BoolParam boolParam
const VectorRational & lhsRational() const
returns left-hand side vector
virtual void removeRows(int perm[])
Removes multiple rows.
bool writeFileRational(const char *filename, const NameSet *rowNames=0, const NameSet *colNames=0, const DIdxSet *intvars=0) const
writes rational LP to file; LP or MPS format is chosen from the extension in filename; if rowNames an...
void removeLast(int m=1)
remove m last elements.
maximize number of basic slack variables, i.e. more variables on bounds
SPxEquiliSC _scalerBiequi
int numNonzerosRational() const
returns number of nonzeros
void getObjUnscaled(VectorBase< Real > &pobj) const
Gets unscaled objective vector.
automatic choice according to number of rows and columns
virtual const std::string what() const
returns exception message
bool isDualFeasible() const
is stored dual solution feasible?
void removeColRangeReal(int start, int end, int perm[]=0)
removes columns start to end including both; an array perm of size numColsReal() may be passed as buf...
void addColReal(const LPCol &lpcol)
adds a single column
int nRows() const
Returns number of rows in LP.
Rational objRational(int i) const
returns objective value of column i
void add(const SVectorBase< S > &vec)
Append nonzeros of sv.
void clearLPRational()
clears the LP
R lower() const
Gets lower bound.
void printOriginalProblemStatistics(std::ostream &os)
stores the problem statistics of the original problem
SPxSolver::Status optimize()
optimize the given LP
void getObjReal(VectorReal &obj) const
gets objective function vector
void getLowerReal(DVectorReal &lower) const
gets lower bound vector
virtual void start()=0
start timer, resume accounting user, system and real time.
#define HYPERPRICINGTHRESHOLD
void addRowRational(const LPRowRational &lprow)
adds a single row
void addColRational(const LPColRational &lpcol)
adds a single column
virtual Real stop()=0
stop timer, return accounted user time.
int dualDegeneratePivots()
get number of dual degenerate pivots
void spx_alloc(T &p, int n=1)
Allocate memory.
std::ostream & getCurrentStream() const
Returns the stream for the current verbosity.
SPxGeometSC _scalerGeoequi
const UnitVectorRational * _unitVectorRational(const int i)
returns pointer to a constant unit vector available until destruction of the SoPlex class ...
void _rangeToPerm(int start, int end, int *perm, int permSize) const
creates a permutation for removing rows/columns from a range of indices
void _syncRealSolution()
synchronizes rational solution with real solution, i.e., copies (rounded) rational solution to real s...
Generic Ids for LP rows or columns.Both SPxColIds and SPxRowIds may be treated uniformly as SPxIds: ...
row representation (lower,lhs) <= (x,Ax) <= (upper,rhs)
void removeColsRational(int perm[])
removes all columns with an index i such that perm[i] < 0; upon completion, perm[i] >= 0 indicates th...
LP is primal infeasible or unbounded.
R objUnscaled(int i) const
Returns unscaled objective value of column i.
refactor threshold for fill-in in current factor update compared to fill-in in last factorization ...
int nNzos() const
Returns number of nonzeros in LP.
void changeRhsRational(const VectorRational &rhs)
changes right-hand side vector to rhs
virtual void setOutstream(SPxOut &newOutstream)
set message handler
int dmaxSizeDualRational(const int base=2)
get size of largest denominator in dual solution
void _ensureDSVectorRationalMemory(DSVectorRational &vec, const int newmax) const
extends sparse vector to hold newmax entries if and only if it holds no more free entries ...
Real luFactorizationTimeReal
time for factorizing bases matrices in real precision
void getLowerUnscaled(DVector &vec) const
Gets unscaled lower bound vector.
Real spxLdexp(Real x, int exp)
returns x * 2^exp
int dlcmSizePrimalRational(const int base=2)
get size of least common multiple of denominators in primal solution
Rational objValueRational()
returns the objective value if a primal solution is available
void getBasis(SPxSolver::VarStatus rows[], SPxSolver::VarStatus cols[]) const
gets current basis via arrays of statuses
column representation Ax - s = 0, lower <= x <= upper, lhs <= s <= rhs
void setNonzeroFactor(Real f)
set refactor threshold for nonzeros in last factorized basis matrix compared to updated basis matrix ...
DataArray< SPxSolver::VarStatus > _basisStatusCols
nothing known about basis status (possibly due to a singular basis in transformed problem) ...
partial multiple pricer based on Dantzig pricing
virtual void writeFile(const char *filename, const NameSet *rowNames=0, const NameSet *colNames=0, const DIdxSet *p_intvars=0) const
Write loaded LP to filename.
void getLhsReal(DVectorReal &lhs) const
gets left-hand side vector
Real upper[SoPlex::REALPARAM_COUNT]
array of upper bounds for real parameter values
decompStatus _currentProb
declaration of types for file output
bool isPrimalFeasible() const
is stored primal solution feasible?
DataArray< RangeType > _colTypes
void maxObjUnscaled(VectorBase< Real > &vec) const
Returns unscaled objective vector for maximization problem.
void addColsRational(const mpq_t *obj, const mpq_t *lower, const mpq_t *colValues, const int *colIndices, const int *colStarts, const int *colLengths, const int numCols, const int numValues, const mpq_t *upper)
adds a set of columns (GMP only method)
void removeRowRangeReal(int start, int end, int perm[]=0)
removes rows start to end including both; an array perm of size numRowsReal() may be passed as buffer...
SPxBoundFlippingRT _ratiotesterBoundFlipping
SLUFactorRational _rationalLUSolver
bool isColBasic(int i) const
is the i 'th column vector basic ?
void getRowRational(int i, LPRowRational &lprow) const
gets row i
void _solveRealLPAndRecordStatistics()
call floating-point solver and update statistics on iterations etc.
user sync of real and rational LP
number of boolean parameters
SPxEquiliSC _scalerUniequi
Status status() const
Status of solution process.
Real sumPrimalDegeneracy()
get the sum of primal degeneracy
void printSolvingStatistics(std::ostream &os)
prints statistics on solving process
bool _readFileRational(const char *filename, NameSet *rowNames=0, NameSet *colNames=0, DIdxSet *intVars=0)
reads rational LP in LP or MPS format from file and returns true on success; gets row names...
lower threshold in lifting (nonzero matrix coefficients with smaller absolute value will be reformula...
bool getPrimalRayReal(VectorReal &vector)
gets the primal ray if available; returns true on success
void getColVectorUnscaled(int i, DSVectorBase< Real > &vec) const
Gets column vector of column i.
bool GT(Real a, Real b, Real eps=Param::epsilon())
returns true iff a > b + eps
static void setFixed(std::ostream &stream, int precision=8)
Sets the precision of the stream to 8 and the floatfield to fixed.
SPxSense spxSense() const
Returns the optimization sense.
static void setEpsilonPivot(Real eps)
void changeLhsReal(const VectorReal &lhs)
changes left-hand side vector for constraints to lhs
DVectorBase< Real > DVectorReal
bool hasDualFarkas() const
is Farkas proof of infeasibility available?
virtual const char * getName() const
get name of simplifier.
std::string description[SoPlex::INTPARAM_COUNT]
array of descriptions for integer parameters
bool _isConsistent() const
checks consistency
void _changeLowerReal(const VectorReal &lower)
changes vector of lower bounds to lower and adjusts basis
R upperUnscaled(int i) const
Returns unscaled upper bound of column i.
R lhs() const
Left-hand side value.
the iteration frequency at which the decomposition solve output is displayed.
decide depending on tolerances whether to apply iterative refinement
LP has been solved to optimality.
Rational maxAbsNonzeroRational() const
returns biggest non-zero element in absolute value
VectorBase< Real > Vector
virtual void setPricer(SPxPricer *pricer, const bool destroy=false)
setup pricer to use. If destroy is true, pricer will be freed in destructor.
bool computeBasisInverseRational()
compute rational basis inverse; returns true on success
bool _upperFinite(const RangeType &rangeType) const
checks whether RangeType corresponds to finite upper bound
use bound flipping also for row representation?
bool hasBasis() const
is an advanced starting basis available?
void _invalidateSolution()
invalidates solution
bool getBasisInverseColReal(int c, Real *coef, int *inds=NULL, int *ninds=NULL, bool unscale=true)
computes column c of basis inverse; returns true on success
bool getDualViolationReal(Real &maxviol, Real &sumviol)
gets violation of dual multipliers; returns true on success
bool getBasisInverseColRational(const int c, SSVectorRational &vec)
computes column c of basis inverse; performs rational factorization if not available; returns true on...
Real sumPrimalDegen
the sum of the rate of primal degeneracy at each iteration
void append(const T &t)
append element t.
const char * getSimplifierName()
name of simplifier
void changeLowerReal(const VectorReal &lower)
changes vector of lower bounds to lower
DVectorBase< Rational > DVectorRational
virtual void addRows(const LPRowSetBase< R > &pset, bool scale=false)
const char * getPricerName()
name of currently loaded pricer
Class for collecting statistical information.
bool isSPxColId() const
is id a column id?
print condition number during the solve
void setDisplayFreq(int freq)
set display frequency
int spxSnprintf(char *t, size_t len, const char *s,...)
safe version of snprintf
solve() aborted due to time limit.
round scaling factors for iterative refinement to powers of two?
const T * get_const_ptr() const
get a const C pointer to the data.
SPxBasis::SPxStatus basisStatus() const
returns the current basis status
virtual void setMinReduction(const Real minRed)
set minimal reduction threshold to continue simplification
void removeRowReal(int i)
removes row i
#define DEFAULT_EPS_ZERO
default allowed additive zero: 1.0 + EPS_ZERO == 1.0
bool getBasisInverseTimesVecReal(Real *rhs, Real *sol, bool unscale=true)
computes dense solution of basis matrix B * sol = rhs; returns true on success
int dlcmSizeDualRational(const int base=2)
get size of least common multiple of denominators in dual solution
virtual void changeLower(const VectorBase< R > &newLower, bool scale=false)
Changes vector of lower bounds to newLower. scale determines whether the new data should be scaled...
virtual void setVerbosity(const Verbosity &v)
LPRowBase< R >::Type rowType(int i) const
Returns the inequality type of the i'th LPRow.
SPxWeightST _starterWeight
Statistics * _statistics
statistics since last call to solveReal() or solveRational()
#define DEFAULT_EPS_PIVOT
virtual void changeRhs(const VectorBase< R > &newRhs, bool scale=false)
Changes right hand side vector for constraints to newRhs. scale determines whether the new data shoul...
bool isPrimalFeasible() const
is the stored solution primal feasible?
R obj(int i) const
Returns objective value of column i.
decide according to problem size
void getColVectorReal(int i, DSVectorReal &col) const
gets vector of col i
void solveRight(VectorRational &x, const VectorRational &b)
Solves .
const VectorBase< R > & lhs() const
Returns left hand side vector.
void _removeRowsReal(int perm[])
removes all rows with an index i such that perm[i] < 0; upon completion, perm[i] >= 0 indicates the n...
void _syncLPRational(bool time=true)
synchronizes rational LP with real LP, i.e., copies real LP to rational LP, without looking at the sy...
void printUserSettings()
print non-default parameter values
void changeBoundsReal(const VectorReal &lower, const VectorReal &upper)
changes vectors of column bounds to lower and upper
RangeType _rangeTypeRational(const Rational &lower, const Rational &upper) const
determines RangeType from rational bounds
SPxSteepPR _pricerQuickSteep
virtual int getColScaleExp(int i) const
returns scaling factor for column i
Real getEstimatedCondition()
int numColsRational() const
returns number of columns
void syncLPReal()
synchronizes real LP with rational LP, i.e., copies (rounded) rational LP into real LP...
SPxDantzigPR _pricerDantzig
SPxParMultPR _pricerParMult
bool getPrimalRational(VectorRational &vector)
gets the primal solution vector if available; returns true on success
void changeObjRational(const VectorRational &obj)
changes objective function vector to obj
std::string statisticString() const
statistical information in form of a string
RangeType _switchRangeType(const RangeType &rangeType) const
switches RANGETYPE_LOWER to RANGETYPE_UPPER and vice versa
variable set to its upper bound.
int primalDegeneratePivots()
get number of primal degenerate pivots
Dynamic index set.Class DIdxSet provides dynamic IdxSet in the sense, that no restrictions are posed ...
void clearBasis()
clears starting basis
const SVectorReal & rowVectorRealInternal(int i) const
returns vector of row i, ignoring scaling
void syncLPRational()
synchronizes rational LP with real LP, i.e., copies real LP to rational LP, if sync mode is manual ...
virtual void setRealParam(Real param, const char *name="realparam")
set real parameter
bool getRedCostReal(VectorReal &vector)
gets the vector of reduced cost values if available; returns true on success
virtual void changeBounds(const VectorBase< R > &newLower, const VectorBase< R > &newUpper, bool scale=false)
Changes variable bounds to newLower and newUpper. scale determines whether the new data should be sca...
void add(const char *str)
int polishIterations()
return number of iterations done with primal algorithm
void getCol(int i, LPColBase< R > &col) const
Gets i 'th column.
Real realParam(const RealParam param) const
returns real parameter value
virtual Real time() const =0
SPxSteepExPR _pricerSteep
int boundFlips() const
get number of bound flips.
int degenPivotsDual
number of dual degenerate pivots
void useFullPerturbation(bool full)
perturb entire problem or only the bounds relevant to the current pivot
bool parseSettingsString(char *line)
parses one setting string and returns true on success; note that string is modified ...
const VectorReal & upperRealInternal() const
returns upper bound vector
SPxLPBase< Rational > SPxLPRational
void changeBoundsRational(const VectorRational &lower, const VectorRational &upper)
changes vectors of column bounds to lower and upper
const SVectorRational & colVectorRational(int i) const
returns vector of column i
R lhsUnscaled(int i) const
Returns unscaled left hand side of row number i.
int index(int n) const
Returns index of the n 'th nonzero element.
int numIterations() const
number of iterations since last call to solve
SPxDefaultRT _ratiotesterTextbook
bool getPrimalRay(VectorBase< R > &vector) const
gets the primal unbounded ray if available; returns true on success
(In)equality for LPs.Class LPRowBase provides constraints for linear programs in the form where a is...
int dmaxSizeDual(const int base=2) const
returns size of largest denominator in dual solution
greedy crash basis weighted by objective, bounds, and sides
virtual void loadLP(const SPxLP &LP, bool initSlackBasis=true)
copy LP.
variable set to its lower bound.
Settings * _currentSettings
bool getBasisInverseTimesVecRational(const SVectorRational &rhs, SSVectorRational &sol)
computes solution of basis matrix B * sol = rhs; performs rational factorization if not available; re...
virtual const char * getName() const
get name of ratio tester.
Real lhsReal(int i) const
returns left-hand side of row i
LPRowReal::Type rowTypeReal(int i) const
returns inequality type of row i
Preconfigured SoPlex LP solver.
#define MSG_INFO3(spxout, x)
Prints out message x if the verbosity level is at least SPxOut::INFO3.
Sparse vector .A UnitVectorBase is an SVectorBase that can take only one nonzero value with value 1 b...
maximize number of basic slack variables, i.e. more variables on bounds
void _syncRationalSolution()
synchronizes real solution with rational solution, i.e., copies real solution to rational solution ...
int _intParamValues[SoPlex::INTPARAM_COUNT]
array of current integer parameter values
virtual void changeRow(int n, const LPRowBase< R > &newRow, bool scale=false)
Replaces i 'th row of LP with newRow. scale determines whether the new data should be scaled...
virtual void changeUpper(const VectorBase< R > &newUpper, bool scale=false)
Changes vector of upper bounds to newUpper. scale determines whether the new data should be scaled...
void reDim(int newdim)
Resets dimension to newdim.
void addRowsRational(const mpq_t *lhs, const mpq_t *rowValues, const int *rowIndices, const int *rowStarts, const int *rowLengths, const int numRows, const int numValues, const mpq_t *rhs)
adds a set of rows (GMP only method)
virtual const char * getName() const
get name of scaler
bool areLPsInSync(const bool checkVecVals=true, const bool checkMatVals=false, const bool quiet=false) const
checks if real LP and rational LP are in sync; dimensions will always be compared, vector and matrix values only if the respective parameter is set to true. If quiet is set to true the function will only display which vectors are different.
dual simplex algorithm, i.e., leaving for column and entering for row representation ...
Set of strings.Class NameSet implements a symbol or name table. It allows to store or remove names (i...
force iterative refinement
lower and upper bound finite, but different
bool isDualFeasible() const
is a dual solution available?
Sequential object-oriented SimPlex.SPxSolver is an LP solver class using the revised Simplex algorith...
virtual bool writeBasisFile(const char *filename, const NameSet *rowNames, const NameSet *colNames, const bool cpxFormat=false) const
Real luSolveTimeReal
time for solving linear systems in real precision
virtual void changeObj(const VectorBase< R > &newObj, bool scale=false)
Changes objective vector to newObj. scale determines whether the new data should be scaled...
R * get_ptr()
Only used in slufactor.cpp.
geometric mean scaling (max 8 rounds) followed by equilibrium scaling (rows and columns) ...
Rational _rationalNegInfty
const SVectorRational & rowVectorRational(int i) const
returns vector of row i
int dlcmSizePrimal(const int base=2) const
returns size of least common multiple of denominators in primal solution
void printStatus(std::ostream &os, SPxSolver::Status status)
prints status
virtual void setTerminationIter(int iteration=-1)
set iteration limit.
threshold on number of rows vs. number of columns for switching from column to row representations in...
lower bound equals upper bound
virtual void addCol(const LPColBase< R > &col, bool scale=false)
std::string description[SoPlex::REALPARAM_COUNT]
array of descriptions for real parameters
bool getSlacksReal(VectorReal &vector)
gets the vector of slack values if available; returns true on success
#define DEFAULT_RANDOM_SEED
int dim() const
Dimension of vector.
Exception base class.This class implements a base class for our SoPlex exceptions We provide a what()...
int size() const
Returns the number of nonzeros.
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
void _changeLhsReal(const VectorReal &lhs)
changes left-hand side vector for constraints to lhs and adjusts basis
working tolerance for feasibility in floating-point solver during iterative refinement ...
int max() const
Maximal number of indices.
bool _lowerFinite(const RangeType &rangeType) const
checks whether RangeType corresponds to finite lower bound
void getCols(int start, int end, LPColSetBase< R > &set) const
Gets columns start, ..., end.
the maximum number of rows that are added in each iteration of the decomposition based simplex ...
bool loadSettingsFile(const char *filename)
reads settings file; returns true on success
virtual void changeRange(const VectorBase< R > &newLhs, const VectorBase< R > &newRhs, bool scale=false)
Changes left and right hand side vectors. scale determines whether the new data should be scaled...
int numNonzerosReal() const
returns number of nonzeros
SoPlex & operator=(const SoPlex &rhs)
assignment operator
bool getRedCostViolationRational(Rational &maxviol, Rational &sumviol)
gets violation of reduced costs; returns true on success
textbook ratio test without stabilization
void clear()
Remove all indices.
virtual void setTester(SPxRatioTester *tester, const bool destroy=false)
setup ratio-tester to use. If destroy is true, tester will be freed in destructor.
Real objReal(int i) const
returns objective value of column i
DataArray< RangeType > _rowTypes
void _removeColReal(int i)
removes column i
void _changeRowReal(int i, const LPRowReal &lprow)
replaces row i with lprow and adjusts basis
void setIntegralityInformation(int ncols, int *intInfo)
pass integrality information about the variables to the solver
bool readStringRational(const char *s, Rational &value)
read Rational from string
void getBasisInd(int *bind) const
gets the indices of the basic columns and rows; basic column n gives value n, basic row m gives value...
apply rational reconstruction after each iterative refinement?
void _changeColReal(int i, const LPColReal &lpcol)
replaces column i with lpcol and adjusts basis
solve() aborted due to detection of cycling.
Real minAbsNonzeroReal() const
returns smallest non-zero element in absolute value
bound flipping ratio test for long steps in the dual simplex
Saving LPs in a form suitable for SoPlex.Class SPxLPBase provides the data structures required for sa...
const VectorReal & lowerRealInternal() const
returns lower bound vector
bool getDualReal(VectorReal &vector)
gets the dual solution vector if available; returns true on success
SPxHarrisRT _ratiotesterHarris
DSVectorBase< Real > DSVectorReal
equilibrium scaling on rows and columns
void changeColReal(int i, const LPColReal &lpcol)
replaces column i with lpcol
working tolerance for optimality in floating-point solver during iterative refinement ...
void clearLPReal()
clears the LP
Preconfigured SoPlex LP-solver.
should the dual of the complementary problem be used in the decomposition simplex?
void removeRowRational(int i)
removes row i
R lowerUnscaled(int i) const
Returns unscaled lower bound of column i.
#define MSG_WARNING(spxout, x)
Prints out message x if the verbosity level is at least SPxOut::WARNING.
Type
(In)Equality type of an LP row.
int iterations
number of iterations/pivots
const VectorBase< R > & maxObj() const
Returns objective vector for maximization problem.
virtual const char * getName() const
get name of pricer.
R upper() const
Gets upper bound.
int upper[SoPlex::INTPARAM_COUNT]
array of upper bounds for int parameter values
Real lower[SoPlex::REALPARAM_COUNT]
array of lower bounds for real parameter values
SPxVectorST _starterVector
void setIntegralityInformation(int ncols, int *intInfo)
pass integrality information about the variables to the solver
void setup()
Initializes nonzero indices for elements with absolute values above epsilon and sets all other elemen...
#define SET_MAX_LINE_LEN
maximum length of lines in settings file
static void setEpsilonUpdate(Real eps)
bool getBoundViolationReal(Real &maxviol, Real &sumviol)
gets violation of bounds; returns true on success
automatic sync of real and rational LP
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...
const VectorRational & upperRational() const
returns upper bound vector
void setConditionInformation(int condInfo)
print condition number within the usual output
int boundflips
number of dual bound flips
void clearAllData()
clears all statistics
const char * getGitHash()
mode for a posteriori feasibility checks
refactor threshold for nonzeros in last factorized basis matrix compared to updated basis matrix ...
nothing known on loaded problem.
steepest edge pricer with initialization to unit norms
don't perform modifications on optimal basis
VarStatus getBasisRowStatus(int row) const
gets basis status for a single row
LPRowRational::Type rowTypeRational(int i) const
returns inequality type of row i
type of algorithm, i.e., primal or dual
const SVectorBase< R > & rowVector(int i) const
Gets row vector of row i.
VarStatus getBasisColStatus(int col) const
gets basis status for a single column
void print(std::ostream &os)
prints statistics
void clearSolvingData()
clears statistics on solving process
primal simplex algorithm, i.e., entering for column and leaving for row representation ...
void _recomputeRangeTypesReal()
recomputes range types from scratch using real LP
virtual void addRow(const LPRowBase< R > &row, bool scale=false)
std::string name[SoPlex::INTPARAM_COUNT]
array of names for integer parameters
#define DEFAULT_REFACTOR_INTERVAL
default setting for LU refactorization interval
DataArray< UnitVectorRational *> _unitMatrixRational
bool getDualFarkasRational(VectorRational &vector)
gets the Farkas proof if LP is infeasible; returns true on success
stalling refinement limit (-1 if unlimited)
bool isSPxRowId() const
is id a row id?
int lower[SoPlex::INTPARAM_COUNT]
array of lower bounds for int parameter values
DataArray< SPxSolver::VarStatus > _basisStatusRows
std::ifstream spxifstream
Set of LP rows.Class LPRowSetBase implements a set of LPRowBase%s. Unless for memory limitations...
geometric mean scaling on rows and columns, max 1 round
Timer * readingTime
reading time not included in solving time
int iterationsFromBasis
number of iterations from Basis
int iterationsPolish
number of iterations during solution polishing
modified Harris ratio test
SPxSolver::VarStatus basisColStatus(int col) const
returns basis status for a single column
void _solveDecompositionDualSimplex()
solves LP using the decomposition based dual simplex
void getNdualNorms(int &nnormsRow, int &nnormsCol) const
gets number of available dual norms
should dual infeasibility be tested in order to try to return a dual solution even if primal infeasib...
int defaultValue[SoPlex::INTPARAM_COUNT]
array of default values for integer parameters
virtual void changeSense(SPxSense sns)
Changes optimization sense to sns.
bool getFastCondition(Real &condition, int type=0)
compute condition number estimate based on the diagonal of the LU factorization; returns true on succ...
void getUpperUnscaled(DVector &vec) const
Gets unscaled upper bound vector.
uint32_t getSeed() const
returns the initial seed shift
Timer * solvingTime
solving time
int size() const
return nr. of elements.
std::string description[SoPlex::BOOLPARAM_COUNT]
array of descriptions for boolean parameters
Type type() const
return current Type.
const VectorReal & rhsRealInternal() const
returns right-hand side vector, ignoring scaling
bool boolParam(const BoolParam param) const
returns boolean parameter value
void setSeed(uint32_t initshift)
initialize all seeds of the random number generator.
void unscaleLP()
unscales the lp and clears basis
virtual const char * getName() const
get name of starter.
the verbosity of the decomposition based simplex
const VectorBase< R > & upper() const
Real getSolveTime() const
time spent in solves
should lifting be used to reduce range of nonzero matrix coefficients?
void printProblemStatistics(std::ostream &os)
int dmaxSizePrimalRational(const int base=2)
get size of largest denominator in primal solution
bool getEstimatedCondition(Real &condition)
computes an estimated condition number for the current basis matrix using the power method; returns t...
int dmaxSizePrimal(const int base=2) const
returns size of largest denominator in primal solution
Real maxObjReal(int i) const
returns objective value of column i after transformation to a maximization problem; since this is how...
void setRandomSeed(unsigned int seed)
set the random seeds of the solver instance
DataArray< int > _rationalLUSolverBind
should the degeneracy be computed for each basis?
#define MSG_INFO1(spxout, x)
Prints out message x if the verbosity level is at least SPxOut::INFO1.
bool getExactCondition(Real &condition)
computes the exact condition number for the current basis matrix using the power method; returns true...
virtual int getRowScaleExp(int i) const
returns scaling factor for row i
const char * getScalerName()
name of scaling method
Real solveTime() const
time spent in last call to solve
void addColsReal(const LPColSetReal &lpcolset)
adds multiple columns
const SVectorBase< R > & colVector(int i) const
Returns column vector of column i.
Random random
The random number generator used throughout the whole computation. Its seed can be modified...
int nCols() const
Returns number of columns in LP.
virtual void changeElement(int i, int j, const R &val, bool scale=false)
Changes LP element (i, j) to val. scale determines whether the new data should be scaled...
SPxSolver::Status status() const
returns the current solver status
zero tolerance used in update of the factorization
int iterationsPrimal
number of iterations with Primal
void changeLowerRational(const VectorRational &lower)
changes vector of lower bounds to lower
lower limit on objective value
bool getRedCostViolationReal(Real &maxviol, Real &sumviol)
gets violation of reduced costs; returns true on success
BoolParam
boolean parameters
bool _isSolveStopped(bool &stoppedTime, bool &stoppedIter) const
should solving process be stopped?
virtual void changeLhs(const VectorBase< R > &newLhs, bool scale=false)
Changes left hand side vector for constraints to newLhs. scale determines whether the new data should...
virtual Real getCoefUnscaled(const SPxLPBase< Real > &lp, int row, int col) const
returns unscaled coefficient of lp
void _changeBoundsReal(const VectorReal &lower, const VectorReal &upper)
changes vectors of column bounds to lower and upper and adjusts basis
#define SOPLEX_SUBVERSION
Settings()
default constructor initializing default settings
maximum number of conjugate gradient iterations in least square scaling
sparse pricing threshold (#violations < dimension * SPARSITY_THRESHOLD activates sparse pricing) ...
Settings & operator=(const Settings &settings)
assignment operator
void setFeastol(Real d)
set parameter feastol.
bool getDualFarkas(VectorBase< R > &vector) const
gets the Farkas proof if available; returns true on success
void addRowReal(const LPRowReal &lprow)
adds a single row
static void setEpsilonFactorization(Real eps)
bool getPrimalRayRational(VectorRational &vector)
gets the primal ray if LP is unbounded; returns true on success
dual feasibility tolerance
void _ensureRealLPLoaded()
ensures that the real LP and the basis are loaded in the solver; performs no sync ...
void invalidate()
invalidate solution
void changeRowReal(int i, const LPRowReal &lprow)
replaces row i with lprow
void setBasis(const SPxSolver::VarStatus rows[], const SPxSolver::VarStatus cols[])
sets starting basis via arrays of statuses
bool hasPrimalRay() const
is a primal unbounded ray available?
bool setIntParam(const IntParam param, const int value, const bool init=true)
sets integer parameter value; returns true on success
void solve(Vector &x, const Vector &rhs)
void getLhsUnscaled(VectorBase< Real > &vec) const
Returns unscaled left hand side vector.
bool saveSettingsFile(const char *filename, const bool onlyChanged=false) const
writes settings file; returns true on success
UnitVectorBase< Real > UnitVectorReal
std::string rationalToString(const Rational &r, const int precision)
convert rational number to string
Real objValueReal()
returns the objective value if a primal solution is available
bool _parseSettingsLine(char *line, const int lineNumber)
parses one line in a settings file and returns true on success; note that the string is modified ...
void changeRhsReal(const VectorReal &rhs)
changes right-hand side vector to rhs
SPxLeastSqSC _scalerLeastsq
geometric frequency at which to apply rational reconstruction
Real opttol() const
allowed optimality, i.e., dual feasibility tolerance.
void changeElementRational(int i, int j, const Rational &val)
changes matrix entry in row i and column j to val
bool isRowBasic(int i) const
is the i 'th row vector basic ?
void hyperPricing(bool h)
enable or disable hyper sparse pricing
void writeStateRational(const char *filename, const NameSet *rowNames=0, const NameSet *colNames=0, const bool cpxFormat=false) const
writes internal LP, basis information, and parameter settings; if rowNames and colNames are NULL...
void _enableSimplifierAndScaler()
enables simplifier and scaler according to current parameters
bool setBoolParam(const BoolParam param, const bool value, const bool init=true)
sets boolean parameter value; returns true on success
should LP be transformed to equality form before a rational solve?
void setOutstream(SPxOut &newOutstream)
Real sumDualDegen
the sum of the rate of dual degeneracy at each iteration
void _idxToPerm(int *idx, int idxSize, int *perm, int permSize) const
creates a permutation for removing rows/columns from an array of indices
virtual void clear()
clears the LP.
void setMemFactor(Real f)
set refactor threshold for memory growth in current factor update compared to the last factorization ...
void solveLeft(VectorRational &x, const VectorRational &b)
Solves .
int number(const DataKey &pkey) const
returns number of name with DataKey pkey in NameSet.
const SPxBasis & basis() const
Return current basis.
SPxSolver::VarStatus basisRowStatus(int row) const
returns basis status for a single row
the number of iterations before the decomposition simplex initialisation is terminated.
equilibrium scaling on rows or columns
virtual void reLoad()
reload LP.
const VectorRational & maxObjRational() const
returns objective function vector after transformation to a maximization problem; since this is how i...
upper threshold in lifting (nonzero matrix coefficients with larger absolute value will be reformulat...
void _addRowsReal(const LPRowSetReal &lprowset)
adds multiple rows to the real LP and adjusts basis
int numColsReal() const
returns number of columns
virtual Status solve()
solve loaded LP.
void changeUpperReal(const VectorReal &upper)
changes vector of upper bounds to upper
void reSize(int newsize)
reset size to newsize.
bool hasPrimalRay() const
is a primal unbounded ray available?
void removeColRational(int i)
removes column i
IntParam
integer parameters
const VectorBase< R > & lower() const
Returns (internal and possibly scaled) lower bound vector.
SPxSolver::Status _status
void setTiming(Timer::TYPE ttype)
set timing type
virtual R maxAbsNzo(bool unscaled=true) const
Absolute biggest non-zero element in (in rational case possibly scaled) LP.
void getObjRational(VectorRational &obj) const
gets objective function vector
int num() const
Returns the number of LPColBases currently in LPColSetBase.
virtual void setIntParam(int param, const char *name="intparam")
set int parameter
virtual void computePrimalActivity(const VectorBase< R > &primal, VectorBase< R > &activity, const bool unscaled=true) const
Computes activity of the rows for a given primal vector; activity does not need to be zero...
LP column.Class LPColBase provides a datatype for storing the column of an LP a the form similar to ...
Representation rep() const
return the current basis representation.
RangeType _rangeTypeReal(const Real &lower, const Real &upper) const
determines RangeType from real bounds
void _completeRangeTypesRational()
completes range type arrays after adding columns and/or rows
const VectorReal & lhsRealInternal() const
returns left-hand side vector, ignoring scaling
solve() aborted due to objective limit.
columnwise representation.
void spx_free(T &p)
Release memory.
decide according to READMODE
SPxSimplifier * _simplifier
void removeRowRangeRational(int start, int end, int perm[]=0)
removes rows start to end including both; an array perm of size numRowsRational() may be passed as bu...
void addRowsReal(const LPRowSetReal &lprowset)
adds multiple rows
bool has(int pnum) const
does NameSet has a name with number pnum?
void getRowVectorUnscaled(int i, DSVectorBase< Real > &vec) const
Gets unscaled row vector of row i.
virtual void addCols(const LPColSetBase< R > &pset, bool scale=false)
void scaleValue(int i, int scaleExp)
Scale i 'th element by a.
perturb the entire problem or only the relevant bounds of s single pivot?
Basis is singular, numerical troubles?
R value(int n) const
Returns value of the n 'th nonzero element.
const SVector & unitVector(int i) const
return i 'th unit vector.
should row and bound violations be computed explicitly in the update of reduced problem in the decomp...
upper bound is finite, lower bound is infinite
bool getBoundViolationRational(Rational &maxviol, Rational &sumviol)
gets violation of bounds; returns true on success
LP has a usable Basis (maybe LP is changed).
int num() const
Returns the number of LPRowBases in LPRowSetBase.
int primalIterations()
return number of iterations done with primal algorithm
generic solution-based crash basis
void setMax(int newmax=1)
Reset nonzero memory to >= newmax.
LP has been proven to be primal unbounded.
int totalSizeDualRational(const int base=2)
get size of dual solution
int degenPivotsPrimal
number of primal degenerate pivots
No Problem has been loaded to the basis.
void removeRowsReal(int perm[])
removes all rows with an index i such that perm[i] < 0; upon completion, perm[i] >= 0 indicates the n...
const VectorRational & lowerRational() const
returns lower bound vector