34 #define SET_MAX_LINE_LEN 500 36 #define DEFAULT_REFACTOR_INTERVAL 200 39 #define strncasecmp _strnicmp 209 description[
SoPlex::SCALER] =
"scaling (0 - off, 1 - uni-equilibrium, 2 - bi-equilibrium, 3 - geometric, 4 - iterated geometric, 5 - least squares, 6 - geometric-equilibrium)";
216 description[
SoPlex::STARTER] =
"crash basis generated when starting from scratch (0 - none, 1 - weight, 2 - sum, 3 - vector)";
223 description[
SoPlex::PRICER] =
"pricing method (0 - auto, 1 - dantzig, 2 - parmult, 3 - devex, 4 - quicksteep, 5 - steep)";
251 description[
SoPlex::SOLVEMODE] =
"mode for iterative refinement strategy (0 - floating-point solve, 1 - auto, 2 - exact rational solve)";
258 description[
SoPlex::CHECKMODE] =
"mode for a posteriori feasibility checks (0 - floating-point check, 1 - auto, 2 - exact rational check)";
328 description[
SoPlex::PRINTCONDITION] =
"print condition number during the solve (0 - off, 1 - ratio estimate , 2 - sum estimate, 3 - product estimate, 4 - exact)";
433 description[
SoPlex::LIFTMINVAL] =
"lower threshold in lifting (nonzero matrix coefficients with smaller absolute value will be reformulated)";
440 description[
SoPlex::LIFTMAXVAL] =
"lower threshold in lifting (nonzero matrix coefficients with smaller absolute value will be reformulated)";
509 #ifdef SOPLEX_WITH_RATIONALPARAM 510 SoPlex::Settings::RationalParam::RationalParam() {}
524 #ifdef SOPLEX_WITH_RATIONALPARAM
525 for(
int i = 0; i < SoPlex::RATIONALPARAM_COUNT; i++ )
526 _rationalParamValues[i] = rationalParam.defaultValue[i];
546 #ifdef SOPLEX_WITH_RATIONALPARAM
547 for(
int i = 0; i < SoPlex::RATIONALPARAM_COUNT; i++ )
548 _rationalParamValues[i] = settings._rationalParamValues[i];
557 #ifdef SOPLEX_WITH_RATIONALPARAM 558 SoPlex::Settings::RationalParam SoPlex::Settings::rationalParam;
1085 assert(ncols ==
_solver.
nCols() || (ncols == 0 && intInfo == NULL));
1709 if( i < _rationalLP->nRows() )
1735 for(
int i = 0; i < oldsize; i++ )
1801 if( i < _rationalLP->nCols() )
1827 for(
int i = 0; i < oldsize; i++ )
1933 #ifdef SOPLEX_WITH_GMP 1935 void SoPlex::addRowRational(
const mpq_t* lhs,
const mpq_t* rowValues,
const int* rowIndices,
const int rowSize,
const mpq_t* rhs)
1955 void SoPlex::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)
1962 _rationalLP->
addRows(lhs, rowValues, rowIndices, rowStarts, rowLengths, numRows, numValues, rhs);
2017 #ifdef SOPLEX_WITH_GMP 2019 void SoPlex::addColRational(
const mpq_t* obj,
const mpq_t* lower,
const mpq_t* colValues,
const int* colIndices,
const int colSize,
const mpq_t* upper)
2040 void SoPlex::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)
2047 _rationalLP->
addCols(obj, lower, colValues, colIndices, colStarts, colLengths, numCols, numValues, upper);
2143 #ifdef SOPLEX_WITH_GMP 2184 #ifdef SOPLEX_WITH_GMP 2193 for(
int i = 0; i < rhsSize; i++ )
2266 #ifdef SOPLEX_WITH_GMP 2346 #ifdef SOPLEX_WITH_GMP 2406 #ifdef SOPLEX_WITH_GMP 2466 #ifdef SOPLEX_WITH_GMP 2523 #ifdef SOPLEX_WITH_GMP 2560 #ifdef SOPLEX_WITH_GMP 2589 if( i < _rationalLP->nRows() )
2616 for(
int i = 0; i < oldsize; i++ )
2684 if( i < _rationalLP->nCols() )
2711 for(
int i = 0; i < oldsize; i++ )
2852 #ifdef SOPLEX_DEBUG // this check will remove scaling of the realLP 2863 #ifdef ENABLE_ADDITIONAL_CHECKS 2871 #ifdef ENABLE_ADDITIONAL_CHECKS 2879 #ifdef ENABLE_ADDITIONAL_CHECKS 3082 Real viol = lower - primal[i];
3086 if( viol > maxviol )
3090 viol = primal[i] - upper;
3094 if( viol > maxviol )
3124 Real viol = lhs - activity[i];
3128 if( viol > maxviol )
3132 viol = activity[i] - rhs;
3136 if( viol > maxviol )
3167 sumviol += -redcost[c];
3168 if( redcost[c] < -maxviol )
3169 maxviol = -redcost[c];
3173 sumviol += redcost[c];
3174 if( redcost[c] > maxviol )
3175 maxviol = redcost[c];
3182 sumviol += redcost[c];
3183 if( redcost[c] > maxviol )
3184 maxviol = redcost[c];
3188 sumviol += -redcost[c];
3189 if( redcost[c] < -maxviol )
3190 maxviol = -redcost[c];
3221 sumviol += -dual[r];
3222 if( dual[r] < -maxviol )
3228 if( dual[r] > maxviol )
3237 if( dual[r] > maxviol )
3242 sumviol += -dual[r];
3243 if( dual[r] < -maxviol )
3398 if( viol > maxviol )
3411 if( viol > maxviol )
3451 if( viol > maxviol )
3464 if( viol > maxviol )
3515 sumviol += -redcost[c];
3516 if( redcost[c] < -maxviol )
3518 MSG_DEBUG( std::cout <<
"increased reduced cost violation for column " << c <<
" not on upper bound: " <<
rationalToString(-redcost[c]) <<
"\n" );
3519 maxviol = -redcost[c];
3524 sumviol += redcost[c];
3525 if( redcost[c] > maxviol )
3527 MSG_DEBUG( std::cout <<
"increased reduced cost violation for column " << c <<
" not on lower bound: " <<
rationalToString(redcost[c]) <<
"\n" );
3528 maxviol = redcost[c];
3536 sumviol += redcost[c];
3537 if( redcost[c] > maxviol )
3539 MSG_DEBUG( std::cout <<
"increased reduced cost violation for column " << c <<
" not on upper bound: " <<
rationalToString(redcost[c]) <<
"\n" );
3540 maxviol = redcost[c];
3545 sumviol += -redcost[c];
3546 if( redcost[c] < -maxviol )
3548 MSG_DEBUG( std::cout <<
"increased reduced cost violation for column " << c <<
" not on lower bound: " <<
rationalToString(-redcost[c]) <<
"\n" );
3549 maxviol = -redcost[c];
3596 sumviol += -dual[r];
3597 if( dual[r] < -maxviol )
3599 MSG_DEBUG( std::cout <<
"increased dual violation for row " << r <<
" not on upper bound: " <<
rationalToString(-dual[r])
3610 if( dual[r] > maxviol )
3612 MSG_DEBUG( std::cout <<
"increased dual violation for row " << r <<
" not on lower bound: " <<
rationalToString(dual[r])
3626 if( dual[r] > maxviol )
3628 MSG_DEBUG( std::cout <<
"increased dual violation for row " << r <<
" not on upper bound: " <<
rationalToString(dual[r])
3638 sumviol += -dual[r];
3639 if( dual[r] < -maxviol )
3641 MSG_DEBUG( std::cout <<
"increased dual violation for row " << r <<
" not on lower bound: " <<
rationalToString(-dual[r])
3657 #ifdef SOPLEX_WITH_GMP 4146 int size = x.
size();
4148 for(
int i = 0; i < size; i++ )
4165 if( ninds != 0 && inds != 0 )
4170 for(
int i = 0; i < *ninds; ++i )
4220 for(
int i = 0; i < rhs.size(); ++i)
4257 if(
id.isSPxRowId() )
4264 coef[rowindex] = y[i];
4274 assert(coef[index] == 0.0);
4327 int size = x.
size();
4329 for(
int i = 0; i < size; i++ )
4356 if( ninds != 0 && inds != 0 )
4361 for(
int i = 0; i < *ninds; ++i )
4426 int size = rhs.size();
4429 for(
int i = 0; i < size; i++ )
4432 rhs.value(i) *=
spxLdexp(1.0, scaleExp);
4440 for(
int i = 0; i < size; i++ )
4467 if(
id.isSPxRowId() )
4480 assert(coef[index] == 0.0);
4526 for(
int i = 0; i < v.
dim(); ++i)
4537 for(
int i = 0; i < x.
dim(); i++ )
4582 if(
id.isSPxRowId() )
4591 rowrhs.add(i,
spxLdexp(v[idx], scaleExp));
4598 assert(rowrhs[i] == 0.0);
4647 x[i] =
spxLdexp(y[index], scaleExp);
4685 for(
int i = 0; i < basisdim; ++i)
4694 vec[i] =
spxLdexp(vec[i], scaleExp);
4698 for(
int i = 0; i < basisdim; ++i)
4701 vec[i] =
spxLdexp(vec[i], -scaleExp);
4716 Vector x(colbasisdim, vec);
4726 for(
int i = 0; i < colbasisdim; ++i)
4795 for(
int i = 0; i < basisdim; ++i)
4800 vec[i] =
spxLdexp(vec[i], scaleExp);
4804 for(
int i = 0; i < basisdim; ++i)
4813 vec[i] =
spxLdexp(vec[i], scaleExp);
4827 Vector x(colbasisdim, vec);
4837 for(
int i = 0; i < colbasisdim; ++i)
4964 MSG_INFO1(
spxout,
spxout <<
"Caught exception <" << E.
what() <<
"> while computing rational basis inverse column.\n" );
4989 MSG_INFO1(
spxout,
spxout <<
"Caught exception <" << E.
what() <<
"> during right solve with rational basis inverse.\n" );
5057 std::stringstream s;
5062 <<
"Solution time : " << std::setw(10) << std::fixed << std::setprecision(2) <<
solveTime() << std::endl
5063 <<
"Iterations : " << std::setw(10) <<
numIterations() << std::endl;
5123 bool success =
false;
5125 success =
_readFileReal(filename, rowNames, colNames, intVars);
5150 origLP->writeFile(filename, rowNames, colNames, intVars);
5151 origLP->~SPxLPReal();
5191 dualLP.
writeFile(filename, colNames, rowNames);
5204 assert(filename != 0);
5230 assert(filename != 0);
5246 const NameSet* colNamesPtr = colNames;
5250 std::stringstream name;
5253 tmpColNames =
new (tmpColNames)
NameSet();
5254 tmpColNames->
reMax(numCols);
5256 for(
int j = 0; j < numCols; ++j )
5259 tmpColNames->
add(name.str().c_str());
5262 colNamesPtr = tmpColNames;
5266 const NameSet* rowNamesPtr = rowNames;
5268 if( rowNamesPtr == 0 )
5270 std::stringstream name;
5273 tmpRowNames =
new (tmpRowNames)
NameSet();
5274 tmpRowNames->
reMax(numRows);
5276 for(
int i = 0; i < numRows; ++i )
5279 tmpRowNames->
add(name.str().c_str());
5282 rowNamesPtr = tmpRowNames;
5289 for(
int i = 0; i < numRows; i++ )
5292 for(
int i = 0; i < numCols; i++ )
5313 if( mps.
field0() != 0 && !strcmp(mps.
field0(),
"ENDATA") )
5325 if( *mps.
field1() ==
'X' )
5331 if( !strcmp(mps.
field1(),
"XU") )
5341 else if( !strcmp(mps.
field1(),
"XL") )
5351 else if( !strcmp(mps.
field1(),
"UL") )
5355 else if( !strcmp(mps.
field1(),
"LL") )
5394 assert(filename != 0);
5400 std::ofstream file(filename);
5404 file.setf(std::ios::left);
5405 file <<
"NAME " << filename <<
"\n";
5419 for(
int col = 0; col < numCols; col++ )
5426 for( ; row < numRows; row++ )
5433 assert(row != numRows);
5440 file << std::setw(8);
5441 if( colNames != 0 && colNames->
has(col) )
5442 file << (*colNames)[col];
5447 if( rowNames != 0 && rowNames->
has(row) )
5448 file << (*rowNames)[row];
5461 file << std::setw(8);
5462 if( colNames != 0 && colNames->
has(col) )
5463 file << (*colNames)[col];
5476 for( ; row < numRows; row++ )
5495 ofname = std::string(filename) +
".set";
5499 ofname = std::string(filename) + ((cpxFormat) ?
".lp" :
".mps");
5503 ofname = std::string(filename) +
".bas";
5516 ofname = std::string(filename) +
".set";
5520 ofname = std::string(filename) + ((cpxFormat) ?
".lp" :
".mps");
5524 ofname = std::string(filename) +
".bas";
5560 #ifdef SOPLEX_WITH_RATIONALPARAM 5562 Rational SoPlex::rationalParam(
const RationalParam param)
const 5565 assert(param < RATIONALPARAM_COUNT);
5587 if( !init && value ==
boolParam(param) )
5643 if( !init && value ==
intParam(param) )
5997 if( !init && value ==
realParam(param) )
6004 Real tmp_value = value;
6010 #ifndef SOPLEX_WITH_GMP 6024 #ifndef SOPLEX_WITH_GMP 6146 #ifdef SOPLEX_WITH_RATIONALPARAM 6148 bool SoPlex::setRationalParam(
const RationalParam param,
const Rational value,
const bool init)
6151 assert(param < RATIONALPARAM_COUNT);
6154 if( !init && value == rationalParam(param) )
6157 if( value < _currentSettings->rationalParam.lower[param] || value >
_currentSettings->rationalParam.upper[param] )
6179 bool success =
true;
6192 #ifdef SOPLEX_WITH_RATIONALPARAM 6193 for(
int i = 0; i < SoPlex::RATIONALPARAM_COUNT; i++ )
6194 success &= setRationalParam((RationalParam)i,
_currentSettings->_rationalParamValues[i], init);
6214 #ifdef SOPLEX_WITH_RATIONALPARAM 6215 for(
int i = 0; i < SoPlex::RATIONALPARAM_COUNT; i++ )
6216 success &= setRationalParam((RationalParam)i,
_currentSettings->rationalParam.defaultValue[i], init);
6224 bool printedValue =
false;
6234 printedValue =
true;
6243 printedValue =
true;
6254 printedValue =
true;
6257 #ifdef SOPLEX_WITH_RATIONALPARAM 6258 for(
int i = 0; i < SoPlex::RATIONALPARAM_COUNT; i++ )
6264 printedValue =
true;
6271 printedValue =
true;
6283 assert(filename != 0);
6285 std::ofstream file(filename);
6291 file.setf(std::ios::left);
6296 #if SOPLEX_SUBVERSION > 0 6338 #ifdef SOPLEX_WITH_RATIONALPARAM 6339 for(
int i = 0; i < SoPlex::RATIONALPARAM_COUNT; i++ )
6347 <<
"], default " <<
_currentSettings->rationalParam.defaultValue[i] <<
"\n";
6355 file <<
"# initial random seed used for perturbation\n";
6368 assert(filename != 0);
6387 bool readError =
false;
6388 bool parseError =
false;
6390 while( !readError && !parseError)
6393 readError = !file.getline(line,
sizeof(line));
6397 readError = readError && !file.eof();
6403 else if( readError )
6417 assert(
string != 0);
6424 char* line = parseString;
6427 while( *line ==
' ' || *line ==
'\t' || *line ==
'\r' )
6429 if( *line ==
'\0' || *line ==
'\n' || *line ==
'#' )
6431 char* paramTypeString = line;
6434 while( *line !=
' ' && *line !=
'\t' && *line !=
'\r' && *line !=
'\n' && *line !=
'#' && *line !=
'\0' && *line !=
':' )
6447 while( *line ==
' ' || *line ==
'\t' || *line ==
'\r' )
6451 MSG_INFO1(
spxout,
spxout <<
"Error parsing setting string: no ':' separating parameter type and name.\n" );
6458 while( *line ==
' ' || *line ==
'\t' || *line ==
'\r' )
6460 if( *line ==
'\0' || *line ==
'\n' || *line ==
'#' )
6465 char* paramName = line;
6468 while( *line !=
' ' && *line !=
'\t' && *line !=
'\r' && *line !=
'\n' && *line !=
'#' && *line !=
'\0' && *line !=
'=' )
6481 while( *line ==
' ' || *line ==
'\t' || *line ==
'\r' )
6492 while( *line ==
' ' || *line ==
'\t' || *line ==
'\r' )
6494 if( *line ==
'\0' || *line ==
'\n' || *line ==
'#' )
6499 char* paramValueString = line;
6502 while( *line !=
' ' && *line !=
'\t' && *line !=
'\r' && *line !=
'\n' && *line !=
'#' && *line !=
'\0' )
6509 while( *line ==
' ' || *line ==
'\t' || *line ==
'\r' )
6511 if( *line !=
'\0' && *line !=
'\n' && *line !=
'#' )
6513 MSG_INFO1(
spxout,
spxout <<
"Error parsing setting string: additional character '" << *line <<
"' after parameter value.\n" );
6519 if( strncmp(paramTypeString,
"bool", 4) == 0 )
6521 for(
int param = 0; ; param++ )
6525 MSG_INFO1(
spxout,
spxout <<
"Error parsing setting string: unknown parameter name <" << paramName <<
">.\n" );
6530 if( strncasecmp(paramValueString,
"true", 4) == 0
6531 || strncasecmp(paramValueString,
"TRUE", 4) == 0
6532 || strncasecmp(paramValueString,
"t", 4) == 0
6533 || strncasecmp(paramValueString,
"T", 4) == 0
6534 || strtol(paramValueString, NULL, 4) == 1 )
6539 else if( strncasecmp(paramValueString,
"false", 5) == 0
6540 || strncasecmp(paramValueString,
"FALSE", 5) == 0
6541 || strncasecmp(paramValueString,
"f", 5) == 0
6542 || strncasecmp(paramValueString,
"F", 5) == 0
6543 || strtol(paramValueString, NULL, 5) == 0 )
6550 MSG_INFO1(
spxout,
spxout <<
"Error parsing setting string: invalid value <" << paramValueString <<
"> for bool parameter <" << paramName <<
">.\n" );
6560 if( strncmp(paramTypeString,
"int", 3) == 0 )
6562 for(
int param = 0; ; param++ )
6566 MSG_INFO1(
spxout,
spxout <<
"Error parsing setting string: unknown parameter name <" << paramName <<
">.\n" );
6572 value = std::stoi(paramValueString);
6578 MSG_INFO1(
spxout,
spxout <<
"Error parsing setting string: invalid value <" << paramValueString <<
"> for int parameter <" << paramName <<
">.\n" );
6588 if( strncmp(paramTypeString,
"real", 4) == 0 )
6590 for(
int param = 0; ; param++ )
6594 MSG_INFO1(
spxout,
spxout <<
"Error parsing setting string: unknown parameter name <" << paramName <<
">.\n" );
6600 #ifdef WITH_LONG_DOUBLE 6601 value = std::stold(paramValueString);
6604 value = std::stof(paramValueString);
6606 value = std::stod(paramValueString);
6614 MSG_INFO1(
spxout,
spxout <<
"Error parsing setting string: invalid value <" << paramValueString <<
"> for real parameter <" << paramName <<
">.\n" );
6623 #ifdef SOPLEX_WITH_RATIONALPARAM 6625 if( strncmp(paramTypeString,
"rational", 8) == 0 )
6627 for(
int param = 0; ; param++ )
6629 if( param >= SoPlex::RATIONALPARAM_COUNT )
6631 MSG_INFO1(
spxout,
spxout <<
"Error parsing setting string: unknown parameter name <" << paramName <<
">.\n" );
6638 if(
readStringRational(paramValueString, value) && setRationalParam((SoPlex::RationalParam)param, value) )
6642 MSG_INFO1(
spxout,
spxout <<
"Error parsing setting string: invalid value <" << paramValueString <<
"> for rational parameter <" << paramName <<
">.\n" );
6653 if( strncmp(paramTypeString,
"uint", 4) == 0 )
6655 if( strncmp(paramName,
"random_seed", 11) == 0 )
6658 unsigned long parseval;
6660 parseval = std::stoul(paramValueString);
6661 if( parseval > UINT_MAX )
6667 value = (
unsigned int) parseval;
6677 MSG_INFO1(
spxout,
spxout <<
"Error parsing setting string: invalid parameter type <" << paramTypeString <<
"> for parameter <" << paramName <<
">.\n" );
6691 os <<
"Solution (real) : \n" 6696 os <<
"Solution (rational) : \n" 6698 os <<
"Size (base 2/10) : \n" 6708 os <<
"Solution : \n" 6709 <<
" Objective value : -\n";
6718 os <<
"Violation (rational): \n";
6722 os <<
" Max/sum bound : - / -\n";
6726 os <<
" Max/sum row : - / -\n";
6730 os <<
" Max/sum redcost : - / -\n";
6734 os <<
" Max/sum dual : - / -\n";
6741 os <<
"Violations (real) : \n";
6743 os <<
" Max/sum bound : " << maxviol <<
" / " << sumviol <<
"\n";
6745 os <<
" Max/sum bound : - / -\n";
6747 os <<
" Max/sum row : " << maxviol <<
" / " << sumviol <<
"\n";
6749 os <<
" Max/sum row : - / -\n";
6751 os <<
" Max/sum redcost : " << maxviol <<
" / " << sumviol <<
"\n";
6753 os <<
" Max/sum redcost : - / -\n";
6755 os <<
" Max/sum dual : " << maxviol <<
" / " << sumviol <<
"\n";
6757 os <<
" Max/sum dual : - / -\n";
6791 os <<
"Original problem : \n";
6810 os <<
"SoPlex status : ";
6815 os <<
"error [unspecified]";
6818 os <<
"error [no ratiotester loaded]";
6821 os <<
"error [no pricer loaded]";
6824 os <<
"error [no linear solver loaded]";
6827 os <<
"error [not initialized]";
6830 os <<
"solving aborted [cycling]";
6833 os <<
"solving aborted [time limit reached]";
6836 os <<
"solving aborted [iteration limit reached]";
6839 os <<
"solving aborted [objective limit reached]";
6842 os <<
"no problem loaded";
6845 os <<
"basis is regular";
6848 os <<
"basis is singular";
6851 os <<
"problem is solved [optimal]";
6854 os <<
"problem is solved [unbounded]";
6857 os <<
"problem is solved [infeasible]";
6860 os <<
"problem is solved [infeasible or unbounded]";
6863 os <<
"problem is solved [optimal with unscaled violations]";
6880 #if (SOPLEX_SUBVERSION > 0) 6899 #ifdef SOPLEX_WITH_GMP 6920 bool nRowsMatch =
true;
6921 bool nColsMatch =
true;
6922 bool rhsDimMatch =
true;
6923 bool lhsDimMatch =
true;
6924 bool maxObjDimMatch =
true;
6925 bool upperDimMatch =
true;
6926 bool lowerDimMatch =
true;
6931 MSG_INFO1(
spxout,
spxout <<
"The number of Rows in the Real LP does not match the one in the Rational LP." 6940 MSG_INFO1(
spxout,
spxout <<
"The number of Columns in the Real LP does not match the one in the Rational LP." 6949 MSG_INFO1(
spxout,
spxout <<
"The number of nonZeros in the Real LP does not match the one in the Rational LP." 6957 MSG_INFO1(
spxout,
spxout <<
"The dimension of the right hand side vector of the Real LP does not match the one of the Rational LP." 6960 rhsDimMatch =
false;
6967 MSG_INFO1(
spxout,
spxout <<
"The dimension of the left hand side vector of the Real LP does not match the one of the Rational LP." 6970 lhsDimMatch =
false;
6976 MSG_INFO1(
spxout,
spxout <<
"The dimension of the objective function vector of the Real LP does not match the one of the Rational LP." 6979 maxObjDimMatch =
false;
6985 MSG_INFO1(
spxout,
spxout <<
"The objective function sense of the Real LP does not match the one of the Rational LP." 6994 MSG_INFO1(
spxout,
spxout <<
"The dimension of the upper bound vector of the Real LP does not match the one of the Rational LP." 6997 upperDimMatch =
false;
7003 MSG_INFO1(
spxout,
spxout <<
"The dimension of the lower bound vector of the Real LP does not match the one of the Rational LP." 7006 lowerDimMatch =
false;
7012 bool rhsValMatch =
true;
7013 bool lhsValMatch =
true;
7014 bool maxObjValMatch =
true;
7015 bool upperValMatch =
true;
7016 bool lowerValMatch =
true;
7021 for(
int i = 0; i <
_realLP->
rhs().dim(); i++ )
7029 MSG_INFO1(
spxout,
spxout <<
"Entries number " << i <<
" of the right hand side vectors don't match." 7032 rhsValMatch =
false;
7037 if( !rhsValMatch && quiet )
7039 MSG_INFO1(
spxout,
spxout <<
"The values of the right hand side vectors don't match." << std::endl );
7046 for(
int i = 0; i <
_realLP->
lhs().dim(); i++ )
7054 MSG_INFO1(
spxout,
spxout <<
"Entries number " << i <<
" of the left hand side vectors don't match." 7057 lhsValMatch =
false;
7062 if( !lhsValMatch && quiet )
7064 MSG_INFO1(
spxout,
spxout <<
"The values of the left hand side vectors don't match." << std::endl );
7069 if( maxObjDimMatch )
7077 MSG_INFO1(
spxout,
spxout <<
"Entries number " << i <<
" of the objective function vectors don't match." 7080 maxObjValMatch =
false;
7085 if( !maxObjValMatch && quiet )
7087 MSG_INFO1(
spxout,
spxout <<
"The values of the objective function vectors don't match." << std::endl );
7105 upperValMatch =
false;
7110 if( !upperValMatch && quiet )
7130 lowerValMatch =
false;
7135 if( !lowerValMatch && quiet )
7143 if( checkMatVals && nRowsMatch && nColsMatch )
7145 bool matrixValMatch =
true;
7158 matrixValMatch =
false;
7164 if( !matrixValMatch && quiet )
7194 assert(newmax > vec.
size());
7205 assert(idxSize >= 0);
7207 assert(permSize >= 0);
7209 for(
int i = 0; i < permSize; i++ )
7212 for(
int i = 0; i < idxSize; i++ )
7214 assert(idx[i] >= 0);
7215 assert(idx[i] < permSize);
7226 assert(permSize >= 0);
7228 for(
int i = 0; i < permSize; i++ )
7229 perm[i] = (i < start || i > end) ? i : -1;
7270 return stoppedTime || stoppedIter;
7278 assert(lower <= upper);
7291 else if( lower == upper )
7303 assert(lower <= upper);
7316 else if( lower == upper )
7462 for(
int i = 0; i < lpcolset.
num(); i++ )
7863 else if( perm[i] >= 0 && perm[i] != i )
7866 assert(perm[perm[i]] < 0);
7927 else if( perm[i] >= 0 && perm[i] != i )
7930 assert(perm[perm[i]] < 0);
8185 bool success =
_realLP->
readFile(filename, rowNames, colNames, intVars);
8391 while( *line ==
' ' || *line ==
'\t' || *line ==
'\r' )
8393 if( *line ==
'\0' || *line ==
'\n' || *line ==
'#' )
8395 char* paramTypeString = line;
8398 while( *line !=
' ' && *line !=
'\t' && *line !=
'\r' && *line !=
'\n' && *line !=
'#' && *line !=
'\0' && *line !=
':' )
8411 while( *line ==
' ' || *line ==
'\t' || *line ==
'\r' )
8415 MSG_INFO1(
spxout,
spxout <<
"Error parsing settings file: no ':' separating parameter type and name in line " << lineNumber <<
".\n" );
8422 while( *line ==
' ' || *line ==
'\t' || *line ==
'\r' )
8424 if( *line ==
'\0' || *line ==
'\n' || *line ==
'#' )
8426 MSG_INFO1(
spxout,
spxout <<
"Error parsing settings file: no parameter name in line " << lineNumber <<
".\n");
8429 char* paramName = line;
8432 while( *line !=
' ' && *line !=
'\t' && *line !=
'\r' && *line !=
'\n' && *line !=
'#' && *line !=
'\0' && *line !=
'=' )
8445 while( *line ==
' ' || *line ==
'\t' || *line ==
'\r' )
8449 MSG_INFO1(
spxout,
spxout <<
"Error parsing settings file: no '=' after parameter name in line " << lineNumber <<
".\n" );
8456 while( *line ==
' ' || *line ==
'\t' || *line ==
'\r' )
8458 if( *line ==
'\0' || *line ==
'\n' || *line ==
'#' )
8460 MSG_INFO1(
spxout,
spxout <<
"Error parsing settings file: no parameter value in line " << lineNumber <<
".\n");
8463 char* paramValueString = line;
8466 while( *line !=
' ' && *line !=
'\t' && *line !=
'\r' && *line !=
'\n' && *line !=
'#' && *line !=
'\0' )
8473 while( *line ==
' ' || *line ==
'\t' || *line ==
'\r' )
8475 if( *line !=
'\0' && *line !=
'\n' && *line !=
'#' )
8477 MSG_INFO1(
spxout,
spxout <<
"Error parsing settings file: additional character '" << *line <<
"' after parameter value in line " << lineNumber <<
".\n" );
8483 if( strncmp(paramTypeString,
"bool", 4) == 0 )
8485 for(
int param = 0; ; param++ )
8489 MSG_INFO1(
spxout,
spxout <<
"Error parsing settings file: unknown parameter name <" << paramName <<
"> in line " << lineNumber <<
".\n" );
8494 if( strncasecmp(paramValueString,
"true", 4) == 0
8495 || strncasecmp(paramValueString,
"TRUE", 4) == 0
8496 || strncasecmp(paramValueString,
"t", 4) == 0
8497 || strncasecmp(paramValueString,
"T", 4) == 0
8498 || strtol(paramValueString, NULL, 4) == 1 )
8503 else if( strncasecmp(paramValueString,
"false", 5) == 0
8504 || strncasecmp(paramValueString,
"FALSE", 5) == 0
8505 || strncasecmp(paramValueString,
"f", 5) == 0
8506 || strncasecmp(paramValueString,
"F", 5) == 0
8507 || strtol(paramValueString, NULL, 5) == 0 )
8514 MSG_INFO1(
spxout,
spxout <<
"Error parsing settings file: invalid value <" << paramValueString <<
"> for bool parameter <" << paramName <<
"> in line " << lineNumber <<
".\n" );
8524 if( strncmp(paramTypeString,
"int", 3) == 0 )
8526 for(
int param = 0; ; param++ )
8530 MSG_INFO1(
spxout,
spxout <<
"Error parsing settings file: unknown parameter name <" << paramName <<
"> in line " << lineNumber <<
".\n" );
8536 value = std::stoi(paramValueString);
8542 MSG_INFO1(
spxout,
spxout <<
"Error parsing settings file: invalid value <" << paramValueString <<
"> for int parameter <" << paramName <<
"> in line " << lineNumber <<
".\n" );
8552 if( strncmp(paramTypeString,
"real", 4) == 0 )
8554 for(
int param = 0; ; param++ )
8558 MSG_INFO1(
spxout,
spxout <<
"Error parsing settings file: unknown parameter name <" << paramName <<
"> in line " << lineNumber <<
".\n" );
8565 #ifdef WITH_LONG_DOUBLE 8566 value = std::stold(paramValueString);
8569 value = std::stof(paramValueString);
8571 value = std::stod(paramValueString);
8578 MSG_INFO1(
spxout,
spxout <<
"Error parsing settings file: invalid value <" << paramValueString <<
"> for real parameter <" << paramName <<
"> in line " << lineNumber <<
".\n" );
8587 #ifdef SOPLEX_WITH_RATIONALPARAM 8589 if( strncmp(paramTypeString,
"rational", 8) == 0 )
8591 for(
int param = 0; ; param++ )
8593 if( param >= SoPlex::RATIONALPARAM_COUNT )
8595 MSG_INFO1(
spxout,
spxout <<
"Error parsing settings file: unknown parameter name <" << paramName <<
"> in line " << lineNumber <<
".\n" );
8602 if(
readStringRational(paramValueString, value) && setRationalParam((SoPlex::RationalParam)param, value) )
8606 MSG_INFO1(
spxout,
spxout <<
"Error parsing settings file: invalid value <" << paramValueString <<
"> for rational parameter <" << paramName <<
"> in line " << lineNumber <<
".\n" );
8617 if( strncmp(paramTypeString,
"uint", 4) == 0 )
8619 if( strncmp(paramName,
"random_seed", 11) == 0 )
8622 unsigned long parseval;
8624 parseval = std::stoul(paramValueString);
8625 if( parseval > UINT_MAX )
8631 value = (
unsigned int) parseval;
8641 MSG_INFO1(
spxout,
spxout <<
"Error parsing settings file: invalid parameter type <" << 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