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 3184 Real viol = lower - primal[i];
3194 viol = primal[i] - upper;
3230 Real viol = lhs - activity[i];
3240 viol = activity[i] - rhs;
3277 sumviol += -redcost[c];
3279 if(redcost[c] < -maxviol)
3280 maxviol = -redcost[c];
3285 sumviol += redcost[c];
3287 if(redcost[c] > maxviol)
3288 maxviol = redcost[c];
3295 sumviol += redcost[c];
3297 if(redcost[c] > maxviol)
3298 maxviol = redcost[c];
3303 sumviol += -redcost[c];
3305 if(redcost[c] < -maxviol)
3306 maxviol = -redcost[c];
3337 sumviol += -dual[r];
3339 if(dual[r] < -maxviol)
3347 if(dual[r] > maxviol)
3357 if(dual[r] > maxviol)
3363 sumviol += -dual[r];
3365 if(dual[r] < -maxviol)
3653 sumviol += -redcost[c];
3655 if(redcost[c] < -maxviol)
3657 MSG_DEBUG(std::cout <<
"increased reduced cost violation for column " << c <<
3659 maxviol = -redcost[c];
3665 sumviol += redcost[c];
3667 if(redcost[c] > maxviol)
3669 MSG_DEBUG(std::cout <<
"increased reduced cost violation for column " << c <<
3671 maxviol = redcost[c];
3679 sumviol += redcost[c];
3681 if(redcost[c] > maxviol)
3683 MSG_DEBUG(std::cout <<
"increased reduced cost violation for column " << c <<
3685 maxviol = redcost[c];
3691 sumviol += -redcost[c];
3693 if(redcost[c] < -maxviol)
3695 MSG_DEBUG(std::cout <<
"increased reduced cost violation for column " << c <<
3697 maxviol = -redcost[c];
3748 sumviol += -dual[r];
3750 if(dual[r] < -maxviol)
3752 MSG_DEBUG(std::cout <<
"increased dual violation for row " << r <<
" not on upper bound: " <<
3766 if(dual[r] > maxviol)
3768 MSG_DEBUG(std::cout <<
"increased dual violation for row " << r <<
" not on lower bound: " <<
3784 if(dual[r] > maxviol)
3786 MSG_DEBUG(std::cout <<
"increased dual violation for row " << r <<
" not on upper bound: " <<
3798 sumviol += -dual[r];
3800 if(dual[r] < -maxviol)
3802 MSG_DEBUG(std::cout <<
"increased dual violation for row " << r <<
" not on lower bound: " <<
3819 #ifdef SOPLEX_WITH_GMP 4324 int size = x.
size();
4326 for(
int i = 0; i < size; i++)
4340 "> while computing basis inverse row.\n");
4345 if(ninds != 0 && inds != 0)
4351 for(
int i = 0; i < *ninds; ++i)
4402 for(
int i = 0; i < rhs.size(); ++i)
4428 "> while computing basis inverse row.\n");
4447 coef[rowindex] = y[i];
4457 assert(coef[index] == 0.0);
4511 int size = x.
size();
4513 for(
int i = 0; i < size; i++)
4537 "> while computing basis inverse row.\n");
4542 if(ninds != 0 && inds != 0)
4548 for(
int i = 0; i < *ninds; ++i)
4614 int size = rhs.size();
4617 for(
int i = 0; i < size; i++)
4620 rhs.value(i) *=
spxLdexp(1.0, scaleExp);
4628 for(
int i = 0; i < size; i++)
4644 "> while computing basis inverse row.\n");
4669 assert(coef[index] == 0.0);
4715 for(
int i = 0; i < v.
dim(); ++i)
4726 for(
int i = 0; i < x.
dim(); i++)
4749 "> while solving with basis matrix.\n");
4783 rowrhs.add(i,
spxLdexp(v[idx], scaleExp));
4790 assert(rowrhs[i] == 0.0);
4802 "> while solving with basis matrix.\n");
4840 x[i] =
spxLdexp(y[index], scaleExp);
4880 for(
int i = 0; i < basisdim; ++i)
4889 vec[i] =
spxLdexp(vec[i], scaleExp);
4895 for(
int i = 0; i < basisdim; ++i)
4898 vec[i] =
spxLdexp(vec[i], -scaleExp);
4913 Vector x(colbasisdim, vec);
4923 for(
int i = 0; i < colbasisdim; ++i)
4995 for(
int i = 0; i < basisdim; ++i)
5000 vec[i] =
spxLdexp(vec[i], scaleExp);
5006 for(
int i = 0; i < basisdim; ++i)
5015 vec[i] =
spxLdexp(vec[i], scaleExp);
5029 Vector x(colbasisdim, vec);
5039 for(
int i = 0; i < colbasisdim; ++i)
5145 "> while computing rational basis inverse row.\n");
5171 "> while computing rational basis inverse column.\n");
5198 "> during right solve with rational basis inverse.\n");
5267 std::stringstream s;
5269 <<
" Time spent : " << std::setw(10) << std::fixed << std::setprecision(
5273 <<
"Solution time : " << std::setw(10) << std::fixed << std::setprecision(
5275 <<
"Iterations : " << std::setw(10) <<
numIterations() << std::endl;
5335 bool success =
false;
5338 success =
_readFileReal(filename, rowNames, colNames, intVars);
5353 const DIdxSet* intVars,
const bool unscale)
const 5364 origLP->writeFile(filename, rowNames, colNames, intVars);
5365 origLP->~SPxLPReal();
5407 dualLP.
writeFile(filename, colNames, rowNames);
5420 assert(filename != 0);
5447 assert(filename != 0);
5463 const NameSet* colNamesPtr = colNames;
5468 std::stringstream name;
5471 tmpColNames =
new(tmpColNames)
NameSet();
5472 tmpColNames->
reMax(numCols);
5474 for(
int j = 0; j < numCols; ++j)
5477 tmpColNames->
add(name.str().c_str());
5480 colNamesPtr = tmpColNames;
5484 const NameSet* rowNamesPtr = rowNames;
5487 if(rowNamesPtr == 0)
5489 std::stringstream name;
5492 tmpRowNames =
new(tmpRowNames)
NameSet();
5493 tmpRowNames->
reMax(numRows);
5495 for(
int i = 0; i < numRows; ++i)
5498 tmpRowNames->
add(name.str().c_str());
5501 rowNamesPtr = tmpRowNames;
5508 for(
int i = 0; i < numRows; i++)
5511 for(
int i = 0; i < numCols; i++)
5534 if(mps.
field0() != 0 && !strcmp(mps.
field0(),
"ENDATA"))
5552 if(!strcmp(mps.
field1(),
"XU"))
5563 else if(!strcmp(mps.
field1(),
"XL"))
5574 else if(!strcmp(mps.
field1(),
"UL"))
5578 else if(!strcmp(mps.
field1(),
"LL"))
5616 const bool cpxFormat)
const 5618 assert(filename != 0);
5624 std::ofstream file(filename);
5629 file.setf(std::ios::left);
5630 file <<
"NAME " << filename <<
"\n";
5644 for(
int col = 0; col < numCols; col++)
5651 for(; row < numRows; row++)
5659 assert(row != numRows);
5667 file << std::setw(8);
5669 if(colNames != 0 && colNames->
has(col))
5670 file << (*colNames)[col];
5676 if(rowNames != 0 && rowNames->
has(row))
5677 file << (*rowNames)[row];
5690 file << std::setw(8);
5692 if(colNames != 0 && colNames->
has(col))
5693 file << (*colNames)[col];
5707 for(; row < numRows; row++)
5723 const bool cpxFormat)
const 5728 ofname = std::string(filename) +
".set";
5732 ofname = std::string(filename) + ((cpxFormat) ?
".lp" :
".mps");
5736 ofname = std::string(filename) +
".bas";
5745 const NameSet* colNames,
const bool cpxFormat)
const 5750 ofname = std::string(filename) +
".set";
5754 ofname = std::string(filename) + ((cpxFormat) ?
".lp" :
".mps");
5758 ofname = std::string(filename) +
".bas";
5794 #ifdef SOPLEX_WITH_RATIONALPARAM 5796 Rational SoPlex::rationalParam(
const RationalParam param)
const 5799 assert(param < RATIONALPARAM_COUNT);
5893 if(!init && value ==
intParam(param))
5897 if(value < _currentSettings->
intParam.lower[param]
6321 if(value < _currentSettings->
realParam.lower[param]
6326 Real tmp_value = value;
6332 #ifndef SOPLEX_WITH_GMP 6348 #ifndef SOPLEX_WITH_GMP 6477 #ifdef SOPLEX_WITH_RATIONALPARAM 6479 bool SoPlex::setRationalParam(
const RationalParam param,
const Rational value,
const bool init)
6482 assert(param < RATIONALPARAM_COUNT);
6485 if(!init && value == rationalParam(param))
6488 if(value < _currentSettings->rationalParam.lower[param]
6511 bool success =
true;
6524 #ifdef SOPLEX_WITH_RATIONALPARAM 6526 for(
int i = 0; i < SoPlex::RATIONALPARAM_COUNT; i++)
6527 success &= setRationalParam((RationalParam)i,
_currentSettings->_rationalParamValues[i], init);
6548 #ifdef SOPLEX_WITH_RATIONALPARAM 6550 for(
int i = 0; i < SoPlex::RATIONALPARAM_COUNT; i++)
6551 success &= setRationalParam((RationalParam)i,
_currentSettings->rationalParam.defaultValue[i],
6561 bool printedValue =
false;
6572 printedValue =
true;
6582 printedValue =
true;
6594 printedValue =
true;
6597 #ifdef SOPLEX_WITH_RATIONALPARAM 6599 for(
int i = 0; i < SoPlex::RATIONALPARAM_COUNT; i++)
6606 printedValue =
true;
6614 printedValue =
true;
6626 assert(filename != 0);
6628 std::ofstream file(filename);
6634 file.setf(std::ios::left);
6640 #if SOPLEX_SUBVERSION > 0 6654 "true\n" :
"false\n");
6691 #ifdef SOPLEX_WITH_RATIONALPARAM 6693 for(
int i = 0; i < SoPlex::RATIONALPARAM_COUNT; i++)
6703 <<
"], default " <<
_currentSettings->rationalParam.defaultValue[i] <<
"\n";
6713 file <<
"# initial random seed used for perturbation\n";
6726 assert(filename != 0);
6745 bool readError =
false;
6746 bool parseError =
false;
6748 while(!readError && !parseError)
6751 readError = !file.getline(line,
sizeof(line));
6757 readError = readError && !file.eof();
6778 assert(
string != 0);
6786 char* line = parseString;
6789 while(*line ==
' ' || *line ==
'\t' || *line ==
'\r')
6792 if(*line ==
'\0' || *line ==
'\n' || *line ==
'#')
6795 char* paramTypeString = line;
6798 while(*line !=
' ' && *line !=
'\t' && *line !=
'\r' && *line !=
'\n' && *line !=
'#' 6799 && *line !=
'\0' && *line !=
':')
6813 while(*line ==
' ' || *line ==
'\t' || *line ==
'\r')
6819 "Error parsing setting string: no ':' separating parameter type and name.\n");
6827 while(*line ==
' ' || *line ==
'\t' || *line ==
'\r')
6830 if(*line ==
'\0' || *line ==
'\n' || *line ==
'#')
6836 char* paramName = line;
6839 while(*line !=
' ' && *line !=
'\t' && *line !=
'\r' && *line !=
'\n' && *line !=
'#' 6840 && *line !=
'\0' && *line !=
'=')
6854 while(*line ==
' ' || *line ==
'\t' || *line ==
'\r')
6867 while(*line ==
' ' || *line ==
'\t' || *line ==
'\r')
6870 if(*line ==
'\0' || *line ==
'\n' || *line ==
'#')
6876 char* paramValueString = line;
6879 while(*line !=
' ' && *line !=
'\t' && *line !=
'\r' && *line !=
'\n' && *line !=
'#' 6889 while(*line ==
' ' || *line ==
'\t' || *line ==
'\r')
6892 if(*line !=
'\0' && *line !=
'\n' && *line !=
'#')
6895 "' after parameter value.\n");
6901 if(strncmp(paramTypeString,
"bool", 4) == 0)
6903 for(
int param = 0; ; param++)
6907 MSG_INFO1(
spxout,
spxout <<
"Error parsing setting string: unknown parameter name <" << paramName <<
6913 if(strncasecmp(paramValueString,
"true", 4) == 0
6914 || strncasecmp(paramValueString,
"TRUE", 4) == 0
6915 || strncasecmp(paramValueString,
"t", 4) == 0
6916 || strncasecmp(paramValueString,
"T", 4) == 0
6917 || strtol(paramValueString, NULL, 4) == 1)
6922 else if(strncasecmp(paramValueString,
"false", 5) == 0
6923 || strncasecmp(paramValueString,
"FALSE", 5) == 0
6924 || strncasecmp(paramValueString,
"f", 5) == 0
6925 || strncasecmp(paramValueString,
"F", 5) == 0
6926 || strtol(paramValueString, NULL, 5) == 0)
6934 "> for bool parameter <" << paramName <<
">.\n");
6944 if(strncmp(paramTypeString,
"int", 3) == 0)
6946 for(
int param = 0; ; param++)
6950 MSG_INFO1(
spxout,
spxout <<
"Error parsing setting string: unknown parameter name <" << paramName <<
6957 value = std::stoi(paramValueString);
6964 "> for int parameter <" << paramName <<
">.\n");
6974 if(strncmp(paramTypeString,
"real", 4) == 0)
6976 for(
int param = 0; ; param++)
6980 MSG_INFO1(
spxout,
spxout <<
"Error parsing setting string: unknown parameter name <" << paramName <<
6987 #ifdef WITH_LONG_DOUBLE 6988 value = std::stold(paramValueString);
6991 value = std::stof(paramValueString);
6993 value = std::stod(paramValueString);
7002 "> for real parameter <" << paramName <<
">.\n");
7011 #ifdef SOPLEX_WITH_RATIONALPARAM 7014 if(strncmp(paramTypeString,
"rational", 8) == 0)
7016 for(
int param = 0; ; param++)
7018 if(param >= SoPlex::RATIONALPARAM_COUNT)
7020 MSG_INFO1(
spxout,
spxout <<
"Error parsing setting string: unknown parameter name <" << paramName <<
7024 else if(strncmp(paramName,
_currentSettings->rationalParam.name[param].c_str(),
7030 && setRationalParam((SoPlex::RationalParam)param, value))
7035 "> for rational parameter <" << paramName <<
">.\n");
7047 if(strncmp(paramTypeString,
"uint", 4) == 0)
7049 if(strncmp(paramName,
"random_seed", 11) == 0)
7052 unsigned long parseval;
7054 parseval = std::stoul(paramValueString);
7056 if(parseval > UINT_MAX)
7062 value = (
unsigned int) parseval;
7073 paramTypeString <<
"> for parameter <" << paramName <<
">.\n");
7088 os <<
"Solution (real) : \n" 7093 os <<
"Solution (rational) : \n" 7095 os <<
"Size (base 2/10) : \n" 7108 os <<
"Solution : \n" 7109 <<
" Objective value : -\n";
7119 os <<
"Violation (rational): \n";
7125 os <<
" Max/sum bound : - / -\n";
7131 os <<
" Max/sum row : - / -\n";
7137 os <<
" Max/sum redcost : - / -\n";
7143 os <<
" Max/sum dual : - / -\n";
7150 os <<
"Violations (real) : \n";
7153 os <<
" Max/sum bound : " << maxviol <<
" / " << sumviol <<
"\n";
7155 os <<
" Max/sum bound : - / -\n";
7158 os <<
" Max/sum row : " << maxviol <<
" / " << sumviol <<
"\n";
7160 os <<
" Max/sum row : - / -\n";
7163 os <<
" Max/sum redcost : " << maxviol <<
" / " << sumviol <<
"\n";
7165 os <<
" Max/sum redcost : - / -\n";
7168 os <<
" Max/sum dual : " << maxviol <<
" / " << sumviol <<
"\n";
7170 os <<
" Max/sum dual : - / -\n";
7204 os <<
"Original problem : \n";
7217 "minimize\n" :
"maximize\n");
7225 os <<
"SoPlex status : ";
7230 os <<
"error [unspecified]";
7234 os <<
"error [no ratiotester loaded]";
7238 os <<
"error [no pricer loaded]";
7242 os <<
"error [no linear solver loaded]";
7246 os <<
"error [not initialized]";
7250 os <<
"solving aborted [cycling]";
7254 os <<
"solving aborted [time limit reached]";
7258 os <<
"solving aborted [iteration limit reached]";
7262 os <<
"solving aborted [objective limit reached]";
7266 os <<
"no problem loaded";
7270 os <<
"basis is regular";
7274 os <<
"basis is singular";
7278 os <<
"problem is solved [optimal]";
7282 os <<
"problem is solved [unbounded]";
7286 os <<
"problem is solved [infeasible]";
7290 os <<
"problem is solved [infeasible or unbounded]";
7294 os <<
"problem is solved [optimal with unscaled violations]";
7312 #if (SOPLEX_SUBVERSION > 0) 7331 #ifdef SOPLEX_WITH_GMP 7352 bool nRowsMatch =
true;
7353 bool nColsMatch =
true;
7354 bool rhsDimMatch =
true;
7355 bool lhsDimMatch =
true;
7356 bool maxObjDimMatch =
true;
7357 bool upperDimMatch =
true;
7358 bool lowerDimMatch =
true;
7364 "The number of Rows in the Real LP does not match the one in the Rational LP." 7374 "The number of Columns in the Real LP does not match the one in the Rational LP." 7384 "The number of nonZeros in the Real LP does not match the one in the Rational LP." 7393 "The dimension of the right hand side vector of the Real LP does not match the one of the Rational LP." 7397 rhsDimMatch =
false;
7405 "The dimension of the left hand side vector of the Real LP does not match the one of the Rational LP." 7409 lhsDimMatch =
false;
7416 "The dimension of the objective function vector of the Real LP does not match the one of the Rational LP." 7420 maxObjDimMatch =
false;
7427 "The objective function sense of the Real LP does not match the one of the Rational LP." 7438 "The dimension of the upper bound vector of the Real LP does not match the one of the Rational LP." 7442 upperDimMatch =
false;
7449 "The dimension of the lower bound vector of the Real LP does not match the one of the Rational LP." 7453 lowerDimMatch =
false;
7459 bool rhsValMatch =
true;
7460 bool lhsValMatch =
true;
7461 bool maxObjValMatch =
true;
7462 bool upperValMatch =
true;
7463 bool lowerValMatch =
true;
7468 for(
int i = 0; i <
_realLP->
rhs().dim(); i++)
7476 MSG_INFO1(
spxout,
spxout <<
"Entries number " << i <<
" of the right hand side vectors don't match." 7480 rhsValMatch =
false;
7485 if(!rhsValMatch && quiet)
7494 for(
int i = 0; i <
_realLP->
lhs().dim(); i++)
7507 lhsValMatch =
false;
7512 if(!lhsValMatch && quiet)
7528 " of the objective function vectors don't match." 7533 maxObjValMatch =
false;
7538 if(!maxObjValMatch && quiet)
7562 upperValMatch =
false;
7567 if(!upperValMatch && quiet)
7591 lowerValMatch =
false;
7596 if(!lowerValMatch && quiet)
7604 if(checkMatVals && nRowsMatch && nColsMatch)
7606 bool matrixValMatch =
true;
7618 i)[j] << std::endl);
7621 matrixValMatch =
false;
7627 if(!matrixValMatch && quiet)
7657 assert(newmax > vec.
size());
7669 assert(idxSize >= 0);
7671 assert(permSize >= 0);
7673 for(
int i = 0; i < permSize; i++)
7676 for(
int i = 0; i < idxSize; i++)
7678 assert(idx[i] >= 0);
7679 assert(idx[i] < permSize);
7690 assert(permSize >= 0);
7692 for(
int i = 0; i < permSize; i++)
7693 perm[i] = (i < start || i > end) ? i : -1;
7737 return stoppedTime || stoppedIter;
7745 assert(lower <= upper);
7758 else if(lower == upper)
7770 assert(lower <= upper);
7783 else if(lower == upper)
7931 for(
int i = 0; i < lpcolset.
num(); i++)
8347 else if(perm[i] >= 0 && perm[i] != i)
8350 assert(perm[perm[i]] < 0);
8411 else if(perm[i] >= 0 && perm[i] != i)
8414 assert(perm[perm[i]] < 0);
8686 bool success =
_realLP->
readFile(filename, rowNames, colNames, intVars);
8904 while(*line ==
' ' || *line ==
'\t' || *line ==
'\r')
8907 if(*line ==
'\0' || *line ==
'\n' || *line ==
'#')
8910 char* paramTypeString = line;
8913 while(*line !=
' ' && *line !=
'\t' && *line !=
'\r' && *line !=
'\n' && *line !=
'#' 8914 && *line !=
'\0' && *line !=
':')
8928 while(*line ==
' ' || *line ==
'\t' || *line ==
'\r')
8934 "Error parsing settings file: no ':' separating parameter type and name in line " << lineNumber <<
8943 while(*line ==
' ' || *line ==
'\t' || *line ==
'\r')
8946 if(*line ==
'\0' || *line ==
'\n' || *line ==
'#')
8953 char* paramName = line;
8956 while(*line !=
' ' && *line !=
'\t' && *line !=
'\r' && *line !=
'\n' && *line !=
'#' 8957 && *line !=
'\0' && *line !=
'=')
8971 while(*line ==
' ' || *line ==
'\t' || *line ==
'\r')
8977 lineNumber <<
".\n");
8985 while(*line ==
' ' || *line ==
'\t' || *line ==
'\r')
8988 if(*line ==
'\0' || *line ==
'\n' || *line ==
'#')
8990 MSG_INFO1(
spxout,
spxout <<
"Error parsing settings file: no parameter value in line " << lineNumber
8995 char* paramValueString = line;
8998 while(*line !=
' ' && *line !=
'\t' && *line !=
'\r' && *line !=
'\n' && *line !=
'#' 9008 while(*line ==
' ' || *line ==
'\t' || *line ==
'\r')
9011 if(*line !=
'\0' && *line !=
'\n' && *line !=
'#')
9014 "' after parameter value in line " << lineNumber <<
".\n");
9020 if(strncmp(paramTypeString,
"bool", 4) == 0)
9022 for(
int param = 0; ; param++)
9027 "> in line " << lineNumber <<
".\n");
9032 if(strncasecmp(paramValueString,
"true", 4) == 0
9033 || strncasecmp(paramValueString,
"TRUE", 4) == 0
9034 || strncasecmp(paramValueString,
"t", 4) == 0
9035 || strncasecmp(paramValueString,
"T", 4) == 0
9036 || strtol(paramValueString, NULL, 4) == 1)
9041 else if(strncasecmp(paramValueString,
"false", 5) == 0
9042 || strncasecmp(paramValueString,
"FALSE", 5) == 0
9043 || strncasecmp(paramValueString,
"f", 5) == 0
9044 || strncasecmp(paramValueString,
"F", 5) == 0
9045 || strtol(paramValueString, NULL, 5) == 0)
9053 "> for bool parameter <" << paramName <<
"> in line " << lineNumber <<
".\n");
9063 if(strncmp(paramTypeString,
"int", 3) == 0)
9065 for(
int param = 0; ; param++)
9070 "> in line " << lineNumber <<
".\n");
9076 value = std::stoi(paramValueString);
9083 "> for int parameter <" << paramName <<
"> in line " << lineNumber <<
".\n");
9093 if(strncmp(paramTypeString,
"real", 4) == 0)
9095 for(
int param = 0; ; param++)
9100 "> in line " << lineNumber <<
".\n");
9107 #ifdef WITH_LONG_DOUBLE 9108 value = std::stold(paramValueString);
9111 value = std::stof(paramValueString);
9113 value = std::stod(paramValueString);
9122 "> for real parameter <" << paramName <<
"> in line " << lineNumber <<
".\n");
9131 #ifdef SOPLEX_WITH_RATIONALPARAM 9134 if(strncmp(paramTypeString,
"rational", 8) == 0)
9136 for(
int param = 0; ; param++)
9138 if(param >= SoPlex::RATIONALPARAM_COUNT)
9141 "> in line " << lineNumber <<
".\n");
9144 else if(strncmp(paramName,
_currentSettings->rationalParam.name[param].c_str(),
9150 && setRationalParam((SoPlex::RationalParam)param, value))
9155 "> for rational parameter <" << paramName <<
"> in line " << lineNumber <<
".\n");
9167 if(strncmp(paramTypeString,
"uint", 4) == 0)
9169 if(strncmp(paramName,
"random_seed", 11) == 0)
9172 unsigned long parseval;
9174 parseval = std::stoul(paramValueString);
9176 if(parseval > UINT_MAX)
9182 value = (
unsigned int) parseval;
9193 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
standard floating-point parsing
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.
textbook ratio test without stabilization
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
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.
Basis is not known to be dual nor primal feasible.
No matrix has yet been loaded.
void coSolve(Vector &x, const Vector &rhs)
Cosolves linear system with basis matrix.
partial multiple pricer based on Dantzig pricing
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)
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
geometric mean scaling on rows and columns, max 8 rounds
const Settings & settings() const
returns current parameter settings
upper limit on objective value
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.
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
automatic sync of real and rational LP
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.
dual simplex algorithm, i.e., leaving for column and entering for row representation ...
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 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
Basis is optimal, i.e. dual and primal feasible.
primal simplex algorithm, i.e., entering for column and leaving for row representation ...
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)
steepest edge pricer with exact initialization of norms
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
greedy crash basis weighted by objective, bounds, and sides
bool isScaled() const
Returns true if and only if the LP is scaled.
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
mode for synchronizing real and rational LP
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 setValue(int i, R x)
Sets i 'th element to x.
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?
decide according to READMODE
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
Basis-vector product.
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
void addColsRational(const LPColSetRational &lpcolset)
adds multiple columns
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
minimize number of basic slack variables, i.e. more variables between bounds
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
geometric mean scaling on rows and columns, max 1 round
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)
user sync of real and rational LP
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.
bound flipping ratio test for long steps in the dual simplex
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.
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 addRowsRational(const LPRowSetRational &lprowset)
adds multiple rows
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.
row representation (lower,lhs) <= (x,Ax) <= (upper,rhs)
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: ...
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 ...
Forrest-Tomlin type update.
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
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) ...
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
SPxStatus status() const
returns current SPxStatus.
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 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.
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 hasPrimal() const
is a primal feasible solution available?
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.
standard Harris ratio test
static void setEpsilonPivot(Real eps)
void changeLhsReal(const VectorReal &lhs)
changes left-hand side vector for constraints to lhs
generic solution-based crash basis
crash basis from a greedy solution
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.
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.
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
force iterative refinement
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
bool hasDual() const
is a dual feasible solution available?
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
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.
automatic choice according to number of rows and columns
Sparse vector .A UnitVectorBase is an SVectorBase that can take only one nonzero value with value 1 b...
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.
apply standard floating-point algorithm
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.
Set of strings.Class NameSet implements a symbol or name table. It allows to store or remove names (i...
decide depending on tolerances whether to apply 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.
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
geometric mean scaling (max 8 rounds) followed by equilibrium scaling (rows and columns) ...
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
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
maximize number of basic slack variables, i.e. more variables on bounds
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
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
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
equilibrium scaling on rows or columns
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
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()
column representation Ax - s = 0, lower <= x <= upper, lhs <= s <= rhs
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.
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
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)
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...
Timer * readingTime
reading time not included in solving time
int iterationsFromBasis
number of iterations from Basis
int iterationsPolish
number of iterations during solution polishing
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
equilibrium scaling on rows and columns
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.
decide according to problem size
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.
LP has been proven to be primal unbounded.
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.
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?
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...
Basis is primal feasible.
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
modified Harris ratio test
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
LP has been proven to be primal infeasible.
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
steepest edge pricer with initialization to unit norms