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-2023 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 spxparmultpr.h
26  * @brief Partial multiple pricing.
27  */
28 #ifndef _SPXPARMULTPR_H_
29 #define _SPXPARMULTPR_H_
30 
31 #include <assert.h>
32 
33 #include "soplex/spxdefines.h"
34 #include "soplex/spxpricer.h"
35 #include "soplex/dataarray.h"
36 #include "soplex/array.h"
37 #include "soplex/ssvector.h"
38 
39 namespace soplex
40 {
41 
42 /**@brief Partial multiple pricing.
43  @ingroup Algo
44 
45  Class SPxParMultPr is an implementation class for SPxPricer implementing
46  Dantzig's default pricing strategy with partial multiple pricing.
47  Partial multiple pricing applies to the entering Simplex only. A set of
48  #partialSize eligible pivot indices is selected (partial pricing). In the
49  following Simplex iterations pricing is restricted to these indices
50  (multiple pricing) until no more eliiable pivots are available. Partial
51  multiple pricing significantly reduces the computation time for computing
52  the matrix-vector-product in the Simplex algorithm.
53 
54  See SPxPricer for a class documentation.
55 */
56 template <class R>
57 class SPxParMultPR : public SPxPricer<R>
58 {
59 private:
60 
61  //-------------------------------------
62  /**@name Private types */
63  ///@{
64  /// Helper structure.
66  {
67  ///
69  ///
70  R test;
71  };
72  ///@}
73 
74  //-------------------------------------
75  /**@name Helper data */
76  ///@{
77  ///
79  ///
81  ///
82  int used;
83  ///
84  int min;
85  ///
86  int last;
87  /// Set size for partial pricing.
89  ///@}
90 
91 public:
92 
93  //-------------------------------------
94  /**@name Construction / destruction */
95  ///@{
96  /// default constructor
98  : SPxPricer<R>("ParMult")
99  , multiParts(0)
100  , used(0)
101  , min(0)
102  , last(0)
103  , partialSize(17)
104  {}
105  /// copy constructor
107  : SPxPricer<R>(old)
108  , pricSet(old.pricSet)
109  , multiParts(old.multiParts)
110  , used(old.used)
111  , min(old.min)
112  , last(old.last)
113  , partialSize(old.partialSize)
114  {}
115  /// assignment operator
117  {
118  if(this != &rhs)
119  {
121  pricSet = rhs.pricSet;
122  multiParts = rhs.multiParts;
123  used = rhs.used;
124  min = rhs.min;
125  last = rhs.last;
126  partialSize = rhs.partialSize;
127  }
128 
129  return *this;
130  }
131  /// destructor
132  virtual ~SPxParMultPR()
133  {}
134  /// clone function for polymorphism
135  inline virtual SPxPricer<R>* clone() const
136  {
137  return new SPxParMultPR(*this);
138  }
139  ///@}
140 
141  //-------------------------------------
142  /**@name Interface */
143  ///@{
144  /// set the solver
145  virtual void load(SPxSolverBase<R>* solver);
146  /// set entering or leaving algorithm
147  virtual void setType(typename SPxSolverBase<R>::Type tp);
148  ///
149  virtual int selectLeave();
150  ///
151  virtual SPxId selectEnter();
152  ///@}
153 
154 };
155 
156 } // namespace soplex
157 
158 #include "spxparmultpr.hpp"
159 #endif // _SPXPARMULTPRR_H_
SPxParMultPR(const SPxParMultPR &old)
copy constructor
Definition: spxparmultpr.h:106
Abstract pricer base class.
SPxParMultPR()
default constructor
Definition: spxparmultpr.h:97
Sequential object-oriented SimPlex.SPxSolverBase is an LP solver class using the revised Simplex algo...
Definition: spxbasis.h:58
SPxPricer & operator=(const SPxPricer &rhs)
assignment operator
Definition: spxpricer.h:298
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:72
virtual int selectLeave()
virtual SPxSolverBase< R > * solver() const
returns loaded SPxSolverBase object.
Definition: spxpricer.h:139
Partial multiple pricing.Class SPxParMultPr is an implementation class for SPxPricer implementing Dan...
Definition: spxparmultpr.h:57
Generic Ids for LP rows or columns.Both SPxColIds and SPxRowIds may be treated uniformly as SPxIds: ...
Definition: spxid.h:94
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:56
virtual SPxId selectEnter()
SPxParMultPR & operator=(const SPxParMultPR &rhs)
assignment operator
Definition: spxparmultpr.h:116
Debugging, floating point type and parameter definitions.
Everything should be within this namespace.
int partialSize
Set size for partial pricing.
Definition: spxparmultpr.h:88
virtual ~SPxParMultPR()
destructor
Definition: spxparmultpr.h:132
Save arrays of arbitrary types.
virtual SPxPricer< R > * clone() const
clone function for polymorphism
Definition: spxparmultpr.h:135
Save arrays of data objects.
Type
Algorithmic type.
Definition: spxsolver.h:144
Array< SPxParMultPr_Tmp > pricSet
Definition: spxparmultpr.h:78