Scippy

SoPlex

Sequential object-oriented simPlex

solvereal.cpp
Go to the documentation of this file.
1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2 /* */
3 /* This file is part of the class library */
4 /* SoPlex --- the Sequential object-oriented simPlex. */
5 /* */
6 /* Copyright (C) 1996-2019 Konrad-Zuse-Zentrum */
7 /* fuer Informationstechnik Berlin */
8 /* */
9 /* SoPlex is distributed under the terms of the ZIB Academic Licence. */
10 /* */
11 /* You should have received a copy of the ZIB Academic License */
12 /* along with SoPlex; see the file COPYING. If not email to soplex@zib.de. */
13 /* */
14 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
15 
16 #include <iostream>
17 #include <assert.h>
18 
19 #include "soplex.h"
20 #include "soplex/statistics.h"
21 
22 #define ALLOWED_UNSCALE_PERCENTAGE 0.1
23 #define MIN_OPT_CALLS_WITH_SCALING 10
24 
25 namespace soplex
26 {
27 /// solves real LP
29 {
30  assert(_realLP != 0);
31  assert(_realLP == &_solver);
32 
35 
36  // start timing
38 
40  {
41  // scale original problem; overwriting _realLP
43  {
44 #ifdef SOPLEX_DEBUG
45  SPxLPReal* origLP = 0;
46  spx_alloc(origLP);
47  origLP = new(origLP) SPxLPReal(*_realLP);
48 #endif
49  _scaler->scale(*_realLP, true);
50  _isRealLPScaled = _realLP->isScaled(); // a scaler might decide not to apply scaling
51 #ifdef SOPLEX_DEBUG
52  _checkScaling(origLP);
53 #endif
54  }
55  // unscale previously scaled problem, overwriting _realLP
56  else if(!_scaler && _realLP->isScaled())
57  {
59  _isRealLPScaled = false;
60  ++_unscaleCalls;
61  }
62  }
63 
64  // remember that last solve was in floating-point
66 
67  // solve and store solution; if we have a starting basis, do not apply preprocessing; if we are solving from
68  // scratch, apply preprocessing according to parameter settings
72  else
74 
76 
77  // stop timing
79 }
80 
81 
82 
83 /// check whether persistent scaling is supposed to be reapplied again after unscaling
85 {
88  return false;
89  else
90  return true;
91 }
92 
93 
94 
95 /// checks result of the solving process and solves again without preprocessing if necessary
97 {
98  // if the simplifier detected infeasibility or unboundedness we optimize again
99  // just to get the proof (primal or dual ray)
100  // todo get infeasibility proof from simplifier
101  switch(simplificationStatus)
102  {
106  _hasBasis = false;
107 
109  {
111  "simplifier detected infeasibility or unboundedness - solve again without simplifying" << std::endl;
112  )
114  }
115  else
116  {
117  if(simplificationStatus == SPxSimplifier::INFEASIBLE)
119  else if(simplificationStatus == SPxSimplifier::UNBOUNDED)
121  else
123 
124  // load original LP to restore clean solver state
125  _loadRealLP(false);
126  }
127 
128  return;
129 
133  return;
134 
135  case SPxSimplifier::OKAY:
136  _status = _solver.status();
137  }
138 
139  // process result
140  switch(_status)
141  {
142  case SPxSolver::OPTIMAL:
144 
145  // apply polishing on original problem
146  if(_applyPolishing)
147  {
148  int polishing = intParam(SoPlex::SOLUTION_POLISHING);
151  }
152 
153  break;
154 
158 
159  // in case of infeasibility or unboundedness, we currently can not unsimplify, but have to solve the original LP again
161  {
162  MSG_INFO1(spxout, spxout << " --- loading original problem" << std::endl;)
164  // we cannot do more to remove violations
165  _resolveWithoutPreprocessing(simplificationStatus);
166  }
167  else
168  {
169  _storeSolutionReal(false);
170  }
171 
172  break;
173 
174  case SPxSolver::SINGULAR:
175 
176  // if preprocessing was applied, try to run again without to avoid singularity
177  if(!_isRealLPLoaded)
178  {
179  MSG_INFO1(spxout, spxout << "encountered singularity - trying to solve again without simplifying" <<
180  std::endl;)
182  return;
183  }
184 
185  _hasBasis = false;
186  break;
187 
189 
190  // if preprocessing or scaling was applied, try to run again without to avoid cycling
192  {
193  MSG_INFO1(spxout, spxout << "encountered cycling - trying to solve again without simplifying" <<
194  std::endl;)
195  // store and unsimplify sub-optimal solution and basis, may trigger re-solve
196  _storeSolutionReal(true);
197  return;
198  }
199 
202 
203  break;
204 
205  // FALLTHROUGH
209  case SPxSolver::REGULAR:
210  case SPxSolver::RUNNING:
211  _storeSolutionReal(false);
212  break;
213 
214  default:
215  _hasBasis = false;
216  break;
217  }
218 }
219 
220 
221 
222 /// solves real LP with/without preprocessing
223 void SoPlex::_preprocessAndSolveReal(bool applySimplifier)
224 {
227 
228  _applyPolishing = false;
229 
230  if(applySimplifier)
232  else
234 
235  // create a copy of the LP when simplifying or when using internal scaling, i.e. w/o persistent scaling
236  bool copyLP = (_simplifier != 0 || (_scaler && !_isRealLPScaled));
237 
240 
241  if(_isRealLPLoaded)
242  {
243  assert(_realLP == &_solver);
244 
245  // preprocessing is always applied to the LP in the solver; hence we have to create a copy of the original LP
246  // if simplifier is turned on
247  if(copyLP)
248  {
249  _realLP = 0;
252  _isRealLPLoaded = false;
253  }
254  }
255  else
256  {
257  assert(_realLP != &_solver);
258 
259  // load real LP and basis if available
260  if(_hasBasis)
261  {
262  assert(_basisStatusRows.size() == numRowsReal());
263  assert(_basisStatusCols.size() == numColsReal());
264 
265  _solver.loadLP(*_realLP, false);
267  }
268  // load real LP and set up slack basis
269  else
270  _solver.loadLP(*_realLP, true);
271 
272  // if there is no simplifier, then the original and the transformed problem are identical and it is more
273  // memory-efficient to keep only the problem in the solver
274  if(!copyLP)
275  {
276  _realLP->~SPxLPReal();
277  spx_free(_realLP);
278  _realLP = &_solver;
279  _isRealLPLoaded = true;
280  }
281  }
282 
283  // assert that we have two problems if and only if we apply the simplifier
284  assert(_realLP == &_solver || copyLP);
285  assert(_realLP != &_solver || !copyLP);
286 
287  // apply problem simplification
288  SPxSimplifier::Result simplificationStatus = SPxSimplifier::OKAY;
289 
290  if(_simplifier)
291  {
292  assert(!_isRealLPLoaded);
293  // do not remove bounds of boxed variables or sides of ranged rows if bound flipping is used; also respect row-boundflip parameter
295 
299  keepbounds &= boolParam(SoPlex::ROWBOUNDFLIPS);
300 
301  simplificationStatus = _simplifier->simplify(_solver, realParam(SoPlex::EPSILON_ZERO),
304  _solver.setScalingInfo(false);
305  _applyPolishing = true;
307  }
308 
310 
311  // run the simplex method if problem has not been solved by the simplifier
312  if(simplificationStatus == SPxSimplifier::OKAY)
313  {
314  if(_scaler && !_solver.isScaled())
315  {
316  _scaler->scale(_solver, false);
317  }
318 
320  }
321 
322  _evaluateSolutionReal(simplificationStatus);
323 }
324 
325 
326 
327 /// loads original problem into solver and solves again after it has been solved to infeasibility or unboundedness with preprocessing
329 {
330  assert(!_isRealLPLoaded || _scaler != 0);
331  assert(_simplifier != 0 || _scaler != 0);
334 
335  // if simplifier was active, then we unsimplify to get the basis
336  if(_simplifier)
337  {
338  assert(!_simplifier->isUnsimplified());
339  assert(simplificationStatus == SPxSimplifier::OKAY);
340 
341  // get temporary solution vectors for transformed problem
342  DVectorReal primal(_solver.nCols());
343  DVectorReal slacks(_solver.nRows());
344  DVectorReal dual(_solver.nRows());
345  DVectorReal redCost(_solver.nCols());
346 
349  assert(_basisStatusRows.size() >= _solver.nRows());
350  assert(_basisStatusCols.size() >= _solver.nCols());
351 
352  // get solution data from transformed problem
353  _solver.getPrimal(primal);
354  _solver.getSlacks(slacks);
355  _solver.getDual(dual);
356  _solver.getRedCost(redCost);
357 
358  // unscale vectors
359  if(_scaler && _solver.isScaled())
360  {
361  _scaler->unscalePrimal(_solver, primal);
362  _scaler->unscaleSlacks(_solver, slacks);
363  _scaler->unscaleDual(_solver, dual);
364  _scaler->unscaleRedCost(_solver, redCost);
365  }
366 
367  // get basis of transformed problem
370 
371  try
372  {
373  _simplifier->unsimplify(primal, dual, slacks, redCost, _basisStatusRows.get_ptr(),
374  _basisStatusCols.get_ptr(), false);
377  _hasBasis = true;
378  }
379  catch(const SPxException& E)
380  {
381  MSG_INFO1(spxout, spxout << "Caught exception <" << E.what() <<
382  "> during unsimplification. Resolving without simplifier and scaler.\n");
383  _hasBasis = false;
384  }
385  }
386  // if the original problem is not in the solver because of scaling, we also need to store the basis
387  else if(_scaler != 0)
388  {
391  assert(_basisStatusRows.size() == _solver.nRows());
392  assert(_basisStatusCols.size() == _solver.nCols());
393 
396  _hasBasis = true;
397  }
398 
399  // resolve the original problem
401  return;
402 }
403 
404 
405 
406 /// verify computed solution based on status and resolve if claimed primal or dual feasibility is not fulfilled
408 {
409  assert(_hasSolReal);
410 
412  {
413  _hasSolReal = false;
414  return;
415  }
416 
417  MSG_INFO1(spxout, spxout << " --- verifying computed solution" << std::endl;)
418 
419  Real sumviol = 0;
420  Real boundviol = 0;
421  Real rowviol = 0;
422  Real dualviol = 0;
423  Real redcostviol = 0;
424 
426  {
427  (void) getBoundViolationReal(boundviol, sumviol);
428  (void) getRowViolationReal(rowviol, sumviol);
429  }
430 
432  {
433  (void) getDualViolationReal(dualviol, sumviol);
434  (void) getRedCostViolationReal(redcostviol, sumviol);
435  }
436 
437  if(boundviol >= _solver.feastol() || rowviol >= _solver.feastol() || dualviol >= _solver.opttol()
438  || redcostviol >= _solver.opttol())
439  {
440  assert(&_solver == _realLP);
441  assert(_isRealLPLoaded);
442  MSG_INFO3(spxout, spxout << "bound violation: " << boundviol
443  << ", row violation: " << rowviol
444  << ", dual violation: " << dualviol
445  << ", redcost violation: " << redcostviol << std::endl;)
447  " --- detected violations in original problem space -- solve again without presolving/scaling" <<
448  std::endl;)
449 
450  if(_isRealLPScaled)
451  {
453  _isRealLPScaled = false;
454  ++_unscaleCalls;
455  }
456 
458  }
459 }
460 
461 
462 /// stores solution data from the solver, possibly after applying unscaling and unsimplifying
463 void SoPlex::_storeSolutionReal(bool verify)
464 {
465  // prepare storage for basis (enough to fit the original basis)
468 
469  // prepare storage for the solution data (only in transformed space due to unscaling), w/o setting it to zero
470  _solReal._primal.reDim(_solver.nCols(), false);
471  _solReal._slacks.reDim(_solver.nRows(), false);
472  _solReal._dual.reDim(_solver.nRows(), false);
473  _solReal._redCost.reDim(_solver.nCols(), false);
474 
475  // check primal status consistency and query solution status
488 
492  && _solver.shift() < 10.0 * realParam(SoPlex::EPSILON_ZERO)));
493 
495 
496  // check dual status consistency and query solution status
497  assert(_solver.basis().status() != SPxBasis::DUAL || status() != SPxSolver::ERROR);
509 
512  && _solver.shift() < 10.0 * realParam(SoPlex::EPSILON_ZERO)));
513 
515 
516  // get infeasibility or unboundedness proof if available
518  {
521  }
522 
524  {
527  }
528 
529  // get solution data from the solver; independent of solution status
532 
537 
538  _hasBasis = true;
539 
540  // get primal and/or dual objective function value depending on status
543 
544  // infeasible solutions shall also be stored and be accessible
545  _hasSolReal = true;
546 
547  // unscale vectors
550 
551  // get unsimplified solution data from simplifier
552  if(_simplifier)
553  {
554  assert(!_simplifier->isUnsimplified());
555  assert(_simplifier->result() == SPxSimplifier::OKAY);
556  assert(_realLP != &_solver);
557 
558  try
559  {
560  // pass solution data of transformed problem to simplifier
563  }
564  catch(const SPxException& E)
565  {
566  MSG_INFO1(spxout, spxout << "Caught exception <" << E.what() <<
567  "> during unsimplification. Resolving without simplifier and scaler.\n");
568  _hasBasis = false;
570  return;
571  }
572 
573  // copy unsimplified solution data from simplifier (size and dimension is adapted during copy)
578 
579  // overwrite the transformed basis with the unsimplified one
582 
583  // load original problem but don't setup a slack basis
584  _loadRealLP(false);
585 
586  assert(_realLP == &_solver);
587 
588  // load unsimplified basis into solver
589  assert(_basisStatusRows.size() == numRowsReal());
590  assert(_basisStatusCols.size() == numColsReal());
593  _hasBasis = true;
594  }
595  // load realLP into the solver again (internal scaling was applied)
596  else if(_realLP != &_solver)
597  {
598  assert(_solver.isScaled());
599  _loadRealLP(false);
600  }
601 
602  // unscale stored solution (removes persistent scaling)
603  if(_isRealLPScaled)
605 
606  // check solution for violations and solve again if necessary
607  if(verify)
609 
610  assert(_solver.nCols() == numColsReal());
611  assert(_solver.nRows() == numRowsReal());
612 }
613 
614 
615 
617 {
618  assert(_simplifier);
620 
621  // prepare storage for basis (enough to fit the original basis)
624 
625  // prepare storage for the solution data and initialize it to zero
628  _solReal._dual.reDim(numRowsReal(), true);
630 
631  // load original LP and setup slack basis for unsimplifying
632  _loadRealLP(true);
633 
634  // store slack basis
637 
638  assert(!_simplifier->isUnsimplified());
639 
640  try
641  {
642  // unsimplify basis and solution data
645 
646  }
647  catch(const SPxException& E)
648  {
649  MSG_INFO1(spxout, spxout << "Caught exception <" << E.what() <<
650  "> during unsimplification. Resolving without simplifier and scaler.\n");
652  return;
653  }
654 
655  // copy unsimplified solution data from simplifier
660 
661  // unscale stored solution (removes persistent scaling)
662  if(_isRealLPScaled)
664 
665  // compute the original objective function value
667 
668  for(int i = 0; i < numColsReal(); ++i)
669  objVal += _solReal._primal[i] * objReal(i);
670 
671  _solReal._objVal = objVal;
672 
673  // store the unsimplified basis
676  _hasBasis = true;
677  _hasSolReal = true;
679  _solReal._isDualFeasible = true;
680 
681  // check solution for violations and solve again if necessary
683 }
684 
685 
686 
687 /// load original LP and possibly setup a slack basis
688 void SoPlex::_loadRealLP(bool initBasis)
689 {
690  _solver.loadLP(*_realLP, initBasis);
691  _isRealLPLoaded = true;
692  _realLP->~SPxLPReal();
693  spx_free(_realLP);
694  _realLP = &_solver;
695 
696  if(initBasis)
697  _solver.init();
698 }
699 
700 
701 
702 /// unscales stored solution to remove internal or external scaling of LP
703 void SoPlex::_unscaleSolutionReal(SPxLPReal& LP, bool persistent)
704 {
705  MSG_INFO1(spxout, spxout << " --- unscaling " << (persistent ? "external" : "internal") <<
706  " solution" << std::endl;)
707  assert(_scaler);
708  assert(!persistent || (boolParam(SoPlex::PERSISTENTSCALING) && _isRealLPScaled));
713 
714  if(_solReal.hasPrimalRay())
716 
717  if(_solReal.hasDualFarkas())
719 }
720 } // namespace soplex
virtual Real objValue()
get objective value of current solution.
Definition: spxsolver.h:2002
int _lastSolveMode
Definition: soplex.h:1858
SPxLPBase< Real > SPxLPReal
Definition: spxlp.h:36
DVectorBase< R > _slacks
Definition: solbase.h:219
void _checkScaling(SPxLPReal *origLP) const
check scaling of LP
Definition: testsoplex.cpp:25
virtual const Vector & unsimplifiedSlacks()=0
returns a reference to the unsimplified slack values.
virtual Real shift() const
total current shift amount.
Definition: spxsolver.h:1627
virtual void unscaleDualray(const SPxLPBase< Real > &lp, Vector &ray) const
unscale dual ray given in ray.
Definition: spxscaler.cpp:674
Basis is dual feasible.
Definition: spxbasis.h:95
bool _reapplyPersistentScaling() const
check whether persistent scaling is supposed to be reapplied again after unscaling ...
Definition: solvereal.cpp:84
not initialised error
Definition: spxsolver.h:208
void reDim(int newdim, const bool setZero=true)
Resets DVectorBase&#39;s dimension to newdim.
Definition: dvectorbase.h:253
DVectorBase< R > _dualFarkas
Definition: solbase.h:223
Basis is not known to be dual nor primal feasible.
Definition: spxbasis.h:94
virtual void unscalePrimal(const SPxLPBase< Real > &lp, Vector &x) const
unscale dense primal solution vector given in x.
Definition: spxscaler.cpp:614
int numRowsReal() const
returns number of rows
Definition: soplex.cpp:850
void _optimizeReal()
solves real LP
Definition: solvereal.cpp:28
virtual Status getPrimal(Vector &vector) const
get solution vector for primal variables.
Definition: spxsolve.cpp:1842
upper limit on objective value
Definition: soplex.h:1329
general zero tolerance
Definition: soplex.h:1308
Result
Result of the simplification.
Definition: spxsimplifier.h:81
mode for solution polishing
Definition: soplex.h:1035
type of ratio test
Definition: soplex.h:1008
the problem was so much simplified that it vanished
Definition: spxsimplifier.h:87
LP has beed solved to optimality but unscaled solution contains violations.
Definition: spxsolver.h:224
void setBasis(const VarStatus rows[], const VarStatus cols[])
set the lp solver&#39;s basis.
Definition: spxsolver.cpp:1975
virtual Result simplify(SPxLP &lp, Real eps, Real delta)=0
simplify SPxLP lp with identical primal and dual feasibility tolerance.
type of computational form, i.e., column or row representation
Definition: soplex.h:969
T * get_ptr()
get a C pointer to the data.
Definition: dataarray.h:110
objective offset
Definition: soplex.h:1371
void setSolutionPolishing(SolutionPolish _polishObj)
set objective of solution polishing (0: off, 1: max_basic_slack, 2: min_basic_slack) ...
Definition: spxsolver.h:644
Status getBasis(VarStatus rows[], VarStatus cols[], const int rowsSize=-1, const int colsSize=-1) const
get current basis, and return solver status.
Definition: spxsolver.cpp:1900
#define ALLOWED_UNSCALE_PERCENTAGE
Definition: solvereal.cpp:22
Real feastol() const
allowed primal feasibility tolerance.
Definition: spxsolver.h:803
void unscaleLPandReloadBasis()
unscales the LP and reloads the basis
Definition: spxsolver.cpp:534
DVectorBase< R > _primalRay
Definition: solbase.h:220
bool isScaled() const
Returns true if and only if the LP is scaled.
Definition: spxlpbase.h:140
DVectorBase< R > _redCost
Definition: solbase.h:222
int _unscaleCalls
Definition: soplex.h:1877
primal feasibility tolerance
Definition: soplex.h:1302
void _storeSolutionRealFromPresol()
stores solution from the simplifier because problem vanished in presolving step
Definition: solvereal.cpp:616
solve() aborted due to iteration limit.
Definition: spxsolver.h:213
SPxScaler * _scaler
Definition: soplex.h:1629
bool hasDualFarkas() const
is a dual farkas ray available?
Definition: solbase.h:110
No Problem has been loaded.
Definition: spxsolver.h:216
virtual void unscaleRedCost(const SPxLPBase< Real > &lp, Vector &r) const
unscale dense reduced cost vector given in r.
Definition: spxscaler.cpp:650
void _unscaleSolutionReal(SPxLPReal &LP, bool persistent=true)
unscales stored solution to remove internal or external scaling of LP
Definition: solvereal.cpp:703
bool getRowViolationReal(Real &maxviol, Real &sumviol)
gets violation of constraints; returns true on success
Definition: soplex.cpp:3211
re-optimize the original problem to get a proof (ray) of infeasibility/unboundedness?
Definition: soplex.h:956
virtual void unscaleDual(const SPxLPBase< Real > &lp, Vector &pi) const
unscale dense dual solution vector given in pi.
Definition: spxscaler.cpp:638
void _disableSimplifierAndScaler()
disables simplifier and scaler
Definition: soplex.cpp:8503
unsigned int _hasPrimalRay
Definition: solbase.h:228
objective sense
Definition: soplex.h:966
LP has been proven to be primal infeasible.
Definition: spxsolver.h:222
int intParam(const IntParam param) const
returns integer parameter value
Definition: soplex.cpp:5775
bound flipping ratio test for long steps in the dual simplex
Definition: soplex.h:1207
virtual void changeObjOffset(const R &o)
Definition: spxlpbase.h:1841
virtual const std::string what() const
returns exception message
Definition: exceptions.h:57
int nRows() const
Returns number of rows in LP.
Definition: spxlpbase.h:152
No ratiotester loaded.
Definition: spxsolver.h:205
No pricer loaded.
Definition: spxsolver.h:206
virtual void start()=0
start timer, resume accounting user, system and real time.
virtual Real stop()=0
stop timer, return accounted user time.
row representation (lower,lhs) <= (x,Ax) <= (upper,rhs)
Definition: soplex.h:1076
void spx_alloc(T &p, int n=1)
Allocate memory.
Definition: spxalloc.h:48
simplification could be done
Definition: spxsimplifier.h:83
virtual Status getDualfarkas(Vector &vector) const
get dual farkas proof of infeasibility.
Definition: spxsolve.cpp:2030
LP is primal infeasible or unbounded.
Definition: spxsolver.h:223
DataArray< SPxSolver::VarStatus > _basisStatusCols
Definition: soplex.h:1861
SPxStatus status() const
returns current SPxStatus.
Definition: spxbasis.h:425
double Real
Definition: spxdefines.h:218
bool _isRealLPLoaded
Definition: soplex.h:1632
void _solveRealLPAndRecordStatistics()
call floating-point solver and update statistics on iterations etc.
Definition: soplex.cpp:8557
DVectorBase< R > _primal
Definition: solbase.h:218
Status status() const
Status of solution process.
Definition: spxsolve.cpp:2213
virtual Real getObjoffset() const
get objective offset.
LP has been solved to optimality.
Definition: spxsolver.h:220
use persistent scaling?
Definition: soplex.h:950
bool _hasBasis
Definition: soplex.h:1867
use bound flipping also for row representation?
Definition: soplex.h:947
bool getDualViolationReal(Real &maxviol, Real &sumviol)
gets violation of dual multipliers; returns true on success
Definition: soplex.cpp:3317
unsigned int _hasDualFarkas
Definition: solbase.h:230
Class for collecting statistical information.
solve() aborted due to time limit.
Definition: spxsolver.h:212
an error occured.
Definition: spxsolver.h:204
const T * get_const_ptr() const
get a const C pointer to the data.
Definition: dataarray.h:115
Statistics * _statistics
statistics since last call to solveReal() or solveRational()
Definition: soplex.h:1577
void _evaluateSolutionReal(SPxSimplifier::Result simplificationStatus)
checks result of the solving process and solves again without preprocessing if necessary ...
Definition: solvereal.cpp:96
bool isPrimalFeasible() const
is the stored solution primal feasible?
Definition: solbase.h:51
virtual void getBasis(SPxSolver::VarStatus[], SPxSolver::VarStatus[], const int rowsSize=-1, const int colsSize=-1) const =0
get optimal basis.
Real realParam(const RealParam param) const
returns real parameter value
Definition: soplex.cpp:5785
primal infeasibility was detected
Definition: spxsimplifier.h:84
void _verifySolutionReal()
verify computed solution and resolve if necessary
Definition: solvereal.cpp:407
virtual Real getFastCondition()
Definition: spxsolver.h:898
SPxOut spxout
Definition: soplex.h:1476
infinity threshold
Definition: soplex.h:1320
algorithm is running
Definition: spxsolver.h:218
void _loadRealLP(bool initBasis)
load original LP and possibly setup a slack basis
Definition: solvereal.cpp:688
virtual const Vector & unsimplifiedPrimal()=0
returns a reference to the unsimplified primal solution.
virtual void loadLP(const SPxLP &LP, bool initSlackBasis=true)
copy LP.
Definition: spxsolver.cpp:71
Preconfigured SoPlex LP solver.
#define MSG_INFO3(spxout, x)
Prints out message x if the verbosity level is at least SPxOut::INFO3.
Definition: spxdefines.h:122
automatic choice according to number of rows and columns
Definition: soplex.h:1070
void setScalingInfo(bool scaled)
set whether the LP is scaled or not
Definition: spxlpbase.h:146
apply standard floating-point algorithm
Definition: soplex.h:1237
bool isDualFeasible() const
is a dual solution available?
Definition: solbase.h:88
Timer * preprocessingTime
preprocessing time
Definition: statistics.h:89
threshold on number of rows vs. number of columns for switching from column to row representations in...
Definition: soplex.h:1350
virtual void scale(SPxLPBase< Real > &lp, bool persistent=true)=0
scale SPxLP.
Exception base class.This class implements a base class for our SoPlex exceptions We provide a what()...
Definition: exceptions.h:32
Everything should be within this namespace.
SPxLPReal * _realLP
Definition: soplex.h:1626
void _preprocessAndSolveReal(bool applyPreprocessing)
solves real LP with/without preprocessing
Definition: solvereal.cpp:223
Real objReal(int i) const
returns objective value of column i
Definition: soplex.cpp:1080
solve() aborted due to detection of cycling.
Definition: spxsolver.h:211
Saving LPs in a form suitable for SoPlex.Class SPxLPBase provides the data structures required for sa...
Definition: spxlpbase.h:80
primal unboundedness was detected
Definition: spxsimplifier.h:86
virtual void unsimplify(const Vector &, const Vector &, const Vector &, const Vector &, const SPxSolver::VarStatus[], const SPxSolver::VarStatus[], bool isOptimal=true)=0
reconstructs an optimal solution for the unsimplified LP.
virtual Result result() const =0
returns result status of the simplification
bool getBoundViolationReal(Real &maxviol, Real &sumviol)
gets violation of bounds; returns true on success
Definition: soplex.cpp:3168
#define MIN_OPT_CALLS_WITH_SCALING
Definition: solvereal.cpp:23
SPxSolver _solver
Definition: soplex.h:1602
don&#39;t perform modifications on optimal basis
Definition: spxsolver.h:230
void _resolveWithoutPreprocessing(SPxSimplifier::Result simplificationStatus)
loads original problem into solver and solves again after it has been solved to optimality with prepr...
Definition: solvereal.cpp:328
int _optimizeCalls
Definition: soplex.h:1876
virtual bool isUnsimplified() const
specifies whether an optimal solution has already been unsimplified.
Real finalBasisCondition
condition number estimate of the optimal basis matrix
Definition: statistics.h:138
DataArray< SPxSolver::VarStatus > _basisStatusRows
Definition: soplex.h:1860
virtual const Vector & unsimplifiedDual()=0
returns a reference to the unsimplified dual solution.
Timer * solvingTime
solving time
Definition: statistics.h:88
int size() const
return nr. of elements.
Definition: dataarray.h:214
bool boolParam(const BoolParam param) const
returns boolean parameter value
Definition: soplex.cpp:5765
virtual Status getRedCost(Vector &vector) const
get vector of reduced costs.
Definition: spxsolve.cpp:1951
void _storeSolutionReal(bool verify=true)
stores solution of the real LP; before calling this, the real LP must be loaded in the solver and sol...
Definition: solvereal.cpp:463
#define MSG_INFO1(spxout, x)
Prints out message x if the verbosity level is at least SPxOut::INFO1.
Definition: spxdefines.h:118
bool _applyPolishing
Definition: soplex.h:1635
int nCols() const
Returns number of columns in LP.
Definition: spxlpbase.h:158
unsigned int _isPrimalFeasible
Definition: solbase.h:227
SPxSolver::Status status() const
returns the current solver status
Definition: soplex.cpp:2998
SolReal _solReal
Definition: soplex.h:1863
lower limit on objective value
Definition: soplex.h:1326
bool getRedCostViolationReal(Real &maxviol, Real &sumviol)
gets violation of reduced costs; returns true on success
Definition: soplex.cpp:3257
bool _hasSolReal
Definition: soplex.h:1868
virtual void init()
intialize data structures.
Definition: spxsolver.cpp:319
dual feasibility tolerance
Definition: soplex.h:1305
void forceRecompNonbasicValue()
Definition: spxsolver.h:670
void invalidate()
invalidate solution
Definition: solbase.h:209
bool hasPrimalRay() const
is a primal unbounded ray available?
Definition: solbase.h:73
bool setIntParam(const IntParam param, const int value, const bool init=true)
sets integer parameter value; returns true on success
Definition: soplex.cpp:5887
virtual const Vector & unsimplifiedRedCost()=0
returns a reference to the unsimplified reduced costs.
Real opttol() const
allowed optimality, i.e., dual feasibility tolerance.
Definition: spxsolver.h:811
void _enableSimplifierAndScaler()
enables simplifier and scaler according to current parameters
Definition: soplex.cpp:8445
unsigned int _isDualFeasible
Definition: solbase.h:229
virtual void unscaleSlacks(const SPxLPBase< Real > &lp, Vector &s) const
unscale dense slack vector given in s.
Definition: spxscaler.cpp:626
DVectorBase< R > _dual
Definition: solbase.h:221
virtual void setTerminationValue(Real value=infinity)
set objective limit.
Definition: spxsolver.cpp:1697
const SPxBasis & basis() const
Return current basis.
Definition: spxsolver.h:1761
virtual void unscalePrimalray(const SPxLPBase< Real > &lp, Vector &ray) const
unscale primal ray given in ray.
Definition: spxscaler.cpp:662
int numColsReal() const
returns number of columns
Definition: soplex.cpp:859
LP has been proven to be primal unbounded.
Definition: spxbasis.h:98
void reSize(int newsize)
reset size to newsize.
Definition: dataarray.h:226
bool _isRealLPScaled
Definition: soplex.h:1634
SPxSolver::Status _status
Definition: soplex.h:1857
solve() aborted due to objective limit.
Definition: spxsolver.h:214
void spx_free(T &p)
Release memory.
Definition: spxalloc.h:110
SPxSimplifier * _simplifier
Definition: soplex.h:1628
virtual Status getDual(Vector &vector) const
get current solution vector for dual variables.
Definition: spxsolve.cpp:1899
Basis is singular, numerical troubles?
Definition: spxsolver.h:215
virtual Status getPrimalray(Vector &vector) const
get primal ray in case of unboundedness.
Definition: spxsolve.cpp:2012
Basis is primal feasible.
Definition: spxbasis.h:96
LP has a usable Basis (maybe LP is changed).
Definition: spxsolver.h:217
dual infeasibility was detected
Definition: spxsimplifier.h:85
virtual Status getSlacks(Vector &vector) const
get vector of slack variables.
Definition: spxsolve.cpp:2048
void setBasisStatus(SPxBasis::SPxStatus stat)
set the lp solver&#39;s basis status.
Definition: spxsolver.h:2051
LP has been proven to be primal unbounded.
Definition: spxsolver.h:221
LP has been proven to be primal infeasible.
Definition: spxbasis.h:99
No Problem has been loaded to the basis.
Definition: spxbasis.h:92
No linear solver loaded.
Definition: spxsolver.h:207