Scippy

SoPlex

Sequential object-oriented simPlex

spxparmultpr.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-2022 Konrad-Zuse-Zentrum */
7 /* fuer Informationstechnik Berlin */
8 /* */
9 /* SoPlex is distributed under the terms of the ZIB Academic Licence. */
10 /* */
11 /* You should have received a copy of the ZIB Academic License */
12 /* along with SoPlex; see the file COPYING. If not email to soplex@zib.de. */
13 /* */
14 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
15 
16 /**@file spxparmultpr.h
17  * @brief Partial multiple pricing.
18  */
19 #ifndef _SPXPARMULTPR_H_
20 #define _SPXPARMULTPR_H_
21 
22 #include <assert.h>
23 
24 #include "soplex/spxdefines.h"
25 #include "soplex/spxpricer.h"
26 #include "soplex/dataarray.h"
27 #include "soplex/array.h"
28 #include "soplex/ssvector.h"
29 
30 namespace soplex
31 {
32 
33 /**@brief Partial multiple pricing.
34  @ingroup Algo
35 
36  Class SPxParMultPr is an implementation class for SPxPricer implementing
37  Dantzig's default pricing strategy with partial multiple pricing.
38  Partial multiple pricing applies to the entering Simplex only. A set of
39  #partialSize eligible pivot indices is selected (partial pricing). In the
40  following Simplex iterations pricing is restricted to these indices
41  (multiple pricing) until no more eliiable pivots are available. Partial
42  multiple pricing significantly reduces the computation time for computing
43  the matrix-vector-product in the Simplex algorithm.
44 
45  See SPxPricer for a class documentation.
46 */
47 template <class R>
48 class SPxParMultPR : public SPxPricer<R>
49 {
50 private:
51 
52  //-------------------------------------
53  /**@name Private types */
54  ///@{
55  /// Helper structure.
57  {
58  ///
60  ///
61  R test;
62  };
63  ///@}
64 
65  //-------------------------------------
66  /**@name Helper data */
67  ///@{
68  ///
70  ///
72  ///
73  int used;
74  ///
75  int min;
76  ///
77  int last;
78  /// Set size for partial pricing.
80  ///@}
81 
82 public:
83 
84  //-------------------------------------
85  /**@name Construction / destruction */
86  ///@{
87  /// default constructor
89  : SPxPricer<R>("ParMult")
90  , multiParts(0)
91  , used(0)
92  , min(0)
93  , last(0)
94  , partialSize(17)
95  {}
96  /// copy constructor
98  : SPxPricer<R>(old)
99  , pricSet(old.pricSet)
100  , multiParts(old.multiParts)
101  , used(old.used)
102  , min(old.min)
103  , last(old.last)
104  , partialSize(old.partialSize)
105  {}
106  /// assignment operator
108  {
109  if(this != &rhs)
110  {
112  pricSet = rhs.pricSet;
113  multiParts = rhs.multiParts;
114  used = rhs.used;
115  min = rhs.min;
116  last = rhs.last;
117  partialSize = rhs.partialSize;
118  }
119 
120  return *this;
121  }
122  /// destructor
123  virtual ~SPxParMultPR()
124  {}
125  /// clone function for polymorphism
126  inline virtual SPxPricer<R>* clone() const
127  {
128  return new SPxParMultPR(*this);
129  }
130  ///@}
131 
132  //-------------------------------------
133  /**@name Interface */
134  ///@{
135  /// set the solver
136  virtual void load(SPxSolverBase<R>* solver);
137  /// set entering or leaving algorithm
138  virtual void setType(typename SPxSolverBase<R>::Type tp);
139  ///
140  virtual int selectLeave();
141  ///
142  virtual SPxId selectEnter();
143  ///@}
144 
145 };
146 
147 } // namespace soplex
148 
149 #include "spxparmultpr.hpp"
150 #endif // _SPXPARMULTPRR_H_
SPxParMultPR(const SPxParMultPR &old)
copy constructor
Definition: spxparmultpr.h:97
Abstract pricer base class.
SPxParMultPR()
default constructor
Definition: spxparmultpr.h:88
Sequential object-oriented SimPlex.SPxSolverBase is an LP solver class using the revised Simplex algo...
Definition: spxbasis.h:49
SPxPricer & operator=(const SPxPricer &rhs)
assignment operator
Definition: spxpricer.h:281
Safe arrays of arbitrary types.Class Array provides safe arrays of arbitrary type. Array elements are accessed just like ordinary C++ array elements by means of the index operator[](). Safety is provided by.
Definition: array.h:63
virtual int selectLeave()
virtual SPxSolverBase< R > * solver() const
returns loaded SPxSolverBase object.
Definition: spxpricer.h:128
Partial multiple pricing.Class SPxParMultPr is an implementation class for SPxPricer implementing Dan...
Definition: spxparmultpr.h:48
Generic Ids for LP rows or columns.Both SPxColIds and SPxRowIds may be treated uniformly as SPxIds: ...
Definition: spxid.h:85
virtual void load(SPxSolverBase< R > *solver)
set the solver
virtual void setType(typename SPxSolverBase< R >::Type tp)
set entering or leaving algorithm
Semi sparse vector.
Abstract pricer base class.Class SPxPricer is a pure virtual class defining the interface for pricer ...
Definition: spxpricer.h:47
virtual SPxId selectEnter()
SPxParMultPR & operator=(const SPxParMultPR &rhs)
assignment operator
Definition: spxparmultpr.h:107
Debugging, floating point type and parameter definitions.
Everything should be within this namespace.
int partialSize
Set size for partial pricing.
Definition: spxparmultpr.h:79
virtual ~SPxParMultPR()
destructor
Definition: spxparmultpr.h:123
Save arrays of arbitrary types.
virtual SPxPricer< R > * clone() const
clone function for polymorphism
Definition: spxparmultpr.h:126
Save arrays of data objects.
Type
Algorithmic type.
Definition: spxsolver.h:135
Array< SPxParMultPr_Tmp > pricSet
Definition: spxparmultpr.h:69