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-2025 Zuse Institute Berlin (ZIB) */
7/* */
8/* Licensed under the Apache License, Version 2.0 (the "License"); */
9/* you may not use this file except in compliance with the License. */
10/* You may obtain a copy of the License at */
11/* */
12/* http://www.apache.org/licenses/LICENSE-2.0 */
13/* */
14/* Unless required by applicable law or agreed to in writing, software */
15/* distributed under the License is distributed on an "AS IS" BASIS, */
16/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */
17/* See the License for the specific language governing permissions and */
18/* limitations under the License. */
19/* */
20/* You should have received a copy of the Apache-2.0 license */
21/* along with SoPlex; see the file LICENSE. If not email to soplex@zib.de. */
22/* */
23/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
24
25/**@file soplex.h
26 * @brief Preconfigured SoPlex LP solver
27 */
28
29#ifndef _SOPLEX_H_
30#define _SOPLEX_H_
31
32#include <string.h>
33
34#include "soplex/spxgithash.h"
35#include "soplex/spxdefines.h"
36#include "soplex/basevectors.h"
37#include "soplex/spxsolver.h"
38#include "soplex/slufactor.h"
40
41///@todo try to move to cpp file by forward declaration
43#include "soplex/spxmainsm.h"
44
45#include "soplex/spxscaler.h"
46#include "soplex/spxequilisc.h"
47#include "soplex/spxleastsqsc.h"
48#include "soplex/spxgeometsc.h"
49
50#include "soplex/spxstarter.h"
51#include "soplex/spxweightst.h"
52#include "soplex/spxsumst.h"
53#include "soplex/spxvectorst.h"
54
55#include "soplex/spxpricer.h"
56#include "soplex/spxautopr.h"
57#include "soplex/spxdantzigpr.h"
58#include "soplex/spxparmultpr.h"
59#include "soplex/spxdevexpr.h"
60#include "soplex/spxsteeppr.h"
61#include "soplex/spxsteepexpr.h"
62#include "soplex/spxhybridpr.h"
63
65#include "soplex/spxdefaultrt.h"
66#include "soplex/spxharrisrt.h"
67#include "soplex/spxfastrt.h"
69
70#include "soplex/solbase.h"
71#include "soplex/sol.h"
72
73#include "soplex/spxlpbase.h"
74
75#include "soplex/spxpapilo.h"
76
77#ifdef SOPLEX_WITH_GMP
78#include <gmp.h>
79#endif
80
81#ifdef SOPLEX_WITH_BOOST
82#ifdef SOPLEX_WITH_MPFR
83// For multiple precision
84#include <boost/multiprecision/mpfr.hpp>
85#endif
86#ifdef SOPLEX_WITH_CPPMPF
87#include <boost/multiprecision/cpp_dec_float.hpp>
88#endif
89
90// An alias for boost multiprecision
91namespace mpf = boost::multiprecision;
92#endif
93
94#define SOPLEX_DEFAULT_RANDOM_SEED 0 // used to suppress output when the seed was not changed
95
96///@todo implement automatic rep switch, based on row/col dim
97///@todo introduce status codes for SoPlex, especially for rational solving
98
99///@todo record and return "best" solutions found during IR (Ambros)
100///@todo implement main IR loop for primal and dual feasible case with fail otherwise (Ambros)
101///@todo implement statistical info (time, factor time, iters, ...) since last call to solveReal() or solveRational() (Ambros?)
102///@todo implement performInfeasibilityIR (Ambros?)
103///@todo extend IR loop to infeasible case (Dan?)
104///@todo extend IR loop to unbounded case (Dan?)
105
106///@todo interface rational reconstruction code for rational vectors
107///@todo integrate rational reconstruction into IR loop
108///@todo integrate rational SPxSolver and distinguish between original and transformed rational LP
109///@todo rational scalers
110///@todo rational simplifier
111
112namespace soplex
113{
114
115/**@class SoPlex
116 * @brief Preconfigured SoPlex LP-solver.
117 * @ingroup Algo
118 */
119template <class R>
121{
122public:
123
124 ///@name Construction and destruction
125 ///@{
126
127 /// default constructor
129
130 /// assignment operator
132
133 /// copy constructor
135
136 /// destructor
137 virtual ~SoPlexBase();
138
139 ///@}
140
141
142 ///@name Access to the real LP
143 ///@{
144
145 /// returns number of rows
146 int numRows() const;
147 int numRowsReal() const; /* For SCIP compatibility */
148 int numRowsRational() const;
149
150 /// Templated function that
151 /// returns number of columns
152 int numCols() const;
153 int numColsReal() const; /* For SCIP compatibility */
154 int numColsRational() const;
155
156 /// returns number of nonzeros
157 int numNonzeros() const;
158
160
161 /// returns smallest non-zero element in absolute value
163
164 /// returns biggest non-zero element in absolute value
166
167 /// returns (unscaled) coefficient
168 R coefReal(int row, int col) const;
169
170 /// returns vector of row \p i, ignoring scaling
172
173 /// gets vector of row \p i
174 void getRowVectorReal(int i, DSVectorBase<R>& row) const;
175
176 /// returns right-hand side vector, ignoring scaling
178
179 /// gets right-hand side vector
180 void getRhsReal(VectorBase<R>& rhs) const;
181
182 /// returns right-hand side of row \p i
183 R rhsReal(int i) const;
184
185 /// returns left-hand side vector, ignoring scaling
187
188 /// gets left-hand side vector
189 void getLhsReal(VectorBase<R>& lhs) const;
190
191 /// returns left-hand side of row \p i
192 R lhsReal(int i) const;
193
194 /// returns inequality type of row \p i
195 typename LPRowBase<R>::Type rowTypeReal(int i) const;
196
197 /// returns vector of col \p i, ignoring scaling
199
200 /// gets vector of col \p i
201 void getColVectorReal(int i, DSVectorBase<R>& col) const;
202
203 /// returns upper bound vector
205
206 /// returns upper bound of column \p i
207 R upperReal(int i) const;
208
209 /// gets upper bound vector
210 void getUpperReal(VectorBase<R>& upper) const;
211
212 /// returns lower bound vector
214
215 /// returns lower bound of column \p i
216 R lowerReal(int i) const;
217
218 /// gets lower bound vector
219 void getLowerReal(VectorBase<R>& lower) const;
220
221 /// gets objective function vector
222 void getObjReal(VectorBase<R>& obj) const;
223
224 /// returns objective value of column \p i
225 R objReal(int i) const;
226
227 /// returns objective function vector after transformation to a maximization problem; since this is how it is stored
228 /// internally, this is generally faster
230
231 /// returns objective value of column \p i after transformation to a maximization problem; since this is how it is
232 /// stored internally, this is generally faster
233 R maxObjReal(int i) const;
234
235 /// gets number of available dual norms
236 void getNdualNorms(int& nnormsRow, int& nnormsCol) const;
237
238 /// gets steepest edge norms and returns false if they are not available
239 bool getDualNorms(int& nnormsRow, int& nnormsCol, R* norms) const;
240
241 /// sets steepest edge norms and returns false if that's not possible
242 bool setDualNorms(int nnormsRow, int nnormsCol, R* norms);
243
244 /// pass integrality information about the variables to the solver
245 void setIntegralityInformation(int ncols, int* intInfo);
246
247 ///@}
248
249
250 ///@name Access to the rational LP
251 ///@{
252
253 /// returns smallest non-zero element in absolute value
255
256 /// returns biggest non-zero element in absolute value
258
259 /// gets row \p i
260 void getRowRational(int i, LPRowRational& lprow) const;
261
262 /// gets rows \p start, ..., \p end.
263 void getRowsRational(int start, int end, LPRowSetRational& lprowset) const;
264
265 /// returns vector of row \p i
267
268 /// returns right-hand side vector
270
271 /// returns right-hand side of row \p i
272 const Rational& rhsRational(int i) const;
273
274 /// returns left-hand side vector
276
277 /// returns left-hand side of row \p i
278 const Rational& lhsRational(int i) const;
279
280 /// returns inequality type of row \p i
282
283 /// gets column \p i
284 void getColRational(int i, LPColRational& lpcol) const;
285
286 /// gets columns \p start, ..., \p end
287 void getColsRational(int start, int end, LPColSetRational& lpcolset) const;
288
289 /// returns vector of column \p i
291
292 /// returns upper bound vector
294
295 /// returns upper bound of column \p i
296 const Rational& upperRational(int i) const;
297
298 /// returns lower bound vector
300
301 /// returns lower bound of column \p i
302 const Rational& lowerRational(int i) const;
303
304 /// gets objective function vector
306
307 /// gets objective value of column \p i
308 void getObjRational(int i, Rational& obj) const;
309
310 /// returns objective value of column \p i
311 Rational objRational(int i) const;
312
313 /// returns objective function vector after transformation to a maximization problem; since this is how it is stored
314 /// internally, this is generally faster
316
317 /// returns objective value of column \p i after transformation to a maximization problem; since this is how it is
318 /// stored internally, this is generally faster
319 const Rational& maxObjRational(int i) const;
320
321 ///@}
322
323
324 ///@name Modification of the real LP
325 ///@{
326
327 /// adds a single row
328 void addRowReal(const LPRowBase<R>& lprow);
329
330 /// adds multiple rows
331 void addRowsReal(const LPRowSetBase<R>& lprowset);
332
333 /// adds a single column
334 void addColReal(const LPColBase<R>& lpcol);
335
336 /// adds multiple columns
337 void addColsReal(const LPColSetBase<R>& lpcolset);
338
339 /// replaces row \p i with \p lprow
340 void changeRowReal(int i, const LPRowBase<R>& lprow);
341
342 /// changes left-hand side vector for constraints to \p lhs
343 void changeLhsReal(const VectorBase<R>& lhs);
344
345 /// changes left-hand side of row \p i to \p lhs
346 void changeLhsReal(int i, const R& lhs);
347
348 /// changes right-hand side vector to \p rhs
349 void changeRhsReal(const VectorBase<R>& rhs);
350
351 /// changes right-hand side of row \p i to \p rhs
352 void changeRhsReal(int i, const R& rhs);
353
354 /// changes left- and right-hand side vectors
355 void changeRangeReal(const VectorBase<R>& lhs, const VectorBase<R>& rhs);
356
357 /// changes left- and right-hand side of row \p i
358 void changeRangeReal(int i, const R& lhs, const R& rhs);
359
360 /// replaces column \p i with \p lpcol
361 void changeColReal(int i, const LPColReal& lpcol);
362
363 /// changes vector of lower bounds to \p lower
364 void changeLowerReal(const VectorBase<R>& lower);
365
366 /// changes lower bound of column i to \p lower
367 void changeLowerReal(int i, const R& lower);
368
369 /// changes vector of upper bounds to \p upper
370 void changeUpperReal(const VectorBase<R>& upper);
371
372 /// changes \p i 'th upper bound to \p upper
373 void changeUpperReal(int i, const R& upper);
374
375 /// changes vectors of column bounds to \p lower and \p upper
376 void changeBoundsReal(const VectorBase<R>& lower, const VectorBase<R>& upper);
377
378 /// changes bounds of column \p i to \p lower and \p upper
379 void changeBoundsReal(int i, const R& lower, const R& upper);
380
381 /// changes objective function vector to \p obj
382 void changeObjReal(const VectorBase<R>& obj);
383
384 /// changes objective coefficient of column i to \p obj
385 void changeObjReal(int i, const R& obj);
386
387 /// changes matrix entry in row \p i and column \p j to \p val
388 void changeElementReal(int i, int j, const R& val);
389
390 /// removes row \p i
391 void removeRowReal(int i);
392
393 /// removes all rows with an index \p i such that \p perm[i] < 0; upon completion, \p perm[i] >= 0 indicates the
394 /// new index where row \p i has been moved to; note that \p perm must point to an array of size at least
395 /// #numRows()
396 void removeRowsReal(int perm[]);
397
398 /// remove all rows with indices in array \p idx of size \p n; an array \p perm of size #numRows() may be passed
399 /// as buffer memory
400 void removeRowsReal(int idx[], int n, int perm[] = nullptr);
401
402 /// removes rows \p start to \p end including both; an array \p perm of size #numRows() may be passed as buffer
403 /// memory
404 void removeRowRangeReal(int start, int end, int perm[] = nullptr);
405
406 /// removes column i
407 void removeColReal(int i);
408
409 /// removes all columns with an index \p i such that \p perm[i] < 0; upon completion, \p perm[i] >= 0 indicates the
410 /// new index where column \p i has been moved to; note that \p perm must point to an array of size at least
411 /// #numColsReal()
412 void removeColsReal(int perm[]);
413
414 /// remove all columns with indices in array \p idx of size \p n; an array \p perm of size #numColsReal() may be
415 /// passed as buffer memory
416 void removeColsReal(int idx[], int n, int perm[] = nullptr);
417
418 /// removes columns \p start to \p end including both; an array \p perm of size #numColsReal() may be passed as
419 /// buffer memory
420 void removeColRangeReal(int start, int end, int perm[] = nullptr);
421
422 /// clears the LP
424
425 /// synchronizes real LP with rational LP, i.e., copies (rounded) rational LP into real LP, if sync mode is manual
427
428 ///@}
429
430
431 ///@name Modification of the rational LP
432 ///@{
433
434 /// adds a single row
435 void addRowRational(const LPRowRational& lprow);
436
437#ifdef SOPLEX_WITH_GMP
438 /// adds a single row (GMP only method)
439 void addRowRational(const mpq_t* lhs, const mpq_t* rowValues, const int* rowIndices,
440 const int rowSize, const mpq_t* rhs);
441
442 /// adds a set of rows (GMP only method)
443 void addRowsRational(const mpq_t* lhs, const mpq_t* rowValues, const int* rowIndices,
444 const int* rowStarts, const int* rowLengths, const int numRows, const int numValues,
445 const mpq_t* rhs);
446#endif
447
448 /// adds multiple rows
449 void addRowsRational(const LPRowSetRational& lprowset);
450
451 /// adds a single column
452 void addColRational(const LPColRational& lpcol);
453
454#ifdef SOPLEX_WITH_GMP
455 /// adds a single column (GMP only method)
456 void addColRational(const mpq_t* obj, const mpq_t* lower, const mpq_t* colValues,
457 const int* colIndices, const int colSize, const mpq_t* upper);
458
459 /// adds a set of columns (GMP only method)
460 void addColsRational(const mpq_t* obj, const mpq_t* lower, const mpq_t* colValues,
461 const int* colIndices, const int* colStarts, const int* colLengths, const int numCols,
462 const int numValues, const mpq_t* upper);
463#endif
464
465 /// adds multiple columns
466 void addColsRational(const LPColSetRational& lpcolset);
467
468 /// replaces row \p i with \p lprow
469 void changeRowRational(int i, const LPRowRational& lprow);
470
471 /// changes left-hand side vector for constraints to \p lhs
473
474 /// changes left-hand side of row \p i to \p lhs
475 void changeLhsRational(int i, const Rational& lhs);
476
477#ifdef SOPLEX_WITH_GMP
478 /// changes left-hand side of row \p i to \p lhs (GMP only method)
479 void changeLhsRational(int i, const mpq_t* lhs);
480#endif
481
482 /// changes right-hand side vector to \p rhs
484
485#ifdef SOPLEX_WITH_GMP
486 /// changes right-hand side vector to \p rhs (GMP only method)
487 void changeRhsRational(const mpq_t* rhs, int rhsSize);
488#endif
489
490 /// changes right-hand side of row \p i to \p rhs
491 void changeRhsRational(int i, const Rational& rhs);
492
493 /// changes left- and right-hand side vectors
495
496 /// changes left- and right-hand side of row \p i
497 void changeRangeRational(int i, const Rational& lhs, const Rational& rhs);
498
499#ifdef SOPLEX_WITH_GMP
500 /// changes left- and right-hand side of row \p i (GMP only method)
501 void changeRangeRational(int i, const mpq_t* lhs, const mpq_t* rhs);
502#endif
503
504 /// replaces column \p i with \p lpcol
505 void changeColRational(int i, const LPColRational& lpcol);
506
507 /// changes vector of lower bounds to \p lower
509
510 /// changes lower bound of column i to \p lower
511 void changeLowerRational(int i, const Rational& lower);
512
513#ifdef SOPLEX_WITH_GMP
514 /// changes lower bound of column i to \p lower (GMP only method)
515 void changeLowerRational(int i, const mpq_t* lower);
516#endif
517
518 /// changes vector of upper bounds to \p upper
520
521 /// changes \p i 'th upper bound to \p upper
522 void changeUpperRational(int i, const Rational& upper);
523
524#ifdef SOPLEX_WITH_GMP
525 /// changes upper bound of column i to \p upper (GMP only method)
526 void changeUpperRational(int i, const mpq_t* upper);
527#endif
528
529 /// changes vectors of column bounds to \p lower and \p upper
530 void changeBoundsRational(const VectorRational& lower, const VectorRational& upper);
531
532 /// changes bounds of column \p i to \p lower and \p upper
533 void changeBoundsRational(int i, const Rational& lower, const Rational& upper);
534
535#ifdef SOPLEX_WITH_GMP
536 /// changes bounds of column \p i to \p lower and \p upper (GMP only method)
537 void changeBoundsRational(int i, const mpq_t* lower, const mpq_t* upper);
538#endif
539
540 /// changes objective function vector to \p obj
542
543 /// changes objective coefficient of column i to \p obj
544 void changeObjRational(int i, const Rational& obj);
545
546#ifdef SOPLEX_WITH_GMP
547 /// changes objective coefficient of column i to \p obj (GMP only method)
548 void changeObjRational(int i, const mpq_t* obj);
549#endif
550
551 /// changes matrix entry in row \p i and column \p j to \p val
552 void changeElementRational(int i, int j, const Rational& val);
553
554#ifdef SOPLEX_WITH_GMP
555 /// changes matrix entry in row \p i and column \p j to \p val (GMP only method)
556 void changeElementRational(int i, int j, const mpq_t* val);
557#endif
558
559 /// removes row \p i
560 void removeRowRational(int i);
561
562 /// removes all rows with an index \p i such that \p perm[i] < 0; upon completion, \p perm[i] >= 0 indicates the new
563 /// index where row \p i has been moved to; note that \p perm must point to an array of size at least
564 /// #numRowsRational()
565 void removeRowsRational(int perm[]);
566
567 /// remove all rows with indices in array \p idx of size \p n; an array \p perm of size #numRowsRational() may be
568 /// passed as buffer memory
569 void removeRowsRational(int idx[], int n, int perm[] = nullptr);
570
571 /// removes rows \p start to \p end including both; an array \p perm of size #numRowsRational() may be passed as
572 /// buffer memory
573 void removeRowRangeRational(int start, int end, int perm[] = nullptr);
574
575 /// removes column i
576 void removeColRational(int i);
577
578 /// removes all columns with an index \p i such that \p perm[i] < 0; upon completion, \p perm[i] >= 0 indicates the
579 /// new index where column \p i has been moved to; note that \p perm must point to an array of size at least
580 /// #numColsRational()
581 void removeColsRational(int perm[]);
582
583 /// remove all columns with indices in array \p idx of size \p n; an array \p perm of size #numColsRational() may be
584 /// passed as buffer memory
585 void removeColsRational(int idx[], int n, int perm[] = nullptr);
586
587 /// removes columns \p start to \p end including both; an array \p perm of size #numColsRational() may be passed as
588 /// buffer memory
589 void removeColRangeRational(int start, int end, int perm[] = nullptr);
590
591 /// clears the LP
593
594 /// synchronizes rational LP with real LP, i.e., copies real LP to rational LP, if sync mode is manual
596
597 ///@}
598
599 ///@name Solving and general solution query
600 ///@{
601
602 /// optimize the given LP
603 typename SPxSolverBase<R>::Status optimize(volatile bool* interrupt = nullptr);
604
605 // old name for backwards compatibility
606 typename SPxSolverBase<R>::Status solve(volatile bool* interrupt = nullptr)
607 {
608 return optimize(interrupt);
609 }
610
611 /// returns the current solver status
613
614 /// is stored primal solution feasible?
615 bool isPrimalFeasible() const;
616
617 /// is a solution available (not neccessarily feasible)?
618 bool hasSol() const;
619
620 /// deprecated: use #hasSol() instead
621 bool hasPrimal() const
622 {
623 return hasSol();
624 }
625
626 /// deprecated: use #hasSol() instead
627 bool hasDual() const
628 {
629 return hasSol();
630 }
631
632 /// is a primal unbounded ray available?
633 bool hasPrimalRay() const;
634
635 /// is stored dual solution feasible?
636 bool isDualFeasible() const;
637
638 /// is Farkas proof of infeasibility available?
639 bool hasDualFarkas() const;
640
641 /// sets the status to OPTIMAL in case the LP has been solved with unscaled violations
643 {
645 {
647 return true;
648 }
649 else
650 return false;
651 }
652 ///@}
653
654
655 ///@name Query for the real solution data
656 ///@{
657
658 /// returns the objective value if a primal solution is available
660
661 /// gets the primal solution vector if available; returns true on success
663 bool getPrimalReal(R* p_vector, int size); // For SCIP compatibility
665
666 /// gets the activity for the \p i 'th row given the current primal solution
667 bool getRowActivity(int i, R& value);
668 bool getRowActivityRational(int i, Rational& value);
669
670 /// gets the activities for the rows in \p indices given the current primal solution;
671 /// all other elements of \p vector are left unchanged;
672 /// \p vector must have the same size as the total number of rows
673 bool getRowsActivity(const std::vector<int>& indices, VectorBase<R>& vector);
674 bool getRowsActivityReal(const std::vector<int>& indices, R* p_vector, int dim);
675 bool getRowsActivityRational(const std::vector<int>& indices, VectorRational& vector);
676
677 /// gets the activities for all rows given the current primal solution;
678 /// \p vector must have the same size as the total number of rows
680 bool getRowsActivityReal(R* p_vector, int dim);
682
683 /// gets the vector of slack values if available; returns true on success
685 bool getSlacksReal(R* p_vector, int dim);
686
687 /// gets the primal ray if available; returns true on success
689 bool getPrimalRayReal(R* vector, int dim); /* For SCIP compatibility */
691
692 /// gets the dual solution vector if available; returns true on success
693 bool getDual(VectorBase<R>& vector);
694 bool getDualReal(R* p_vector, int dim); /* For SCIP compatibility */
696
697 /// gets the activity for the \p i 'th column given the current dual solution
698 bool getColActivity(const int i, R& value);
699 bool getColActivityRational(const int i, Rational& value);
700
701 /// gets the activities for the columns in \p indices given the current dual solution;
702 /// all other elements of \p vector are left unchanged;
703 /// \p vector must have the same size as the total number of columns
704 bool getColsActivity(const std::vector<int>& indices, VectorBase<R>& vector);
705 bool getColsActivityReal(const std::vector<int>& indices, R* p_vector, const int dim);
706 bool getColsActivityRational(const std::vector<int>& indices, VectorRational& vector);
707
708 /// gets the activities for all columns given the current dual solution;
709 /// \p vector must have the same size as the total number of columns
711 bool getColsActivityReal(R* p_vector, const int dim);
713
714 /// gets the vector of reduced cost values if available; returns true on success
716 bool getRedCostReal(R* vector, int dim); /* For SCIP compatibility */
718
719 /// gets the Farkas proof if available; returns true on success
721 bool getDualFarkasReal(R* vector, int dim);
723
724 /// gets violation of bounds; returns true on success
725 bool getBoundViolation(R& maxviol, R& sumviol);
727
728 /// gets violation of constraints; returns true on success
729 bool getRowViolation(R& maxviol, R& sumviol);
730 bool getRowViolationRational(Rational& maxviol, Rational& sumviol);
731
732 /// gets violation of reduced costs; returns true on success
733 bool getRedCostViolation(R& maxviol, R& sumviol);
735
736 /// gets violation of dual multipliers; returns true on success
737 bool getDualViolation(R& maxviol, R& sumviol);
739
740 ///@}
741
742
743 ///@name Query for the rational solution data
744 ///@{
745
746 /// returns the objective value if a primal solution is available
748
749 /// gets the vector of slack values if available; returns true on success
751
752#ifdef SOPLEX_WITH_GMP
753 /// gets the primal solution vector if available; returns true on success (GMP only method)
754 bool getPrimalRational(mpq_t* vector, const int size);
755
756 /// gets the vector of slack values if available; returns true on success (GMP only method)
757 bool getSlacksRational(mpq_t* vector, const int size);
758
759 /// gets the primal ray if LP is unbounded; returns true on success (GMP only method)
760 bool getPrimalRayRational(mpq_t* vector, const int size);
761
762 /// gets the dual solution vector if available; returns true on success (GMP only method)
763 bool getDualRational(mpq_t* vector, const int size);
764
765 /// gets the vector of reduced cost values if available; returns true on success (GMP only method)
766 bool getRedCostRational(mpq_t* vector, const int size);
767
768 /// gets the Farkas proof if LP is infeasible; returns true on success (GMP only method)
769 bool getDualFarkasRational(mpq_t* vector, const int size);
770#endif
771
772 /// get size of primal solution
773 int totalSizePrimalRational(const int base = 2);
774
775 /// get size of dual solution
776 int totalSizeDualRational(const int base = 2);
777
778 /// get size of least common multiple of denominators in primal solution
779 int dlcmSizePrimalRational(const int base = 2);
780
781 /// get size of least common multiple of denominators in dual solution
782 int dlcmSizeDualRational(const int base = 2);
783
784 /// get size of largest denominator in primal solution
785 int dmaxSizePrimalRational(const int base = 2);
786
787 /// get size of largest denominator in dual solution
788 int dmaxSizeDualRational(const int base = 2);
789
790 ///@}
791
792
793 ///@name Access and modification of basis information
794 ///@{
795
796 /// is an advanced starting basis available?
797 bool hasBasis() const;
798
799 /// returns the current basis status
801
802 /// returns basis status for a single row
804
805 /// returns basis status for a single column
807
808 /// gets current basis via arrays of statuses
810 typename SPxSolverBase<R>::VarStatus cols[]) const;
811
812 /// gets the indices of the basic columns and rows; basic column n gives value n, basic row m gives value -1-m
813 void getBasisInd(int* bind) const;
814
815 /** compute one of several matrix metrics based on the diagonal of the LU factorization
816 * type = 0: max/min ratio
817 * type = 1: trace of U (sum of diagonal elements)
818 * type = 2: determinant (product of diagonal elements)
819 */
820 bool getBasisMetric(R& metric, int type = 0);
821
822 /// computes an estimated condition number for the current basis matrix using the power method; returns true on success
823 bool getEstimatedCondition(R& condition);
824
825 /// computes the exact condition number for the current basis matrix using the power method; returns true on success
826 bool getExactCondition(R& condition);
827
828 /// computes row \p r of basis inverse; returns true on success
829 /// @param r which row of the basis inverse is computed
830 /// @param coef values of result vector (not packed but scattered)
831 /// @param inds indices of result vector (nullptr if not to be used)
832 /// @param ninds number of nonzeros in result vector
833 /// @param unscale determines whether the result should be unscaled according to the original LP data
834 bool getBasisInverseRowReal(int r, R* coef, int* inds = nullptr, int* ninds = nullptr,
835 bool unscale = true);
836
837 /// computes column \p c of basis inverse; returns true on success
838 /// @param c which column of the basis inverse is computed
839 /// @param coef values of result vector (not packed but scattered)
840 /// @param inds indices of result vector (nullptr if not to be used)
841 /// @param ninds number of nonzeros in result vector
842 /// @param unscale determines whether the result should be unscaled according to the original LP data
843 bool getBasisInverseColReal(int c, R* coef, int* inds = nullptr, int* ninds = nullptr,
844 bool unscale = true);
845
846 /// computes dense solution of basis matrix B * \p sol = \p rhs; returns true on success
847 bool getBasisInverseTimesVecReal(R* rhs, R* sol, bool unscale = true);
848
849 /// multiply with basis matrix; B * \p vec (inplace)
850 /// @param vec (dense) vector to be multiplied with
851 /// @param unscale determines whether the result should be unscaled according to the original LP data
852 bool multBasis(R* vec, bool unscale = true);
853
854 /// multiply with transpose of basis matrix; \p vec * B^T (inplace)
855 /// @param vec (dense) vector to be multiplied with
856 /// @param unscale determines whether the result should be unscaled according to the original LP data
857 bool multBasisTranspose(R* vec, bool unscale = true);
858
859 /// compute rational basis inverse; returns true on success
861
862 /// gets an array of indices for the columns of the rational basis matrix; bind[i] >= 0 means that the i-th column of
863 /// the basis matrix contains variable bind[i]; bind[i] < 0 means that the i-th column of the basis matrix contains
864 /// the slack variable for row -bind[i]-1; performs rational factorization if not available; returns true on success
866
867 /// computes row r of basis inverse; performs rational factorization if not available; returns true on success
869
870 /// computes column c of basis inverse; performs rational factorization if not available; returns true on success
872
873 /// computes solution of basis matrix B * sol = rhs; performs rational factorization if not available; returns true
874 /// on success
876
877 /// sets starting basis via arrays of statuses
878 void setBasis(const typename SPxSolverBase<R>::VarStatus rows[],
879 const typename SPxSolverBase<R>::VarStatus cols[]);
880
881 /// clears starting basis
883
884 ///@}
885
886
887 ///@name Statistical information
888 ///@{
889
890 /// number of iterations since last call to solve
891 int numIterations() const;
892
893 /// number of iterative refinements
894 int numRefinements() const;
895
896 /// number of precision boosts since last call to solve
898
899 /// number of iterations in higher precision since last call to solve
901
902 /// time spen in higher precision since last call to solve
904
905 /// time spent in last call to solve
907
908 /// statistical information in form of a string
909 std::string statisticString() const;
910
911 /// name of starter
912 const char* getStarterName();
913
914 /// name of simplifier
915 const char* getSimplifierName();
916
917 /// name of scaling method
918 const char* getScalerName();
919
920 /// name of currently loaded pricer
921 const char* getPricerName();
922
923 /// name of currently loaded ratiotester
924 const char* getRatiotesterName();
925
926 ///@}
927
928
929 ///@name File I/O
930 ///@{
931
932 /// reads LP file in LP or MPS format according to READMODE parameter; gets row names, column names, and
933 /// integer variables if desired; returns true on success
934 bool readFile(const char* filename, NameSet* rowNames = nullptr, NameSet* colNames = nullptr,
935 DIdxSet* intVars = nullptr);
936
937 /// Templated write function
938 /// Real
939 /// writes real LP to file; LP or MPS format is chosen from the extension in \p filename; if \p rowNames and \p
940 /// colNames are \c nullptr, default names are used; if \p intVars is not \c nullptr, the variables contained in it are
941 /// marked as integer; returns true on success
942 /// Rational
943 /// writes rational LP to file; LP or MPS format is chosen from the extension in \p filename; if \p rowNames and \p
944 /// colNames are \c nullptr, default names are used; if \p intVars is not \c nullptr, the variables contained in it are
945 /// marked as integer; returns true on success
946 bool writeFile(const char* filename, const NameSet* rowNames = nullptr,
947 const NameSet* colNames = nullptr,
948 const DIdxSet* intvars = nullptr, const bool unscale = true,
949 const bool writeZeroObjective = false) const;
950
951 bool writeFileRational(const char* filename, const NameSet* rowNames = nullptr,
952 const NameSet* colNames = nullptr, const DIdxSet* intvars = nullptr,
953 const bool writeZeroObjective = false) const;
954
955 /* For SCIP compatibility */
956 bool writeFileReal(const char* filename, const NameSet* rowNames = nullptr,
957 const NameSet* colNames = nullptr,
958 const DIdxSet* intvars = nullptr, const bool unscale = true,
959 const bool writeZeroObjective = false) const;
960
961 /// writes the dual of the real LP to file; LP or MPS format is chosen from the extension in \p filename;
962 /// if \p rowNames and \p colNames are \c nullptr, default names are used; if \p intVars is not \c nullptr,
963 /// the variables contained in it are marked as integer; returns true on success
964 bool writeDualFileReal(const char* filename, const NameSet* rowNames = nullptr,
965 const NameSet* colNames = nullptr, const DIdxSet* intvars = nullptr,
966 const bool writeZeroObjective = false) const;
967
968 /// reads basis information from \p filename and returns true on success; if \p rowNames and \p colNames are \c nullptr,
969 /// default names are assumed; returns true on success
970 bool readBasisFile(const char* filename, const NameSet* rowNames = nullptr,
971 const NameSet* colNames = nullptr);
972
973 /// writes basis information to \p filename; if \p rowNames and \p colNames are \c nullptr, default names are used;
974 /// returns true on success
975 bool writeBasisFile(const char* filename, const NameSet* rowNames = nullptr,
976 const NameSet* colNames = nullptr,
977 const bool cpxFormat = false) const;
978
979 /// writes internal LP, basis information, and parameter settings; if \p rowNames and \p colNames are \c nullptr,
980 /// default names are used
981 void writeStateReal(const char* filename, const NameSet* rowNames = nullptr,
982 const NameSet* colNames = nullptr,
983 const bool cpxFormat = false, const bool writeZeroObjective = false) const;
984
985 /// writes internal LP, basis information, and parameter settings; if \p rowNames and \p colNames are \c nullptr,
986 /// default names are used
987 void writeStateRational(const char* filename, const NameSet* rowNames = nullptr,
988 const NameSet* colNames = nullptr, const bool cpxFormat = false,
989 const bool writeZeroObjective = false) const;
990
991 ///@}
992
993
994 ///@name Parameters
995 ///@{
996
997 /// boolean parameters
998 typedef enum
999 {
1000 /// should lifting be used to reduce range of nonzero matrix coefficients?
1002
1003 /// should LP be transformed to equality form before a rational solve?
1005
1006 /// should dual infeasibility be tested in order to try to return a dual solution even if primal infeasible?
1008
1009 /// should a rational factorization be performed after iterative refinement?
1011
1012 /// should cycling solutions be accepted during iterative refinement?
1014
1015 /// apply rational reconstruction after each iterative refinement?
1017
1018 /// round scaling factors for iterative refinement to powers of two?
1020
1021 /// continue iterative refinement with exact basic solution if not optimal?
1023
1024 /// use bound flipping also for row representation?
1026
1027 /// use persistent scaling?
1029
1030 /// perturb the entire problem or only the relevant bounds of s single pivot?
1032
1033 /// re-optimize the original problem to get a proof (ray) of infeasibility/unboundedness?
1035
1036 /// try to enforce that the optimal solution is a basic solution
1038
1039 // enable presolver SingletonCols in PaPILO?
1041
1042 // enable presolver ConstraintPropagation in PaPILO?
1044
1045 // enable presolver ParallelRowDetection in PaPILO?
1047
1048 // enable presolver ParallelColDetection in PaPILO?
1050
1051 // enable presolver SingletonStuffing in PaPILO?
1053
1054 // enable presolver DualFix in PaPILO?
1056
1057 // enable presolver FixContinuous in PaPILO?
1059
1060 // enable presolver DominatedCols in PaPILO?
1062
1063 // enable iterative refinement ?
1065
1066 /// adapt tolerances to the multiprecision used
1068
1069 /// enable precision boosting ?
1071
1072 /// boosted solver start from last basis
1074
1075 /// try different settings when solve fails
1077
1078 /// number of boolean parameters
1079 BOOLPARAM_COUNT = 26
1081
1082 /// integer parameters
1083 typedef enum
1084 {
1085 /// objective sense
1087
1088 /// type of computational form, i.e., column or row representation
1090
1091 /// type of algorithm, i.e., primal or dual
1093
1094 /// type of LU update
1096
1097 /// maximum number of updates without fresh factorization
1099
1100 /// iteration limit (-1 if unlimited)
1102
1103 /// refinement limit (-1 if unlimited)
1105
1106 /// stalling refinement limit (-1 if unlimited)
1108
1109 /// display frequency
1111
1112 /// verbosity level
1114
1115 /// type of simplifier
1117
1118 /// type of scaler
1120
1121 /// type of starter used to create crash basis
1123
1124 /// type of pricer
1126
1127 /// type of ratio test
1129
1130 /// mode for synchronizing real and rational LP
1132
1133 /// mode for reading LP files
1135
1136 /// mode for iterative refinement strategy
1138
1139 /// mode for a posteriori feasibility checks
1141
1142 /// type of timer
1143 TIMER = 19,
1144
1145 /// mode for hyper sparse pricing
1147
1148 /// minimum number of stalling refinements since last pivot to trigger rational factorization
1150
1151 /// maximum number of conjugate gradient iterations in least square scaling
1153
1154 /// mode for solution polishing
1156
1157 /// print condition number during the solve
1159
1160 /// type of timer for statistics
1162
1163 // maximum number of digits for the multiprecision type
1165
1166 ///@todo precision-boosting find better parameter name
1167 /// after how many simplex pivots do we store the advanced and stable basis, 1 = every iterations
1169
1170 /// number of integer parameters
1171 INTPARAM_COUNT = 28
1173
1174 /// values for parameter OBJSENSE
1175 enum
1176 {
1177 /// minimization
1179
1180 /// maximization
1183
1184 /// values for parameter REPRESENTATION
1185 enum
1186 {
1187 /// automatic choice according to number of rows and columns
1189
1190 /// column representation Ax - s = 0, lower <= x <= upper, lhs <= s <= rhs
1192
1193 /// row representation (lower,lhs) <= (x,Ax) <= (upper,rhs)
1196
1197 /// values for parameter ALGORITHM
1198 enum
1199 {
1200 /// primal simplex algorithm, i.e., entering for column and leaving for row representation
1202
1203 /// dual simplex algorithm, i.e., leaving for column and entering for row representation
1204 ALGORITHM_DUAL = 1
1206
1207 /// values for parameter FACTOR_UPDATE_TYPE
1208 enum
1209 {
1210 /// product form update
1212
1213 /// Forrest-Tomlin type update
1216
1217 /// values for parameter VERBOSITY
1218 enum
1219 {
1220 /// only error output
1222
1223 /// only error and warning output
1225
1226 /// only error, warning, and debug output
1228
1229 /// standard verbosity level
1231
1232 /// high verbosity level
1234
1235 /// full verbosity level
1236 VERBOSITY_FULL = 5
1238
1239 /// values for parameter SIMPLIFIER
1240 enum
1241 {
1242 /// disabling presolving
1244
1245 /// using internal presolving methods
1247
1248 /// using the presolve lib papilo
1250
1251 /// SoPlex chooses automatically (currently always "internal")
1252 SIMPLIFIER_AUTO = 1
1254
1255 /// values for parameter SCALER
1256 enum
1257 {
1258 /// no scaler
1260
1261 /// equilibrium scaling on rows or columns
1263
1264 /// equilibrium scaling on rows and columns
1266
1267 /// geometric mean scaling on rows and columns, max 1 round
1269
1270 /// geometric mean scaling on rows and columns, max 8 rounds
1272
1273 /// least square scaling
1275
1276 /// geometric mean scaling (max 8 rounds) followed by equilibrium scaling (rows and columns)
1277 SCALER_GEOEQUI = 6
1279
1280 /// values for parameter STARTER
1281 enum
1282 {
1283 /// slack basis
1285
1286 /// greedy crash basis weighted by objective, bounds, and sides
1288
1289 /// crash basis from a greedy solution
1291
1292 /// generic solution-based crash basis
1293 STARTER_VECTOR = 3
1295
1296 /// values for parameter PRICER
1297 enum
1298 {
1299 /// automatic pricer
1301
1302 /// Dantzig pricer
1304
1305 /// partial multiple pricer based on Dantzig pricing
1307
1308 /// devex pricer
1310
1311 /// steepest edge pricer with initialization to unit norms
1313
1314 /// steepest edge pricer with exact initialization of norms
1315 PRICER_STEEP = 5
1317
1318 /// values for parameter RATIOTESTER
1319 enum
1320 {
1321 /// textbook ratio test without stabilization
1323
1324 /// standard Harris ratio test
1326
1327 /// modified Harris ratio test
1329
1330 /// bound flipping ratio test for long steps in the dual simplex
1333
1334 /// values for parameter SYNCMODE
1335 enum
1336 {
1337 /// store only real LP
1339
1340 /// automatic sync of real and rational LP
1342
1343 /// user sync of real and rational LP
1344 SYNCMODE_MANUAL = 2
1346
1347 /// values for parameter READMODE
1348 enum
1349 {
1350 /// standard floating-point parsing
1352
1353 /// rational parsing
1356
1357 /// values for parameter SOLVEMODE
1358 enum
1359 {
1360 /// apply standard floating-point algorithm
1362
1363 /// decide depending on tolerances whether to apply iterative refinement
1365
1366 /// force iterative refinement
1369
1370 /// values for parameter CHECKMODE
1371 enum
1372 {
1373 /// floating-point check
1375
1376 /// decide according to READMODE
1378
1379 /// rational check
1382
1383 /// values for parameter TIMER
1384 enum
1385 {
1386 /// disable timing
1388
1389 /// cpu or user time
1391
1392 /// wallclock time
1393 TIMER_WALLCLOCK = 2
1395
1396 /// values for parameter HYPER_PRICING
1397 enum
1398 {
1399 /// never
1401
1402 /// decide according to problem size
1404
1405 /// always
1408
1409 /// values for parameter SOLUTION_POLISHING
1410 enum
1411 {
1412 /// no solution polishing
1414
1415 /// maximize number of basic slack variables, i.e. more variables on bounds
1417
1418 /// minimize number of basic slack variables, i.e. more variables between bounds
1421
1422 /// real parameters
1423 typedef enum
1424 {
1425 /// primal feasibility tolerance
1427
1428 /// dual feasibility tolerance
1430
1431 /// general zero tolerance
1433
1434 /// zero tolerance used in factorization
1436
1437 /// zero tolerance used in update of the factorization
1439
1440 /// pivot zero tolerance used in factorization
1442
1443 /// infinity threshold
1445
1446 /// time limit in seconds (INFTY if unlimited)
1448
1449 /// lower limit on objective value
1451
1452 /// upper limit on objective value
1454
1455 /// working tolerance for feasibility in floating-point solver during iterative refinement
1457
1458 /// working tolerance for optimality in floating-point solver during iterative refinement
1460
1461 /// maximum increase of scaling factors between refinements
1463
1464 /// lower threshold in lifting (nonzero matrix coefficients with smaller absolute value will be reformulated)
1466
1467 /// upper threshold in lifting (nonzero matrix coefficients with larger absolute value will be reformulated)
1469
1470 /// sparse pricing threshold (\#violations < dimension * SPARSITY_THRESHOLD activates sparse pricing)
1472
1473 /// threshold on number of rows vs. number of columns for switching from column to row representations in auto mode
1475
1476 /// geometric frequency at which to apply rational reconstruction
1478
1479 /// minimal reduction (sum of removed rows/cols) to continue simplification
1481
1482 /// refactor threshold for nonzeros in last factorized basis matrix compared to updated basis matrix
1484
1485 /// refactor threshold for fill-in in current factor update compared to fill-in in last factorization
1487
1488 /// refactor threshold for memory growth in factorization since last refactorization
1490
1491 /// accuracy of conjugate gradient method in least squares scaling (higher value leads to more iterations)
1493
1494 /// objective offset
1496
1497 /// minimal Markowitz threshold to control sparsity/stability in LU factorization
1499
1500 /// minimal modification threshold to apply presolve reductions
1502
1503 /// factor by which the precision of the floating-point solver is multiplied
1505
1506 /// number of real parameters
1507 REALPARAM_COUNT = 27
1509
1510#ifdef SOPLEX_WITH_RATIONALPARAM
1511 /// rational parameters
1512 typedef enum
1513 {
1514 /// number of rational parameters
1515 RATIONALPARAM_COUNT = 0
1516 } RationalParam;
1517#endif
1518
1519 /// class of parameter settings
1521 {
1522 public:
1523 static struct BoolParam
1524 {
1525 /// constructor
1527 /// array of names for boolean parameters
1529 /// array of descriptions for boolean parameters
1531 /// array of default values for boolean parameters
1534
1535 static struct IntParam
1536 {
1537 /// constructor
1539 /// array of names for integer parameters
1541 /// array of descriptions for integer parameters
1543 /// array of default values for integer parameters
1545 /// array of lower bounds for int parameter values
1547 /// array of upper bounds for int parameter values
1550
1551 static struct RealParam
1552 {
1553 /// constructor
1555 /// array of names for real parameters
1557 /// array of descriptions for real parameters
1559 /// array of default values for real parameters
1561 /// array of lower bounds for real parameter values
1563 /// array of upper bounds for real parameter values
1566
1567#ifdef SOPLEX_WITH_RATIONALPARAM
1568 static struct RationalParam
1569 {
1570 /// constructor
1571 RationalParam();
1572 /// array of names for rational parameters
1573 std::string name[SoPlexBase<R>::RATIONALPARAM_COUNT];
1574 /// array of descriptions for rational parameters
1575 std::string description[SoPlexBase<R>::RATIONALPARAM_COUNT];
1576 /// array of default values for rational parameters
1578 /// array of lower bounds for rational parameter values
1580 /// array of upper bounds for rational parameter values
1582 } rationalParam;
1583#endif
1584
1585 /// array of current boolean parameter values
1587
1588 /// array of current integer parameter values
1590
1591 /// array of current real parameter values
1593
1594#ifdef SOPLEX_WITH_RATIONALPARAM
1595 /// array of current rational parameter values
1596 Rational _rationalParamValues[SoPlexBase<R>::RATIONALPARAM_COUNT];
1597#endif
1598
1599 /// default constructor initializing default settings
1601
1602 /// copy constructor
1604
1605 /// assignment operator
1607 };
1608
1610
1611 /// returns boolean parameter value
1612 bool boolParam(const BoolParam param) const;
1613
1614 /// returns integer parameter value
1615 int intParam(const IntParam param) const;
1616
1617 /// returns real parameter value
1618 Real realParam(const RealParam param) const;
1619
1620#ifdef SOPLEX_WITH_RATIONALPARAM
1621 /// returns rational parameter value
1622 Rational rationalParam(const RationalParam param) const;
1623#endif
1624
1625 /// returns current parameter settings
1626 const Settings& settings() const;
1627
1628 /// returns current tolerances
1629 const std::shared_ptr<Tolerances> tolerances() const;
1630
1631 /// sets boolean parameter value; returns true on success
1632 bool setBoolParam(const BoolParam param, const bool value, const bool init = true);
1633
1634 /// sets integer parameter value; returns true on success
1635 bool setIntParam(const IntParam param, const int value, const bool init = true);
1636
1637 /// sets real parameter value; returns true on success
1638 bool setRealParam(const RealParam param, const Real value, const bool init = true);
1639
1640#ifdef SOPLEX_WITH_RATIONALPARAM
1641 /// sets rational parameter value; returns true on success
1642 bool setRationalParam(const RationalParam param, const Rational value, const bool init = true);
1643#endif
1644
1645 /// sets parameter settings; returns true on success
1646 bool setSettings(const Settings& newSettings, const bool init = true);
1647
1648 /// resets default parameter settings
1649 void resetSettings(const bool quiet = false, const bool init = true);
1650
1651 /// print non-default parameter values
1653
1654 /// writes settings file; returns true on success
1655 bool saveSettingsFile(const char* filename, const bool onlyChanged = false,
1656 int solvemode = 1) const;
1657
1658 /// reads settings file; returns true on success
1659 bool loadSettingsFile(const char* filename);
1660
1661 /// parses one setting string and returns true on success; note that string is modified
1662 bool parseSettingsString(char* str);
1663
1664 ///@}
1665
1666
1667 ///@name Statistics
1668 ///@{
1669
1670 /// set statistic timers to a certain type
1671 void setTimings(const Timer::TYPE ttype);
1672
1673 /// prints solution statistics
1674 void printSolutionStatistics(std::ostream& os);
1675
1676 /// prints statistics on solving process
1677 void printSolvingStatistics(std::ostream& os);
1678
1679 /// prints short statistics
1680 void printShortStatistics(std::ostream& os);
1681
1682 /// prints complete statistics
1683 void printStatistics(std::ostream& os);
1684
1685 /// prints status
1686
1687 void printStatus(std::ostream& os, typename SPxSolverBase<R>::Status status);
1688
1689 ///@}
1690
1691
1692 ///@name Miscellaneous
1693 ///@{
1694
1695 /// prints version and compilation options
1696 void printVersion() const;
1697
1698 /// checks if real LP and rational LP are in sync; dimensions will always be compared,
1699 /// vector and matrix values only if the respective parameter is set to true.
1700 /// If quiet is set to true the function will only display which vectors are different.
1701 bool areLPsInSync(const bool checkVecVals = true, const bool checkMatVals = false,
1702 const bool quiet = false) const;
1703
1704 /// set the random seeds of the solver instance
1705 void setRandomSeed(unsigned int seed);
1706
1707 /// returns the current random seed of the solver instance
1708 unsigned int randomSeed() const;
1709
1710 ///@}
1711
1712private:
1713
1714 ///@name Statistics on solving process
1715 ///@{
1716
1717 /// class of statistics
1718 class Statistics;
1719
1720 /// statistics since last call to solveReal() or solveRational()
1722
1723 ///@}
1724
1725
1726 ///@name Parameter settings
1727 ///@{
1728
1730
1731 std::shared_ptr<Tolerances> _tolerances;
1732
1738
1739 ///@}
1740
1741
1742 ///@name Data for the real LP
1743 ///@{
1744
1768
1773
1774#ifdef SOPLEX_WITH_BOOST
1775#ifdef SOPLEX_WITH_MPFR
1776 //----------------------------- BOOSTED SOLVER -----------------------------
1777 // multiprecision type used for the boosted solver
1778 using BP = number<mpfr_float_backend<0>, et_off>;
1779#else
1780#ifdef SOPLEX_WITH_GMP
1781 using BP = number<gmp_float<50>, et_off>;
1782#else
1783 using BP = number<cpp_dec_float<50>, et_off>;
1784#endif
1785#endif
1786#else
1787 using BP = double;
1788#endif
1789
1790 // boosted solver object
1792
1793 // ------------- Main attributes for precision boosting
1794
1795 int _initialPrecision = 50; // initial number of digits for multiprecision
1796 bool _boostingLimitReached; // true if BP::default_precision() > max authorized number of digits
1797 bool _switchedToBoosted; // true if _boostedSolver is used instead of _solver to cope with the numerical failure of _solver
1798 // this attribute remembers wether we are testing feasibility (1), unboundedness (2) or neither (0)
1799 // it is used when storing/loading the right basis in precision boosting.
1800 // example: if _certificateMode == 1, it is the basis for the feasibility LP that should be stored/loaded.
1802
1803 // ------------- Buffers for statistics of precision boosting
1804
1805 // ideally these four attributes would be local variables, however the precision boosting loop
1806 // wraps the solve in a way that it is complicated to declare these variables locally.
1807 int _lastStallPrecBoosts; // number of previous stalling precision boosts
1808 bool _factorSolNewBasisPrecBoost; // false if the current basis has already been factorized (no new iterations have been done)
1809 int _nextRatrecPrecBoost; // the iteration during or after which rational reconstruction can be performed
1810 // buffer storing the number of iterations before a given precision boost
1811 // used to detect stalling (_prevIterations < _statistics->iterations)
1813
1814 // ------------- Tolerances Ratios
1815
1816 /// ratios for computing the tolerances for precision boosting
1817 /// ratio denotes the proportion of precision used by the tolerance
1818 /// e.g. ratio = 0.65, precision = 100 digits, new tol = 10^(0.65*100)
1824
1825 // ------------- [Boosted] SLUFactor, Pricers, RatioTesters, Scalers, Simplifiers
1826
1828
1835
1840
1843
1850
1853
1854 //--------------------------------------------------------------------------
1855
1856 bool _isRealLPLoaded; // true indicates that the original LP is loaded in the _solver variable, hence all actions
1857 // are performed on the original LP.
1860
1867
1868 ///@}
1869
1870
1871 ///@name Data for the rational LP
1872 ///@{
1873
1877
1901
1902 /// type of bounds and sides
1903 typedef enum
1904 {
1905 /// both bounds are infinite
1907
1908 /// lower bound is finite, upper bound is infinite
1910
1911 /// upper bound is finite, lower bound is infinite
1913
1914 /// lower and upper bound finite, but different
1916
1917 /// lower bound equals upper bound
1918 RANGETYPE_FIXED = 4
1920
1923
1924 ///@}
1925
1926
1927 ///@name Solution data
1928 ///@{
1929
1932
1935
1936 // indicates wether an old basis is currently stored for warm start
1938 bool _hasOldFeasBasis; // basis for testing feasibility
1939 bool _hasOldUnbdBasis; // basis for testing unboundedness
1940
1941 // these vectors store the last basis met in precision boosting when not testing feasibility or unboundedness.
1944
1945 // these vectors store the last basis met when testing feasibility in precision boosting.
1948
1949 // these vectors store the last basis met when testing unboundedness in precision boosting.
1952
1953 // these vectors don't replace _basisStatusRows and _basisStatusCols
1954 // they aim to overcome the issue of having the enum VarStatus inside SPxSolverBase.
1955 // When calling setBasis or getBasis (from SPxSolverBase class), a specific conversion is needed.
1956 // Function: SPxSolverBase<BP>::setBasis(...)
1957 // Usage: copy _basisStatusRows(Cols) to _tmpBasisStatusRows(Cols) before calling
1958 // mysolver.setBasis(_tmpBasisStatusRows, _tmpBasisStatusCols)
1959 // Function: SPxSolverBase<BP>::getBasis(...)
1960 // Usage: copy _tmpBasisStatusRows(Cols) to _basisStatusRows(Cols) after calling
1961 // mysolver.getBasis(_tmpBasisStatusRows, _tmpBasisStatusCols, _basisStatusRows.size(), _basisStatusCols.size())
1964
1968
1972
1973 ///@}
1974
1975 ///@name Miscellaneous
1976 ///@{
1977
1980
1984
1985 ///@}
1986
1987 ///@name Constant helper methods
1988 ///@{
1989
1990 /// extends sparse vector to hold newmax entries if and only if it holds no more free entries
1991 void _ensureDSVectorRationalMemory(DSVectorRational& vec, const int newmax) const;
1992
1993 /// creates a permutation for removing rows/columns from an array of indices
1994 void _idxToPerm(int* idx, int idxSize, int* perm, int permSize) const;
1995
1996 /// creates a permutation for removing rows/columns from a range of indices
1997 void _rangeToPerm(int start, int end, int* perm, int permSize) const;
1998
1999 /// checks consistency for the boosted solver
2001
2002 /// checks consistency
2003 bool _isConsistent() const;
2004
2005 /// should solving process be stopped?
2006 bool _isSolveStopped(bool& stoppedTime, bool& stoppedIter) const;
2007
2008 /// determines RangeType from real bounds
2009 RangeType _rangeTypeReal(const R& lower, const R& upper) const;
2010
2011 /// determines RangeType from rational bounds
2012 RangeType _rangeTypeRational(const Rational& lower, const Rational& upper) const;
2013
2014 /// switches RANGETYPE_LOWER to RANGETYPE_UPPER and vice versa
2015 RangeType _switchRangeType(const RangeType& rangeType) const;
2016
2017 /// checks whether RangeType corresponds to finite lower bound
2018 bool _lowerFinite(const RangeType& rangeType) const;
2019
2020 /// checks whether RangeType corresponds to finite upper bound
2021 bool _upperFinite(const RangeType& rangeType) const;
2022
2023 ///@}
2024
2025
2026 ///@name Non-constant helper methods
2027 ///@{
2028
2029 /// adds a single row to the real LP and adjusts basis
2030 void _addRowReal(const LPRowBase<R>& lprow);
2031
2032 /// adds a single row to the real LP and adjusts basis
2033 void _addRowReal(R lhs, const SVectorBase<R>& lprow, R rhs);
2034
2035 /// adds multiple rows to the real LP and adjusts basis
2036 void _addRowsReal(const LPRowSetBase<R>& lprowset);
2037
2038 /// adds a single column to the real LP and adjusts basis
2039 void _addColReal(const LPColReal& lpcol);
2040
2041 /// adds a single column to the real LP and adjusts basis
2042 void _addColReal(R obj, R lower, const SVectorBase<R>& lpcol, R upper);
2043
2044 /// adds multiple columns to the real LP and adjusts basis
2045 void _addColsReal(const LPColSetReal& lpcolset);
2046
2047 /// replaces row \p i with \p lprow and adjusts basis
2048 void _changeRowReal(int i, const LPRowBase<R>& lprow);
2049
2050 /// changes left-hand side vector for constraints to \p lhs and adjusts basis
2052
2053 /// changes left-hand side of row \p i to \p lhs and adjusts basis
2054 void _changeLhsReal(int i, const R& lhs);
2055
2056 /// changes right-hand side vector to \p rhs and adjusts basis
2058
2059 /// changes right-hand side of row \p i to \p rhs and adjusts basis
2060 void _changeRhsReal(int i, const R& rhs);
2061
2062 /// changes left- and right-hand side vectors and adjusts basis
2063 void _changeRangeReal(const VectorBase<R>& lhs, const VectorBase<R>& rhs);
2064
2065 /// changes left- and right-hand side of row \p i and adjusts basis
2066 void _changeRangeReal(int i, const R& lhs, const R& rhs);
2067
2068 /// replaces column \p i with \p lpcol and adjusts basis
2069 void _changeColReal(int i, const LPColReal& lpcol);
2070
2071 /// changes vector of lower bounds to \p lower and adjusts basis
2073
2074 /// changes lower bound of column i to \p lower and adjusts basis
2075 void _changeLowerReal(int i, const R& lower);
2076
2077 /// changes vector of upper bounds to \p upper and adjusts basis
2079
2080 /// changes \p i 'th upper bound to \p upper and adjusts basis
2081 void _changeUpperReal(int i, const R& upper);
2082
2083 /// changes vectors of column bounds to \p lower and \p upper and adjusts basis
2084 void _changeBoundsReal(const VectorBase<R>& lower, const VectorBase<R>& upper);
2085
2086 /// changes bounds of column \p i to \p lower and \p upper and adjusts basis
2087 void _changeBoundsReal(int i, const R& lower, const R& upper);
2088
2089 /// changes matrix entry in row \p i and column \p j to \p val and adjusts basis
2090 void _changeElementReal(int i, int j, const R& val);
2091
2092 /// removes row \p i and adjusts basis
2093 void _removeRowReal(int i);
2094
2095 /// removes all rows with an index \p i such that \p perm[i] < 0; upon completion, \p perm[i] >= 0 indicates the
2096 /// new index where row \p i has been moved to; note that \p perm must point to an array of size at least
2097 /// #numRows()
2098 void _removeRowsReal(int perm[]);
2099
2100 /// remove all rows with indices in array \p idx of size \p n; an array \p perm of size #numRows() may be passed
2101 /// as buffer memory
2102 void _removeRowsReal(int idx[], int n, int perm[]);
2103
2104 /// removes rows \p start to \p end including both; an array \p perm of size #numRows() may be passed as buffer
2105 /// memory
2106 void _removeRowRangeReal(int start, int end, int perm[]);
2107
2108 /// removes column i
2109 void _removeColReal(int i);
2110
2111 /// removes all columns with an index \p i such that \p perm[i] < 0; upon completion, \p perm[i] >= 0 indicates the
2112 /// new index where column \p i has been moved to; note that \p perm must point to an array of size at least
2113 /// #numColsReal()
2114 void _removeColsReal(int perm[]);
2115
2116 /// remove all columns with indices in array \p idx of size \p n; an array \p perm of size #numColsReal() may be
2117 /// passed as buffer memory
2118 void _removeColsReal(int idx[], int n, int perm[]);
2119
2120 /// removes columns \p start to \p end including both; an array \p perm of size #numColsReal() may be passed as
2121 /// buffer memory
2122 void _removeColRangeReal(int start, int end, int perm[]);
2123
2124 /// invalidates solution
2126
2127 /// enables simplifier and scaler according to current parameters
2129
2130 /// disables simplifier and scaler
2132
2133 /// ensures that the rational LP is available; performs no sync
2135
2136 /// ensures that the real LP and the basis are loaded in the solver; performs no sync
2138
2139 /// call floating-point solver and update statistics on iterations etc.
2140 void _solveBoostedRealLPAndRecordStatistics(volatile bool* interrupt = nullptr);
2141
2142 /// call floating-point solver and update statistics on iterations etc.
2143 void _solveRealLPAndRecordStatistics(volatile bool* interrupt = nullptr);
2144
2145 /// reads real LP in LP or MPS format from file and returns true on success; gets row names, column names, and
2146 /// integer variables if desired
2147 bool _readFileReal(const char* filename, NameSet* rowNames = nullptr, NameSet* colNames = nullptr,
2148 DIdxSet* intVars = nullptr);
2149
2150 /// reads rational LP in LP or MPS format from file and returns true on success; gets row names, column names, and
2151 /// integer variables if desired
2152 bool _readFileRational(const char* filename, NameSet* rowNames = nullptr,
2153 NameSet* colNames = nullptr,
2154 DIdxSet* intVars = nullptr);
2155
2156 /// completes range type arrays after adding columns and/or rows
2158
2159 /// recomputes range types from scratch using real LP
2161
2162 /// recomputes range types from scratch using rational LP
2164
2165 /// synchronizes real LP with rational LP, i.e., copies (rounded) rational LP into real LP, without looking at the sync mode
2166 void _syncLPReal(bool time = true);
2167
2168 /// synchronizes rational LP with real LP, i.e., copies real LP to rational LP, without looking at the sync mode
2169 void _syncLPRational(bool time = true);
2170
2171 /// synchronizes rational solution with real solution, i.e., copies (rounded) rational solution to real solution
2173
2174 /// synchronizes real solution with rational solution, i.e., copies real solution to rational solution
2176
2177 /// returns pointer to a constant unit vector available until destruction of the SoPlexBase class
2179
2180 /// parses one line in a settings file and returns true on success; note that the string is modified
2181 bool _parseSettingsLine(char* line, const int lineNumber);
2182
2183 ///@}
2184
2185
2186 //**@name Private solving methods implemented in solverational.hpp */
2187 ///@{
2188
2189 /// stores floating-point solution of original LP as current rational solution and ensure that solution vectors have right dimension; ensure that solution is aligned with basis
2190 template <typename T>
2192 SolRational& sol,
2193 VectorBase<T>& primalReal,
2194 VectorBase<T>& dualReal,
2195 int& dualSize);
2196
2197 /// computes violation of bounds during the refinement loop
2198 void _computeBoundsViolation(SolRational& sol, Rational& boundsViolation);
2199
2200 /// computes violation of sides during the refinement loop
2201 void _computeSidesViolation(SolRational& sol, Rational& sideViolation);
2202
2203 /// computes violation of reduced costs during the refinement loop
2205 SolRational& sol,
2206 Rational& redCostViolation,
2207 const bool& maximizing);
2208
2209 /// computes dual violation during the refinement loop
2211 SolRational& sol,
2212 Rational& dualViolation,
2213 const bool& maximizing);
2214
2215 /// checks termination criteria for refinement loop
2217 bool& primalFeasible,
2218 bool& dualFeasible,
2219 Rational& boundsViolation,
2220 Rational& sideViolation,
2221 Rational& redCostViolation,
2222 Rational& dualViolation,
2223 int minIRRoundsRemaining,
2224 bool& stoppedTime,
2225 bool& stoppedIter,
2226 int numFailedRefinements);
2227
2228 /// checks refinement loop progress
2230 Rational& boundsViolation,
2231 Rational& sideViolation,
2232 Rational& redCostViolation,
2233 Rational& dualViolation,
2234 Rational& maxViolation,
2235 Rational& bestViolation,
2236 const Rational& violationImprovementFactor,
2237 int& numFailedRefinements);
2238
2239 /// performs rational reconstruction and/or factorizationd
2241 int& minIRRoundsRemaining,
2242 int& lastStallIterations,
2243 int& numberOfIterations,
2244 bool& factorSolNewBasis,
2245 int& nextRatrec,
2246 const Rational& errorCorrectionFactor,
2247 Rational& errorCorrection,
2248 Rational& maxViolation,
2249 SolRational& sol,
2250 bool& primalFeasible,
2251 bool& dualFeasible,
2252 bool& stoppedTime,
2253 bool& stoppedIter,
2254 bool& error,
2255 bool& breakAfter,
2256 bool& continueAfter);
2257
2258 /// forces value of given nonbasic variable to bound
2260 SolRational& sol,
2261 int& c,
2262 const int& maxDimRational,
2263 bool toLower);
2264
2265 /// computes primal scaling factor; limit increase in scaling by tolerance used in floating point solve
2267 Rational& maxScale,
2268 Rational& primalScale,
2269 Rational& boundsViolation,
2270 Rational& sideViolation,
2271 Rational& redCostViolation);
2272
2273 /// computes dual scaling factor; limit increase in scaling by tolerance used in floating point solve
2275 Rational& maxScale,
2276 Rational& primalScale,
2277 Rational& dualScale,
2278 Rational& redCostViolation,
2279 Rational& dualViolation);
2280
2281 /// applies scaled bounds
2282 template <typename T>
2283 void _applyScaledBounds(SPxSolverBase<T>& solver, Rational& primalScale);
2284
2285 /// applies scaled sides
2286 template <typename T>
2287 void _applyScaledSides(SPxSolverBase<T>& solver, Rational& primalScale);
2288
2289 /// applies scaled objective function
2290 template <typename T>
2291 void _applyScaledObj(SPxSolverBase<T>& solver, Rational& dualScale, SolRational& sol);
2292
2293 /// evaluates result of solve. Return true if the algorithm must to stopped, false otherwise.
2294 template <typename T>
2296 SPxSolverBase<T>& solver,
2297 typename SPxSolverBase<T>::Status result,
2298 bool usingRefinedLP,
2299 SolRational& sol,
2300 VectorBase<T>& dualReal,
2301 bool& infeasible,
2302 bool& unbounded,
2303 bool& stoppedTime,
2304 bool& stoppedIter,
2305 bool& error);
2306
2307 /// corrects primal solution and aligns with basis
2308 template <typename T>
2310 SolRational& sol,
2311 Rational& primalScale,
2312 int& primalSize,
2313 const int& maxDimRational,
2314 VectorBase<T>& primalReal);
2315
2316 /// updates or recomputes slacks depending on which looks faster
2317 void _updateSlacks(SolRational& sol, int& primalSize);
2318
2319 /// corrects dual solution and aligns with basis
2320 template <typename T>
2322 SPxSolverBase<T>& solver,
2323 SolRational& sol,
2324 const bool& maximizing,
2325 VectorBase<T>& dualReal,
2326 Rational& dualScale,
2327 int& dualSize,
2328 const int& maxDimRational);
2329
2330 /// updates or recomputes reduced cost values depending on which looks faster; adding one to the length of the
2331 /// dual vector accounts for the objective function vector
2332 void _updateReducedCosts(SolRational& sol, int& dualSize, const int& numCorrectedPrimals);
2333
2334 ///@todo precision-boosting move some place else
2335 /// converts the given DataArray of VarStatus to boostedPrecision
2337 DataArray< typename SPxSolverBase<R>::VarStatus >& base,
2338 DataArray< typename SPxSolverBase<BP>::VarStatus >& copy);
2339
2340 ///@todo precision-boosting move some place else
2341 /// converts the given DataArray of VarStatus to R precision
2343 DataArray< typename SPxSolverBase<BP>::VarStatus >& base,
2344 DataArray< typename SPxSolverBase<R>::VarStatus >& copy);
2345
2346 /// disable initial precision solver and switch to boosted solver
2348
2349 /// setup boosted solver before launching iteration
2351
2352 /// increase the multiprecision, return false if maximum precision is reached, true otherwise
2354
2355 /// reset the boosted precision to the default value
2357
2358 /// setup recovery mecanism using multiprecision, return false if maximum precision reached, true otherwise
2360
2361 /// return true if slack basis has to be loaded for boosted solver
2362 bool _isBoostedStartingFromSlack(bool initialSolve = true);
2363
2364 /// indicate if we are testing feasibility, unboundedness or neither
2368
2369 /// check if we are testing feasibility, unboundedness or neither
2373
2374 // stores given basis in old basis attributes: _oldBasisStatusRows, _oldFeasBasisStatusRows, _oldUnbdBasisStatusRows (and ...Cols)
2376 DataArray< typename SPxSolverBase<R>::VarStatus >& cols);
2377
2378 // stores given basis in old basis attributes: _oldBasisStatusRows, _oldFeasBasisStatusRows, _oldUnbdBasisStatusRows (and ...Cols)
2380 DataArray< typename SPxSolverBase<BP>::VarStatus >& cols);
2381
2382 // get the last advanced and stable basis stored by the initial solver and store it as old basis, unsimplify basis if simplifier activated
2383 void _storeLastStableBasis(bool vanished);
2384
2385 // get the last advanced and stable basis stored by the boosted solver and store it as old basis, unsimplify basis if simplifier activated
2386 void _storeLastStableBasisBoosted(bool vanished);
2387
2388 // load old basis in solver. The old basis loaded depends on the certificate mode (feasibility, unboundedness, or neither)
2389 bool _loadBasisFromOldBasis(bool boosted);
2390
2391 // update statistics for precision boosting
2393
2394 /// solves current problem using multiprecision floating-point solver
2395 /// return false if a new boosted iteration is necessary, true otherwise
2397 SolRational& sol,
2398 bool& primalFeasible,
2399 bool& dualFeasible,
2400 bool& infeasible,
2401 bool& unbounded,
2402 bool& stoppedTime,
2403 bool& stoppedIter,
2404 bool& error,
2405 bool& needNewBoostedIt);
2406
2407 /// solves current problem with iterative refinement and recovery mechanism using boosted solver
2409 SolRational& sol,
2410 bool acceptUnbounded,
2411 bool acceptInfeasible,
2412 int minIRRoundsRemaining,
2413 bool& primalFeasible,
2414 bool& dualFeasible,
2415 bool& infeasible,
2416 bool& unbounded,
2417 bool& stoppedTime,
2418 bool& stoppedIter,
2419 bool& error,
2420 bool& needNewBoostedIt);
2421
2422 /// perform iterative refinement using the right precision
2424 SolRational& sol,
2425 bool acceptUnbounded,
2426 bool acceptInfeasible,
2427 int minIRRoundsRemaining,
2428 bool& primalFeasible,
2429 bool& dualFeasible,
2430 bool& infeasible,
2431 bool& unbounded,
2432 bool& stoppedTime,
2433 bool& stoppedIter,
2434 bool& error
2435 );
2436
2437 /// solves current problem using double floating-point solver
2439 SolRational& sol,
2440 bool& primalFeasible,
2441 bool& dualFeasible,
2442 bool& infeasible,
2443 bool& unbounded,
2444 bool& stoppedTime,
2445 bool& stoppedIter,
2446 bool& error);
2447
2448 /// solves current problem with iterative refinement and recovery mechanism
2450 bool acceptUnbounded,
2451 bool acceptInfeasible,
2452 int minIRRoundsRemaining,
2453 bool& primalFeasible,
2454 bool& dualFeasible,
2455 bool& infeasible,
2456 bool& unbounded,
2457 bool& stoppedTime,
2458 bool& stoppedIter,
2459 bool& error);
2460
2461 /// performs iterative refinement on the auxiliary problem for testing unboundedness
2462 void _performUnboundedIRStable(SolRational& sol, bool& hasUnboundedRay, bool& stoppedTime,
2463 bool& stoppedIter, bool& error);
2464
2465 /// performs iterative refinement on the auxiliary problem for testing feasibility
2466 void _performFeasIRStable(SolRational& sol, bool& withDualFarkas, bool& stoppedTime,
2467 bool& stoppedIter, bool& error);
2468
2469 /// reduces matrix coefficient in absolute value by the lifting procedure of Thiele et al. 2013
2470 void _lift();
2471
2472 /// undoes lifting
2474
2475 /// store basis
2477
2478 /// restore basis
2480
2481 /// stores objective, bounds, and sides of real LP
2483
2484 /// restores objective, bounds, and sides of real LP
2486
2487 /// introduces slack variables to transform inequality constraints into equations for both rational and real LP,
2488 /// which should be in sync
2490
2491 /// undoes transformation to equality form
2493
2494 /// transforms LP to unboundedness problem by moving the objective function to the constraints, changing right-hand
2495 /// side and bounds to zero, and adding an auxiliary variable for the decrease in the objective function
2497
2498 /// undoes transformation to unboundedness problem
2499 void _untransformUnbounded(SolRational& sol, bool unbounded);
2500
2501 /// transforms LP to feasibility problem by removing the objective function, shifting variables, and homogenizing the
2502 /// right-hand side
2504
2505 /// undoes transformation to feasibility problem
2506 void _untransformFeasibility(SolRational& sol, bool infeasible);
2507
2508 /** computes radius of infeasibility box implied by an approximate Farkas' proof
2509
2510 Given constraints of the form \f$ lhs <= Ax <= rhs \f$, a farkas proof y should satisfy \f$ y^T A = 0 \f$ and
2511 \f$ y_+^T lhs - y_-^T rhs > 0 \f$, where \f$ y_+, y_- \f$ denote the positive and negative parts of \f$ y \f$.
2512 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
2513 as the following holds for all potentially feasible \f$ x \f$:
2514
2515 \f[
2516 y^T Ax < (y_+^T lhs - y_-^T rhs) (*)
2517 \f]
2518
2519 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
2520 bounds on \f$ x \f$ imply that all feasible \f$ x \f$ satisfy (*), and if not then compute bounds on \f$ x \f$ to
2521 guarantee (*). The simplest way to do this is to compute
2522
2523 \f[
2524 B = (y_+^T lhs - y_-^T rhs) / \sum_i(|(y^T A)_i|)
2525 \f]
2526
2527 noting that if every component of \f$ x \f$ has \f$ |x_i| < B \f$, then (*) holds.
2528
2529 \f$ B \f$ can be increased by iteratively including variable bounds smaller than \f$ B \f$. The speed of this
2530 method can be further improved by using interval arithmetic for all computations. For related information see
2531 Sec. 4 of Neumaier and Shcherbina, Mathematical Programming A, 2004.
2532
2533 Set transformed to true if this method is called after _transformFeasibility().
2534 */
2535 void _computeInfeasBox(SolRational& sol, bool transformed);
2536
2537 /// solves real LP during iterative refinement
2539 VectorBase<R>& dual,
2540 DataArray< typename SPxSolverBase<R>::VarStatus >& basisStatusRows,
2541 DataArray< typename SPxSolverBase<R>::VarStatus >& basisStatusCols);
2542
2543 /// solves real LP with recovery mechanism
2544 typename SPxSolverBase<R>::Status _solveRealStable(bool acceptUnbounded, bool acceptInfeasible,
2545 VectorBase<R>& primal, VectorBase<R>& dual,
2546 DataArray< typename SPxSolverBase<R>::VarStatus >& basisStatusRows,
2547 DataArray< typename SPxSolverBase<R>::VarStatus >& basisStatusCols,
2548 const bool forceNoSimplifier = false);
2549
2550 /// solves real LP during iterative refinement
2552 VectorBase<BP>& primal, VectorBase<BP>& dual,
2553 DataArray< typename SPxSolverBase<R>::VarStatus >& basisStatusRows,
2554 DataArray< typename SPxSolverBase<R>::VarStatus >& basisStatusCols,
2555 typename SPxSolverBase<BP>::Status& boostedResult, bool initialSolve);
2556
2557 /// computes rational inverse of basis matrix as defined by _rationalLUSolverBind
2559
2560public:
2561
2562 /// factorizes rational basis matrix in column representation
2564 DataArray< typename SPxSolverBase<R>::VarStatus >& basisStatusRows,
2565 DataArray< typename SPxSolverBase<R>::VarStatus >& basisStatusCols, bool& stoppedTime,
2566 bool& stoppedIter, bool& error, bool& optimal);
2567
2568private:
2569
2570 /// attempts rational reconstruction of primal-dual solution
2572 DataArray< typename SPxSolverBase<R>::VarStatus >& basisStatusRows,
2573 DataArray< typename SPxSolverBase<R>::VarStatus >& basisStatusCols,
2574 const Rational& denomBoundSquared);
2575 ///@}
2576
2577 ///@name Private solving methods implemented in solvereal.cpp
2578 ///@{
2579
2580 /// solves the templated LP
2581 void _optimize(volatile bool* interrupt = nullptr);
2582
2583 /// temporary fix for Rational
2584 void _optimizeRational(volatile bool* interrupt = nullptr);
2585
2586 /// checks result of the solving process and solves again without preprocessing if necessary
2587 void _evaluateSolutionReal(typename SPxSimplifier<R>::Result simplificationStatus);
2588
2589 /// solves real LP with/without preprocessing
2590 void _preprocessAndSolveReal(bool applyPreprocessing, volatile bool* interrupt = nullptr);
2591
2592 /// loads original problem into solver and solves again after it has been solved to optimality with preprocessing
2593 void _resolveWithoutPreprocessing(typename SPxSimplifier<R>::Result simplificationStatus);
2594
2595 /// verify computed solution and resolve if necessary
2597
2598 /// verify computed obj stop and resolve if necessary
2600
2601 /// stores solution of the real LP; before calling this, the real LP must be loaded in the solver and solved (again)
2602 void _storeSolutionReal(bool verify = true);
2603
2604 /// stores solution from the simplifier because problem vanished in presolving step
2606
2607 /// unscales stored solution to remove internal or external scaling of LP
2608 void _unscaleSolutionReal(SPxLPBase<R>& LP, bool persistent = true);
2609
2610 /// load original LP and possibly setup a slack basis
2611 void _loadRealLP(bool initBasis);
2612
2613 /// check scaling of LP
2614 void _checkScaling(SPxLPBase<R>* origLP) const;
2615
2616 /// check correctness of (un)scaled basis matrix operations
2618
2619 /// check whether persistent scaling is supposed to be reapplied again after unscaling
2621
2622 /// checks the dual feasibility of the current basis
2624 ///@}
2625};
2626
2627/* Backwards compatibility */
2629// A header file containing all the general templated functions
2630
2631} // namespace soplex
2632
2633// General templated function
2634#include "soplex.hpp"
2635#include "soplex/solverational.hpp"
2636#include "soplex/testsoplex.hpp"
2637#include "soplex/solvereal.hpp"
2638
2639#endif // _SOPLEX_H_
Collection of dense, sparse, and semi-sparse vectors.
Safe arrays of arbitrary types.
Definition: array.h:73
Dynamic index set.
Definition: didxset.h:52
Dynamic sparse vectors.
Definition: dsvectorbase.h:53
LP column.
Definition: lpcolbase.h:55
(In)equality for LPs.
Definition: lprowbase.h:55
Type
(In)Equality type of an LP row.
Definition: lprowbase.h:82
Set of LP rows.
Definition: lprowsetbase.h:54
Set of strings.
Definition: nameset.h:71
Implementation of Sparse Linear Solver with Rational precision.
Implementation of Sparse Linear Solver.
Definition: slufactor.h:51
Auto pricer.
Definition: spxautopr.h:52
SPxStatus
basis status.
Definition: spxbasis.h:102
Bound flipping ratio test ("long step dual") for SoPlex.
Dantzig pricer.
Definition: spxdantzigpr.h:49
Textbook ratio test for SoPlex.
Definition: spxdefaultrt.h:53
Devex pricer.
Definition: spxdevexpr.h:54
Equilibrium row/column scaling.
Definition: spxequilisc.h:46
Fast shifting ratio test.
Definition: spxfastrt.h:54
Geometric mean row/column scaling.
Definition: spxgeometsc.h:46
Harris pricing with shifting.
Definition: spxharrisrt.h:51
Saving LPs in a form suitable for SoPlex.
Definition: spxlpbase.h:108
Least squares scaling.
Definition: spxleastsqsc.h:48
LP simplifier for removing uneccessary row/columns.
Definition: spxmainsm.h:72
Wrapper for several output streams. A verbosity level is used to decide which stream to use and wheth...
Definition: spxout.h:78
Partial multiple pricing.
Definition: spxparmultpr.h:58
LP scaler abstract base class.
Definition: spxscaler.h:87
LP simplification abstract base class.
Definition: spxsimplifier.h:52
Result
Result of the simplification.
Definition: spxsimplifier.h:93
Sequential object-oriented SimPlex.
Definition: spxsolver.h:104
SoPlex start basis generation base class.
Definition: spxstarter.h:52
Steepest edge pricer.
Definition: spxsteepexpr.h:51
Steepest edge pricer.
Definition: spxsteeppr.h:52
Simple heuristic SPxStarter.
Definition: spxsumst.h:48
Solution vector based start basis.
Definition: spxvectorst.h:55
Weighted start basis.
Definition: spxweightst.h:67
Sparse vectors.
Definition: svectorbase.h:140
class of parameter settings
Definition: soplex.h:1521
int _intParamValues[SoPlexBase< R >::INTPARAM_COUNT]
array of current integer parameter values
Definition: soplex.h:1589
static struct soplex::SoPlexBase::Settings::BoolParam boolParam
bool _boolParamValues[SoPlexBase< R >::BOOLPARAM_COUNT]
array of current boolean parameter values
Definition: soplex.h:1586
static struct soplex::SoPlexBase::Settings::IntParam intParam
Settings(const Settings &settings)
copy constructor
Settings & operator=(const Settings &settings)
assignment operator
Real _realParamValues[SoPlexBase< R >::REALPARAM_COUNT]
array of current real parameter values
Definition: soplex.h:1592
static struct soplex::SoPlexBase::Settings::RealParam realParam
Settings()
default constructor initializing default settings
int numRows() const
returns number of rows
void _performOptIRStableBoosted(SolRational &sol, bool acceptUnbounded, bool acceptInfeasible, int minIRRoundsRemaining, bool &primalFeasible, bool &dualFeasible, bool &infeasible, bool &unbounded, bool &stoppedTime, bool &stoppedIter, bool &error, bool &needNewBoostedIt)
solves current problem with iterative refinement and recovery mechanism using boosted solver
bool getBasisInverseTimesVecRational(const SVectorRational &rhs, SSVectorRational &sol)
computes solution of basis matrix B * sol = rhs; performs rational factorization if not available; re...
bool _isSolveStopped(bool &stoppedTime, bool &stoppedIter) const
should solving process be stopped?
SPxLeastSqSC< BP > _boostedScalerLeastsq
Definition: soplex.h:1849
@ STARTER_VECTOR
generic solution-based crash basis
Definition: soplex.h:1293
@ STARTER_WEIGHT
greedy crash basis weighted by objective, bounds, and sides
Definition: soplex.h:1287
@ STARTER_SUM
crash basis from a greedy solution
Definition: soplex.h:1290
@ STARTER_OFF
slack basis
Definition: soplex.h:1284
bool getDualNorms(int &nnormsRow, int &nnormsCol, R *norms) const
gets steepest edge norms and returns false if they are not available
@ CHECKMODE_REAL
floating-point check
Definition: soplex.h:1374
@ CHECKMODE_RATIONAL
rational check
Definition: soplex.h:1380
@ CHECKMODE_AUTO
decide according to READMODE
Definition: soplex.h:1377
VectorRational _modObj
Definition: soplex.h:1893
void _changeColReal(int i, const LPColReal &lpcol)
replaces column i with lpcol and adjusts basis
SPxSolverBase< R >::Status _solveRealForRational(bool fromscratch, VectorBase< R > &primal, VectorBase< R > &dual, DataArray< typename SPxSolverBase< R >::VarStatus > &basisStatusRows, DataArray< typename SPxSolverBase< R >::VarStatus > &basisStatusCols)
solves real LP during iterative refinement
void _untransformFeasibility(SolRational &sol, bool infeasible)
undoes transformation to feasibility problem
void _computeDualViolation(SolRational &sol, Rational &dualViolation, const bool &maximizing)
computes dual violation during the refinement loop
@ OBJSENSE_MAXIMIZE
maximization
Definition: soplex.h:1181
@ OBJSENSE_MINIMIZE
minimization
Definition: soplex.h:1178
bool getRowViolation(R &maxviol, R &sumviol)
gets violation of constraints; returns true on success
bool getColActivity(const int i, R &value)
gets the activity for the i 'th column given the current dual solution
void _resolveWithoutPreprocessing(typename SPxSimplifier< R >::Result simplificationStatus)
loads original problem into solver and solves again after it has been solved to optimality with prepr...
R objValueReal()
returns the objective value if a primal solution is available
void _removeRowsReal(int idx[], int n, int perm[])
remove all rows with indices in array idx of size n; an array perm of size numRows() may be passed as...
bool _setupBoostedSolverAfterRecovery()
setup recovery mecanism using multiprecision, return false if maximum precision reached,...
VectorRational _modUpper
Definition: soplex.h:1890
void _storeSolutionReal(bool verify=true)
stores solution of the real LP; before calling this, the real LP must be loaded in the solver and sol...
void getObjReal(VectorBase< R > &obj) const
gets objective function vector
void _updateBoostingStatistics()
bool getRowsActivityReal(R *p_vector, int dim)
void _storeLPReal()
stores objective, bounds, and sides of real LP
Real solveTime() const
time spent in last call to solve
void _storeRealSolutionAsRational(SolRational &sol, VectorBase< T > &primalReal, VectorBase< T > &dualReal, int &dualSize)
stores floating-point solution of original LP as current rational solution and ensure that solution v...
VectorBase< R > _manualRhs
Definition: soplex.h:1864
bool multBasisTranspose(R *vec, bool unscale=true)
multiply with transpose of basis matrix; vec * B^T (inplace)
void _removeRowReal(int i)
removes row i and adjusts basis
void _rangeToPerm(int start, int end, int *perm, int permSize) const
creates a permutation for removing rows/columns from a range of indices
void changeColRational(int i, const LPColRational &lpcol)
replaces column i with lpcol
void setTimings(const Timer::TYPE ttype)
set statistic timers to a certain type
SPxWeightST< R > _starterWeight
Definition: soplex.h:1755
const VectorBase< R > & lhsRealInternal() const
returns left-hand side vector, ignoring scaling
bool _isBoostedConsistent() const
checks consistency for the boosted solver
R coefReal(int row, int col) const
returns (unscaled) coefficient
VectorRational _unboundedLhs
Definition: soplex.h:1881
bool getSlacksReal(VectorBase< R > &vector)
gets the vector of slack values if available; returns true on success
DataArray< typename SPxSolverBase< BP >::VarStatus > _tmpBasisStatusRows
Definition: soplex.h:1962
SPxDantzigPR< BP > _boostedPricerDantzig
Definition: soplex.h:1830
void _removeColsReal(int idx[], int n, int perm[])
remove all columns with indices in array idx of size n; an array perm of size numColsReal() may be pa...
SPxEquiliSC< R > _scalerBiequi
Definition: soplex.h:1750
RealParam
real parameters
Definition: soplex.h:1424
@ OPTTOL
dual feasibility tolerance
Definition: soplex.h:1429
@ FPOPTTOL
working tolerance for optimality in floating-point solver during iterative refinement
Definition: soplex.h:1459
@ PRECISION_BOOSTING_FACTOR
factor by which the precision of the floating-point solver is multiplied
Definition: soplex.h:1504
@ SPARSITY_THRESHOLD
sparse pricing threshold (#violations < dimension * SPARSITY_THRESHOLD activates sparse pricing)
Definition: soplex.h:1471
@ LIFTMAXVAL
upper threshold in lifting (nonzero matrix coefficients with larger absolute value will be reformulat...
Definition: soplex.h:1468
@ EPSILON_ZERO
general zero tolerance
Definition: soplex.h:1432
@ EPSILON_FACTORIZATION
zero tolerance used in factorization
Definition: soplex.h:1435
@ OBJLIMIT_UPPER
upper limit on objective value
Definition: soplex.h:1453
@ FPFEASTOL
working tolerance for feasibility in floating-point solver during iterative refinement
Definition: soplex.h:1456
@ RATREC_FREQ
geometric frequency at which to apply rational reconstruction
Definition: soplex.h:1477
@ MAXSCALEINCR
maximum increase of scaling factors between refinements
Definition: soplex.h:1462
@ TIMELIMIT
time limit in seconds (INFTY if unlimited)
Definition: soplex.h:1447
@ LIFTMINVAL
lower threshold in lifting (nonzero matrix coefficients with smaller absolute value will be reformula...
Definition: soplex.h:1465
@ REPRESENTATION_SWITCH
threshold on number of rows vs. number of columns for switching from column to row representations in...
Definition: soplex.h:1474
@ REFAC_UPDATE_FILL
refactor threshold for fill-in in current factor update compared to fill-in in last factorization
Definition: soplex.h:1486
@ REALPARAM_COUNT
number of real parameters
Definition: soplex.h:1507
@ MINRED
minimal reduction (sum of removed rows/cols) to continue simplification
Definition: soplex.h:1480
@ OBJ_OFFSET
objective offset
Definition: soplex.h:1495
@ OBJLIMIT_LOWER
lower limit on objective value
Definition: soplex.h:1450
@ FEASTOL
primal feasibility tolerance
Definition: soplex.h:1426
@ EPSILON_PIVOT
pivot zero tolerance used in factorization
Definition: soplex.h:1441
@ MIN_MARKOWITZ
minimal Markowitz threshold to control sparsity/stability in LU factorization
Definition: soplex.h:1498
@ REFAC_MEM_FACTOR
refactor threshold for memory growth in factorization since last refactorization
Definition: soplex.h:1489
@ SIMPLIFIER_MODIFYROWFAC
minimal modification threshold to apply presolve reductions
Definition: soplex.h:1501
@ EPSILON_UPDATE
zero tolerance used in update of the factorization
Definition: soplex.h:1438
@ REFAC_BASIS_NNZ
refactor threshold for nonzeros in last factorized basis matrix compared to updated basis matrix
Definition: soplex.h:1483
@ LEASTSQ_ACRCY
accuracy of conjugate gradient method in least squares scaling (higher value leads to more iterations...
Definition: soplex.h:1492
@ INFTY
infinity threshold
Definition: soplex.h:1444
bool getDualViolation(R &maxviol, R &sumviol)
gets violation of dual multipliers; returns true on success
void _enableSimplifierAndScaler()
enables simplifier and scaler according to current parameters
void _verifyObjLimitReal()
verify computed obj stop and resolve if necessary
bool getSlacksReal(R *p_vector, int dim)
DataArray< typename SPxSolverBase< R >::VarStatus > _basisStatusRows
Definition: soplex.h:1933
SoPlexBase()
default constructor
void changeLhsReal(const VectorBase< R > &lhs)
changes left-hand side vector for constraints to lhs
void addRowsRational(const LPRowSetRational &lprowset)
adds multiple rows
@ TIMER_WALLCLOCK
wallclock time
Definition: soplex.h:1393
@ TIMER_CPU
cpu or user time
Definition: soplex.h:1390
@ TIMER_OFF
disable timing
Definition: soplex.h:1387
VectorRational _feasObj
Definition: soplex.h:1884
bool _switchedToBoosted
Definition: soplex.h:1797
void changeRhsRational(const VectorRational &rhs)
changes right-hand side vector to rhs
IntParam
integer parameters
Definition: soplex.h:1084
@ HYPER_PRICING
mode for hyper sparse pricing
Definition: soplex.h:1146
@ DISPLAYFREQ
display frequency
Definition: soplex.h:1110
@ TIMER
type of timer
Definition: soplex.h:1143
@ CHECKMODE
mode for a posteriori feasibility checks
Definition: soplex.h:1140
@ STATTIMER
type of timer for statistics
Definition: soplex.h:1161
@ FACTOR_UPDATE_TYPE
type of LU update
Definition: soplex.h:1095
@ READMODE
mode for reading LP files
Definition: soplex.h:1134
@ STALLREFLIMIT
stalling refinement limit (-1 if unlimited)
Definition: soplex.h:1107
@ STARTER
type of starter used to create crash basis
Definition: soplex.h:1122
@ STORE_BASIS_SIMPLEX_FREQ
Definition: soplex.h:1168
@ REFLIMIT
refinement limit (-1 if unlimited)
Definition: soplex.h:1104
@ SYNCMODE
mode for synchronizing real and rational LP
Definition: soplex.h:1131
@ PRICER
type of pricer
Definition: soplex.h:1125
@ LEASTSQ_MAXROUNDS
maximum number of conjugate gradient iterations in least square scaling
Definition: soplex.h:1152
@ ALGORITHM
type of algorithm, i.e., primal or dual
Definition: soplex.h:1092
@ INTPARAM_COUNT
number of integer parameters
Definition: soplex.h:1171
@ OBJSENSE
objective sense
Definition: soplex.h:1086
@ SIMPLIFIER
type of simplifier
Definition: soplex.h:1116
@ PRINTBASISMETRIC
print condition number during the solve
Definition: soplex.h:1158
@ REPRESENTATION
type of computational form, i.e., column or row representation
Definition: soplex.h:1089
@ SOLVEMODE
mode for iterative refinement strategy
Definition: soplex.h:1137
@ RATFAC_MINSTALLS
minimum number of stalling refinements since last pivot to trigger rational factorization
Definition: soplex.h:1149
@ SOLUTION_POLISHING
mode for solution polishing
Definition: soplex.h:1155
@ FACTOR_UPDATE_MAX
maximum number of updates without fresh factorization
Definition: soplex.h:1098
@ SCALER
type of scaler
Definition: soplex.h:1119
@ ITERLIMIT
iteration limit (-1 if unlimited)
Definition: soplex.h:1101
@ RATIOTESTER
type of ratio test
Definition: soplex.h:1128
@ VERBOSITY
verbosity level
Definition: soplex.h:1113
DSVectorRational _tauColVector
Definition: soplex.h:1883
int numRefinements() const
number of iterative refinements
void _removeColReal(int i)
removes column i
void changeUpperRational(const VectorRational &upper)
changes vector of upper bounds to upper
bool getColsActivityReal(const std::vector< int > &indices, R *p_vector, const int dim)
void _convertDataArrayVarStatusToRPrecision(DataArray< typename SPxSolverBase< BP >::VarStatus > &base, DataArray< typename SPxSolverBase< R >::VarStatus > &copy)
SolRational _solRational
Definition: soplex.h:1966
bool _hasOldFeasBasis
Definition: soplex.h:1938
void _addColReal(const LPColReal &lpcol)
adds a single column to the real LP and adjusts basis
DataArray< typename SPxSolverBase< R >::VarStatus > _storedBasisStatusRows
Definition: soplex.h:1895
bool getDualRational(mpq_t *vector, const int size)
gets the dual solution vector if available; returns true on success (GMP only method)
void changeElementRational(int i, int j, const Rational &val)
changes matrix entry in row i and column j to val
LPRowRational::Type rowTypeRational(int i) const
returns inequality type of row i
void getObjRational(int i, Rational &obj) const
gets objective value of column i
const char * getStarterName()
name of starter
void _storeBasis()
store basis
void _ensureRealLPLoaded()
ensures that the real LP and the basis are loaded in the solver; performs no sync
void changeLhsRational(int i, const mpq_t *lhs)
changes left-hand side of row i to lhs (GMP only method)
SolRational _workSol
Definition: soplex.h:1967
const Rational & upperRational(int i) const
returns upper bound of column i
bool getSlacksRational(mpq_t *vector, const int size)
gets the vector of slack values if available; returns true on success (GMP only method)
VectorRational _unboundedLower
Definition: soplex.h:1879
bool getBasisInverseRowReal(int r, R *coef, int *inds=nullptr, int *ninds=nullptr, bool unscale=true)
computes row r of basis inverse; returns true on success
int _nextRatrecPrecBoost
Definition: soplex.h:1809
void printSolvingStatistics(std::ostream &os)
prints statistics on solving process
const VectorBase< R > & maxObjRealInternal() const
returns objective function vector after transformation to a maximization problem; since this is how i...
void _updateReducedCosts(SolRational &sol, int &dualSize, const int &numCorrectedPrimals)
updates or recomputes reduced cost values depending on which looks faster; adding one to the length o...
int numRowsRational() const
bool checkBasisDualFeasibility(VectorBase< R > feasVec)
checks the dual feasibility of the current basis
void _updateSlacks(SolRational &sol, int &primalSize)
updates or recomputes slacks depending on which looks faster
bool getSlacksRational(VectorRational &vector)
gets the vector of slack values if available; returns true on success
const SVectorBase< R > & rowVectorRealInternal(int i) const
returns vector of row i, ignoring scaling
const VectorBase< R > & lowerRealInternal() const
returns lower bound vector
bool getBasisIndRational(DataArray< int > &bind)
gets an array of indices for the columns of the rational basis matrix; bind[i] >= 0 means that the i-...
bool getBasisInverseTimesVecReal(R *rhs, R *sol, bool unscale=true)
computes dense solution of basis matrix B * sol = rhs; returns true on success
void _applyScaledObj(SPxSolverBase< T > &solver, Rational &dualScale, SolRational &sol)
applies scaled objective function
void _syncLPReal(bool time=true)
synchronizes real LP with rational LP, i.e., copies (rounded) rational LP into real LP,...
void _recomputeRangeTypesRational()
recomputes range types from scratch using rational LP
int numIterations() const
number of iterations since last call to solve
const SVectorBase< R > & colVectorRealInternal(int i) const
returns vector of col i, ignoring scaling
bool setDualNorms(int nnormsRow, int nnormsCol, R *norms)
sets steepest edge norms and returns false if that's not possible
bool _factorSolNewBasisPrecBoost
Definition: soplex.h:1808
SPxGeometSC< R > _scalerGeo1
Definition: soplex.h:1751
void addRowsReal(const LPRowSetBase< R > &lprowset)
adds multiple rows
void changeBoundsReal(int i, const R &lower, const R &upper)
changes bounds of column i to lower and upper
bool getPrimalRayReal(R *vector, int dim)
void _solveRealForRationalStable(SolRational &sol, bool &primalFeasible, bool &dualFeasible, bool &infeasible, bool &unbounded, bool &stoppedTime, bool &stoppedIter, bool &error)
solves current problem using double floating-point solver
bool parseSettingsString(char *str)
parses one setting string and returns true on success; note that string is modified
int numNonzerosRational() const
const SVectorRational & rowVectorRational(int i) const
returns vector of row i
SPxLPBase< R > _manualRealLP
Definition: soplex.h:1866
void changeColReal(int i, const LPColReal &lpcol)
replaces column i with lpcol
void changeObjRational(int i, const Rational &obj)
changes objective coefficient of column i to obj
void _changeBoundsReal(int i, const R &lower, const R &upper)
changes bounds of column i to lower and upper and adjusts basis
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...
SPxHarrisRT< BP > _boostedRatiotesterHarris
Definition: soplex.h:1837
void clearLPRational()
clears the LP
void printStatus(std::ostream &os, typename SPxSolverBase< R >::Status status)
prints status
void changeRhsRational(const mpq_t *rhs, int rhsSize)
changes right-hand side vector to rhs (GMP only method)
bool getBasisInverseColReal(int c, R *coef, int *inds=nullptr, int *ninds=nullptr, bool unscale=true)
computes column c of basis inverse; returns true on success
void removeColRational(int i)
removes column i
void getBasis(typename SPxSolverBase< R >::VarStatus rows[], typename SPxSolverBase< R >::VarStatus cols[]) const
gets current basis via arrays of statuses
void _syncRealSolution()
synchronizes rational solution with real solution, i.e., copies (rounded) rational solution to real s...
int numColsRational() const
void addColReal(const LPColBase< R > &lpcol)
adds a single column
void getRowRational(int i, LPRowRational &lprow) const
gets row i
SPxLPBase< R > * _realLP
Definition: soplex.h:1769
void _changeLhsReal(const VectorBase< R > &lhs)
changes left-hand side vector for constraints to lhs and adjusts basis
@ SYNCMODE_MANUAL
user sync of real and rational LP
Definition: soplex.h:1344
@ SYNCMODE_ONLYREAL
store only real LP
Definition: soplex.h:1338
@ SYNCMODE_AUTO
automatic sync of real and rational LP
Definition: soplex.h:1341
bool boolParam(const BoolParam param) const
returns boolean parameter value
const Rational & lowerRational(int i) const
returns lower bound of column i
int dmaxSizeDualRational(const int base=2)
get size of largest denominator in dual solution
SPxParMultPR< R > _pricerParMult
Definition: soplex.h:1760
const char * getPricerName()
name of currently loaded pricer
void addColsRational(const LPColSetRational &lpcolset)
adds multiple columns
VectorRational _feasLhs
Definition: soplex.h:1885
void changeElementReal(int i, int j, const R &val)
changes matrix entry in row i and column j to val
void changeRangeReal(int i, const R &lhs, const R &rhs)
changes left- and right-hand side of row i
void getColRational(int i, LPColRational &lpcol) const
gets column i
void printUserSettings()
print non-default parameter values
bool _loadBasisFromOldBasis(bool boosted)
void _computePrimalScalingFactor(Rational &maxScale, Rational &primalScale, Rational &boundsViolation, Rational &sideViolation, Rational &redCostViolation)
computes primal scaling factor; limit increase in scaling by tolerance used in floating point solve
VectorRational _feasRhs
Definition: soplex.h:1886
VectorRational _feasLower
Definition: soplex.h:1887
void _correctDualSolution(SPxSolverBase< T > &solver, SolRational &sol, const bool &maximizing, VectorBase< T > &dualReal, Rational &dualScale, int &dualSize, const int &maxDimRational)
corrects dual solution and aligns with basis
SPxAutoPR< BP > _boostedPricerAuto
Definition: soplex.h:1829
int numColsReal() const
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,...
void _loadRealLP(bool initBasis)
load original LP and possibly setup a slack basis
const std::shared_ptr< Tolerances > tolerances() const
returns current tolerances
bool hasDual() const
deprecated: use hasSol() instead
Definition: soplex.h:627
bool getDualFarkasReal(R *vector, int dim)
void changeUpperRational(int i, const mpq_t *upper)
changes upper bound of column i to upper (GMP only method)
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)
adds a set of rows (GMP only method)
void _solveRealLPAndRecordStatistics(volatile bool *interrupt=nullptr)
call floating-point solver and update statistics on iterations etc.
void _changeBoundsReal(const VectorBase< R > &lower, const VectorBase< R > &upper)
changes vectors of column bounds to lower and upper and adjusts basis
void _completeRangeTypesRational()
completes range type arrays after adding columns and/or rows
void changeUpperReal(const VectorBase< R > &upper)
changes vector of upper bounds to upper
Rational _rationalNegInfty
Definition: soplex.h:1734
Rational _rationalZero
Definition: soplex.h:1983
void _invalidateSolution()
invalidates solution
void removeRowRangeRational(int start, int end, int perm[]=nullptr)
removes rows start to end including both; an array perm of size numRowsRational() may be passed as bu...
void _optimizeRational(volatile bool *interrupt=nullptr)
temporary fix for Rational
DataArray< RangeType > _colTypes
Definition: soplex.h:1921
bool isDualFeasible() const
is stored dual solution feasible?
DataArray< typename SPxSolverBase< R >::VarStatus > _basisStatusCols
Definition: soplex.h:1934
void _transformFeasibility()
transforms LP to feasibility problem by removing the objective function, shifting variables,...
bool getBasisMetric(R &metric, int type=0)
SPxDantzigPR< R > _pricerDantzig
Definition: soplex.h:1759
Presol< R > _simplifierPaPILO
Definition: soplex.h:1748
SPxGeometSC< BP > _boostedScalerGeo8
Definition: soplex.h:1847
bool getEstimatedCondition(R &condition)
computes an estimated condition number for the current basis matrix using the power method; returns t...
R lowerReal(int i) const
returns lower bound of column i
void removeRowRational(int i)
removes row i
void _optimize(volatile bool *interrupt=nullptr)
solves the templated LP
Rational _rationalPosone
Definition: soplex.h:1981
SPxParMultPR< BP > _boostedPricerParMult
Definition: soplex.h:1831
bool getPrimalRational(VectorRational &vector)
int totalSizeDualRational(const int base=2)
get size of dual solution
int dlcmSizeDualRational(const int base=2)
get size of least common multiple of denominators in dual solution
SPxSteepPR< R > _pricerQuickSteep
Definition: soplex.h:1762
void _project(SolRational &sol)
undoes lifting
bool getRedCostViolation(R &maxviol, R &sumviol)
gets violation of reduced costs; returns true on success
bool _applyPolishing
Definition: soplex.h:1859
SPxSolverBase< R >::Status optimize(volatile bool *interrupt=nullptr)
optimize the given LP
SPxSolverBase< R >::Status solve(volatile bool *interrupt=nullptr)
Definition: soplex.h:606
void addColRational(const LPColRational &lpcol)
adds a single column
DSVectorRational _primalDualDiff
Definition: soplex.h:1894
DataArray< typename SPxSolverBase< R >::VarStatus > _storedBasisStatusCols
Definition: soplex.h:1896
void _computeDualScalingFactor(Rational &maxScale, Rational &primalScale, Rational &dualScale, Rational &redCostViolation, Rational &dualViolation)
computes dual scaling factor; limit increase in scaling by tolerance used in floating point solve
SPxSumST< R > _starterSum
Definition: soplex.h:1756
bool ignoreUnscaledViolations()
sets the status to OPTIMAL in case the LP has been solved with unscaled violations
Definition: soplex.h:642
bool getDualFarkas(VectorBase< R > &vector)
gets the Farkas proof if available; returns true on success
bool getDualFarkasRational(mpq_t *vector, const int size)
gets the Farkas proof if LP is infeasible; returns true on success (GMP only method)
bool readBasisFile(const char *filename, const NameSet *rowNames=nullptr, const NameSet *colNames=nullptr)
reads basis information from filename and returns true on success; if rowNames and colNames are nullp...
SLUFactor< R > _slufactor
Definition: soplex.h:1746
int numCols() const
Templated function that returns number of columns.
void _applyScaledBounds(SPxSolverBase< T > &solver, Rational &primalScale)
applies scaled bounds
bool _lowerFinite(const RangeType &rangeType) const
checks whether RangeType corresponds to finite lower bound
SPxDevexPR< R > _pricerDevex
Definition: soplex.h:1761
void _checkRefinementProgress(Rational &boundsViolation, Rational &sideViolation, Rational &redCostViolation, Rational &dualViolation, Rational &maxViolation, Rational &bestViolation, const Rational &violationImprovementFactor, int &numFailedRefinements)
checks refinement loop progress
void changeObjReal(int i, const R &obj)
changes objective coefficient of column i to obj
bool _isRealLPScaled
Definition: soplex.h:1858
bool readFile(const char *filename, NameSet *rowNames=nullptr, NameSet *colNames=nullptr, DIdxSet *intVars=nullptr)
reads LP file in LP or MPS format according to READMODE parameter; gets row names,...
Rational objRational(int i) const
returns objective value of column i
VectorBase< R > _manualObj
Definition: soplex.h:1865
SLUFactorRational _rationalLUSolver
Definition: soplex.h:1875
void setRandomSeed(unsigned int seed)
set the random seeds of the solver instance
void _computeInfeasBox(SolRational &sol, bool transformed)
void printStatistics(std::ostream &os)
prints complete statistics
void writeStateReal(const char *filename, const NameSet *rowNames=nullptr, const NameSet *colNames=nullptr, const bool cpxFormat=false, const bool writeZeroObjective=false) const
writes internal LP, basis information, and parameter settings; if rowNames and colNames are nullptr,...
void _applyScaledSides(SPxSolverBase< T > &solver, Rational &primalScale)
applies scaled sides
int intParam(const IntParam param) const
returns integer parameter value
bool getRowsActivity(VectorBase< R > &vector)
gets the activities for all rows given the current primal solution; vector must have the same size as...
void changeBoundsRational(const VectorRational &lower, const VectorRational &upper)
changes vectors of column bounds to lower and upper
void _untransformEquality(SolRational &sol)
undoes transformation to equality form
@ SIMPLIFIER_INTERNAL
using internal presolving methods
Definition: soplex.h:1246
@ SIMPLIFIER_PAPILO
using the presolve lib papilo
Definition: soplex.h:1249
@ SIMPLIFIER_AUTO
SoPlex chooses automatically (currently always "internal")
Definition: soplex.h:1252
@ SIMPLIFIER_OFF
disabling presolving
Definition: soplex.h:1243
void removeRowsReal(int idx[], int n, int perm[]=nullptr)
remove all rows with indices in array idx of size n; an array perm of size numRows() may be passed as...
Real _epsPivotPrecisionRatio
Definition: soplex.h:1823
const char * getRatiotesterName()
name of currently loaded ratiotester
Rational objValueRational()
returns the objective value if a primal solution is available
void _solveRealForRationalBoosted(VectorBase< BP > &primal, VectorBase< BP > &dual, DataArray< typename SPxSolverBase< R >::VarStatus > &basisStatusRows, DataArray< typename SPxSolverBase< R >::VarStatus > &basisStatusCols, typename SPxSolverBase< BP >::Status &boostedResult, bool initialSolve)
solves real LP during iterative refinement
bool getRowsActivityRational(const std::vector< int > &indices, VectorRational &vector)
Real realParam(const RealParam param) const
returns real parameter value
int totalSizePrimalRational(const int base=2)
get size of primal solution
bool getBoundViolation(R &maxviol, R &sumviol)
gets violation of bounds; returns true on success
bool getBoundViolationRational(Rational &maxviol, Rational &sumviol)
void changeRangeRational(int i, const mpq_t *lhs, const mpq_t *rhs)
changes left- and right-hand side of row i (GMP only method)
void changeObjRational(int i, const mpq_t *obj)
changes objective coefficient of column i to obj (GMP only method)
bool _upperFinite(const RangeType &rangeType) const
checks whether RangeType corresponds to finite upper bound
bool saveSettingsFile(const char *filename, const bool onlyChanged=false, int solvemode=1) const
writes settings file; returns true on success
SPxEquiliSC< BP > _boostedScalerBiequi
Definition: soplex.h:1845
void changeRhsRational(int i, const Rational &rhs)
changes right-hand side of row i to rhs
SPxVectorST< R > _starterVector
Definition: soplex.h:1757
void _convertDataArrayVarStatusToBoosted(DataArray< typename SPxSolverBase< R >::VarStatus > &base, DataArray< typename SPxSolverBase< BP >::VarStatus > &copy)
SPxBoundFlippingRT< BP > _boostedRatiotesterBoundFlipping
Definition: soplex.h:1839
void removeRowsRational(int idx[], int n, int perm[]=nullptr)
remove all rows with indices in array idx of size n; an array perm of size numRowsRational() may be p...
void _performOptIRStable(SolRational &sol, bool acceptUnbounded, bool acceptInfeasible, int minIRRoundsRemaining, bool &primalFeasible, bool &dualFeasible, bool &infeasible, bool &unbounded, bool &stoppedTime, bool &stoppedIter, bool &error)
solves current problem with iterative refinement and recovery mechanism
void _forceNonbasicToBound(SolRational &sol, int &c, const int &maxDimRational, bool toLower)
forces value of given nonbasic variable to bound
void _changeRangeReal(const VectorBase< R > &lhs, const VectorBase< R > &rhs)
changes left- and right-hand side vectors and adjusts basis
void _transformUnbounded()
transforms LP to unboundedness problem by moving the objective function to the constraints,...
void setBasis(const typename SPxSolverBase< R >::VarStatus rows[], const typename SPxSolverBase< R >::VarStatus cols[])
sets starting basis via arrays of statuses
std::shared_ptr< Tolerances > _tolerances
Definition: soplex.h:1731
void _changeLowerReal(const VectorBase< R > &lower)
changes vector of lower bounds to lower and adjusts basis
void _changeUpperReal(const VectorBase< R > &upper)
changes vector of upper bounds to upper and adjusts basis
void removeColReal(int i)
removes column i
int dlcmSizePrimalRational(const int base=2)
get size of least common multiple of denominators in primal solution
void _computeBasisInverseRational()
computes rational inverse of basis matrix as defined by _rationalLUSolverBind
void _computeSidesViolation(SolRational &sol, Rational &sideViolation)
computes violation of sides during the refinement loop
R objReal(int i) const
returns objective value of column i
VectorRational _unboundedRhs
Definition: soplex.h:1882
@ SCALER_GEOEQUI
geometric mean scaling (max 8 rounds) followed by equilibrium scaling (rows and columns)
Definition: soplex.h:1277
@ SCALER_UNIEQUI
equilibrium scaling on rows or columns
Definition: soplex.h:1262
@ SCALER_BIEQUI
equilibrium scaling on rows and columns
Definition: soplex.h:1265
@ SCALER_LEASTSQ
least square scaling
Definition: soplex.h:1274
@ SCALER_GEO1
geometric mean scaling on rows and columns, max 1 round
Definition: soplex.h:1268
@ SCALER_OFF
no scaler
Definition: soplex.h:1259
@ SCALER_GEO8
geometric mean scaling on rows and columns, max 8 rounds
Definition: soplex.h:1271
SolBase< R > _solReal
Definition: soplex.h:1965
SLUFactor< BP > _boostedSlufactor
Definition: soplex.h:1827
DataArray< typename SPxSolverBase< R >::VarStatus > _oldFeasBasisStatusRows
Definition: soplex.h:1946
bool _isRealLPLoaded
Definition: soplex.h:1856
void _performUnboundedIRStable(SolRational &sol, bool &hasUnboundedRay, bool &stoppedTime, bool &stoppedIter, bool &error)
performs iterative refinement on the auxiliary problem for testing unboundedness
bool getPrimal(VectorBase< R > &vector)
gets the primal solution vector if available; returns true on success
bool _readFileReal(const char *filename, NameSet *rowNames=nullptr, NameSet *colNames=nullptr, DIdxSet *intVars=nullptr)
reads real LP in LP or MPS format from file and returns true on success; gets row names,...
Settings * _currentSettings
Definition: soplex.h:1729
void _switchToBoosted()
disable initial precision solver and switch to boosted solver
Presol< BP > _boostedSimplifierPaPILO
Definition: soplex.h:1852
unsigned int randomSeed() const
returns the current random seed of the solver instance
SPxAutoPR< R > _pricerAuto
Definition: soplex.h:1758
bool getExactCondition(R &condition)
computes the exact condition number for the current basis matrix using the power method; returns true...
void writeStateRational(const char *filename, const NameSet *rowNames=nullptr, const NameSet *colNames=nullptr, const bool cpxFormat=false, const bool writeZeroObjective=false) const
writes internal LP, basis information, and parameter settings; if rowNames and colNames are nullptr,...
Real _tolPrecisionRatio
ratios for computing the tolerances for precision boosting ratio denotes the proportion of precision ...
Definition: soplex.h:1819
int numRowsReal() const
void _changeUpperReal(int i, const R &upper)
changes i 'th upper bound to upper and adjusts basis
void changeLowerRational(const VectorRational &lower)
changes vector of lower bounds to lower
void _solveBoostedRealLPAndRecordStatistics(volatile bool *interrupt=nullptr)
call floating-point solver and update statistics on iterations etc.
void changeRowReal(int i, const LPRowBase< R > &lprow)
replaces row i with lprow
void _recomputeRangeTypesReal()
recomputes range types from scratch using real LP
int numIterationsBoosted() const
number of iterations in higher precision since last call to solve
SPxSteepExPR< R > _pricerSteep
Definition: soplex.h:1763
bool getBasisInverseColRational(const int c, SSVectorRational &vec)
computes column c of basis inverse; performs rational factorization if not available; returns true on...
Rational _rationalOpttol
Definition: soplex.h:1736
void _checkScaling(SPxLPBase< R > *origLP) const
check scaling of LP
void _solveRealForRationalBoostedStable(SolRational &sol, bool &primalFeasible, bool &dualFeasible, bool &infeasible, bool &unbounded, bool &stoppedTime, bool &stoppedIter, bool &error, bool &needNewBoostedIt)
solves current problem using multiprecision floating-point solver return false if a new boosted itera...
void removeRowReal(int i)
removes row i
DataArray< RangeType > _rowTypes
Definition: soplex.h:1922
SPxDefaultRT< R > _ratiotesterTextbook
Definition: soplex.h:1764
void _storeLastStableBasisBoosted(bool vanished)
SPxSolverBase< R >::VarStatus basisRowStatus(int row) const
returns basis status for a single row
void _restoreLPReal()
restores objective, bounds, and sides of real LP
SPxMainSM< BP > _boostedSimplifierMainSM
Definition: soplex.h:1851
bool setBoolParam(const BoolParam param, const bool value, const bool init=true)
sets boolean parameter value; returns true on success
void changeLowerReal(const VectorBase< R > &lower)
changes vector of lower bounds to lower
void printSolutionStatistics(std::ostream &os)
prints solution statistics
void changeUpperReal(int i, const R &upper)
changes i 'th upper bound to upper
bool getRowsActivity(const std::vector< int > &indices, VectorBase< R > &vector)
gets the activities for the rows in indices given the current primal solution; all other elements of ...
const Rational & maxObjRational(int i) const
returns objective value of column i after transformation to a maximization problem; since this is how...
void printShortStatistics(std::ostream &os)
prints short statistics
const Rational & lhsRational(int i) const
returns left-hand side of row i
int dmaxSizePrimalRational(const int base=2)
get size of largest denominator in primal solution
VectorRational _modLower
Definition: soplex.h:1889
void changeUpperRational(int i, const Rational &upper)
changes i 'th upper bound to upper
bool getRedCost(VectorBase< R > &vector)
gets the vector of reduced cost values if available; returns true on success
SPxBoundFlippingRT< R > _ratiotesterBoundFlipping
Definition: soplex.h:1767
bool getRedCostReal(R *vector, int dim)
void _syncLPRational(bool time=true)
synchronizes rational LP with real LP, i.e., copies real LP to rational LP, without looking at the sy...
bool _isBoostedStartingFromSlack(bool initialSolve=true)
return true if slack basis has to be loaded for boosted solver
bool _parseSettingsLine(char *line, const int lineNumber)
parses one line in a settings file and returns true on success; note that the string is modified
void removeColRangeReal(int start, int end, int perm[]=nullptr)
removes columns start to end including both; an array perm of size numColsReal() may be passed as buf...
const char * getSimplifierName()
name of simplifier
const SVectorRational & colVectorRational(int i) const
returns vector of column i
void factorizeColumnRational(SolRational &sol, DataArray< typename SPxSolverBase< R >::VarStatus > &basisStatusRows, DataArray< typename SPxSolverBase< R >::VarStatus > &basisStatusCols, bool &stoppedTime, bool &stoppedIter, bool &error, bool &optimal)
factorizes rational basis matrix in column representation
void _syncRationalSolution()
synchronizes real solution with rational solution, i.e., copies real solution to rational solution
void _storeLastStableBasis(bool vanished)
void _changeLhsReal(int i, const R &lhs)
changes left-hand side of row i to lhs and adjusts basis
SPxSteepExPR< BP > _boostedPricerSteep
Definition: soplex.h:1834
VectorRational _unboundedUpper
Definition: soplex.h:1880
SPxSolverBase< R >::Status _status
Definition: soplex.h:1930
void changeElementRational(int i, int j, const mpq_t *val)
changes matrix entry in row i and column j to val (GMP only method)
bool getRowActivityRational(int i, Rational &value)
void _removeRowRangeReal(int start, int end, int perm[])
removes rows start to end including both; an array perm of size numRows() may be passed as buffer mem...
void changeBoundsRational(int i, const Rational &lower, const Rational &upper)
changes bounds of column i to lower and upper
RangeType _switchRangeType(const RangeType &rangeType) const
switches RANGETYPE_LOWER to RANGETYPE_UPPER and vice versa
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
bool _evaluateResult(SPxSolverBase< T > &solver, typename SPxSolverBase< T >::Status result, bool usingRefinedLP, SolRational &sol, VectorBase< T > &dualReal, bool &infeasible, bool &unbounded, bool &stoppedTime, bool &stoppedIter, bool &error)
evaluates result of solve. Return true if the algorithm must to stopped, false otherwise.
@ ALGORITHM_PRIMAL
primal simplex algorithm, i.e., entering for column and leaving for row representation
Definition: soplex.h:1201
@ ALGORITHM_DUAL
dual simplex algorithm, i.e., leaving for column and entering for row representation
Definition: soplex.h:1204
void syncLPReal()
synchronizes real LP with rational LP, i.e., copies (rounded) rational LP into real LP,...
void _transformEquality()
introduces slack variables to transform inequality constraints into equations for both rational and r...
void clearBasis()
clears starting basis
SPxScaler< BP > * _boostedScaler
Definition: soplex.h:1841
DataArray< int > _rationalLUSolverBind
Definition: soplex.h:1876
Real _epsZeroPrecisionRatio
Definition: soplex.h:1820
SPxGeometSC< R > _scalerGeo8
Definition: soplex.h:1752
void _ratrecAndOrRatfac(int &minIRRoundsRemaining, int &lastStallIterations, int &numberOfIterations, bool &factorSolNewBasis, int &nextRatrec, const Rational &errorCorrectionFactor, Rational &errorCorrection, Rational &maxViolation, SolRational &sol, bool &primalFeasible, bool &dualFeasible, bool &stoppedTime, bool &stoppedIter, bool &error, bool &breakAfter, bool &continueAfter)
performs rational reconstruction and/or factorizationd
std::string statisticString() const
statistical information in form of a string
void _ensureRationalLP()
ensures that the rational LP is available; performs no sync
DataArray< typename SPxSolverBase< R >::VarStatus > _oldBasisStatusRows
Definition: soplex.h:1942
VectorRational _modRhs
Definition: soplex.h:1892
VectorBase< R > _manualLhs
Definition: soplex.h:1863
void changeBoundsReal(const VectorBase< R > &lower, const VectorBase< R > &upper)
changes vectors of column bounds to lower and upper
void changeBoundsRational(int i, const mpq_t *lower, const mpq_t *upper)
changes bounds of column i to lower and upper (GMP only method)
void getNdualNorms(int &nnormsRow, int &nnormsCol) const
gets number of available dual norms
Rational _rationalNegone
Definition: soplex.h:1982
SPxSolverBase< BP > _boostedSolver
Definition: soplex.h:1791
void changeLhsRational(const VectorRational &lhs)
changes left-hand side vector for constraints to lhs
bool _isConsistent() const
checks consistency
void changeRowRational(int i, const LPRowRational &lprow)
replaces row i with lprow
void _addRowReal(const LPRowBase< R > &lprow)
adds a single row to the real LP and adjusts basis
void getUpperReal(VectorBase< R > &upper) const
gets upper bound vector
VectorBase< R > _manualLower
Definition: soplex.h:1861
SoPlexBase< R > & operator=(const SoPlexBase< R > &rhs)
assignment operator
const VectorRational & maxObjRational() const
returns objective function vector after transformation to a maximization problem; since this is how i...
bool getColActivityRational(const int i, Rational &value)
bool hasPrimalRay() const
is a primal unbounded ray available?
bool getDual(VectorBase< R > &vector)
gets the dual solution vector if available; returns true on success
SPxSimplifier< BP > * _boostedSimplifier
Definition: soplex.h:1842
void resetSettings(const bool quiet=false, const bool init=true)
resets default parameter settings
bool hasPrimal() const
deprecated: use hasSol() instead
Definition: soplex.h:621
bool getColsActivity(const std::vector< int > &indices, VectorBase< R > &vector)
gets the activities for the columns in indices given the current dual solution; all other elements of...
void changeObjReal(const VectorBase< R > &obj)
changes objective function vector to obj
bool writeFile(const char *filename, const NameSet *rowNames=nullptr, const NameSet *colNames=nullptr, const DIdxSet *intvars=nullptr, const bool unscale=true, const bool writeZeroObjective=false) const
Templated write function Real writes real LP to file; LP or MPS format is chosen from the extension i...
bool getColsActivityReal(R *p_vector, const int dim)
Rational maxAbsNonzeroRational() const
returns biggest non-zero element in absolute value
@ POLISHING_FRACTIONALITY
minimize number of basic slack variables, i.e. more variables between bounds
Definition: soplex.h:1419
@ POLISHING_OFF
no solution polishing
Definition: soplex.h:1413
@ POLISHING_INTEGRALITY
maximize number of basic slack variables, i.e. more variables on bounds
Definition: soplex.h:1416
bool getRowActivity(int i, R &value)
gets the activity for the i 'th row given the current primal solution
void _correctPrimalSolution(SolRational &sol, Rational &primalScale, int &primalSize, const int &maxDimRational, VectorBase< T > &primalReal)
corrects primal solution and aligns with basis
Array< UnitVectorRational * > _unitMatrixRational
Definition: soplex.h:1897
void _switchToStandardMode()
indicate if we are testing feasibility, unboundedness or neither
void _preprocessAndSolveReal(bool applyPreprocessing, volatile bool *interrupt=nullptr)
solves real LP with/without preprocessing
@ RATIOTESTER_TEXTBOOK
textbook ratio test without stabilization
Definition: soplex.h:1322
@ RATIOTESTER_FAST
modified Harris ratio test
Definition: soplex.h:1328
@ RATIOTESTER_HARRIS
standard Harris ratio test
Definition: soplex.h:1325
@ RATIOTESTER_BOUNDFLIPPING
bound flipping ratio test for long steps in the dual simplex
Definition: soplex.h:1331
VectorBase< R > _manualUpper
Definition: soplex.h:1862
R maxObjReal(int i) const
returns objective value of column i after transformation to a maximization problem; since this is how...
void _unscaleSolutionReal(SPxLPBase< R > &LP, bool persistent=true)
unscales stored solution to remove internal or external scaling of LP
bool _reapplyPersistentScaling() const
check whether persistent scaling is supposed to be reapplied again after unscaling
void removeRowsReal(int perm[])
removes all rows with an index i such that perm[i] < 0; upon completion, perm[i] >= 0 indicates the n...
bool _inStandardMode()
check if we are testing feasibility, unboundedness or neither
int numNonzeros() const
returns number of nonzeros
void _changeRhsReal(const VectorBase< R > &rhs)
changes right-hand side vector to rhs and adjusts basis
bool _readFileRational(const char *filename, NameSet *rowNames=nullptr, NameSet *colNames=nullptr, DIdxSet *intVars=nullptr)
reads rational LP in LP or MPS format from file and returns true on success; gets row names,...
SoPlexBase(const SoPlexBase< R > &rhs)
copy constructor
const VectorBase< R > & rhsRealInternal() const
returns right-hand side vector, ignoring scaling
void changeLowerRational(int i, const mpq_t *lower)
changes lower bound of column i to lower (GMP only method)
void _removeRowsReal(int perm[])
removes all rows with an index i such that perm[i] < 0; upon completion, perm[i] >= 0 indicates the n...
void _addRowReal(R lhs, const SVectorBase< R > &lprow, R rhs)
adds a single row to the real LP and adjusts basis
bool getBasisInverseRowRational(const int r, SSVectorRational &vec)
computes row r of basis inverse; performs rational factorization if not available; returns true on su...
SPxLeastSqSC< R > _scalerLeastsq
Definition: soplex.h:1754
bool getColsActivityRational(const std::vector< int > &indices, VectorRational &vector)
bool getPrimalRayRational(mpq_t *vector, const int size)
gets the primal ray if LP is unbounded; returns true on success (GMP only method)
bool getPrimalRayRational(VectorRational &vector)
void _storeBasisAsOldBasisBoosted(DataArray< typename SPxSolverBase< BP >::VarStatus > &rows, DataArray< typename SPxSolverBase< BP >::VarStatus > &cols)
SPxGeometSC< BP > _boostedScalerGeo1
Definition: soplex.h:1846
void printVersion() const
prints version and compilation options
Statistics * _statistics
statistics since last call to solveReal() or solveRational()
Definition: soplex.h:1718
SPxSolverBase< R > _solver
Definition: soplex.h:1745
bool _boostPrecision()
increase the multiprecision, return false if maximum precision is reached, true otherwise
SPxDevexPR< BP > _boostedPricerDevex
Definition: soplex.h:1832
void syncLPRational()
synchronizes rational LP with real LP, i.e., copies real LP to rational LP, if sync mode is manual
bool writeFileReal(const char *filename, const NameSet *rowNames=nullptr, const NameSet *colNames=nullptr, const DIdxSet *intvars=nullptr, const bool unscale=true, const bool writeZeroObjective=false) const
bool writeFileRational(const char *filename, const NameSet *rowNames=nullptr, const NameSet *colNames=nullptr, const DIdxSet *intvars=nullptr, const bool writeZeroObjective=false) const
void clearLPReal()
clears the LP
@ HYPER_PRICING_OFF
never
Definition: soplex.h:1400
@ HYPER_PRICING_ON
always
Definition: soplex.h:1406
@ HYPER_PRICING_AUTO
decide according to problem size
Definition: soplex.h:1403
bool _hasOldUnbdBasis
Definition: soplex.h:1939
void getColVectorReal(int i, DSVectorBase< R > &col) const
gets vector of col i
bool hasDualFarkas() const
is Farkas proof of infeasibility available?
SPxLPRational * _rationalLP
Definition: soplex.h:1874
void _changeRangeReal(int i, const R &lhs, const R &rhs)
changes left- and right-hand side of row i and adjusts basis
VectorRational _feasUpper
Definition: soplex.h:1888
void getColsRational(int start, int end, LPColSetRational &lpcolset) const
gets columns start, ..., end
@ READMODE_REAL
standard floating-point parsing
Definition: soplex.h:1351
@ READMODE_RATIONAL
rational parsing
Definition: soplex.h:1354
@ FACTOR_UPDATE_TYPE_ETA
product form update
Definition: soplex.h:1211
@ FACTOR_UPDATE_TYPE_FT
Forrest-Tomlin type update.
Definition: soplex.h:1214
bool setSettings(const Settings &newSettings, const bool init=true)
sets parameter settings; returns true on success
bool getRedCostRational(mpq_t *vector, const int size)
gets the vector of reduced cost values if available; returns true on success (GMP only method)
@ PRICER_DEVEX
devex pricer
Definition: soplex.h:1309
@ PRICER_STEEP
steepest edge pricer with exact initialization of norms
Definition: soplex.h:1315
@ PRICER_QUICKSTEEP
steepest edge pricer with initialization to unit norms
Definition: soplex.h:1312
@ PRICER_PARMULT
partial multiple pricer based on Dantzig pricing
Definition: soplex.h:1306
@ PRICER_AUTO
automatic pricer
Definition: soplex.h:1300
@ PRICER_DANTZIG
Dantzig pricer.
Definition: soplex.h:1303
void _addColsReal(const LPColSetReal &lpcolset)
adds multiple columns to the real LP and adjusts basis
Real _epsUpdatePrecisionRatio
Definition: soplex.h:1822
Real _epsFactorPrecisionRatio
Definition: soplex.h:1821
void _changeRhsReal(int i, const R &rhs)
changes right-hand side of row i to rhs and adjusts basis
SPxSimplifier< R > * _simplifier
Definition: soplex.h:1770
void getRowVectorReal(int i, DSVectorBase< R > &row) const
gets vector of row i
void _storeBasisAsOldBasis(DataArray< typename SPxSolverBase< R >::VarStatus > &rows, DataArray< typename SPxSolverBase< R >::VarStatus > &cols)
void changeLhsReal(int i, const R &lhs)
changes left-hand side of row i to lhs
DataArray< typename SPxSolverBase< R >::VarStatus > _oldUnbdBasisStatusCols
Definition: soplex.h:1951
void removeRowsRational(int perm[])
removes all rows with an index i such that perm[i] < 0; upon completion, perm[i] >= 0 indicates the n...
const Settings & settings() const
returns current parameter settings
@ SOLVEMODE_RATIONAL
force iterative refinement
Definition: soplex.h:1367
@ SOLVEMODE_REAL
apply standard floating-point algorithm
Definition: soplex.h:1361
@ SOLVEMODE_AUTO
decide depending on tolerances whether to apply iterative refinement
Definition: soplex.h:1364
LPRowBase< R >::Type rowTypeReal(int i) const
returns inequality type of row i
SPxFastRT< R > _ratiotesterFast
Definition: soplex.h:1766
SPxDefaultRT< BP > _boostedRatiotesterTextbook
Definition: soplex.h:1836
SPxFastRT< BP > _boostedRatiotesterFast
Definition: soplex.h:1838
void _resetBoostedPrecision()
reset the boosted precision to the default value
bool getColsActivityRational(VectorRational &vector)
Rational _rationalFeastol
Definition: soplex.h:1735
const VectorRational & lhsRational() const
returns left-hand side vector
void changeObjRational(const VectorRational &obj)
changes objective function vector to obj
void getLhsReal(VectorBase< R > &lhs) const
gets left-hand side vector
SPxSolverBase< R >::Status status() const
returns the current solver status
int _lastStallPrecBoosts
Definition: soplex.h:1807
bool getDualFarkasRational(VectorRational &vector)
R maxAbsNonzeroReal() const
returns biggest non-zero element in absolute value
SPxBasisBase< R >::SPxStatus basisStatus() const
returns the current basis status
bool isPrimalFeasible() const
is stored primal solution feasible?
void getLowerReal(VectorBase< R > &lower) const
gets lower bound vector
bool getColsActivity(VectorBase< R > &vector)
gets the activities for all columns given the current dual solution; vector must have the same size a...
void _performFeasIRStable(SolRational &sol, bool &withDualFarkas, bool &stoppedTime, bool &stoppedIter, bool &error)
performs iterative refinement on the auxiliary problem for testing feasibility
SPxStarter< R > * _starter
Definition: soplex.h:1772
void _restoreBasis()
restore basis
SPxSteepPR< BP > _boostedPricerQuickSteep
Definition: soplex.h:1833
RangeType _rangeTypeReal(const R &lower, const R &upper) const
determines RangeType from real bounds
bool getPrimalReal(R *p_vector, int size)
bool writeDualFileReal(const char *filename, const NameSet *rowNames=nullptr, const NameSet *colNames=nullptr, const DIdxSet *intvars=nullptr, const bool writeZeroObjective=false) const
writes the dual of the real LP to file; LP or MPS format is chosen from the extension in filename; if...
bool getDualRational(VectorRational &vector)
bool hasBasis() const
is an advanced starting basis available?
SPxScaler< R > * _scaler
Definition: soplex.h:1771
void _untransformUnbounded(SolRational &sol, bool unbounded)
undoes transformation to unboundedness problem
bool _boostingLimitReached
Definition: soplex.h:1796
void _verifySolutionReal()
verify computed solution and resolve if necessary
void removeColsReal(int perm[])
removes all columns with an index i such that perm[i] < 0; upon completion, perm[i] >= 0 indicates th...
DataArray< typename SPxSolverBase< R >::VarStatus > _oldFeasBasisStatusCols
Definition: soplex.h:1947
Real precisionBoostTime() const
time spen in higher precision since last call to solve
virtual ~SoPlexBase()
destructor
SPxSolverBase< R >::Status _solveRealStable(bool acceptUnbounded, bool acceptInfeasible, VectorBase< R > &primal, VectorBase< R > &dual, DataArray< typename SPxSolverBase< R >::VarStatus > &basisStatusRows, DataArray< typename SPxSolverBase< R >::VarStatus > &basisStatusCols, const bool forceNoSimplifier=false)
solves real LP with recovery mechanism
void changeLowerReal(int i, const R &lower)
changes lower bound of column i to lower
void _evaluateSolutionReal(typename SPxSimplifier< R >::Result simplificationStatus)
checks result of the solving process and solves again without preprocessing if necessary
void removeColRangeRational(int start, int end, int perm[]=nullptr)
removes columns start to end including both; an array perm of size numColsRational() may be passed as...
R upperReal(int i) const
returns upper bound of column i
bool setRealParam(const RealParam param, const Real value, const bool init=true)
sets real parameter value; returns true on success
const VectorRational & lowerRational() const
returns lower bound vector
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 _changeElementReal(int i, int j, const R &val)
changes matrix entry in row i and column j to val and adjusts basis
void addRowReal(const LPRowBase< R > &lprow)
adds a single row
void _removeColsReal(int perm[])
removes all columns with an index i such that perm[i] < 0; upon completion, perm[i] >= 0 indicates th...
bool writeBasisFile(const char *filename, const NameSet *rowNames=nullptr, const NameSet *colNames=nullptr, const bool cpxFormat=false) const
writes basis information to filename; if rowNames and colNames are nullptr, default names are used; r...
SPxSolverBase< R >::VarStatus basisColStatus(int col) const
returns basis status for a single column
Rational minAbsNonzeroRational() const
returns smallest non-zero element in absolute value
bool setIntParam(const IntParam param, const int value, const bool init=true)
sets integer parameter value; returns true on success
bool getDualReal(R *p_vector, int dim)
void getRowsRational(int start, int end, LPRowSetRational &lprowset) const
gets rows start, ..., end.
SPxMainSM< R > _simplifierMainSM
Definition: soplex.h:1747
bool _hasSolRational
Definition: soplex.h:1971
bool getRowsActivityReal(const std::vector< int > &indices, R *p_vector, int dim)
bool getDualViolationRational(Rational &maxviol, Rational &sumviol)
@ VERBOSITY_HIGH
high verbosity level
Definition: soplex.h:1233
@ VERBOSITY_WARNING
only error and warning output
Definition: soplex.h:1224
@ VERBOSITY_DEBUG
only error, warning, and debug output
Definition: soplex.h:1227
@ VERBOSITY_NORMAL
standard verbosity level
Definition: soplex.h:1230
@ VERBOSITY_ERROR
only error output
Definition: soplex.h:1221
@ VERBOSITY_FULL
full verbosity level
Definition: soplex.h:1236
void _addRowsReal(const LPRowSetBase< R > &lprowset)
adds multiple rows to the real LP and adjusts basis
int numPrecisionBoosts() const
number of precision boosts since last call to solve
DataArray< typename SPxSolverBase< R >::VarStatus > _oldUnbdBasisStatusRows
Definition: soplex.h:1950
void addColsReal(const LPColSetBase< R > &lpcolset)
adds multiple columns
void changeRhsReal(const VectorBase< R > &rhs)
changes right-hand side vector to rhs
const VectorRational & rhsRational() const
returns right-hand side vector
void changeRangeReal(const VectorBase< R > &lhs, const VectorBase< R > &rhs)
changes left- and right-hand side vectors
void addRowRational(const mpq_t *lhs, const mpq_t *rowValues, const int *rowIndices, const int rowSize, const mpq_t *rhs)
adds a single row (GMP only method)
bool computeBasisInverseRational()
compute rational basis inverse; returns true on success
@ REPRESENTATION_AUTO
automatic choice according to number of rows and columns
Definition: soplex.h:1188
@ REPRESENTATION_COLUMN
column representation Ax - s = 0, lower <= x <= upper, lhs <= s <= rhs
Definition: soplex.h:1191
@ REPRESENTATION_ROW
row representation (lower,lhs) <= (x,Ax) <= (upper,rhs)
Definition: soplex.h:1194
bool loadSettingsFile(const char *filename)
reads settings file; returns true on success
void _storeSolutionRealFromPresol()
stores solution from the simplifier because problem vanished in presolving step
const char * getScalerName()
name of scaling method
SPxGeometSC< R > _scalerGeoequi
Definition: soplex.h:1753
void addColRational(const mpq_t *obj, const mpq_t *lower, const mpq_t *colValues, const int *colIndices, const int colSize, const mpq_t *upper)
adds a single column (GMP only method)
bool multBasis(R *vec, bool unscale=true)
multiply with basis matrix; B * vec (inplace)
VectorRational _modLhs
Definition: soplex.h:1891
bool _reconstructSolutionRational(SolRational &sol, DataArray< typename SPxSolverBase< R >::VarStatus > &basisStatusRows, DataArray< typename SPxSolverBase< R >::VarStatus > &basisStatusCols, const Rational &denomBoundSquared)
attempts rational reconstruction of primal-dual solution
void _changeLowerReal(int i, const R &lower)
changes lower bound of column i to lower and adjusts basis
void changeRangeRational(const VectorRational &lhs, const VectorRational &rhs)
changes left- and right-hand side vectors
void removeColsReal(int idx[], int n, int perm[]=nullptr)
remove all columns with indices in array idx of size n; an array perm of size numColsReal() may be pa...
void _addColReal(R obj, R lower, const SVectorBase< R > &lpcol, R upper)
adds a single column to the real LP and adjusts basis
void changeLhsRational(int i, const Rational &lhs)
changes left-hand side of row i to lhs
void _performOptIRWrapper(SolRational &sol, bool acceptUnbounded, bool acceptInfeasible, int minIRRoundsRemaining, bool &primalFeasible, bool &dualFeasible, bool &infeasible, bool &unbounded, bool &stoppedTime, bool &stoppedIter, bool &error)
perform iterative refinement using the right precision
Rational _rationalMaxscaleincr
Definition: soplex.h:1737
DataArray< typename SPxSolverBase< R >::VarStatus > _oldBasisStatusCols
Definition: soplex.h:1943
void setIntegralityInformation(int ncols, int *intInfo)
pass integrality information about the variables to the solver
void _computeReducedCostViolation(SolRational &sol, Rational &redCostViolation, const bool &maximizing)
computes violation of reduced costs during the refinement loop
R lhsReal(int i) const
returns left-hand side of row i
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)
adds a set of columns (GMP only method)
bool getPrimalRational(mpq_t *vector, const int size)
gets the primal solution vector if available; returns true on success (GMP only method)
void _computeBoundsViolation(SolRational &sol, Rational &boundsViolation)
computes violation of bounds during the refinement loop
void _disableSimplifierAndScaler()
disables simplifier and scaler
R minAbsNonzeroReal() const
returns smallest non-zero element in absolute value
void getObjRational(VectorRational &obj) const
gets objective function vector
SPxGeometSC< BP > _boostedScalerGeoequi
Definition: soplex.h:1848
bool getPrimalRay(VectorBase< R > &vector)
gets the primal ray if available; returns true on success
void removeRowRangeReal(int start, int end, int perm[]=nullptr)
removes rows start to end including both; an array perm of size numRows() may be passed as buffer mem...
SPxHarrisRT< R > _ratiotesterHarris
Definition: soplex.h:1765
const Rational & rhsRational(int i) const
returns right-hand side of row i
const UnitVectorRational * _unitVectorRational(const int i)
returns pointer to a constant unit vector available until destruction of the SoPlexBase class
void _changeRowReal(int i, const LPRowBase< R > &lprow)
replaces row i with lprow and adjusts basis
bool getRedCostRational(VectorRational &vector)
bool getRowsActivityRational(VectorRational &vector)
void _setupBoostedSolver()
setup boosted solver before launching iteration
R rhsReal(int i) const
returns right-hand side of row i
bool _isRefinementOver(bool &primalFeasible, bool &dualFeasible, Rational &boundsViolation, Rational &sideViolation, Rational &redCostViolation, Rational &dualViolation, int minIRRoundsRemaining, bool &stoppedTime, bool &stoppedIter, int numFailedRefinements)
checks termination criteria for refinement loop
const VectorBase< R > & upperRealInternal() const
returns upper bound vector
bool getRedCostViolationRational(Rational &maxviol, Rational &sumviol)
bool hasSol() const
is a solution available (not neccessarily feasible)?
SPxEquiliSC< BP > _boostedScalerUniequi
Definition: soplex.h:1844
LPColSetRational _slackCols
Definition: soplex.h:1878
void changeRhsReal(int i, const R &rhs)
changes right-hand side of row i to rhs
void _idxToPerm(int *idx, int idxSize, int *perm, int permSize) const
creates a permutation for removing rows/columns from an array of indices
void changeRangeRational(int i, const Rational &lhs, const Rational &rhs)
changes left- and right-hand side of row i
void _lift()
reduces matrix coefficient in absolute value by the lifting procedure of Thiele et al....
void removeColsRational(int perm[])
removes all columns with an index i such that perm[i] < 0; upon completion, perm[i] >= 0 indicates th...
const VectorRational & upperRational() const
returns upper bound vector
BoolParam
boolean parameters
Definition: soplex.h:999
@ TESTDUALINF
should dual infeasibility be tested in order to try to return a dual solution even if primal infeasib...
Definition: soplex.h:1007
@ FORCEBASIC
try to enforce that the optimal solution is a basic solution
Definition: soplex.h:1037
@ ENSURERAY
re-optimize the original problem to get a proof (ray) of infeasibility/unboundedness?
Definition: soplex.h:1034
@ SIMPLIFIER_FIXCONTINUOUS
Definition: soplex.h:1058
@ PRECISION_BOOSTING
enable precision boosting ?
Definition: soplex.h:1070
@ SIMPLIFIER_PARALLELCOLDETECTION
Definition: soplex.h:1049
@ ACCEPTCYCLING
should cycling solutions be accepted during iterative refinement?
Definition: soplex.h:1013
@ SIMPLIFIER_SINGLETONCOLS
Definition: soplex.h:1040
@ RATREC
apply rational reconstruction after each iterative refinement?
Definition: soplex.h:1016
@ RATFAC
should a rational factorization be performed after iterative refinement?
Definition: soplex.h:1010
@ ADAPT_TOLS_TO_MULTIPRECISION
adapt tolerances to the multiprecision used
Definition: soplex.h:1067
@ LIFTING
should lifting be used to reduce range of nonzero matrix coefficients?
Definition: soplex.h:1001
@ SIMPLIFIER_CONSTRAINTPROPAGATION
Definition: soplex.h:1043
@ EQTRANS
should LP be transformed to equality form before a rational solve?
Definition: soplex.h:1004
@ FULLPERTURBATION
perturb the entire problem or only the relevant bounds of s single pivot?
Definition: soplex.h:1031
@ BOOSTED_WARM_START
boosted solver start from last basis
Definition: soplex.h:1073
@ SIMPLIFIER_SINGLETONSTUFFING
Definition: soplex.h:1052
@ POWERSCALING
round scaling factors for iterative refinement to powers of two?
Definition: soplex.h:1019
@ BOOLPARAM_COUNT
number of boolean parameters
Definition: soplex.h:1079
@ SIMPLIFIER_PARALLELROWDETECTION
Definition: soplex.h:1046
@ PERSISTENTSCALING
use persistent scaling?
Definition: soplex.h:1028
@ SIMPLIFIER_DOMINATEDCOLS
Definition: soplex.h:1061
@ ROWBOUNDFLIPS
use bound flipping also for row representation?
Definition: soplex.h:1025
@ RATFACJUMP
continue iterative refinement with exact basic solution if not optimal?
Definition: soplex.h:1022
@ RECOVERY_MECHANISM
try different settings when solve fails
Definition: soplex.h:1076
RangeType
type of bounds and sides
Definition: soplex.h:1904
@ RANGETYPE_UPPER
upper bound is finite, lower bound is infinite
Definition: soplex.h:1912
@ RANGETYPE_FIXED
lower bound equals upper bound
Definition: soplex.h:1918
@ RANGETYPE_BOXED
lower and upper bound finite, but different
Definition: soplex.h:1915
@ RANGETYPE_LOWER
lower bound is finite, upper bound is infinite
Definition: soplex.h:1909
@ RANGETYPE_FREE
both bounds are infinite
Definition: soplex.h:1906
void changeLowerRational(int i, const Rational &lower)
changes lower bound of column i to lower
void addRowRational(const LPRowRational &lprow)
adds a single row
void removeColsRational(int idx[], int n, int perm[]=nullptr)
remove all columns with indices in array idx of size n; an array perm of size numColsRational() may b...
Rational _rationalPosInfty
Definition: soplex.h:1733
void _checkBasisScaling()
check correctness of (un)scaled basis matrix operations
RangeType _rangeTypeRational(const Rational &lower, const Rational &upper) const
determines RangeType from rational bounds
SPxEquiliSC< R > _scalerUniequi
Definition: soplex.h:1749
void getRhsReal(VectorBase< R > &rhs) const
gets right-hand side vector
DataArray< typename SPxSolverBase< BP >::VarStatus > _tmpBasisStatusCols
Definition: soplex.h:1963
bool getRowViolationRational(Rational &maxviol, Rational &sumviol)
Class for storing a primal-dual solution with basis information.
Definition: solbase.h:53
TYPE
types of timers
Definition: timer.h:109
Dense vector.
Definition: vectorbase.h:86
Everything should be within this namespace.
SoPlexBase< Real > SoPlex
Definition: soplex.h:2628
double Real
Definition: spxdefines.h:269
Implementation of Sparse Linear Solver.
Implementation of Sparse Linear Solver with Rational precision.
Types of solution classes.
Class for storing a primal-dual solution with basis information.
Auto pricer.
Bound flipping ratio test (long step dual) for SoPlex.
Dantzig pricer.
Textbook ratio test for SoPlex.
Debugging, floating point type and parameter definitions.
Devex pricer.
LP equilibrium scaling.
Fast shifting ratio test.
LP geometric mean scaling.
returns the current git hash of SoPlex
Harris pricing with shifting.
Hybrid pricer.
LP least squares scaling.
Saving LPs in a form suitable for SoPlex.
General methods in LP preprocessing.
Partial multiple pricing.
Abstract pricer base class.
Abstract ratio test base class.
LP scaling base class.
LP simplification base class.
main LP solver class
SoPlex start basis generation base class.
Steepest edge pricer with exact initialization of weights.
Steepest edge pricer.
Simple heuristic SPxStarter.
Solution vector based start basis.
Weighted start basis.
std::string name[SoPlexBase< R >::BOOLPARAM_COUNT]
array of names for boolean parameters
Definition: soplex.h:1528
std::string description[SoPlexBase< R >::BOOLPARAM_COUNT]
array of descriptions for boolean parameters
Definition: soplex.h:1530
bool defaultValue[SoPlexBase< R >::BOOLPARAM_COUNT]
array of default values for boolean parameters
Definition: soplex.h:1532
std::string name[SoPlexBase< R >::INTPARAM_COUNT]
array of names for integer parameters
Definition: soplex.h:1540
int lower[SoPlexBase< R >::INTPARAM_COUNT]
array of lower bounds for int parameter values
Definition: soplex.h:1546
int upper[SoPlexBase< R >::INTPARAM_COUNT]
array of upper bounds for int parameter values
Definition: soplex.h:1548
int defaultValue[SoPlexBase< R >::INTPARAM_COUNT]
array of default values for integer parameters
Definition: soplex.h:1544
std::string description[SoPlexBase< R >::INTPARAM_COUNT]
array of descriptions for integer parameters
Definition: soplex.h:1542
Real upper[SoPlexBase< R >::REALPARAM_COUNT]
array of upper bounds for real parameter values
Definition: soplex.h:1564
Real defaultValue[SoPlexBase< R >::REALPARAM_COUNT]
array of default values for real parameters
Definition: soplex.h:1560
Real lower[SoPlexBase< R >::REALPARAM_COUNT]
array of lower bounds for real parameter values
Definition: soplex.h:1562
std::string description[SoPlexBase< R >::REALPARAM_COUNT]
array of descriptions for real parameters
Definition: soplex.h:1558
std::string name[SoPlexBase< R >::REALPARAM_COUNT]
array of names for real parameters
Definition: soplex.h:1556