Scippy

SoPlex

Sequential object-oriented simPlex

soplex.h
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-2016 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 /**@file soplex.h
17  * @brief Preconfigured SoPlex LP solver
18  */
19 
20 #ifndef _SOPLEX_H_
21 #define _SOPLEX_H_
22 
23 #ifndef SOPLEX_LEGACY
24 #include <string.h>
25 
26 ///@todo SoPlex should also have an spxout object to avoid using a global one
27 #include "spxdefines.h"
28 #include "basevectors.h"
29 #include "spxsolver.h"
30 #include "slufactor.h"
31 
32 ///@todo try to move to cpp file by forward declaration
33 #include "spxsimplifier.h"
34 #include "spxmainsm.h"
35 
36 #include "spxscaler.h"
37 #include "spxequilisc.h"
38 #include "spxgeometsc.h"
39 
40 #include "spxstarter.h"
41 #include "spxweightst.h"
42 #include "spxsumst.h"
43 #include "spxvectorst.h"
44 
45 #include "spxpricer.h"
46 #include "spxautopr.h"
47 #include "spxdantzigpr.h"
48 #include "spxparmultpr.h"
49 #include "spxdevexpr.h"
50 #include "spxsteeppr.h"
51 #include "spxsteepexpr.h"
52 #include "spxhybridpr.h"
53 
54 #include "spxratiotester.h"
55 #include "spxdefaultrt.h"
56 #include "spxharrisrt.h"
57 #include "spxfastrt.h"
58 #include "spxboundflippingrt.h"
59 
60 #include "sol.h"
61 
62 ///@todo implement automatic rep switch, based on row/col dim
63 ///@todo introduce status codes for SoPlex, especially for rational solving
64 
65 ///@todo record and return "best" solutions found during IR (Ambros)
66 ///@todo implement main IR loop for primal and dual feasible case with fail otherwise (Ambros)
67 ///@todo implement statistical info (time, factor time, iters, ...) since last call to solveReal() or solveRational() (Ambros?)
68 ///@todo implement performInfeasibilityIR (Ambros?)
69 ///@todo extend IR loop to infeasible case (Dan?)
70 ///@todo extend IR loop to unbounded case (Dan?)
71 
72 ///@todo interface rational reconstruction code for rational vectors
73 ///@todo integrate rational reconstruction into IR loop
74 ///@todo templatize SPxSolver and necessary components (SLUFactor, pricer, ratiotester)
75 ///@todo integrate rational SPxSolver and distinguish between original and transformed rational LP
76 ///@todo rational scalers
77 ///@todo rational simplifier
78 
79 namespace soplex
80 {
81 
82 /**@class SoPlex
83  * @brief Preconfigured SoPlex LP-solver.
84  * @ingroup Algo
85  */
86 class SoPlex
87 {
88 public:
89 
90  //**@name Construction and destruction */
91  //@{
92 
93  /// default constructor
94  SoPlex();
95 
96  /// assignment operator
97  SoPlex& operator=(const SoPlex& rhs);
98 
99  /// copy constructor
100  SoPlex(const SoPlex& rhs);
101 
102  /// destructor
103  virtual ~SoPlex();
104 
105  //@}
106 
107 
108  /// message handler
109 // SPxOut spxout;
110 
111 
112  //**@name Access to the real LP */
113  //@{
114 
115  /// returns number of rows
116  int numRowsReal() const;
117 
118  /// returns number of columns
119  int numColsReal() const;
120 
121  /// returns number of nonzeros
122  int numNonzerosReal() const;
123 
124  /// returns smallest non-zero element in absolute value
125  Real minAbsNonzeroReal() const;
126 
127  /// returns biggest non-zero element in absolute value
128  Real maxAbsNonzeroReal() const;
129 
130  /// gets row \p i
131  void getRowReal(int i, LPRowReal& lprow) const;
132 
133  /// gets rows \p start, ..., \p end.
134  void getRowsReal(int start, int end, LPRowSetReal& lprowset) const;
135 
136  /// returns vector of row \p i
137  const SVectorReal& rowVectorReal(int i) const;
138 
139  /// returns right-hand side vector
140  const VectorReal& rhsReal() const;
141 
142  /// returns right-hand side of row \p i
143  Real rhsReal(int i) const;
144 
145  /// returns left-hand side vector
146  const VectorReal& lhsReal() const;
147 
148  /// returns left-hand side of row \p i
149  Real lhsReal(int i) const;
150 
151  /// returns inequality type of row \p i
152  LPRowReal::Type rowTypeReal(int i) const;
153 
154  /// gets column \p i
155  void getColReal(int i, LPColReal& lpcol) const;
156 
157  /// gets columns \p start, ..., \p end
158  void getColsReal(int start, int end, LPColSetReal& lpcolset) const;
159 
160  /// returns vector of column \p i
161  const SVectorReal& colVectorReal(int i) const;
162 
163  /// returns upper bound vector
164  const VectorReal& upperReal() const;
165 
166  /// returns upper bound of column \p i
167  Real upperReal(int i) const;
168 
169  /// returns lower bound vector
170  const VectorReal& lowerReal() const;
171 
172  /// returns lower bound of column \p i
173  Real lowerReal(int i) const;
174 
175  /// gets objective function vector
176  void getObjReal(VectorReal& obj) const;
177 
178  /// returns objective value of column \p i
179  Real objReal(int i) const;
180 
181  /// returns objective function vector after transformation to a maximization problem; since this is how it is stored
182  /// internally, this is generally faster
183  const VectorReal& maxObjReal() const;
184 
185  /// returns objective value of column \p i after transformation to a maximization problem; since this is how it is
186  /// stored internally, this is generally faster
187  Real maxObjReal(int i) const;
188 
189  /// gets number of available dual norms
190  void getNdualNorms(int& nnormsRow, int& nnormsCol) const;
191 
192  /// gets steepest edge norms and returns false if they are not available
193  bool getDualNorms(int& nnormsRow, int& nnormsCol, Real* norms) const;
194 
195  /// sets steepest edge norms and returns false if that's not possible
196  bool setDualNorms(int nnormsRow, int nnormsCol, Real* norms);
197 
198  //@}
199 
200 
201  //**@name Access to the rational LP */
202  //@{
203 
204  /// returns number of rows
205  int numRowsRational() const;
206 
207  /// returns number of columns
208  int numColsRational() const;
209 
210  /// returns number of nonzeros
211  int numNonzerosRational() const;
212 
213  /// returns smallest non-zero element in absolute value
215 
216  /// returns biggest non-zero element in absolute value
218 
219  /// gets row \p i
220  void getRowRational(int i, LPRowRational& lprow) const;
221 
222  /// gets rows \p start, ..., \p end.
223  void getRowsRational(int start, int end, LPRowSetRational& lprowset) const;
224 
225  /// returns vector of row \p i
226  const SVectorRational& rowVectorRational(int i) const;
227 
228  /// returns right-hand side vector
229  const VectorRational& rhsRational() const;
230 
231  /// returns right-hand side of row \p i
232  const Rational& rhsRational(int i) const;
233 
234  /// returns left-hand side vector
235  const VectorRational& lhsRational() const;
236 
237  /// returns left-hand side of row \p i
238  const Rational& lhsRational(int i) const;
239 
240  /// returns inequality type of row \p i
242 
243  /// gets column \p i
244  void getColRational(int i, LPColRational& lpcol) const;
245 
246  /// gets columns \p start, ..., \p end
247  void getColsRational(int start, int end, LPColSetRational& lpcolset) const;
248 
249  /// returns vector of column \p i
250  const SVectorRational& colVectorRational(int i) const;
251 
252  /// returns upper bound vector
253  const VectorRational& upperRational() const;
254 
255  /// returns upper bound of column \p i
256  const Rational& upperRational(int i) const;
257 
258  /// returns lower bound vector
259  const VectorRational& lowerRational() const;
260 
261  /// returns lower bound of column \p i
262  const Rational& lowerRational(int i) const;
263 
264  /// gets objective function vector
265  void getObjRational(VectorRational& obj) const;
266 
267  /// gets objective value of column \p i
268  void getObjRational(int i, Rational& obj) const;
269 
270  /// returns objective value of column \p i
271  Rational objRational(int i) const;
272 
273  /// returns objective function vector after transformation to a maximization problem; since this is how it is stored
274  /// internally, this is generally faster
275  const VectorRational& maxObjRational() const;
276 
277  /// returns objective value of column \p i after transformation to a maximization problem; since this is how it is
278  /// stored internally, this is generally faster
279  const Rational& maxObjRational(int i) const;
280 
281  //@}
282 
283 
284  //**@name Modification of the real LP */
285  //@{
286 
287  /// adds a single row
288  void addRowReal(const LPRowReal& lprow);
289 
290  /// adds multiple rows
291  void addRowsReal(const LPRowSetReal& lprowset);
292 
293  /// adds a single column
294  void addColReal(const LPCol& lpcol);
295 
296  /// adds multiple columns
297  void addColsReal(const LPColSetReal& lpcolset);
298 
299  /// replaces row \p i with \p lprow
300  void changeRowReal(int i, const LPRowReal& lprow);
301 
302  /// changes left-hand side vector for constraints to \p lhs
303  void changeLhsReal(const VectorReal& lhs);
304 
305  /// changes left-hand side of row \p i to \p lhs
306  void changeLhsReal(int i, const Real& lhs);
307 
308  /// changes right-hand side vector to \p rhs
309  void changeRhsReal(const VectorReal& rhs);
310 
311  /// changes right-hand side of row \p i to \p rhs
312  void changeRhsReal(int i, const Real& rhs);
313 
314  /// changes left- and right-hand side vectors
315  void changeRangeReal(const VectorReal& lhs, const VectorReal& rhs);
316 
317  /// changes left- and right-hand side of row \p i
318  void changeRangeReal(int i, const Real& lhs, const Real& rhs);
319 
320  /// replaces column \p i with \p lpcol
321  void changeColReal(int i, const LPColReal& lpcol);
322 
323  /// changes vector of lower bounds to \p lower
324  void changeLowerReal(const VectorReal& lower);
325 
326  /// changes lower bound of column i to \p lower
327  void changeLowerReal(int i, const Real& lower);
328 
329  /// changes vector of upper bounds to \p upper
330  void changeUpperReal(const VectorReal& upper);
331 
332  /// changes \p i 'th upper bound to \p upper
333  void changeUpperReal(int i, const Real& upper);
334 
335  /// changes vectors of column bounds to \p lower and \p upper
336  void changeBoundsReal(const VectorReal& lower, const VectorReal& upper);
337 
338  /// changes bounds of column \p i to \p lower and \p upper
339  void changeBoundsReal(int i, const Real& lower, const Real& upper);
340 
341  /// changes objective function vector to \p obj
342  void changeObjReal(const VectorReal& obj);
343 
344  /// changes objective coefficient of column i to \p obj
345  void changeObjReal(int i, const Real& obj);
346 
347  /// changes matrix entry in row \p i and column \p j to \p val
348  void changeElementReal(int i, int j, const Real& val);
349 
350  /// removes row \p i
351  void removeRowReal(int i);
352 
353  /// removes all rows with an index \p i such that \p perm[i] < 0; upon completion, \p perm[i] >= 0 indicates the
354  /// new index where row \p i has been moved to; note that \p perm must point to an array of size at least
355  /// #numRowsReal()
356  void removeRowsReal(int perm[]);
357 
358  /// remove all rows with indices in array \p idx of size \p n; an array \p perm of size #numRowsReal() may be passed
359  /// as buffer memory
360  void removeRowsReal(int idx[], int n, int perm[] = 0);
361 
362  /// removes rows \p start to \p end including both; an array \p perm of size #numRowsReal() may be passed as buffer
363  /// memory
364  void removeRowRangeReal(int start, int end, int perm[] = 0);
365 
366  /// removes column i
367  void removeColReal(int i);
368 
369  /// removes all columns with an index \p i such that \p perm[i] < 0; upon completion, \p perm[i] >= 0 indicates the
370  /// new index where column \p i has been moved to; note that \p perm must point to an array of size at least
371  /// #numColsReal()
372  void removeColsReal(int perm[]);
373 
374  /// remove all columns with indices in array \p idx of size \p n; an array \p perm of size #numColsReal() may be
375  /// passed as buffer memory
376  void removeColsReal(int idx[], int n, int perm[] = 0);
377 
378  /// removes columns \p start to \p end including both; an array \p perm of size #numColsReal() may be passed as
379  /// buffer memory
380  void removeColRangeReal(int start, int end, int perm[] = 0);
381 
382  /// clears the LP
383  void clearLPReal();
384 
385  /// synchronizes real LP with rational LP, i.e., copies (rounded) rational LP into real LP, if sync mode is manual
386  void syncLPReal();
387 
388  //@}
389 
390 
391  //**@name Modification of the rational LP */
392  //@{
393 
394  /// adds a single row
395  void addRowRational(const LPRowRational& lprow);
396 
397 #ifdef SOPLEX_WITH_GMP
398  /// adds a single row
399  void addRowRational(const mpq_t* lhs, const mpq_t* rowValues, const int* rowIndices, const int rowSize, const mpq_t* rhs);
400 
401  /// adds a set of rows
402  void 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);
403 #endif
404 
405  /// adds multiple rows
406  void addRowsRational(const LPRowSetRational& lprowset);
407 
408  /// adds a single column
409  void addColRational(const LPColRational& lpcol);
410 
411 #ifdef SOPLEX_WITH_GMP
412  /// adds a single column
413  void addColRational(const mpq_t* obj, const mpq_t* lower, const mpq_t* colValues, const int* colIndices, const int colSize, const mpq_t* upper);
414 
415  /// adds a set of columns
416  void 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);
417 #endif
418 
419  /// adds multiple columns
420  void addColsRational(const LPColSetRational& lpcolset);
421 
422  /// replaces row \p i with \p lprow
423  void changeRowRational(int i, const LPRowRational& lprow);
424 
425  /// changes left-hand side vector for constraints to \p lhs
426  void changeLhsRational(const VectorRational& lhs);
427 
428  /// changes left-hand side of row \p i to \p lhs
429  void changeLhsRational(int i, const Rational& lhs);
430 
431 #ifdef SOPLEX_WITH_GMP
432  /// changes left-hand side of row \p i to \p lhs
433  void changeLhsRational(int i, const mpq_t* lhs);
434 #endif
435 
436  /// changes right-hand side vector to \p rhs
437  void changeRhsRational(const VectorRational& rhs);
438 
439 #ifdef SOPLEX_WITH_GMP
440  /// changes right-hand side vector to \p rhs
441  void changeRhsRational(const mpq_t* rhs, int rhsSize);
442 #endif
443 
444  /// changes right-hand side of row \p i to \p rhs
445  void changeRhsRational(int i, const Rational& rhs);
446 
447  /// changes left- and right-hand side vectors
448  void changeRangeRational(const VectorRational& lhs, const VectorRational& rhs);
449 
450  /// changes left- and right-hand side of row \p i
451  void changeRangeRational(int i, const Rational& lhs, const Rational& rhs);
452 
453 #ifdef SOPLEX_WITH_GMP
454  /// changes left- and right-hand side of row \p i
455  void changeRangeRational(int i, const mpq_t* lhs, const mpq_t* rhs);
456 #endif
457 
458  /// replaces column \p i with \p lpcol
459  void changeColRational(int i, const LPColRational& lpcol);
460 
461  /// changes vector of lower bounds to \p lower
462  void changeLowerRational(const VectorRational& lower);
463 
464  /// changes lower bound of column i to \p lower
465  void changeLowerRational(int i, const Rational& lower);
466 
467 #ifdef SOPLEX_WITH_GMP
468  /// changes lower bound of column i to \p lower
469  void changeLowerRational(int i, const mpq_t* lower);
470 #endif
471 
472  /// changes vector of upper bounds to \p upper
473  void changeUpperRational(const VectorRational& upper);
474 
475  /// changes \p i 'th upper bound to \p upper
476  void changeUpperRational(int i, const Rational& upper);
477 
478 #ifdef SOPLEX_WITH_GMP
479  /// changes upper bound of column i to \p upper
480  void changeUpperRational(int i, const mpq_t* upper);
481 #endif
482 
483  /// changes vectors of column bounds to \p lower and \p upper
484  void changeBoundsRational(const VectorRational& lower, const VectorRational& upper);
485 
486  /// changes bounds of column \p i to \p lower and \p upper
487  void changeBoundsRational(int i, const Rational& lower, const Rational& upper);
488 
489 #ifdef SOPLEX_WITH_GMP
490  /// changes bounds of column \p i to \p lower and \p upper
491  void changeBoundsRational(int i, const mpq_t* lower, const mpq_t* upper);
492 #endif
493 
494  /// changes objective function vector to \p obj
495  void changeObjRational(const VectorRational& obj);
496 
497  /// changes objective coefficient of column i to \p obj
498  void changeObjRational(int i, const Rational& obj);
499 
500 #ifdef SOPLEX_WITH_GMP
501  /// changes objective coefficient of column i to \p obj
502  void changeObjRational(int i, const mpq_t* obj);
503 #endif
504 
505  /// changes matrix entry in row \p i and column \p j to \p val
506  void changeElementRational(int i, int j, const Rational& val);
507 
508 #ifdef SOPLEX_WITH_GMP
509  /// changes matrix entry in row \p i and column \p j to \p val
510  void changeElementRational(int i, int j, const mpq_t* val);
511 #endif
512 
513  /// removes row \p i
514  void removeRowRational(int i);
515 
516  /// removes all rows with an index \p i such that \p perm[i] < 0; upon completion, \p perm[i] >= 0 indicates the new
517  /// index where row \p i has been moved to; note that \p perm must point to an array of size at least
518  /// #numRowsRational()
519  void removeRowsRational(int perm[]);
520 
521  /// remove all rows with indices in array \p idx of size \p n; an array \p perm of size #numRowsRational() may be
522  /// passed as buffer memory
523  void removeRowsRational(int idx[], int n, int perm[] = 0);
524 
525  /// removes rows \p start to \p end including both; an array \p perm of size #numRowsRational() may be passed as
526  /// buffer memory
527  void removeRowRangeRational(int start, int end, int perm[] = 0);
528 
529  /// removes column i
530  void removeColRational(int i);
531 
532  /// removes all columns with an index \p i such that \p perm[i] < 0; upon completion, \p perm[i] >= 0 indicates the
533  /// new index where column \p i has been moved to; note that \p perm must point to an array of size at least
534  /// #numColsRational()
535  void removeColsRational(int perm[]);
536 
537  /// remove all columns with indices in array \p idx of size \p n; an array \p perm of size #numColsRational() may be
538  /// passed as buffer memory
539  void removeColsRational(int idx[], int n, int perm[] = 0);
540 
541  /// removes columns \p start to \p end including both; an array \p perm of size #numColsRational() may be passed as
542  /// buffer memory
543  void removeColRangeRational(int start, int end, int perm[] = 0);
544 
545  /// clears the LP
546  void clearLPRational();
547 
548  /// synchronizes rational LP with real LP, i.e., copies real LP to rational LP, if sync mode is manual
549  void syncLPRational();
550 
551  //@}
552 
553 
554  //**@name Solving and general solution query */
555  //@{
556 
557  /// solves the LP
559 
560  /// returns the current solver status
561  SPxSolver::Status status() const;
562 
563  /// is a primal feasible solution available?
564  bool hasPrimal() const;
565 
566  /// is a primal unbounded ray available?
567  bool hasPrimalRay() const;
568 
569  /// is a dual feasible solution available?
570  bool hasDual() const;
571 
572  /// is Farkas proof of infeasibility available?
573  bool hasDualFarkas() const;
574 
575  //@}
576 
577 
578  //**@name Query for the real solution data */
579  //@{
580 
581  /// returns the objective value if a primal solution is available
582  Real objValueReal();
583 
584  /// gets the primal solution vector if available; returns true on success
585  bool getPrimalReal(VectorReal& vector);
586 
587  /// gets the vector of slack values if available; returns true on success
588  bool getSlacksReal(VectorReal& vector);
589 
590  /// gets the primal ray if available; returns true on success
591  bool getPrimalRayReal(VectorReal& vector);
592 
593  /// gets the dual solution vector if available; returns true on success
594  bool getDualReal(VectorReal& vector);
595 
596  /// gets the vector of reduced cost values if available; returns true on success
597  bool getRedCostReal(VectorReal& vector);
598 
599  /// gets the Farkas proof if available; returns true on success
600  bool getDualFarkasReal(VectorReal& vector);
601 
602  /// gets violation of bounds; returns true on success
603  bool getBoundViolationReal(Real& maxviol, Real& sumviol);
604 
605  /// gets violation of constraints; returns true on success
606  bool getRowViolationReal(Real& maxviol, Real& sumviol);
607 
608  /// gets violation of reduced costs; returns true on success
609  bool getRedCostViolationReal(Real& maxviol, Real& sumviol);
610 
611  /// gets violation of dual multipliers; returns true on success
612  bool getDualViolationReal(Real& maxviol, Real& sumviol);
613 
614  //@}
615 
616 
617  //**@name Query for the rational solution data */
618  //@{
619 
620  /// returns the objective value if a primal solution is available
622 
623  /// gets the primal solution vector if available; returns true on success
624  bool getPrimalRational(VectorRational& vector);
625 
626  /// gets the vector of slack values if available; returns true on success
627  bool getSlacksRational(VectorRational& vector);
628 
629  /// gets the primal ray if LP is unbounded; returns true on success
630  bool getPrimalRayRational(VectorRational& vector);
631 
632  /// gets the dual solution vector if available; returns true on success
633  bool getDualRational(VectorRational& vector);
634 
635  /// gets the vector of reduced cost values if available; returns true on success
636  bool getRedCostRational(VectorRational& vector);
637 
638  /// gets the Farkas proof if LP is infeasible; returns true on success
640 
641  /// gets violation of bounds; returns true on success
642  bool getBoundViolationRational(Rational& maxviol, Rational& sumviol);
643 
644  /// gets violation of constraints; returns true on success
645  bool getRowViolationRational(Rational& maxviol, Rational& sumviol);
646 
647  /// gets violation of reduced costs; returns true on success
648  bool getRedCostViolationRational(Rational& maxviol, Rational& sumviol);
649 
650  /// gets violation of dual multipliers; returns true on success
651  bool getDualViolationRational(Rational& maxviol, Rational& sumviol);
652 
653 #ifdef SOPLEX_WITH_GMP
654  /// gets the primal solution vector if available; returns true on success
655  bool getPrimalRational(mpq_t* vector, const int size);
656 
657  /// gets the vector of slack values if available; returns true on success
658  bool getSlacksRational(mpq_t* vector, const int size);
659 
660  /// gets the primal ray if LP is unbounded; returns true on success
661  bool getPrimalRayRational(mpq_t* vector, const int size);
662 
663  /// gets the dual solution vector if available; returns true on success
664  bool getDualRational(mpq_t* vector, const int size);
665 
666  /// gets the vector of reduced cost values if available; returns true on success
667  bool getRedCostRational(mpq_t* vector, const int size);
668 
669  /// gets the Farkas proof if LP is infeasible; returns true on success
670  bool getDualFarkasRational(mpq_t* vector, const int size);
671 #endif
672 
673  /// get size of primal solution
674  int totalSizePrimalRational(const int base = 2);
675 
676  /// get size of dual solution
677  int totalSizeDualRational(const int base = 2);
678 
679  /// get size of least common multiple of denominators in primal solution
680  int dlcmSizePrimalRational(const int base = 2);
681 
682  /// get size of least common multiple of denominators in dual solution
683  int dlcmSizeDualRational(const int base = 2);
684 
685  /// get size of largest denominator in primal solution
686  int dmaxSizePrimalRational(const int base = 2);
687 
688  /// get size of largest denominator in dual solution
689  int dmaxSizeDualRational(const int base = 2);
690 
691  //@}
692 
693 
694  //**@name Access and modification of basis information */
695  //@{
696 
697  /// is an advanced starting basis available?
698  bool hasBasis() const;
699 
700  /// returns the current basis status
702 
703  /// returns basis status for a single row
704  SPxSolver::VarStatus basisRowStatus(int row) const;
705 
706  /// returns basis status for a single column
707  SPxSolver::VarStatus basisColStatus(int col) const;
708 
709  /// gets current basis via arrays of statuses
710  void getBasis(SPxSolver::VarStatus rows[], SPxSolver::VarStatus cols[]) const;
711 
712  /// gets the indices of the basic columns and rows; basic column n gives value n, basic row m gives value -1-m
713  void getBasisInd(int* bind) const;
714 
715  /// computes an estimated condition number for the current basis matrix using the power method; returns true on success
716  bool getEstimatedCondition(Real& condition);
717 
718  /// computes the exact condition number for the current basis matrix using the power method; returns true on success
719  bool getExactCondition(Real& condition);
720 
721  /// computes row r of basis inverse; returns true on success
722  bool getBasisInverseRowReal(int r, Real* coef, int* inds = NULL, int* ninds = NULL);
723 
724  /// computes column c of basis inverse; returns true on success
725  bool getBasisInverseColReal(int c, Real* coef, int* inds = NULL, int* ninds = NULL);
726 
727  /// computes dense solution of basis matrix B * sol = rhs; returns true on success
728  bool getBasisInverseTimesVecReal(Real* rhs, Real* sol);
729 
730  /// sets starting basis via arrays of statuses
732 
733  /// clears starting basis
734  void clearBasis();
735 
736  //@}
737 
738 
739  //**@name Statistical information */
740  //@{
741 
742  /// number of iterations since last call to solve
743  int numIterations() const;
744 
745  /// time spent in last call to solve
746  Real solveTime() const;
747 
748  /// statistical information in form of a string
749  std::string statisticString() const;
750 
751  /// name of starter
752  const char* getStarterName();
753 
754  /// name of simplifier
755  const char* getSimplifierName();
756 
757  /// name of scaling method
758  const char* getScalerName();
759 
760  /// name of currently loaded pricer
761  const char* getPricerName();
762 
763  /// name of currently loaded ratiotester
764  const char* getRatiotesterName();
765 
766  //@}
767 
768 
769  //**@name File I/O */
770  //@{
771 
772  /// reads LP file in LP or MPS format according to READMODE parameter; gets row names, column names, and
773  /// integer variables if desired; returns true on success
774  bool readFile(const char* filename, NameSet* rowNames = 0, NameSet* colNames = 0, DIdxSet* intVars = 0);
775 
776  /// writes real LP to file; LP or MPS format is chosen from the extension in \p filename; if \p rowNames and \p
777  /// colNames are \c NULL, default names are used; if \p intVars is not \c NULL, the variables contained in it are
778  /// marked as integer; returns true on success
779  bool writeFileReal(const char* filename, const NameSet* rowNames = 0, const NameSet* colNames = 0, const DIdxSet* intvars = 0) const;
780 
781  /// writes rational LP to file; LP or MPS format is chosen from the extension in \p filename; if \p rowNames and \p
782  /// colNames are \c NULL, default names are used; if \p intVars is not \c NULL, the variables contained in it are
783  /// marked as integer; returns true on success
784  bool writeFileRational(const char* filename, const NameSet* rowNames = 0, const NameSet* colNames = 0, const DIdxSet* intvars = 0) const;
785 
786  /// reads basis information from \p filename and returns true on success; if \p rowNames and \p colNames are \c NULL,
787  /// default names are assumed; returns true on success
788  bool readBasisFile(const char* filename, const NameSet* rowNames = 0, const NameSet* colNames = 0);
789 
790  /// writes basis information to \p filename; if \p rowNames and \p colNames are \c NULL, default names are used;
791  /// returns true on success
792  bool writeBasisFile(const char* filename, const NameSet* rowNames = 0, const NameSet* colNames = 0, const bool cpxFormat = false) const;
793 
794  /// writes internal LP, basis information, and parameter settings; if \p rowNames and \p colNames are \c NULL,
795  /// default names are used
796  void writeStateReal(const char* filename, const NameSet* rowNames = 0, const NameSet* colNames = 0, const bool cpxFormat = false) const;
797 
798  /// writes internal LP, basis information, and parameter settings; if \p rowNames and \p colNames are \c NULL,
799  /// default names are used
800  void writeStateRational(const char* filename, const NameSet* rowNames = 0, const NameSet* colNames = 0, const bool cpxFormat = false) const;
801 
802  //@}
803 
804 
805  //**@name Parameters */
806  //@{
807 
808  /// boolean parameters
809  typedef enum
810  {
811  /// should lifting be used to reduce range of nonzero matrix coefficients?
812  LIFTING = 0,
813 
814  /// should LP be transformed to equality form before a rational solve?
815  EQTRANS = 1,
816 
817  /// should dual infeasibility be tested in order to try to return a dual solution even if primal infeasible?
819 
820  /// should a rational factorization be performed after iterative refinement?
821  RATFAC = 3,
822 
823  /// should cycling solutions be accepted during iterative refinement?
825 
826  /// apply rational reconstruction after each iterative refinement?
827  RATREC = 5,
828 
829  /// round scaling factors for iterative refinement to powers of two?
831 
832  /// continue iterative refinement with exact basic solution if not optimal?
834 
835  /// should feasibility be tested with relaxed bounds and sides?
837 
838  /// use bound flipping also for row representation?
840 
841  /// number of boolean parameters
843  } BoolParam;
844 
845  /// integer parameters
846  typedef enum
847  {
848  /// objective sense
849  OBJSENSE = 0,
850 
851  /// type of computational form, i.e., column or row representation
853 
854  /// type of algorithm, i.e., primal or dual
856 
857  /// type of LU update
859 
860  /// maximum number of updates without fresh factorization
862 
863  /// iteration limit (-1 if unlimited)
865 
866  /// refinement limit (-1 if unlimited)
867  REFLIMIT = 6,
868 
869  /// stalling refinement limit (-1 if unlimited)
871 
872  /// display frequency
874 
875  /// verbosity level
877 
878  /// type of simplifier
880 
881  /// type of scaler
882  SCALER = 11,
883 
884  /// type of starter used to create crash basis
885  STARTER = 12,
886 
887  /// type of pricer
888  PRICER = 13,
889 
890  /// type of ratio test
892 
893  /// mode for synchronizing real and rational LP
894  SYNCMODE = 15,
895 
896  /// mode for reading LP files
897  READMODE = 16,
898 
899  /// mode for iterative refinement strategy
900  SOLVEMODE = 17,
901 
902  /// mode for a posteriori feasibility checks
903  CHECKMODE = 18,
904 
905  /// type of timer
906  TIMER = 19,
907 
908  /// mode for hyper sparse pricing
910 
911  /// minimum number of stalling refinements since last pivot to trigger rational factorization
913 
914  /// number of integer parameters
916  } IntParam;
917 
918  /// values for parameter OBJSENSE
919  enum
920  {
921  /// minimization
923 
924  /// maximization
926  };
927 
928  /// values for parameter REPRESENTATION
929  enum
930  {
931  /// automatic choice according to number of rows and columns
933 
934  /// column representation Ax - s = 0, lower <= x <= upper, lhs <= s <= rhs
936 
937  /// row representation (lower,lhs) <= (x,Ax) <= (upper,rhs)
939  };
940 
941  /// values for parameter ALGORITHM
942  enum
943  {
944  /// primal simplex algorithm, i.e., entering for column and leaving for row representation
946 
947  /// dual simplex algorithm, i.e., leaving for column and entering for row representation
949  };
950 
951  /// values for parameter FACTOR_UPDATE_TYPE
952  enum
953  {
954  /// product form update
956 
957  /// Forrest-Tomlin type update
959  };
960 
961  /// values for parameter VERBOSITY
962  enum
963  {
964  /// only error output
966 
967  /// only error and warning output
969 
970  /// only error, warning, and debug output
972 
973  /// standard verbosity level
975 
976  /// high verbosity level
978 
979  /// full verbosity level
981  };
982 
983  /// values for parameter SIMPLIFIER
984  enum
985  {
986  /// no simplifier
988 
989  /// automatic choice
991  };
992 
993  /// values for parameter SCALER
994  enum
995  {
996  /// no scaler
998 
999  /// equilibrium scaling on rows or columns
1001 
1002  /// equilibrium scaling on rows and columns
1004 
1005  /// geometric mean scaling on rows and columns, max 1 round
1007 
1008  /// geometric mean scaling on rows and columns, max 8 rounds
1010  };
1011 
1012  /// values for parameter STARTER
1013  enum
1014  {
1015  /// slack basis
1017 
1018  /// greedy crash basis weighted by objective, bounds, and sides
1020 
1021  /// crash basis from a greedy solution
1023 
1024  /// generic solution-based crash basis
1026  };
1027 
1028  /// values for parameter PRICER
1029  enum
1030  {
1031  /// automatic pricer
1033 
1034  /// Dantzig pricer
1036 
1037  /// partial multiple pricer based on Dantzig pricing
1039 
1040  /// devex pricer
1042 
1043  /// steepest edge pricer with initialization to unit norms
1045 
1046  /// steepest edge pricer with exact initialization of norms
1048  };
1049 
1050  /// values for parameter RATIOTESTER
1051  enum
1052  {
1053  /// textbook ratio test without stabilization
1055 
1056  /// standard Harris ratio test
1058 
1059  /// modified Harris ratio test
1061 
1062  /// bound flipping ratio test for long steps in the dual simplex
1064  };
1065 
1066  /// values for parameter SYNCMODE
1067  enum
1068  {
1069  /// store only real LP
1071 
1072  /// automatic sync of real and rational LP
1074 
1075  /// user sync of real and rational LP
1077  };
1078 
1079  /// values for parameter READMODE
1080  enum
1081  {
1082  /// standard floating-point parsing
1084 
1085  /// rational parsing
1087  };
1088 
1089  /// values for parameter SOLVEMODE
1090  enum
1091  {
1092  /// apply standard floating-point algorithm
1094 
1095  /// decide depending on tolerances whether to apply iterative refinement
1097 
1098  /// force iterative refinement
1100  };
1101 
1102  /// values for parameter CHECKMODE
1103  enum
1104  {
1105  /// floating-point check
1107 
1108  /// decide according to READMODE
1110 
1111  /// rational check
1113  };
1114 
1115  /// values for parameter TIMER
1116  enum
1117  {
1118  /// disable timing
1120 
1121  /// cpu or user time
1123 
1124  /// wallclock time
1126  };
1127 
1128  /// values for parameter HYPER_PRICING
1129  enum
1130  {
1131  /// never
1133 
1134  /// decide according to problem size
1136 
1137  /// always
1139  };
1140 
1141  /// real parameters
1142  typedef enum
1143  {
1144  /// primal feasibility tolerance
1145  FEASTOL = 0,
1146 
1147  /// dual feasibility tolerance
1148  OPTTOL = 1,
1149 
1150  /// general zero tolerance
1152 
1153  /// zero tolerance used in factorization
1155 
1156  /// zero tolerance used in update of the factorization
1158 
1159  /// pivot zero tolerance used in factorization
1161 
1162  /// infinity threshold
1163  INFTY = 6,
1164 
1165  /// time limit in seconds (INFTY if unlimited)
1167 
1168  /// lower limit on objective value
1170 
1171  /// upper limit on objective value
1173 
1174  /// working tolerance for feasibility in floating-point solver during iterative refinement
1176 
1177  /// working tolerance for optimality in floating-point solver during iterative refinement
1178  FPOPTTOL = 11,
1179 
1180  /// maximum increase of scaling factors between refinements
1182 
1183  /// lower threshold in lifting (nonzero matrix coefficients with smaller absolute value will be reformulated)
1185 
1186  /// upper threshold in lifting (nonzero matrix coefficients with larger absolute value will be reformulated)
1188 
1189  /// sparse pricing threshold (\#violations < dimension * SPARSITY_THRESHOLD activates sparse pricing)
1191 
1192  /// threshold on number of rows vs. number of columns for switching from column to row representations in auto mode
1194 
1195  /// geometric frequency at which to apply rational reconstruction
1197 
1198  /// minimal reduction (sum of removed rows/cols) to continue simplification
1199  MINRED = 18,
1200 
1201  /// number of real parameters
1203  } RealParam;
1204 
1205 #ifdef SOPLEX_WITH_RATIONALPARAM
1206  /// rational parameters
1207  typedef enum
1208  {
1209  /// number of rational parameters
1210  RATIONALPARAM_COUNT = 0
1211  } RationalParam;
1212 #endif
1213 
1214  /// class of parameter settings
1215  class Settings;
1216 
1217  mutable SPxOut spxout;
1218 
1219  /// returns boolean parameter value
1220  bool boolParam(const BoolParam param) const;
1221 
1222  /// returns integer parameter value
1223  int intParam(const IntParam param) const;
1224 
1225  /// returns real parameter value
1226  Real realParam(const RealParam param) const;
1227 
1228 #ifdef SOPLEX_WITH_RATIONALPARAM
1229  /// returns rational parameter value
1230  Rational rationalParam(const RationalParam param) const;
1231 #endif
1232 
1233  /// returns current parameter settings
1234  const Settings& settings() const;
1235 
1236  /// sets boolean parameter value; returns true on success
1237  bool setBoolParam(const BoolParam param, const bool value, const bool quiet = false, const bool init = false);
1238 
1239  /// sets integer parameter value; returns true on success
1240  bool setIntParam(const IntParam param, const int value, const bool quiet = false, const bool init = false);
1241 
1242  /// sets real parameter value; returns true on success
1243  bool setRealParam(const RealParam param, const Real value, const bool quiet = false, const bool init = false);
1244 
1245 #ifdef SOPLEX_WITH_RATIONALPARAM
1246  /// sets rational parameter value; returns true on success
1247  bool setRationalParam(const RationalParam param, const Rational value, const bool quiet = false, const bool init = false);
1248 #endif
1249 
1250  /// sets parameter settings; returns true on success
1251  bool setSettings(const Settings& newSettings, const bool quiet = false, const bool init = false);
1252 
1253  /// print non-default parameter values
1254  void printUserSettings();
1255 
1256  /// writes settings file; returns true on success
1257  bool saveSettingsFile(const char* filename, const bool onlyChanged = false) const;
1258 
1259  /// reads settings file; returns true on success
1260  bool loadSettingsFile(const char* filename);
1261 
1262  /// parses one setting string and returns true on success; note that string is modified
1263  bool parseSettingsString(char* line);
1264 
1265  //@}
1266 
1267 
1268  //**@name Statistics */
1269  //@{
1270 
1271  /// prints solution statistics
1272  void printSolutionStatistics(std::ostream& os);
1273 
1274  /// prints statistics on solving process
1275  void printSolvingStatistics(std::ostream& os);
1276 
1277  /// prints short statistics
1278  void printShortStatistics(std::ostream& os);
1279 
1280  /// prints complete statistics
1281  void printStatistics(std::ostream& os);
1282 
1283  /// prints status
1284  void printStatus(std::ostream& os, SPxSolver::Status status);
1285 
1286  //@}
1287 
1288 
1289  //**@name Miscellaneous */
1290  //@{
1291 
1292  /// prints version and compilation options
1293  void printVersion() const;
1294 
1295  /// checks if real LP and rational LP are in sync; dimensions will always be compared,
1296  /// vector and matrix values only if the respective parameter is set to true.
1297  /// If quiet is set to true the function will only display which vectors are different.
1298  bool areLPsInSync(const bool checkVecVals = true, const bool checkMatVals = false, const bool quiet = false) const;
1299 
1300  //@}
1301 
1302 private:
1303 
1304  //**@name Statistics on solving process */
1305  //@{
1306 
1307  /// class of statistics
1308  class Statistics;
1309 
1310  /// statistics since last call to solveReal() or solveRational()
1312 
1313  //@}
1314 
1315 
1316  //**@name Parameter settings */
1317  //@{
1318 
1320 
1326 
1327  //@}
1328 
1329 
1330  //**@name Data for the real LP */
1331  //@{
1332 
1353 
1358 
1360 
1367 
1368  //@}
1369 
1370 
1371  //**@name Data for the rational LP */
1372  //@{
1373 
1375 
1399 
1400  /// type of bounds and sides
1401  typedef enum
1402  {
1403  /// both bounds are infinite
1405 
1406  /// lower bound is finite, upper bound is infinite
1408 
1409  /// upper bound is finite, lower bound is infinite
1411 
1412  /// lower and upper bound finite, but different
1414 
1415  /// lower bound equals upper bound
1417  } RangeType;
1418 
1421 
1422  //@}
1423 
1424 
1425  //**@name Solution data */
1426  //@{
1427 
1430 
1433 
1437 
1441 
1442  //@}
1443 
1444 
1445  //**@name Constant helper methods */
1446  //@{
1447 
1448  /// extends sparse vector to hold newmax entries if and only if it holds no more free entries
1449  void _ensureDSVectorRationalMemory(DSVectorRational& vec, const int newmax) const;
1450 
1451  /// creates a permutation for removing rows/columns from an array of indices
1452  void _idxToPerm(int* idx, int idxSize, int* perm, int permSize) const;
1453 
1454  /// creates a permutation for removing rows/columns from a range of indices
1455  void _rangeToPerm(int start, int end, int* perm, int permSize) const;
1456 
1457  /// checks consistency
1458  bool _isConsistent() const;
1459 
1460  /// should solving process be stopped?
1461  bool _isSolveStopped(bool& stoppedTime, bool& stoppedIter) const;
1462 
1463  /// determines RangeType from real bounds
1464  RangeType _rangeTypeReal(const Real& lower, const Real& upper) const;
1465 
1466  /// determines RangeType from rational bounds
1467  RangeType _rangeTypeRational(const Rational& lower, const Rational& upper) const;
1468 
1469  /// switches RANGETYPE_LOWER to RANGETYPE_UPPER and vice versa
1470  RangeType _switchRangeType(const RangeType& rangeType) const;
1471 
1472  /// checks whether RangeType corresponds to finite lower bound
1473  bool _lowerFinite(const RangeType& rangeType) const;
1474 
1475  /// checks whether RangeType corresponds to finite upper bound
1476  bool _upperFinite(const RangeType& rangeType) const;
1477 
1478  //@}
1479 
1480 
1481  //**@name Non-constant helper methods */
1482  //@{
1483 
1484  /// adds a single row to the real LP and adjusts basis
1485  void _addRowReal(const LPRowReal& lprow);
1486 
1487  /// adds a single row to the real LP and adjusts basis
1488  void _addRowReal(Real lhs, const SVectorReal& lprow, Real rhs);
1489 
1490  /// adds multiple rows to the real LP and adjusts basis
1491  void _addRowsReal(const LPRowSetReal& lprowset);
1492 
1493  /// adds a single column to the real LP and adjusts basis
1494  void _addColReal(const LPColReal& lpcol);
1495 
1496  /// adds a single column to the real LP and adjusts basis
1497  void _addColReal(Real obj, Real lower, const SVectorReal& lpcol, Real upper);
1498 
1499  /// adds multiple columns to the real LP and adjusts basis
1500  void _addColsReal(const LPColSetReal& lpcolset);
1501 
1502  /// replaces row \p i with \p lprow and adjusts basis
1503  void _changeRowReal(int i, const LPRowReal& lprow);
1504 
1505  /// changes left-hand side vector for constraints to \p lhs and adjusts basis
1506  void _changeLhsReal(const VectorReal& lhs);
1507 
1508  /// changes left-hand side of row \p i to \p lhs and adjusts basis
1509  void _changeLhsReal(int i, const Real& lhs);
1510 
1511  /// changes right-hand side vector to \p rhs and adjusts basis
1512  void _changeRhsReal(const VectorReal& rhs);
1513 
1514  /// changes right-hand side of row \p i to \p rhs and adjusts basis
1515  void _changeRhsReal(int i, const Real& rhs);
1516 
1517  /// changes left- and right-hand side vectors and adjusts basis
1518  void _changeRangeReal(const VectorReal& lhs, const VectorReal& rhs);
1519 
1520  /// changes left- and right-hand side of row \p i and adjusts basis
1521  void _changeRangeReal(int i, const Real& lhs, const Real& rhs);
1522 
1523  /// replaces column \p i with \p lpcol and adjusts basis
1524  void _changeColReal(int i, const LPColReal& lpcol);
1525 
1526  /// changes vector of lower bounds to \p lower and adjusts basis
1527  void _changeLowerReal(const VectorReal& lower);
1528 
1529  /// changes lower bound of column i to \p lower and adjusts basis
1530  void _changeLowerReal(int i, const Real& lower);
1531 
1532  /// changes vector of upper bounds to \p upper and adjusts basis
1533  void _changeUpperReal(const VectorReal& upper);
1534 
1535  /// changes \p i 'th upper bound to \p upper and adjusts basis
1536  void _changeUpperReal(int i, const Real& upper);
1537 
1538  /// changes vectors of column bounds to \p lower and \p upper and adjusts basis
1539  void _changeBoundsReal(const VectorReal& lower, const VectorReal& upper);
1540 
1541  /// changes bounds of column \p i to \p lower and \p upper and adjusts basis
1542  void _changeBoundsReal(int i, const Real& lower, const Real& upper);
1543 
1544  /// changes matrix entry in row \p i and column \p j to \p val and adjusts basis
1545  void _changeElementReal(int i, int j, const Real& val);
1546 
1547  /// removes row \p i and adjusts basis
1548  void _removeRowReal(int i);
1549 
1550  /// removes all rows with an index \p i such that \p perm[i] < 0; upon completion, \p perm[i] >= 0 indicates the
1551  /// new index where row \p i has been moved to; note that \p perm must point to an array of size at least
1552  /// #numRowsReal()
1553  void _removeRowsReal(int perm[]);
1554 
1555  /// remove all rows with indices in array \p idx of size \p n; an array \p perm of size #numRowsReal() may be passed
1556  /// as buffer memory
1557  void _removeRowsReal(int idx[], int n, int perm[]);
1558 
1559  /// removes rows \p start to \p end including both; an array \p perm of size #numRowsReal() may be passed as buffer
1560  /// memory
1561  void _removeRowRangeReal(int start, int end, int perm[]);
1562 
1563  /// removes column i
1564  void _removeColReal(int i);
1565 
1566  /// removes all columns with an index \p i such that \p perm[i] < 0; upon completion, \p perm[i] >= 0 indicates the
1567  /// new index where column \p i has been moved to; note that \p perm must point to an array of size at least
1568  /// #numColsReal()
1569  void _removeColsReal(int perm[]);
1570 
1571  /// remove all columns with indices in array \p idx of size \p n; an array \p perm of size #numColsReal() may be
1572  /// passed as buffer memory
1573  void _removeColsReal(int idx[], int n, int perm[]);
1574 
1575  /// removes columns \p start to \p end including both; an array \p perm of size #numColsReal() may be passed as
1576  /// buffer memory
1577  void _removeColRangeReal(int start, int end, int perm[]);
1578 
1579  /// invalidates solution
1580  void _invalidateSolution();
1581 
1582  /// enables simplifier and scaler according to current parameters
1584 
1585  /// disables simplifier and scaler
1587 
1588  /// ensures that the rational LP is available; performs no sync
1589  void _ensureRationalLP();
1590 
1591  /// ensures that the real LP and the basis are loaded in the solver; performs no sync
1592  void _ensureRealLPLoaded();
1593 
1594  /// call floating-point solver and update statistics on iterations etc.
1596 
1597  /// reads real LP in LP or MPS format from file and returns true on success; gets row names, column names, and
1598  /// integer variables if desired
1599  bool _readFileReal(const char* filename, NameSet* rowNames = 0, NameSet* colNames = 0, DIdxSet* intVars = 0);
1600 
1601  /// reads rational LP in LP or MPS format from file and returns true on success; gets row names, column names, and
1602  /// integer variables if desired
1603  bool _readFileRational(const char* filename, NameSet* rowNames = 0, NameSet* colNames = 0, DIdxSet* intVars = 0);
1604 
1605  /// recomputes range types from scratch using real LP
1606  void _recomputeRangeTypesReal();
1607 
1608  /// recomputes range types from scratch using rational LP
1610 
1611  /// synchronizes real LP with rational LP, i.e., copies (rounded) rational LP into real LP, without looking at the sync mode
1612  void _syncLPReal(bool time = true);
1613 
1614  /// synchronizes rational LP with real LP, i.e., copies real LP to rational LP, without looking at the sync mode
1615  void _syncLPRational(bool time = true);
1616 
1617  /// synchronizes real solution with rational solution, i.e., copies real solution to rational solution
1618  void _syncRealSolution();
1619 
1620  /// synchronizes rational solution with real solution, i.e., copies (rounded) rational solution to real solution
1621  void _syncRationalSolution();
1622 
1623  /// returns pointer to a constant unit vector available until destruction of the SoPlex class
1624  const UnitVectorRational* _unitVectorRational(const int i);
1625 
1626  /// parses one line in a settings file and returns true on success; note that the string is modified
1627  bool _parseSettingsLine(char* line, const int lineNumber);
1628 
1629  //@}
1630 
1631 
1632  //**@name Private solving methods implemented in solverational.cpp */
1633  //@{
1634 
1635  /// solves rational LP
1636  void _solveRational();
1637 
1638  /// solves current problem with iterative refinement and recovery mechanism
1639  void _performOptIRStable(SolRational& sol,
1640  bool acceptUnbounded,
1641  bool acceptInfeasible,
1642  int minRounds,
1643  bool& primalFeasible,
1644  bool& dualFeasible,
1645  bool& infeasible,
1646  bool& unbounded,
1647  bool& stopped,
1648  bool& stoppedIter,
1649  bool& error);
1650 
1651  /// performs iterative refinement on the auxiliary problem for testing unboundedness
1652  void _performUnboundedIRStable(SolRational& sol, bool& hasUnboundedRay, bool& stopped, bool& stoppedIter, bool& error);
1653 
1654  /// performs iterative refinement on the auxiliary problem for testing feasibility
1655  void _performFeasIRStable(SolRational& sol, bool& withDualFarkas, bool& stopped, bool& stoppedIter, bool& error);
1656 
1657  /// reduces matrix coefficient in absolute value by the lifting procedure of Thiele et al. 2013
1658  void _lift();
1659 
1660  /// undoes lifting
1661  void _project(SolRational& sol);
1662 
1663  /// store basis
1664  void _storeBasis();
1665 
1666  /// restore basis
1667  void _restoreBasis();
1668 
1669  /// stores objective, bounds, and sides of real LP
1670  void _storeLPReal();
1671 
1672  /// restores objective, bounds, and sides of real LP
1673  void _restoreLPReal();
1674 
1675  /// introduces slack variables to transform inequality constraints into equations for both rational and real LP,
1676  /// which should be in sync
1677  void _transformEquality();
1678 
1679  /// undoes transformation to equality form
1680  void _untransformEquality(SolRational& sol);
1681 
1682  /// transforms LP to unboundedness problem by moving the objective function to the constraints, changing right-hand
1683  /// side and bounds to zero, and adding an auxiliary variable for the decrease in the objective function
1684  void _transformUnbounded();
1685 
1686  /// undoes transformation to unboundedness problem
1687  void _untransformUnbounded(SolRational& sol, bool unbounded);
1688 
1689  /// transforms LP to feasibility problem by removing the objective function, shifting variables, and homogenizing the
1690  /// right-hand side
1691  void _transformFeasibility();
1692 
1693  /// undoes transformation to feasibility problem
1694  void _untransformFeasibility(SolRational& sol, bool infeasible);
1695 
1696  /** computes radius of infeasibility box implied by an approximate Farkas' proof
1697 
1698  Given constraints of the form \f$ lhs <= Ax <= rhs \f$, a farkas proof y should satisfy \f$ y^T A = 0 \f$ and
1699  \f$ y_+^T lhs - y_-^T rhs > 0 \f$, where \f$ y_+, y_- \f$ denote the positive and negative parts of \f$ y \f$.
1700  If \f$ y \f$ is approximate, it may not satisfy \f$ y^T A = 0 \f$ exactly, but the proof is still valid as long
1701  as the following holds for all potentially feasible \f$ x \f$:
1702 
1703  \f[
1704  y^T Ax < (y_+^T lhs - y_-^T rhs) (*)
1705  \f]
1706 
1707  we may therefore calculate \f$ y^T A \f$ and \f$ y_+^T lhs - y_-^T rhs \f$ exactly and check if the upper and lower
1708  bounds on \f$ x \f$ imply that all feasible \f$ x \f$ satisfy (*), and if not then compute bounds on \f$ x \f$ to
1709  guarantee (*). The simplest way to do this is to compute
1710 
1711  \f[
1712  B = (y_+^T lhs - y_-^T rhs) / \sum_i(|(y^T A)_i|)
1713  \f]
1714 
1715  noting that if every component of \f$ x \f$ has \f$ |x_i| < B \f$, then (*) holds.
1716 
1717  \f$ B \f$ can be increased by iteratively including variable bounds smaller than \f$ B \f$. The speed of this
1718  method can be further improved by using interval arithmetic for all computations. For related information see
1719  Sec. 4 of Neumaier and Shcherbina, Mathematical Programming A, 2004.
1720 
1721  Set transformed to true if this method is called after _transformFeasibility().
1722  */
1723  void _computeInfeasBox(SolRational& sol, bool transformed);
1724 
1725  /// solves real LP during iterative refinement
1726  SPxSolver::Status _solveRealForRational(bool fromscratch, VectorReal& primal, VectorReal& dual,
1727  DataArray< SPxSolver::VarStatus >& basisStatusRows,
1728  DataArray< SPxSolver::VarStatus >& basisStatusCols, bool& returnedBasis);
1729 
1730  /// solves real LP with recovery mechanism
1731  SPxSolver::Status _solveRealStable(bool acceptUnbounded, bool acceptInfeasible, VectorReal& primal, VectorReal& dual,
1732  DataArray< SPxSolver::VarStatus >& basisStatusRows,
1733  DataArray< SPxSolver::VarStatus >& basisStatusCols, bool& returnedBasis, const bool forceNoSimplifier = false);
1734 
1735  /// factorizes rational basis matrix in column representation
1736  void _factorizeColumnRational(SolRational& sol, DataArray< SPxSolver::VarStatus >& basisStatusRows, DataArray< SPxSolver::VarStatus >& basisStatusCols, bool& stoppedTime, bool& stoppedIter, bool& error, bool& optimal);
1737 
1738  /// attempts rational reconstruction of primal-dual solution
1739  bool _reconstructSolutionRational(SolRational& sol, DataArray< SPxSolver::VarStatus >& basisStatusRows, DataArray< SPxSolver::VarStatus >& basisStatusCols, const Rational& denomBoundSquared);
1740  //@}
1741 
1742 
1743  //**@name Private solving methods implemented in solvereal.cpp */
1744  //@{
1745 
1746  /// solves real LP
1747  void _solveReal();
1748 
1749  /// checks result of the solving process and solves again without preprocessing if necessary
1750  void _evaluateSolutionReal(SPxSimplifier::Result simplificationStatus);
1751 
1752  /// solves real LP with/without preprocessing
1753  void _preprocessAndSolveReal(bool applyPreprocessing);
1754 
1755  /// loads original problem into solver and solves again after it has been solved to optimality with preprocessing
1756  void _resolveWithoutPreprocessing(SPxSimplifier::Result simplificationStatus);
1757 
1758  /// stores solution of the real LP; before calling this, the real LP must be loaded in the solver and solved (again)
1759  void _storeSolutionReal();
1760 
1761  //@}
1762 };
1763 }
1764 #else
1765 #include "soplexlegacy.h"
1766 
1767 namespace soplex
1768 {
1769  typedef SoPlexLegacy SoPlex;
1770 }
1771 #endif
1772 #endif // _SOPLEX_H_
void changeLhsRational(const VectorRational &lhs)
changes left-hand side vector for constraints to lhs
Definition: soplex.cpp:2025
int _lastSolveMode
Definition: soplex.h:1429
floating-point check
Definition: soplex.h:1106
Fast shifting ratio test.
RangeType
type of bounds and sides
Definition: soplex.h:1401
const char * getRatiotesterName()
name of currently loaded ratiotester
Definition: soplex.cpp:4466
textbook ratio test without stabilization
Definition: soplex.h:1054
void _changeUpperReal(const VectorReal &upper)
changes vector of upper bounds to upper and adjusts basis
Definition: soplex.cpp:6775
int numColsReal() const
returns number of columns
Definition: soplex.cpp:779
const VectorReal & lowerReal() const
returns lower bound vector
Definition: soplex.cpp:932
const Settings & settings() const
returns current parameter settings
Definition: soplex.cpp:4888
SoPlex start basis generation base class.
zero tolerance used in factorization
Definition: soplex.h:1154
Rational _rationalMaxscaleincr
Definition: soplex.h:1325
Bound flipping ratio test ("long step dual") for SoPlex.Class SPxBoundFlippingRT provides an implemen...
DVectorRational _unboundedRhs
Definition: soplex.h:1380
Safe arrays of data objects.Class DataArray provides safe arrays of Data Objects. For general C++ obj...
Definition: dataarray.h:63
Real maxAbsNonzeroReal() const
returns biggest non-zero element in absolute value
Definition: soplex.cpp:806
SoPlex()
default constructor
Definition: soplex.cpp:559
bool getDualViolationRational(Rational &maxviol, Rational &sumviol)
gets violation of dual multipliers; returns true on success
Definition: soplex.cpp:3430
Types of solution classes.
SolRational _workSol
Definition: soplex.h:1436
void printSolutionStatistics(std::ostream &os)
prints solution statistics
Definition: soplex.cpp:5818
void _transformEquality()
introduces slack variables to transform inequality constraints into equations for both rational and r...
Real minAbsNonzeroReal() const
returns smallest non-zero element in absolute value
Definition: soplex.cpp:797
void _addColReal(const LPColReal &lpcol)
adds a single column to the real LP and adjusts basis
Definition: soplex.cpp:6502
void removeRowsRational(int perm[])
removes all rows with an index i such that perm[i] < 0; upon completion, perm[i] >= 0 indicates the n...
Definition: soplex.cpp:2526
type of starter used to create crash basis
Definition: soplex.h:885
bool setSettings(const Settings &newSettings, const bool quiet=false, const bool init=false)
sets parameter settings; returns true on success
Definition: soplex.cpp:5385
void removeColsReal(int perm[])
removes all columns with an index i such that perm[i] < 0; upon completion, perm[i] >= 0 indicates th...
Definition: soplex.cpp:1735
upper limit on objective value
Definition: soplex.h:1172
Devex pricer.The Devex Pricer for SoPlex implements an approximate steepest edge pricing, that does without solving an extra linear system and computing the scalar products.
Definition: spxdevexpr.h:43
void _changeElementReal(int i, int j, const Real &val)
changes matrix entry in row i and column j to val and adjusts basis
Definition: soplex.cpp:6862
void _transformUnbounded()
transforms LP to unboundedness problem by moving the objective function to the constraints, changing right-hand side and bounds to zero, and adding an auxiliary variable for the decrease in the objective function
general zero tolerance
Definition: soplex.h:1151
Result
Result of the simplification.
Definition: spxsimplifier.h:81
bool hasBasis() const
is an advanced starting basis available?
Definition: soplex.cpp:3720
void _changeRangeReal(const VectorReal &lhs, const VectorReal &rhs)
changes left- and right-hand side vectors and adjusts basis
Definition: soplex.cpp:6664
type of ratio test
Definition: soplex.h:891
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...
Definition: soplex.cpp:4826
void removeColReal(int i)
removes column i
Definition: soplex.cpp:1709
Steepest edge pricer.Class SPxSteepExPR implements a steepest edge pricer to be used with SoPlex...
Definition: spxsteepexpr.h:40
void _rangeToPerm(int start, int end, int *perm, int permSize) const
creates a permutation for removing rows/columns from a range of indices
Definition: soplex.cpp:6332
maximum increase of scaling factors between refinements
Definition: soplex.h:1181
bool setBoolParam(const BoolParam param, const bool value, const bool quiet=false, const bool init=false)
sets boolean parameter value; returns true on success
Definition: soplex.cpp:4896
SPxMainSM _simplifierMainSM
Definition: soplex.h:1335
Geometric mean row/column scaling.This SPxScaler implementation performs geometric mean scaling of th...
Definition: spxgeometsc.h:35
verbosity level
Definition: soplex.h:876
continue iterative refinement with exact basic solution if not optimal?
Definition: soplex.h:833
bool hasDual() const
is a dual feasible solution available?
Definition: soplex.cpp:2823
type of timer
Definition: soplex.h:906
DVectorRational _feasLhs
Definition: soplex.h:1383
number of real parameters
Definition: soplex.h:1202
apply standard floating-point algorithm
Definition: soplex.h:1093
int numNonzerosRational() const
returns number of nonzeros
Definition: soplex.cpp:1030
type of computational form, i.e., column or row representation
Definition: soplex.h:852
void changeColRational(int i, const LPColRational &lpcol)
replaces column i with lpcol
Definition: soplex.cpp:2208
Abstract pricer base class.
bool getPrimalReal(VectorReal &vector)
gets the primal solution vector if available; returns true on success
Definition: soplex.cpp:2865
bool _isConsistent() const
checks consistency
Definition: soplex.cpp:6344
pivot zero tolerance used in factorization
Definition: soplex.h:1160
equilibrium scaling on rows or columns
Definition: soplex.h:1000
SPxSolver::Status solve()
solves the LP
Definition: soplex.cpp:2722
refinement limit (-1 if unlimited)
Definition: soplex.h:867
bool getDualRational(VectorRational &vector)
gets the dual solution vector if available; returns true on success
Definition: soplex.cpp:3220
SPxSolver::VarStatus basisRowStatus(int row) const
returns basis status for a single row
Definition: soplex.cpp:3749
class of parameter settings
Definition: soplex.cpp:45
SPxLPRational * _rationalLP
Definition: soplex.h:1374
void printShortStatistics(std::ostream &os)
prints short statistics
Definition: soplex.cpp:5905
Solution vector based start basis.
bool getSlacksRational(VectorRational &vector)
gets the vector of slack values if available; returns true on success
Definition: soplex.cpp:3190
standard Harris ratio test
Definition: soplex.h:1057
SPxSolver::Status _solveRealStable(bool acceptUnbounded, bool acceptInfeasible, VectorReal &primal, VectorReal &dual, DataArray< SPxSolver::VarStatus > &basisStatusRows, DataArray< SPxSolver::VarStatus > &basisStatusCols, bool &returnedBasis, const bool forceNoSimplifier=false)
solves real LP with recovery mechanism
int totalSizePrimalRational(const int base=2)
get size of primal solution
Definition: soplex.cpp:3636
void _addColsReal(const LPColSetReal &lpcolset)
adds multiple columns to the real LP and adjusts basis
Definition: soplex.cpp:6539
void getRowsReal(int start, int end, LPRowSetReal &lprowset) const
gets rows start, ..., end.
Definition: soplex.cpp:824
time limit in seconds (INFTY if unlimited)
Definition: soplex.h:1166
const VectorRational & rhsRational() const
returns right-hand side vector
Definition: soplex.cpp:1084
mode for iterative refinement strategy
Definition: soplex.h:900
SPxGeometSC _scalerGeo8
Definition: soplex.h:1339
void changeRangeReal(const VectorReal &lhs, const VectorReal &rhs)
changes left- and right-hand side vectors
Definition: soplex.cpp:1406
void _idxToPerm(int *idx, int idxSize, int *perm, int permSize) const
creates a permutation for removing rows/columns from an array of indices
Definition: soplex.cpp:6311
Rational _rationalFeastol
Definition: soplex.h:1323
void _removeColsReal(int perm[])
removes all columns with an index i such that perm[i] < 0; upon completion, perm[i] >= 0 indicates th...
Definition: soplex.cpp:6969
modified Harris ratio test
Definition: soplex.h:1060
virtual ~SoPlex()
destructor
Definition: soplex.cpp:729
bool getRedCostRational(VectorRational &vector)
gets the vector of reduced cost values if available; returns true on success
Definition: soplex.cpp:3235
void getColsRational(int start, int end, LPColSetRational &lpcolset) const
gets columns start, ..., end
Definition: soplex.cpp:1138
LP geometric mean scaling.
crash basis from a greedy solution
Definition: soplex.h:1022
primal feasibility tolerance
Definition: soplex.h:1145
standard verbosity level
Definition: soplex.h:974
int numRowsReal() const
message handler
Definition: soplex.cpp:770
bound flipping ratio test for long steps in the dual simplex
Definition: soplex.h:1063
Abstract ratio test base class.
void _addRowReal(const LPRowReal &lprow)
adds a single row to the real LP and adjusts basis
Definition: soplex.cpp:6458
DVectorRational _feasLower
Definition: soplex.h:1385
DVectorRational _feasRhs
Definition: soplex.h:1384
SPxScaler * _scaler
Definition: soplex.h:1356
cpu or user time
Definition: soplex.h:1122
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...
Definition: soplex.cpp:4516
void changeRangeRational(const VectorRational &lhs, const VectorRational &rhs)
changes left- and right-hand side vectors
Definition: soplex.cpp:2148
mode for reading LP files
Definition: soplex.h:897
mode for synchronizing real and rational LP
Definition: soplex.h:894
void _syncLPReal(bool time=true)
synchronizes real LP with rational LP, i.e., copies (rounded) rational LP into real LP...
Definition: soplex.cpp:7310
bool getDualFarkasReal(VectorReal &vector)
gets the Farkas proof if available; returns true on success
Definition: soplex.cpp:2940
automatic sync of real and rational LP
Definition: soplex.h:1073
void _recomputeRangeTypesRational()
recomputes range types from scratch using rational LP
Definition: soplex.cpp:7297
iteration limit (-1 if unlimited)
Definition: soplex.h:864
void _transformFeasibility()
transforms LP to feasibility problem by removing the objective function, shifting variables...
void changeObjReal(const VectorReal &obj)
changes objective function vector to obj
Definition: soplex.cpp:1572
void changeRowRational(int i, const LPRowRational &lprow)
replaces row i with lprow
Definition: soplex.cpp:2006
Implementation of Sparse Linear Solver.
bool getRowViolationReal(Real &maxviol, Real &sumviol)
gets violation of constraints; returns true on success
Definition: soplex.cpp:2992
SPxFastRT _ratiotesterFast
Definition: soplex.h:1351
should cycling solutions be accepted during iterative refinement?
Definition: soplex.h:824
void _disableSimplifierAndScaler()
disables simplifier and scaler
Definition: soplex.cpp:7060
bool getRowViolationRational(Rational &maxviol, Rational &sumviol)
gets violation of constraints; returns true on success
Definition: soplex.cpp:3306
DataArray< SPxSolver::VarStatus > _storedBasisStatusCols
Definition: soplex.h:1394
void _performFeasIRStable(SolRational &sol, bool &withDualFarkas, bool &stopped, bool &stoppedIter, bool &error)
performs iterative refinement on the auxiliary problem for testing feasibility
void _removeRowReal(int i)
removes row i and adjusts basis
Definition: soplex.cpp:6882
lower bound is finite, upper bound is infinite
Definition: soplex.h:1407
void _storeBasis()
store basis
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...
Definition: soplex.cpp:7196
decide according to problem size
Definition: soplex.h:1135
SoPlex start basis generation base class.SPxStarter is the virtual base class for classes generating ...
Definition: spxstarter.h:41
void addColsRational(const LPColSetRational &lpcolset)
adds multiple columns
Definition: soplex.cpp:1986
bool _upperFinite(const RangeType &rangeType) const
checks whether RangeType corresponds to finite upper bound
Definition: soplex.cpp:6450
const char * getStarterName()
name of starter
Definition: soplex.cpp:4425
DVectorReal _manualObj
Definition: soplex.h:1365
objective sense
Definition: soplex.h:849
int numColsRational() const
returns number of columns
Definition: soplex.cpp:1021
int numIterations() const
number of iterations since last call to solve
Definition: soplex.cpp:4393
Dantzig pricer.
bool getDualNorms(int &nnormsRow, int &nnormsCol, Real *norms) const
gets steepest edge norms and returns false if they are not available
Definition: soplex.cpp:996
Rational minAbsNonzeroRational() const
returns smallest non-zero element in absolute value
Definition: soplex.cpp:1039
SPxSolver::Status _solveRealForRational(bool fromscratch, VectorReal &primal, VectorReal &dual, DataArray< SPxSolver::VarStatus > &basisStatusRows, DataArray< SPxSolver::VarStatus > &basisStatusCols, bool &returnedBasis)
solves real LP during iterative refinement
General methods in LP preprocessing.
void _untransformUnbounded(SolRational &sol, bool unbounded)
undoes transformation to unboundedness problem
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
Definition: soplex.cpp:4475
bool setIntParam(const IntParam param, const int value, const bool quiet=false, const bool init=false)
sets integer parameter value; returns true on success
Definition: soplex.cpp:4939
display frequency
Definition: soplex.h:873
void _ensureRationalLP()
ensures that the rational LP is available; performs no sync
Definition: soplex.cpp:7069
minimum number of stalling refinements since last pivot to trigger rational factorization ...
Definition: soplex.h:912
Auto pricer.This pricer switches between Devex and Steepest edge pricer based on the difficulty of th...
Definition: spxautopr.h:40
minimal reduction (sum of removed rows/cols) to continue simplification
Definition: soplex.h:1199
Wrapper for GMP type mpq_class.We wrap mpq_class so that we can replace it by a double type if GMP is...
Definition: rational.h:45
automatic choice
Definition: soplex.h:990
void _changeRhsReal(const VectorReal &rhs)
changes right-hand side vector to rhs and adjusts basis
Definition: soplex.cpp:6624
void changeElementReal(int i, int j, const Real &val)
changes matrix entry in row i and column j to val
Definition: soplex.cpp:1602
bool hasDualFarkas() const
is Farkas proof of infeasibility available?
Definition: soplex.cpp:2831
Devex pricer.
disable timing
Definition: soplex.h:1119
void printStatistics(std::ostream &os)
prints complete statistics
Definition: soplex.cpp:5916
should a rational factorization be performed after iterative refinement?
Definition: soplex.h:821
mode for hyper sparse pricing
Definition: soplex.h:909
maximum number of updates without fresh factorization
Definition: soplex.h:861
const VectorReal & upperReal() const
returns upper bound vector
Definition: soplex.cpp:914
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...
Definition: soplex.cpp:2670
std::string statisticString() const
statistical information in form of a string
Definition: soplex.cpp:4409
const VectorRational & maxObjRational() const
returns objective function vector after transformation to a maximization problem; since this is how i...
Definition: soplex.cpp:1221
void changeUpperRational(const VectorRational &upper)
changes vector of upper bounds to upper
Definition: soplex.cpp:2287
Rational _rationalPosInfty
Definition: soplex.h:1321
number of integer parameters
Definition: soplex.h:915
Rational _rationalOpttol
Definition: soplex.h:1324
bool _isSolveStopped(bool &stoppedTime, bool &stoppedIter) const
should solving process be stopped?
Definition: soplex.cpp:6364
RealParam
real parameters
Definition: soplex.h:1142
bool setDualNorms(int nnormsRow, int nnormsCol, Real *norms)
sets steepest edge norms and returns false if that&#39;s not possible
Definition: soplex.cpp:1004
LP simplification base class.
Real realParam(const RealParam param) const
returns real parameter value
Definition: soplex.cpp:4866
void _solveReal()
solves real LP
Definition: solvereal.cpp:26
const SVectorReal & rowVectorReal(int i) const
returns vector of row i
Definition: soplex.cpp:833
SPxEquiliSC _scalerBiequi
Definition: soplex.h:1337
steepest edge pricer with exact initialization of norms
Definition: soplex.h:1047
bool hasPrimalRay() const
is a primal unbounded ray available?
Definition: soplex.cpp:2815
full verbosity level
Definition: soplex.h:980
only error, warning, and debug output
Definition: soplex.h:971
Partial multiple pricing.Class SPxParMultPr is an implementation class for SPxPricer implementing Dan...
Definition: spxparmultpr.h:47
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...
Definition: soplex.cpp:1783
void addColReal(const LPCol &lpcol)
adds a single column
Definition: soplex.cpp:1277
void clearLPRational()
clears the LP
Definition: soplex.cpp:2688
DVectorRational _modLhs
Definition: soplex.h:1389
DVectorReal _manualLower
Definition: soplex.h:1361
void _removeColRangeReal(int start, int end, int perm[])
removes columns start to end including both; an array perm of size numColsReal() may be passed as buf...
void addRowsRational(const LPRowSetRational &lprowset)
adds multiple rows
Definition: soplex.cpp:1898
const SVectorRational & rowVectorRational(int i) const
returns vector of row i
Definition: soplex.cpp:1075
Steepest edge pricer.
void addRowRational(const LPRowRational &lprow)
adds a single row
Definition: soplex.cpp:1832
void addColRational(const LPColRational &lpcol)
adds a single column
Definition: soplex.cpp:1918
const UnitVectorRational * _unitVectorRational(const int i)
returns pointer to a constant unit vector available until destruction of the SoPlex class ...
Definition: soplex.cpp:7376
void _syncRealSolution()
synchronizes real solution with rational solution, i.e., copies real solution to rational solution ...
Definition: soplex.cpp:7352
void removeColsRational(int perm[])
removes all columns with an index i such that perm[i] < 0; upon completion, perm[i] >= 0 indicates th...
Definition: soplex.cpp:2621
Fast shifting ratio test.Class SPxFastRT is an implementation class of SPxRatioTester providing fast ...
Definition: spxfastrt.h:41
bool _lowerFinite(const RangeType &rangeType) const
checks whether RangeType corresponds to finite lower bound
Definition: soplex.cpp:6442
void getObjReal(VectorReal &obj) const
gets objective function vector
Definition: soplex.cpp:950
void changeRhsRational(const VectorRational &rhs)
changes right-hand side vector to rhs
Definition: soplex.cpp:2085
standard floating-point parsing
Definition: soplex.h:1083
int dmaxSizeDualRational(const int base=2)
get size of largest denominator in dual solution
Definition: soplex.cpp:3706
RangeType _rangeTypeReal(const Real &lower, const Real &upper) const
determines RangeType from real bounds
Definition: soplex.cpp:6379
int dlcmSizePrimalRational(const int base=2)
get size of least common multiple of denominators in primal solution
Definition: soplex.cpp:3664
Rational objValueRational()
returns the objective value if a primal solution is available
Definition: soplex.cpp:3139
DataArray< SPxSolver::VarStatus > _basisStatusCols
Definition: soplex.h:1432
DVectorRational _unboundedLower
Definition: soplex.h:1377
decide depending on tolerances whether to apply iterative refinement
Definition: soplex.h:1096
bool boolParam(const BoolParam param) const
returns boolean parameter value
Definition: soplex.cpp:4846
SPxSolver::Status status() const
returns the current solver status
Definition: soplex.cpp:2799
DVectorReal _manualRhs
Definition: soplex.h:1364
DataArray< RangeType > _colTypes
Definition: soplex.h:1419
type of scaler
Definition: soplex.h:882
automatic choice according to number of rows and columns
Definition: soplex.h:932
double Real
SOPLEX_DEBUG.
Definition: spxdefines.h:200
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...
Definition: soplex.cpp:1691
SPxBoundFlippingRT _ratiotesterBoundFlipping
Definition: soplex.h:1352
bool _isRealLPLoaded
Definition: soplex.h:1359
geometric mean scaling on rows and columns, max 8 rounds
Definition: soplex.h:1009
const VectorReal & maxObjReal() const
returns objective function vector after transformation to a maximization problem; since this is how i...
Definition: soplex.cpp:969
void _solveRealLPAndRecordStatistics()
call floating-point solver and update statistics on iterations etc.
Definition: soplex.cpp:7109
number of boolean parameters
Definition: soplex.h:842
SPxEquiliSC _scalerUniequi
Definition: soplex.h:1336
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...
Definition: soplex.cpp:4707
void printSolvingStatistics(std::ostream &os)
prints statistics on solving process
Definition: soplex.cpp:5896
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...
Definition: soplex.cpp:7237
lower threshold in lifting (nonzero matrix coefficients with smaller absolute value will be reformula...
Definition: soplex.h:1184
bool getPrimalRayReal(VectorReal &vector)
gets the primal ray if available; returns true on success
Definition: soplex.cpp:2895
Real objReal(int i) const
returns objective value of column i
Definition: soplex.cpp:959
void changeLhsReal(const VectorReal &lhs)
changes left-hand side vector for constraints to lhs
Definition: soplex.cpp:1332
const VectorReal & rhsReal() const
returns right-hand side vector
Definition: soplex.cpp:842
int _beforeLiftCols
Definition: soplex.h:1398
greedy crash basis weighted by objective, bounds, and sides
Definition: soplex.h:1019
void _changeLowerReal(const VectorReal &lower)
changes vector of lower bounds to lower and adjusts basis
Definition: soplex.cpp:6735
bool setRealParam(const RealParam param, const Real value, const bool quiet=false, const bool init=false)
sets real parameter value; returns true on success
Definition: soplex.cpp:5245
void _performOptIRStable(SolRational &sol, bool acceptUnbounded, bool acceptInfeasible, int minRounds, bool &primalFeasible, bool &dualFeasible, bool &infeasible, bool &unbounded, bool &stopped, bool &stoppedIter, bool &error)
solves current problem with iterative refinement and recovery mechanism
dual simplex algorithm, i.e., leaving for column and entering for row representation ...
Definition: soplex.h:948
LP simplification abstract base class.Instances of classes derived from SPxSimplifier may be loaded t...
Definition: spxsimplifier.h:41
steepest edge pricer with initialization to unit norms
Definition: soplex.h:1044
int numRowsRational() const
returns number of rows
Definition: soplex.cpp:1012
const VectorRational & lowerRational() const
returns lower bound vector
Definition: soplex.cpp:1174
bool _hasBasis
Definition: soplex.h:1438
use bound flipping also for row representation?
Definition: soplex.h:839
void _invalidateSolution()
invalidates solution
Definition: soplex.cpp:7002
preconfigured SoPlexLegacy LP-solver.
bool getDualViolationReal(Real &maxviol, Real &sumviol)
gets violation of dual multipliers; returns true on success
Definition: soplex.cpp:3085
Wrapper for several output streams. A verbosity level is used to decide which stream to use and wheth...
Definition: spxout.h:63
const char * getSimplifierName()
name of simplifier
Definition: soplex.cpp:4436
void getColsReal(int start, int end, LPColSetReal &lpcolset) const
gets columns start, ..., end
Definition: soplex.cpp:896
void changeLowerReal(const VectorReal &lower)
changes vector of lower bounds to lower
Definition: soplex.cpp:1461
void _restoreLPReal()
restores objective, bounds, and sides of real LP
void _project(SolRational &sol)
undoes lifting
LPRowReal::Type rowTypeReal(int i) const
returns inequality type of row i
Definition: soplex.cpp:878
const char * getPricerName()
name of currently loaded pricer
Definition: soplex.cpp:4458
void _performUnboundedIRStable(SolRational &sol, bool &hasUnboundedRay, bool &stopped, bool &stoppedIter, bool &error)
performs iterative refinement on the auxiliary problem for testing unboundedness
main LP solver class
DVectorRational _feasObj
Definition: soplex.h:1382
round scaling factors for iterative refinement to powers of two?
Definition: soplex.h:830
void _computeInfeasBox(SolRational &sol, bool transformed)
void removeRowReal(int i)
removes row i
Definition: soplex.cpp:1617
Forrest-Tomlin type update.
Definition: soplex.h:958
int dlcmSizeDualRational(const int base=2)
get size of least common multiple of denominators in dual solution
Definition: soplex.cpp:3678
Auto pricer.
SPxWeightST _starterWeight
Definition: soplex.h:1340
Statistics * _statistics
statistics since last call to solveReal() or solveRational()
Definition: soplex.h:1308
void _solveRational()
solves rational LP
void _evaluateSolutionReal(SPxSimplifier::Result simplificationStatus)
checks result of the solving process and solves again without preprocessing if necessary ...
Definition: solvereal.cpp:46
LPColSetRational _slackCols
Definition: soplex.h:1376
type of simplifier
Definition: soplex.h:879
RangeType _switchRangeType(const RangeType &rangeType) const
switches RANGETYPE_LOWER to RANGETYPE_UPPER and vice versa
Definition: soplex.cpp:6429
DVectorRational _feasUpper
Definition: soplex.h:1386
void _removeRowsReal(int perm[])
removes all rows with an index i such that perm[i] < 0; upon completion, perm[i] >= 0 indicates the n...
Definition: soplex.cpp:6909
void _syncLPRational(bool time=true)
synchronizes rational LP with real LP, i.e., copies real LP to rational LP, without looking at the sy...
Definition: soplex.cpp:7333
void printUserSettings()
print non-default parameter values
Definition: soplex.cpp:5415
void changeBoundsReal(const VectorReal &lower, const VectorReal &upper)
changes vectors of column bounds to lower and upper
Definition: soplex.cpp:1536
SPxSteepPR _pricerQuickSteep
Definition: soplex.h:1347
void syncLPReal()
synchronizes real LP with rational LP, i.e., copies (rounded) rational LP into real LP...
Definition: soplex.cpp:1821
bool _reconstructSolutionRational(SolRational &sol, DataArray< SPxSolver::VarStatus > &basisStatusRows, DataArray< SPxSolver::VarStatus > &basisStatusCols, const Rational &denomBoundSquared)
attempts rational reconstruction of primal-dual solution
SPxDantzigPR _pricerDantzig
Definition: soplex.h:1344
SPxParMultPR _pricerParMult
Definition: soplex.h:1345
bool getPrimalRational(VectorRational &vector)
gets the primal solution vector if available; returns true on success
Definition: soplex.cpp:3175
Solution vector based start basis.This version of SPxWeightST can be used to construct a starting bas...
Definition: spxvectorst.h:44
void changeObjRational(const VectorRational &obj)
changes objective function vector to obj
Definition: soplex.cpp:2407
void getObjRational(VectorRational &obj) const
gets objective function vector
Definition: soplex.cpp:1192
SLUFactor _slufactor
Definition: soplex.h:1334
void getBasis(SPxSolver::VarStatus rows[], SPxSolver::VarStatus cols[]) const
gets current basis via arrays of statuses
Definition: soplex.cpp:3810
void _removeRowRangeReal(int start, int end, int perm[])
removes rows start to end including both; an array perm of size numRowsReal() may be passed as buffer...
Dynamic index set.Class DIdxSet provides dynamic IdxSet in the sense, that no restrictions are posed ...
Definition: didxset.h:42
void clearBasis()
clears starting basis
Definition: soplex.cpp:4383
void syncLPRational()
synchronizes rational LP with real LP, i.e., copies real LP to rational LP, if sync mode is manual ...
Definition: soplex.cpp:2711
bool getRedCostReal(VectorReal &vector)
gets the vector of reduced cost values if available; returns true on success
Definition: soplex.cpp:2925
Simple heuristic SPxStarter.
DVectorRational _modUpper
Definition: soplex.h:1388
user sync of real and rational LP
Definition: soplex.h:1076
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 ...
Definition: soplex.cpp:6301
SPxSteepExPR _pricerSteep
Definition: soplex.h:1348
bool parseSettingsString(char *line)
parses one setting string and returns true on success; note that string is modified ...
Definition: soplex.cpp:5581
SPxOut spxout
Definition: soplex.h:1215
infinity threshold
Definition: soplex.h:1163
void changeBoundsRational(const VectorRational &lower, const VectorRational &upper)
changes vectors of column bounds to lower and upper
Definition: soplex.cpp:2347
SPxDefaultRT _ratiotesterTextbook
Definition: soplex.h:1349
(In)equality for LPs.Class LPRowBase provides constraints for linear programs in the form where a is...
Definition: lprowbase.h:45
Settings * _currentSettings
Definition: soplex.h:1319
only error and warning output
Definition: soplex.h:968
Sparse vector .A UnitVectorBase is an SVectorBase that can take only one nonzero value with value 1 b...
Bound flipping ratio test (long step dual) for SoPlex.
Preconfigured SoPlexLegacy LP-solver.
Definition: soplexlegacy.h:41
const SVectorRational & colVectorRational(int i) const
returns vector of column i
Definition: soplex.cpp:1147
void getRowReal(int i, LPRowReal &lprow) const
gets row i
Definition: soplex.cpp:815
void _syncRationalSolution()
synchronizes rational solution with real solution, i.e., copies (rounded) rational solution to real s...
Definition: soplex.cpp:7364
Debugging, floating point type and parameter definitions.
Set of strings.Class NameSet implements a symbol or name table. It allows to store or remove names (i...
Definition: nameset.h:61
int _beforeLiftRows
Definition: soplex.h:1397
partial multiple pricer based on Dantzig pricing
Definition: soplex.h:1038
lower and upper bound finite, but different
Definition: soplex.h:1413
Sequential object-oriented SimPlex.SPxSolver is an LP solver class using the revised Simplex algorith...
Definition: spxsolver.h:84
DVectorReal _manualLhs
Definition: soplex.h:1363
equilibrium scaling on rows and columns
Definition: soplex.h:1003
bool _storedBasis
Definition: soplex.h:1396
void _storeLPReal()
stores objective, bounds, and sides of real LP
Rational _rationalNegInfty
Definition: soplex.h:1322
const VectorReal & lhsReal() const
returns left-hand side vector
Definition: soplex.cpp:860
void printStatus(std::ostream &os, SPxSolver::Status status)
prints status
Definition: soplex.cpp:5936
threshold on number of rows vs. number of columns for switching from column to row representations in...
Definition: soplex.h:1193
lower bound equals upper bound
Definition: soplex.h:1416
Collection of dense, sparse, and semi-sparse vectors.
column representation Ax - s = 0, lower <= x <= upper, lhs <= s <= rhs
Definition: soplex.h:935
bool getSlacksReal(VectorReal &vector)
gets the vector of slack values if available; returns true on success
Definition: soplex.cpp:2880
Implementation of Sparse Linear Solver.This class implements a SLinSolver interface by using the spar...
Definition: slufactor.h:41
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...
Definition: soplex.cpp:4498
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.
Definition: soplex.cpp:6042
void getRowsRational(int start, int end, LPRowSetRational &lprowset) const
gets rows start, ..., end.
Definition: soplex.cpp:1066
automatic pricer
Definition: soplex.h:1032
Everything should be within this namespace.
void getNdualNorms(int &nnormsRow, int &nnormsCol) const
gets number of available dual norms
Definition: soplex.cpp:988
void _changeLhsReal(const VectorReal &lhs)
changes left-hand side vector for constraints to lhs and adjusts basis
Definition: soplex.cpp:6585
DVectorReal _manualUpper
Definition: soplex.h:1362
working tolerance for feasibility in floating-point solver during iterative refinement ...
Definition: soplex.h:1175
SPxLPReal * _realLP
Definition: soplex.h:1354
bool loadSettingsFile(const char *filename)
reads settings file; returns true on success
Definition: soplex.cpp:5532
SPxGeometSC _scalerGeo1
Definition: soplex.h:1338
void _preprocessAndSolveReal(bool applyPreprocessing)
solves real LP with/without preprocessing
Definition: solvereal.cpp:139
SoPlex & operator=(const SoPlex &rhs)
assignment operator
Definition: soplex.cpp:609
Dantzig pricer.Class SPxDantzigPR is an implementation class of an SPxPricer implementing Dantzig&#39;s d...
Definition: spxdantzigpr.h:38
bool getRedCostViolationRational(Rational &maxviol, Rational &sumviol)
gets violation of reduced costs; returns true on success
Definition: soplex.cpp:3349
Harris pricing with shifting.
SPxDevexPR _pricerDevex
Definition: soplex.h:1346
Rational maxAbsNonzeroRational() const
returns biggest non-zero element in absolute value
Definition: soplex.cpp:1048
DataArray< RangeType > _rowTypes
Definition: soplex.h:1420
void _removeColReal(int i)
removes column i
Definition: soplex.cpp:6942
void _changeRowReal(int i, const LPRowReal &lprow)
replaces row i with lprow and adjusts basis
Definition: soplex.cpp:6563
DVectorRational _modObj
Definition: soplex.h:1391
SPxSumST _starterSum
Definition: soplex.h:1341
bool getBasisInverseTimesVecReal(Real *rhs, Real *sol)
computes dense solution of basis matrix B * sol = rhs; returns true on success
Definition: soplex.cpp:4247
row representation (lower,lhs) <= (x,Ax) <= (upper,rhs)
Definition: soplex.h:938
apply rational reconstruction after each iterative refinement?
Definition: soplex.h:827
void _changeColReal(int i, const LPColReal &lpcol)
replaces column i with lpcol and adjusts basis
Definition: soplex.cpp:6711
SPxBasis::SPxStatus basisStatus() const
returns the current basis status
Definition: soplex.cpp:3728
Weighted start basis.
type of pricer
Definition: soplex.h:888
Saving LPs in a form suitable for SoPlex.Class SPxLPBase provides the data structures required for sa...
Definition: spxlpbase.h:76
bool getDualReal(VectorReal &vector)
gets the dual solution vector if available; returns true on success
Definition: soplex.cpp:2910
SPxHarrisRT _ratiotesterHarris
Definition: soplex.h:1350
void changeColReal(int i, const LPColReal &lpcol)
replaces column i with lpcol
Definition: soplex.cpp:1443
Steepest edge pricer with exact initialization of weights.
working tolerance for optimality in floating-point solver during iterative refinement ...
Definition: soplex.h:1178
void clearLPReal()
clears the LP
Definition: soplex.cpp:1801
Preconfigured SoPlex LP-solver.
Definition: soplex.h:86
void getColRational(int i, LPColRational &lpcol) const
gets column i
Definition: soplex.cpp:1129
void removeRowRational(int i)
removes row i
Definition: soplex.cpp:2499
Type
(In)Equality type of an LP row.
Definition: lprowbase.h:72
DVectorRational _unboundedLhs
Definition: soplex.h:1379
DSVectorRational _primalDualDiff
Definition: soplex.h:1392
bool writeFileReal(const char *filename, const NameSet *rowNames=0, const NameSet *colNames=0, const DIdxSet *intvars=0) const
writes real LP to file; LP or MPS format is chosen from the extension in filename; if rowNames and co...
Definition: soplex.cpp:4486
SPxVectorST _starterVector
Definition: soplex.h:1342
LP scaling base class.
DVectorRational _unboundedUpper
Definition: soplex.h:1378
RangeType _rangeTypeRational(const Rational &lower, const Rational &upper) const
determines RangeType from rational bounds
Definition: soplex.cpp:6404
bool getBoundViolationReal(Real &maxviol, Real &sumviol)
gets violation of bounds; returns true on success
Definition: soplex.cpp:2955
Simple heuristic SPxStarter.Testing version of an SPxVectorST using a very simplistic heuristic to bu...
Definition: spxsumst.h:37
Weighted start basis.Class SPxWeightST is an implementation of a SPxStarter for generating a Simplex ...
Definition: spxweightst.h:56
decide according to READMODE
Definition: soplex.h:1109
void printVersion() const
prints version and compilation options
Definition: soplex.cpp:6002
SPxSolver::VarStatus basisColStatus(int col) const
returns basis status for a single column
Definition: soplex.cpp:3774
SPxSolver _solver
Definition: soplex.h:1333
bool getBasisInverseColReal(int c, Real *coef, int *inds=NULL, int *ninds=NULL)
computes column c of basis inverse; returns true on success
Definition: soplex.cpp:4103
mode for a posteriori feasibility checks
Definition: soplex.h:903
Partial multiple pricing.
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:229
Textbook ratio test for SoPlex.Class SPxDefaultRT provides an implementation of the textbook ratio te...
Definition: spxdefaultrt.h:42
type of algorithm, i.e., primal or dual
Definition: soplex.h:855
void _recomputeRangeTypesReal()
recomputes range types from scratch using real LP
Definition: soplex.cpp:7284
should feasibility be tested with relaxed bounds and sides?
Definition: soplex.h:836
const VectorRational & lhsRational() const
returns left-hand side vector
Definition: soplex.cpp:1102
DataArray< UnitVectorRational * > _unitMatrixRational
Definition: soplex.h:1395
bool getDualFarkasRational(VectorRational &vector)
gets the Farkas proof if LP is infeasible; returns true on success
Definition: soplex.cpp:3250
LP scaler abstract base class.Instances of classes derived from SPxScaler may be loaded to SoPlex in ...
Definition: spxscaler.h:39
stalling refinement limit (-1 if unlimited)
Definition: soplex.h:870
DataArray< SPxSolver::VarStatus > _basisStatusRows
Definition: soplex.h:1431
Rational objRational(int i) const
returns objective value of column i
Definition: soplex.cpp:1211
should dual infeasibility be tested in order to try to return a dual solution even if primal infeasib...
Definition: soplex.h:818
void _factorizeColumnRational(SolRational &sol, DataArray< SPxSolver::VarStatus > &basisStatusRows, DataArray< SPxSolver::VarStatus > &basisStatusCols, bool &stoppedTime, bool &stoppedIter, bool &error, bool &optimal)
factorizes rational basis matrix in column representation
generic solution-based crash basis
Definition: soplex.h:1025
int intParam(const IntParam param) const
returns integer parameter value
Definition: soplex.cpp:4856
should lifting be used to reduce range of nonzero matrix coefficients?
Definition: soplex.h:812
int dmaxSizePrimalRational(const int base=2)
get size of largest denominator in primal solution
Definition: soplex.cpp:3692
bool getEstimatedCondition(Real &condition)
computes an estimated condition number for the current basis matrix using the power method; returns t...
Definition: soplex.cpp:3929
LPRowRational::Type rowTypeRational(int i) const
returns inequality type of row i
Definition: soplex.cpp:1120
bool getExactCondition(Real &condition)
computes the exact condition number for the current basis matrix using the power method; returns true...
Definition: soplex.cpp:3944
SPxStatus
basis status.
Definition: spxbasis.h:90
const char * getScalerName()
name of scaling method
Definition: soplex.cpp:4447
void addColsReal(const LPColSetReal &lpcolset)
adds multiple columns
Definition: soplex.cpp:1295
bool saveSettingsFile(const char *filename, const bool onlyChanged=false) const
writes settings file; returns true on success
Definition: soplex.cpp:5463
bool getBasisInverseRowReal(int r, Real *coef, int *inds=NULL, int *ninds=NULL)
computes row r of basis inverse; returns true on success
Definition: soplex.cpp:3959
SolReal _solReal
Definition: soplex.h:1434
zero tolerance used in update of the factorization
Definition: soplex.h:1157
lower limit on objective value
Definition: soplex.h:1169
void changeLowerRational(const VectorRational &lower)
changes vector of lower bounds to lower
Definition: soplex.cpp:2227
DSVectorRational _tauColVector
Definition: soplex.h:1381
DVectorRational _modLower
Definition: soplex.h:1387
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...
Definition: soplex.cpp:4805
both bounds are infinite
Definition: soplex.h:1404
bool getRedCostViolationReal(Real &maxviol, Real &sumviol)
gets violation of reduced costs; returns true on success
Definition: soplex.cpp:3031
BoolParam
boolean parameters
Definition: soplex.h:809
bool _hasSolReal
Definition: soplex.h:1439
void _changeBoundsReal(const VectorReal &lower, const VectorReal &upper)
changes vectors of column bounds to lower and upper and adjusts basis
Definition: soplex.cpp:6815
sparse pricing threshold (#violations < dimension * SPARSITY_THRESHOLD activates sparse pricing) ...
Definition: soplex.h:1190
void addRowReal(const LPRowReal &lprow)
adds a single row
Definition: soplex.cpp:1240
bool getPrimalRayRational(VectorRational &vector)
gets the primal ray if LP is unbounded; returns true on success
Definition: soplex.cpp:3205
dual feasibility tolerance
Definition: soplex.h:1148
void _ensureRealLPLoaded()
ensures that the real LP and the basis are loaded in the solver; performs no sync ...
Definition: soplex.cpp:7082
high verbosity level
Definition: soplex.h:977
void _restoreBasis()
restore basis
void changeRowReal(int i, const LPRowReal &lprow)
replaces row i with lprow
Definition: soplex.cpp:1314
Hybrid pricer.
SolRational _solRational
Definition: soplex.h:1435
Textbook ratio test for SoPlex.
Real objValueReal()
returns the objective value if a primal solution is available
Definition: soplex.cpp:2839
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 ...
Definition: soplex.cpp:7399
int numNonzerosReal() const
returns number of nonzeros
Definition: soplex.cpp:788
void changeRhsReal(const VectorReal &rhs)
changes right-hand side vector to rhs
Definition: soplex.cpp:1369
geometric frequency at which to apply rational reconstruction
Definition: soplex.h:1196
void changeElementRational(int i, int j, const Rational &val)
changes matrix entry in row i and column j to val
Definition: soplex.cpp:2463
SPxStarter * _starter
Definition: soplex.h:1357
bool _hasSolRational
Definition: soplex.h:1440
Real solveTime() const
time spent in last call to solve
Definition: soplex.cpp:4401
void _enableSimplifierAndScaler()
enables simplifier and scaler according to current parameters
Definition: soplex.cpp:7017
primal simplex algorithm, i.e., entering for column and leaving for row representation ...
Definition: soplex.h:945
void getRowRational(int i, LPRowRational &lprow) const
gets row i
Definition: soplex.cpp:1057
DVectorRational _modRhs
Definition: soplex.h:1390
LP euilibrium scaling.
should LP be transformed to equality form before a rational solve?
Definition: soplex.h:815
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...
Definition: soplex.cpp:3850
Equilibrium row/column scaling.This SPxScaler implementation performs equilibrium scaling of the LPs ...
Definition: spxequilisc.h:35
const VectorRational & upperRational() const
returns upper bound vector
Definition: soplex.cpp:1156
void _storeSolutionReal()
stores solution of the real LP; before calling this, the real LP must be loaded in the solver and sol...
Definition: solvereal.cpp:312
store only real LP
Definition: soplex.h:1070
upper threshold in lifting (nonzero matrix coefficients with larger absolute value will be reformulat...
Definition: soplex.h:1187
DataArray< SPxSolver::VarStatus > _storedBasisStatusRows
Definition: soplex.h:1393
SPxLPReal _manualRealLP
Definition: soplex.h:1366
void _addRowsReal(const LPRowSetReal &lprowset)
adds multiple rows to the real LP and adjusts basis
Definition: soplex.cpp:6488
const SVectorReal & colVectorReal(int i) const
returns vector of column i
Definition: soplex.cpp:905
void changeUpperReal(const VectorReal &upper)
changes vector of upper bounds to upper
Definition: soplex.cpp:1499
void removeColRational(int i)
removes column i
Definition: soplex.cpp:2594
bool hasPrimal() const
is a primal feasible solution available?
Definition: soplex.cpp:2807
IntParam
integer parameters
Definition: soplex.h:846
void _lift()
reduces matrix coefficient in absolute value by the lifting procedure of Thiele et al...
force iterative refinement
Definition: soplex.h:1099
SPxSolver::Status _status
Definition: soplex.h:1428
void getColReal(int i, LPColReal &lpcol) const
gets column i
Definition: soplex.cpp:887
LP column.Class LPColBase provides a datatype for storing the column of an LP a the form similar to ...
Definition: lpcolbase.h:45
SPxSimplifier * _simplifier
Definition: soplex.h:1355
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...
Definition: soplex.cpp:2576
void addRowsReal(const LPRowSetReal &lprowset)
adds multiple rows
Definition: soplex.cpp:1258
geometric mean scaling on rows and columns, max 1 round
Definition: soplex.h:1006
void _untransformEquality(SolRational &sol)
undoes transformation to equality form
void setBasis(SPxSolver::VarStatus rows[], SPxSolver::VarStatus cols[])
sets starting basis via arrays of statuses
Definition: soplex.cpp:4355
Steepest edge pricer.Class SPxSteepPR implements a steepest edge pricer to be used with SoPlex...
Definition: spxsteeppr.h:41
Harris pricing with shifting.Class SPxHarrisRT is a stable implementation of a SPxRatioTester class a...
Definition: spxharrisrt.h:40
upper bound is finite, lower bound is infinite
Definition: soplex.h:1410
bool getBoundViolationRational(Rational &maxviol, Rational &sumviol)
gets violation of bounds; returns true on success
Definition: soplex.cpp:3265
SPxAutoPR _pricerAuto
Definition: soplex.h:1343
only error output
Definition: soplex.h:965
LP simplifier for removing uneccessary row/columns.This SPxSimplifier is mainly based on the paper "P...
Definition: spxmainsm.h:60
void _untransformFeasibility(SolRational &sol, bool infeasible)
undoes transformation to feasibility problem
int totalSizeDualRational(const int base=2)
get size of dual solution
Definition: soplex.cpp:3650
void removeRowsReal(int perm[])
removes all rows with an index i such that perm[i] < 0; upon completion, perm[i] >= 0 indicates the n...
Definition: soplex.cpp:1643