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-2024 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
39namespace 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*/
56template <class R>
57class SPxParMultPR : public SPxPricer<R>
58{
59private:
60
61 //-------------------------------------
62 /**@name Private types */
63 ///@{
64 /// Helper structure.
66 {
67 ///
69 ///
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
91public:
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)
110 , used(old.used)
111 , min(old.min)
112 , last(old.last)
114 {}
115 /// assignment operator
117 {
118 if(this != &rhs)
119 {
121 pricSet = rhs.pricSet;
123 used = rhs.used;
124 min = rhs.min;
125 last = rhs.last;
127 }
128
129 return *this;
130 }
131 /// destructor
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
146 /// set entering or leaving algorithm
147 virtual void setType(typename SPxSolverBase<R>::Type tp);
148 ///
149 virtual int selectLeave();
150 ///
152 ///@}
153
154};
155
156} // namespace soplex
157
158#include "spxparmultpr.hpp"
159#endif // _SPXPARMULTPRR_H_
Save arrays of arbitrary types.
Safe arrays of arbitrary types.
Definition: array.h:73
Generic Ids for LP rows or columns.
Definition: spxid.h:95
Partial multiple pricing.
Definition: spxparmultpr.h:58
SPxParMultPR()
default constructor
Definition: spxparmultpr.h:97
virtual SPxPricer< R > * clone() const
clone function for polymorphism
Definition: spxparmultpr.h:135
SPxParMultPR(const SPxParMultPR &old)
copy constructor
Definition: spxparmultpr.h:106
Array< SPxParMultPr_Tmp > pricSet
Definition: spxparmultpr.h:78
SPxParMultPR & operator=(const SPxParMultPR &rhs)
assignment operator
Definition: spxparmultpr.h:116
virtual void load(SPxSolverBase< R > *solver)
set the solver
virtual void setType(typename SPxSolverBase< R >::Type tp)
set entering or leaving algorithm
virtual int selectLeave()
int partialSize
Set size for partial pricing.
Definition: spxparmultpr.h:88
virtual ~SPxParMultPR()
destructor
Definition: spxparmultpr.h:132
virtual SPxId selectEnter()
Abstract pricer base class.
Definition: spxpricer.h:57
virtual SPxSolverBase< R > * solver() const
returns loaded SPxSolverBase object.
Definition: spxpricer.h:139
SPxPricer & operator=(const SPxPricer &rhs)
assignment operator
Definition: spxpricer.h:298
Sequential object-oriented SimPlex.
Definition: spxsolver.h:104
Type
Algorithmic type.
Definition: spxsolver.h:143
Save arrays of data objects.
Everything should be within this namespace.
Debugging, floating point type and parameter definitions.
Abstract pricer base class.
Semi sparse vector.