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-2017 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 #ifndef SOPLEX_LEGACY
17 #include <iostream>
18 #include <assert.h>
19 
20 #include "soplex.h"
21 #include "statistics.h"
22 
23 #define ALLOWED_UNSCALE_PERCENTAGE 0.1
24 #define MIN_OPT_CALLS_WITH_SCALING 10
25 
26 namespace soplex
27 {
28  /// solves real LP
30  {
31  assert(_realLP != 0);
32  assert(_realLP == &_solver);
33 
36 
37  // start timing
39 
41  {
42  // scale original problem; overwriting _realLP
44  {
45 #ifdef SOPLEX_DEBUG
46  SPxLPReal* origLP = 0;
47  spx_alloc(origLP);
48  origLP = new (origLP) SPxLPReal(*_realLP);
49 #endif
50  _scaler->scale(*_realLP, true);
51  _isRealLPScaled = _realLP->isScaled(); // a scaler might decide not to apply scaling
52 #ifdef SOPLEX_DEBUG
53  _checkScalingReal(origLP);
54 #endif
55  }
56  // unscale previously scaled problem, overwriting _realLP
57  else if( !_scaler && _realLP->isScaled() )
58  {
60  _isRealLPScaled = false;
61  ++_unscaleCalls;
62  }
63  }
64 
65  // remember that last solve was in floating-point
67 
68  // solve and store solution; if we have a starting basis, do not apply preprocessing; if we are solving from
69  // 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  {
87  return false;
88  else
89  return true;
90  }
91 
92 
93 
94  /// checks result of the solving process and solves again without preprocessing if necessary
96  {
97  // if the simplifier detected infeasibility or unboundedness we optimize again
98  // just to get the proof (primal or dual ray)
99  // todo get infeasibility proof from simplifier
100  switch( simplificationStatus )
101  {
105  MSG_INFO1( spxout, spxout << "simplifier detected infeasibility or unboundedness - solve again without simplifying" << std::endl; )
106  _hasBasis = false;
108  return;
109 
113  return;
114 
115  case SPxSimplifier::OKAY:
116  _status = _solver.status();
117  }
118 
119  // process result
120  switch( _status )
121  {
122  case SPxSolver::OPTIMAL:
124  // apply polishing on original problem
125  if( _applyPolishing )
126  {
127  int polishing = intParam(SoPlex::SOLUTION_POLISHING);
130  }
131  break;
132 
136  // in case of infeasibility or unboundedness, we currently can not unsimplify, but have to solve the original LP again
137  if( !_isRealLPLoaded )
138  {
139  MSG_INFO1( spxout, spxout << " --- loading original problem" << std::endl; )
141  // we cannot do more to remove violations
142  _resolveWithoutPreprocessing(simplificationStatus);
143  }
144  else
145  {
146  _storeSolutionReal(false);
147  }
148  break;
149 
150  case SPxSolver::SINGULAR:
151  // if preprocessing was applied, try to run again without to avoid singularity
152  if( !_isRealLPLoaded )
153  {
154  MSG_INFO3( spxout, spxout << "encountered singularity - trying to solve again without simplifying" << std::endl; )
156  return;
157  }
158  _hasBasis = false;
159  break;
160 
162  // if preprocessing was applied, try to run again without to avoid cycling
163  if( !_isRealLPLoaded )
164  {
165  MSG_INFO3( spxout, spxout << "encountered cycling - trying to solve again without simplifying" << std::endl; )
167  return;
168  }
169  // FALLTHROUGH
173  case SPxSolver::REGULAR:
174  case SPxSolver::RUNNING:
175  _storeSolutionReal(false);
176  break;
177 
178  default:
179  _hasBasis = false;
180  break;
181  }
182  }
183 
184 
185 
186  /// solves real LP with/without preprocessing
187  void SoPlex::_preprocessAndSolveReal(bool applySimplifier)
188  {
191 
192  _applyPolishing = false;
193 
194  if( applySimplifier )
196  else
198 
199  // create a copy of the LP when simplifying or when using internal scaling, i.e. w/o persistent scaling
200  bool copyLP = (_simplifier != 0 || (_scaler && !_isRealLPScaled));
201 
204 
205  if( _isRealLPLoaded )
206  {
207  assert(_realLP == &_solver);
208 
209  // preprocessing is always applied to the LP in the solver; hence we have to create a copy of the original LP
210  // if simplifier is turned on
211  if( copyLP )
212  {
213  _realLP = 0;
215  _realLP = new (_realLP) SPxLPReal(_solver);
216  _isRealLPLoaded = false;
217  }
218  }
219  else
220  {
221  assert(_realLP != &_solver);
222 
223  // load real LP and basis if available
224  if( _hasBasis )
225  {
226  assert(_basisStatusRows.size() == numRowsReal());
227  assert(_basisStatusCols.size() == numColsReal());
228 
229  _solver.loadLP(*_realLP, false);
231  }
232  // load real LP and set up slack basis
233  else
234  _solver.loadLP(*_realLP, true);
235 
236  // if there is no simplifier, then the original and the transformed problem are identical and it is more
237  // memory-efficient to keep only the problem in the solver
238  if( !copyLP )
239  {
240  _realLP->~SPxLPReal();
241  spx_free(_realLP);
242  _realLP = &_solver;
243  _isRealLPLoaded = true;
244  }
245  }
246 
247  // assert that we have two problems if and only if we apply the simplifier
248  assert(_realLP == &_solver || copyLP);
249  assert(_realLP != &_solver || !copyLP);
250 
251  // apply problem simplification
252  SPxSimplifier::Result simplificationStatus = SPxSimplifier::OKAY;
253  if( _simplifier )
254  {
255  assert(!_isRealLPLoaded);
256  // do not remove bounds of boxed variables or sides of ranged rows if bound flipping is used; also respect row-boundflip parameter
261  keepbounds &= boolParam(SoPlex::ROWBOUNDFLIPS);
264  _solver.setScalingInfo(false);
265  _applyPolishing = true;
267  }
268 
270 
271  // run the simplex method if problem has not been solved by the simplifier
272  if( simplificationStatus == SPxSimplifier::OKAY )
273  {
274  if( _scaler && !_solver.isScaled() )
275  {
276  _scaler->scale(_solver, false);
277  }
278 
280  }
281 
282  _evaluateSolutionReal(simplificationStatus);
283  }
284 
285 
286 
287  /// loads original problem into solver and solves again after it has been solved to infeasibility or unboundedness with preprocessing
289  {
290  assert(!_isRealLPLoaded || _scaler != 0);
291  assert(_simplifier != 0 || _scaler != 0);
293 
294  // if simplifier was active, then we unsimplify to get the basis
295  if( _simplifier )
296  {
297  assert(!_simplifier->isUnsimplified());
298  assert(simplificationStatus == SPxSimplifier::OKAY);
299 
300  // get temporary solution vectors for transformed problem
301  DVectorReal primal(_solver.nCols());
302  DVectorReal slacks(_solver.nRows());
303  DVectorReal dual(_solver.nRows());
304  DVectorReal redCost(_solver.nCols());
305 
308  assert(_basisStatusRows.size() >= _solver.nRows());
309  assert(_basisStatusCols.size() >= _solver.nCols());
310 
311  // get solution data from transformed problem
312  _solver.getPrimal(primal);
313  _solver.getSlacks(slacks);
314  _solver.getDual(dual);
315  _solver.getRedCost(redCost);
316 
317  // unscale vectors
318  if( _scaler && _solver.isScaled())
319  {
320  _scaler->unscalePrimal(_solver, primal);
321  _scaler->unscaleSlacks(_solver, slacks);
322  _scaler->unscaleDual(_solver, dual);
323  _scaler->unscaleRedCost(_solver, redCost);
324  }
325 
326  // get basis of transformed problem
328 
329  try
330  {
331  _simplifier->unsimplify(primal, dual, slacks, redCost, _basisStatusRows.get_ptr(), _basisStatusCols.get_ptr(), false);
333  _hasBasis = true;
334  }
335  catch( const SPxException& E )
336  {
337  MSG_INFO1( spxout, spxout << "Caught exception <" << E.what() << "> during unsimplification. Resolving without simplifier and scaler.\n" );
338  _hasBasis = false;
339  }
340  }
341  // if the original problem is not in the solver because of scaling, we also need to store the basis
342  else if( _scaler != 0 )
343  {
346  assert(_basisStatusRows.size() == _solver.nRows());
347  assert(_basisStatusCols.size() == _solver.nCols());
348 
350  _hasBasis = true;
351  }
352 
353  // resolve the original problem
355  return;
356  }
357 
358 
359 
360  /// verify computed solution based on status and resolve if claimed primal or dual feasibility is not fulfilled
362  {
363  assert(_hasSolReal);
365  {
366  _hasSolReal = false;
367  return;
368  }
369 
370  MSG_INFO1( spxout, spxout << " --- verifying computed solution" << std::endl; )
371 
372  Real sumviol = 0;
373  Real boundviol = 0;
374  Real rowviol = 0;
375  Real dualviol = 0;
376  Real redcostviol = 0;
377 
379  {
380  (void) getBoundViolationReal(boundviol, sumviol);
381  (void) getRowViolationReal(rowviol, sumviol);
382  }
384  {
385  (void) getDualViolationReal(dualviol, sumviol);
386  (void) getRedCostViolationReal(redcostviol, sumviol);
387  }
388 
389  if( boundviol >= _solver.feastol() || rowviol >= _solver.feastol() || dualviol >= _solver.opttol() || redcostviol >= _solver.opttol())
390  {
391  assert(&_solver == _realLP);
392  assert(_isRealLPLoaded);
393  MSG_INFO3( spxout, spxout << "bound violation: " << boundviol
394  << ", row violation: " << rowviol
395  << ", dual violation: " << dualviol
396  << ", redcost violation: " << redcostviol << std::endl; )
397  MSG_INFO1( spxout, spxout << " --- detected violations in original problem space -- solve again without presolving" << std::endl; )
398 
399  if( _isRealLPScaled )
400  {
402  _isRealLPScaled = false;
403  ++_unscaleCalls;
404  }
405 
407  }
408  }
409 
410 
411  /// stores solution data from the solver, possibly after applying unscaling and unsimplifying
412  void SoPlex::_storeSolutionReal(bool verify)
413  {
414  // prepare storage for basis (enough to fit the original basis)
417 
418  // prepare storage for the solution data (only in transformed space due to unscaling), w/o setting it to zero
419  _solReal._primal.reDim(_solver.nCols(), false);
420  _solReal._slacks.reDim(_solver.nRows(), false);
421  _solReal._dual.reDim(_solver.nRows(), false);
422  _solReal._redCost.reDim(_solver.nCols(), false);
423 
424  // check primal status consistency and query solution status
436 
439  && _solver.shift() < 10.0 * realParam(SoPlex::EPSILON_ZERO)));
440 
442 
443  // check dual status consistency and query solution status
444  assert(_solver.basis().status() != SPxBasis::DUAL || status() != SPxSolver::ERROR);
455 
458  && _solver.shift() < 10.0 * realParam(SoPlex::EPSILON_ZERO)));
459 
461 
462  // get infeasibility or unboundedness proof if available
463  if( _solReal._hasPrimalRay )
464  {
467  }
468 
470  {
473  }
474 
475  // get solution data from the solver; independent of solution status
478 
483 
484  _hasBasis = true;
485 
486  // get primal and/or dual objective function value depending on status
489 
490  // infeasible solutions shall also be stored and be accessible
491  _hasSolReal = true;
492 
493  // unscale vectors
494  if( _solver.isScaled() && !_isRealLPLoaded )
496 
497  // get unsimplified solution data from simplifier
498  if( _simplifier )
499  {
500  assert(!_simplifier->isUnsimplified());
501  assert(_simplifier->result() == SPxSimplifier::OKAY);
502  assert(_realLP != &_solver);
503 
504  try
505  {
506  // pass solution data of transformed problem to simplifier
509  }
510  catch( const SPxException& E )
511  {
512  MSG_INFO1( spxout, spxout << "Caught exception <" << E.what() << "> during unsimplification. Resolving without simplifier and scaler.\n" );
513  _hasBasis = false;
515  return;
516  }
517 
518  // copy unsimplified solution data from simplifier (size and dimension is adapted during copy)
523 
524  // overwrite the transformed basis with the unsimplified one
526 
527  // load original problem but don't setup a slack basis
528  _loadRealLP(false);
529 
530  assert(_realLP == &_solver);
531 
532  // load unsimplified basis into solver
533  assert(_basisStatusRows.size() == numRowsReal());
534  assert(_basisStatusCols.size() == numColsReal());
537  _hasBasis = true;
538  }
539  // load realLP into the solver again (internal scaling was applied)
540  else if( _realLP != &_solver )
541  {
542  assert(_solver.isScaled());
543  _loadRealLP(false);
544  }
545 
546  // unscale stored solution (removes persistent scaling)
547  if( _isRealLPScaled )
549 
550  // check solution for violations and solve again if necessary
551  if( verify )
553 
554  assert(_solver.nCols() == numColsReal());
555  assert(_solver.nRows() == numRowsReal());
556  }
557 
558 
559 
561  {
562  assert(_simplifier);
564 
565  // prepare storage for basis (enough to fit the original basis)
568 
569  // prepare storage for the solution data and initialize it to zero
572  _solReal._dual.reDim(numRowsReal(), true);
574 
575  // load original LP and setup slack basis for unsimplifying
576  _loadRealLP(true);
577 
578  // store slack basis
581 
582  assert(!_simplifier->isUnsimplified());
583 
584  try
585  {
586  // unsimplify basis and solution data
589 
590  }
591  catch( const SPxException& E )
592  {
593  MSG_INFO1( spxout, spxout << "Caught exception <" << E.what() << "> during unsimplification. Resolving without simplifier and scaler.\n" );
595  return;
596  }
597 
598  // copy unsimplified solution data from simplifier
603 
604  // unscale stored solution (removes persistent scaling)
605  if( _isRealLPScaled )
607 
608  // compute the original objective function value
610  for( int i = 0; i < numColsReal(); ++i )
612 
613  // store the unsimplified basis
615  _hasBasis = true;
616  _hasSolReal = true;
618  _solReal._isDualFeasible = true;
619 
620  // check solution for violations and solve again if necessary
622  }
623 
624 
625 
626  /// load original LP and possibly setup a slack basis
627  void SoPlex::_loadRealLP(bool initBasis)
628  {
629  _solver.loadLP(*_realLP, initBasis);
630  _isRealLPLoaded = true;
631  _realLP->~SPxLPReal();
632  spx_free(_realLP);
633  _realLP = &_solver;
634  if( initBasis )
635  _solver.init();
636  }
637 
638 
639 
640  /// unscales stored solution to remove internal or external scaling of LP
641  void SoPlex::_unscaleSolutionReal(SPxLPReal& LP, bool persistent)
642  {
643  MSG_INFO1( spxout, spxout << " --- unscaling " << (persistent ? "external" : "internal") <<" solution" << std::endl; )
644  assert(_scaler);
645  assert(!persistent || (boolParam(SoPlex::PERSISTENTSCALING) && _isRealLPScaled));
650  if( _solReal.hasPrimalRay() )
652  if( _solReal.hasDualFarkas() )
654  }
655 } // namespace soplex
656 #endif
virtual Real objValue()
get objective value of current solution.
Definition: spxsolver.h:1977
int _lastSolveMode
Definition: soplex.h:1813
SPxLPBase< Real > SPxLPReal
Definition: spxlp.h:36
DVectorBase< R > _slacks
Definition: solbase.h:219
virtual const Vector & unsimplifiedSlacks()=0
returns a reference to the unsimplified slack values.
virtual Real shift() const
total current shift amount.
Definition: spxsolver.h:1602
virtual void unscaleDualray(const SPxLPBase< Real > &lp, Vector &ray) const
unscale dual ray given in ray.
Definition: spxscaler.cpp:666
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:249
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:606
int numRowsReal() const
returns number of rows
Definition: soplex.cpp:797
void _optimizeReal()
solves real LP
Definition: solvereal.cpp:29
virtual Status getPrimal(Vector &vector) const
get solution vector for primal variables.
Definition: spxsolve.cpp:1593
upper limit on objective value
Definition: soplex.h:1301
general zero tolerance
Definition: soplex.h:1280
Result
Result of the simplification.
Definition: spxsimplifier.h:81
mode for solution polishing
Definition: soplex.h:1007
type of ratio test
Definition: soplex.h:980
the problem was so much simplified that it vanished
Definition: spxsimplifier.h:87
void setBasis(const VarStatus rows[], const VarStatus cols[])
set the lp solver&#39;s basis.
Definition: spxsolver.cpp:1873
virtual Result simplify(SPxLP &lp, Real eps, Real delta)=0
simplify SPxLP lp with identical primal and dual feasibility tolerance.
apply standard floating-point algorithm
Definition: soplex.h:1209
type of computational form, i.e., column or row representation
Definition: soplex.h:941
T * get_ptr()
get a C pointer to the data.
Definition: dataarray.h:110
objective offset
Definition: soplex.h:1343
void setSolutionPolishing(SolutionPolish _polishObj)
set objective of solution polishing (0: off, 1: max_basic_slack, 2: min_basic_slack) ...
Definition: spxsolver.h:616
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:1800
#define ALLOWED_UNSCALE_PERCENTAGE
Definition: solvereal.cpp:23
Real feastol() const
allowed primal feasibility tolerance.
Definition: spxsolver.h:786
void unscaleLPandReloadBasis()
unscales the LP and reloads the basis
Definition: spxsolver.cpp:525
DVectorBase< R > _primalRay
Definition: solbase.h:220
bool isScaled() const
Returns true if and only if the LP is scaled.
Definition: spxlpbase.h:139
DVectorBase< R > _redCost
Definition: solbase.h:222
int _unscaleCalls
Definition: soplex.h:1832
primal feasibility tolerance
Definition: soplex.h:1274
bound flipping ratio test for long steps in the dual simplex
Definition: soplex.h:1179
void _storeSolutionRealFromPresol()
stores solution from the simplifier because problem vanished in presolving step
Definition: solvereal.cpp:560
solve() aborted due to iteration limit.
Definition: spxsolver.h:213
SPxScaler * _scaler
Definition: soplex.h:1595
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:642
void _unscaleSolutionReal(SPxLPReal &LP, bool persistent=true)
unscales stored solution to remove internal or external scaling of LP
Definition: solvereal.cpp:641
bool getRowViolationReal(Real &maxviol, Real &sumviol)
gets violation of constraints; returns true on success
Definition: soplex.cpp:3102
virtual void unscaleDual(const SPxLPBase< Real > &lp, Vector &pi) const
unscale dense dual solution vector given in pi.
Definition: spxscaler.cpp:630
void _disableSimplifierAndScaler()
disables simplifier and scaler
Definition: soplex.cpp:7989
unsigned int _hasPrimalRay
Definition: solbase.h:228
objective sense
Definition: soplex.h:938
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:5538
virtual void changeObjOffset(const R &o)
Definition: spxlpbase.h:1747
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:151
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.
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:1734
LP is primal infeasible or unbounded.
Definition: spxsolver.h:223
DataArray< SPxSolver::VarStatus > _basisStatusCols
Definition: soplex.h:1816
SPxStatus status() const
returns current SPxStatus.
Definition: spxbasis.h:425
automatic choice according to number of rows and columns
Definition: soplex.h:1042
double Real
Definition: spxdefines.h:218
bool _isRealLPLoaded
Definition: soplex.h:1598
void _solveRealLPAndRecordStatistics()
call floating-point solver and update statistics on iterations etc.
Definition: soplex.cpp:8043
DVectorBase< R > _primal
Definition: solbase.h:218
Status status() const
Status of solution process.
Definition: spxsolve.cpp:1910
virtual Real getObjoffset() const
get objective offset.
LP has been solved to optimality.
Definition: spxsolver.h:220
use persistent scaling?
Definition: soplex.h:925
bool _hasBasis
Definition: soplex.h:1822
use bound flipping also for row representation?
Definition: soplex.h:922
bool getDualViolationReal(Real &maxviol, Real &sumviol)
gets violation of dual multipliers; returns true on success
Definition: soplex.cpp:3198
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:1544
void _evaluateSolutionReal(SPxSimplifier::Result simplificationStatus)
checks result of the solving process and solves again without preprocessing if necessary ...
Definition: solvereal.cpp:95
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:5548
primal infeasibility was detected
Definition: spxsimplifier.h:84
void _verifySolutionReal()
verify computed solution and resolve if necessary
Definition: solvereal.cpp:361
virtual Real getFastCondition()
Definition: spxsolver.h:881
SPxOut spxout
Definition: soplex.h:1444
infinity threshold
Definition: soplex.h:1292
algorithm is running
Definition: spxsolver.h:218
void _loadRealLP(bool initBasis)
load original LP and possibly setup a slack basis
Definition: solvereal.cpp:627
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:68
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
void setScalingInfo(bool scaled)
set whether the LP is scaled or not
Definition: spxlpbase.h:145
Timer * preprocessingTime
preprocessing time
Definition: statistics.h:90
threshold on number of rows vs. number of columns for switching from column to row representations in...
Definition: soplex.h:1322
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:1592
void _preprocessAndSolveReal(bool applyPreprocessing)
solves real LP with/without preprocessing
Definition: solvereal.cpp:187
Real objReal(int i) const
returns objective value of column i
Definition: soplex.cpp:1027
row representation (lower,lhs) <= (x,Ax) <= (upper,rhs)
Definition: soplex.h:1048
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:3063
#define MIN_OPT_CALLS_WITH_SCALING
Definition: solvereal.cpp:24
SPxSolver _solver
Definition: soplex.h:1569
don&#39;t perform modifications on optimal basis
Definition: spxsolver.h:229
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:288
int _optimizeCalls
Definition: soplex.h:1831
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:139
DataArray< SPxSolver::VarStatus > _basisStatusRows
Definition: soplex.h:1815
virtual const Vector & unsimplifiedDual()=0
returns a reference to the unsimplified dual solution.
Timer * solvingTime
solving time
Definition: statistics.h:89
int size() const
return nr. of elements.
Definition: dataarray.h:211
bool boolParam(const BoolParam param) const
returns boolean parameter value
Definition: soplex.cpp:5528
virtual Status getRedCost(Vector &vector) const
get vector of reduced costs.
Definition: spxsolve.cpp:1673
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:412
#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:1601
int nCols() const
Returns number of columns in LP.
Definition: spxlpbase.h:157
unsigned int _isPrimalFeasible
Definition: solbase.h:227
SPxSolver::Status status() const
returns the current solver status
Definition: soplex.cpp:2896
SolReal _solReal
Definition: soplex.h:1818
lower limit on objective value
Definition: soplex.h:1298
bool getRedCostViolationReal(Real &maxviol, Real &sumviol)
gets violation of reduced costs; returns true on success
Definition: soplex.cpp:3144
bool _hasSolReal
Definition: soplex.h:1823
virtual void init()
intialize data structures.
Definition: spxsolver.cpp:317
dual feasibility tolerance
Definition: soplex.h:1277
void forceRecompNonbasicValue()
Definition: spxsolver.h:642
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:5632
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:794
void _enableSimplifierAndScaler()
enables simplifier and scaler according to current parameters
Definition: soplex.cpp:7940
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:618
DVectorBase< R > _dual
Definition: solbase.h:221
virtual void setTerminationValue(Real value=infinity)
set objective limit.
Definition: spxsolver.cpp:1620
const SPxBasis & basis() const
Return current basis.
Definition: spxsolver.h:1736
virtual void unscalePrimalray(const SPxLPBase< Real > &lp, Vector &ray) const
unscale primal ray given in ray.
Definition: spxscaler.cpp:654
int numColsReal() const
returns number of columns
Definition: soplex.cpp:806
LP has been proven to be primal unbounded.
Definition: spxbasis.h:98
void reSize(int newsize)
reset size to newsize.
Definition: dataarray.h:223
bool _isRealLPScaled
Definition: soplex.h:1600
SPxSolver::Status _status
Definition: soplex.h:1812
solve() aborted due to objective limit.
Definition: spxsolver.h:214
void spx_free(T &p)
Release memory.
Definition: spxalloc.h:109
SPxSimplifier * _simplifier
Definition: soplex.h:1594
virtual Status getDual(Vector &vector) const
get current solution vector for dual variables.
Definition: spxsolve.cpp:1642
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:1716
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:1752
void setBasisStatus(SPxBasis::SPxStatus stat)
set the lp solver&#39;s basis status.
Definition: spxsolver.h:2025
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