45 #ifndef SOPLEX_WITH_BOOST 46 throw SPxException(
"Rational functions cannot be used when built without Boost.");
86 for(
int i = 0; i < colsize; ++i)
88 if(colentries[i] != 0.0)
89 col.
add(i, colentries[i]);
92 so->addColReal(
LPCol(objval, col, ub, lb));
110 #ifndef SOPLEX_WITH_BOOST 111 throw SPxException(
"Rational functions cannot be used when built without Boost.");
123 Rational objval(objvalnum, objvaldenom);
126 for(
int i = 0; i < colsize; ++i)
131 Rational colentry(colnums[i], coldenoms[i]);
132 col.
add(i, colentry);
136 so->addColRational(
LPColRational(objval, col, upper, lower));
153 for(
int i = 0; i < rowsize; ++i)
155 if(rowentries[i] != 0.0)
156 row.
add(i, rowentries[i]);
159 so->addRowReal(
LPRow(lb, row, ub));
175 #ifndef SOPLEX_WITH_BOOST 176 throw SPxException(
"Rational functions cannot be used when built without Boost.");
188 for(
int i = 0; i < rowsize; ++i)
193 Rational rowentry(rownums[i], rowdenoms[i]);
194 row.
add(i, rowentry);
205 so->getPrimalReal(primal, dim);
213 #ifndef SOPLEX_WITH_BOOST 214 throw SPxException(
"Rational functions cannot be used when built without Boost.");
218 std::string primalstring;
221 so->getPrimalRational(primal);
223 for(
int i = 0; i < dim; ++i)
225 primalstring.append(primal[i].str());
226 primalstring.append(
" ");
229 rawstring =
new char[strlen(primalstring.c_str()) + 1];
230 strcpy(rawstring, primalstring.c_str());
238 so->getDualReal(dual, dim);
245 return so->optimize();
252 Vector objective(dim, obj);
253 return so->changeObjReal(objective);
259 #ifndef SOPLEX_WITH_BOOST 260 throw SPxException(
"Rational functions cannot be used when built without Boost.");
266 for(
int i = 0; i < dim; ++i)
268 Rational objentry(objnums[i], objdenoms[i]);
269 objrational[i] = objentry;
273 return so->changeObjRational(objective);
281 return so->changeLhsReal(lhsvec);
287 #ifndef SOPLEX_WITH_BOOST 288 throw SPxException(
"Rational functions cannot be used when built without Boost.");
294 for(
int i = 0; i < dim; ++i)
296 Rational lhsentry(lhsnums[i], lhsdenoms[i]);
297 lhsrational[i] = lhsentry;
301 return so->changeLhsRational(lhs);
309 return so->changeRhsReal(rhsvec);
315 #ifndef SOPLEX_WITH_BOOST 316 throw SPxException(
"Rational functions cannot be used when built without Boost.");
322 for(
int i = 0; i < dim; ++i)
324 Rational rhsentry(rhsnums[i], rhsdenoms[i]);
325 rhsrational[i] = rhsentry;
329 return so->changeRhsRational(rhs);
336 so->writeFile(filename);
343 return so->objValueReal();
351 #ifndef SOPLEX_WITH_BOOST 352 throw SPxException(
"Rational functions cannot be used when built without Boost.");
355 std::string objstring;
357 objstring = so->objValueRational().str();
358 value =
new char[strlen(objstring.c_str()) + 1];
359 strcpy(value, objstring.c_str());
369 return so->changeBoundsReal(lbvec, ubvec);
376 return so->changeBoundsReal(colidx, lb, ub);
389 #ifndef SOPLEX_WITH_BOOST 390 throw SPxException(
"Rational functions cannot be used when built without Boost.");
400 return so->changeBoundsRational(colidx, lower, upper);
407 return so->changeLowerReal(colidx, ub);
416 so->getLowerReal(ubvec);
418 for(
int i = 0; i < dim; ++i)
number< gmp_rational, et_off > Rational
void SoPlex_getUpperReal(void *soplex, double *ub, int dim)
int SoPlex_numRows(void *soplex)
void SoPlex_clearLPReal(void *soplex)
void SoPlex_setRational(void *soplex)
LPRowBase< Rational > LPRowRational
automatic sync of real and rational LP
void SoPlex_changeLhsRational(void *soplex, long *lhsnums, long *lhsdenoms, int dim)
dual feasibility tolerance
Dynamic sparse vectors.Class DSVectorBase implements dynamic sparse vectors, i.e. SVectorBases with a...
void SoPlex_changeObjReal(void *soplex, double *obj, int dim)
void SoPlex_addRowRational(void *soplex, long *rownums, long *rowdenoms, int rowsize, int nnonzeros, long lbnum, long lbdenom, long ubnum, long ubdenom)
int SoPlex_optimize(void *soplex)
void SoPlex_free(void *soplex)
mode for a posteriori feasibility checks
void add(const SVectorBase< S > &vec)
Append nonzeros of sv.
void SoPlex_writeFileReal(void *soplex, char *filename)
void SoPlex_addRowReal(void *soplex, double *rowentries, int rowsize, int nnonzeros, double lb, double ub)
void SoPlex_getPrimalReal(void *soplex, double *primal, int dim)
void SoPlex_changeObjRational(void *soplex, long *objnums, long *objdenoms, int dim)
primal feasibility tolerance
void SoPlex_changeRhsRational(void *soplex, long *rhsnums, long *rhsdenoms, int dim)
void SoPlex_getDualReal(void *soplex, double *dual, int dim)
IntParam
integer parameters
void SoPlex_changeVarBoundsRational(void *soplex, int colidx, long lbnum, long lbdenom, long ubnum, long ubdenom)
void SoPlex_changeVarUpperReal(void *soplex, int colidx, double ub)
void SoPlex_changeLhsReal(void *soplex, double *lhs, int dim)
LPColBase< Rational > LPColRational
Preconfigured SoPlex LP solver.
Preconfigured SoPlex LP-solver.
char * SoPlex_getPrimalRationalString(void *soplex, int dim)
void SoPlex_changeBoundsReal(void *soplex, double *lb, double *ub, int dim)
Exception base class.This class implements a base class for our SoPlex exceptions We provide a what()...
Everything should be within this namespace.
force iterative refinement
mode for iterative refinement strategy
mode for reading LP files
int SoPlex_getIntParam(void *soplex, int paramcode)
SoPlexBase< Real > SoPlex
void SoPlex_changeVarBoundsReal(void *soplex, int colidx, double lb, double ub)
void SoPlex_changeRhsReal(void *soplex, double *rhs, int dim)
void SoPlex_setIntParam(void *soplex, int paramcode, int paramvalue)
int SoPlex_numCols(void *soplex)
mode for synchronizing real and rational LP
void SoPlex_addColRational(void *soplex, long *colnums, long *coldenoms, int colsize, int nnonzeros, long objvalnum, long objvaldenom, long lbnum, long lbdenom, long ubnum, long ubdenom)
void SoPlex_addColReal(void *soplex, double *colentries, int colsize, int nnonzeros, double objval, double lb, double ub)
double SoPlex_objValueReal(void *soplex)
char * SoPlex_objValueRationalString(void *soplex)