Scippy

SoPlex

Sequential object-oriented simPlex

spxdantzigpr.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 spxdantzigpr.h
26  * @brief Dantzig pricer.
27  */
28 #ifndef _SPXDEFAULTPR_H_
29 #define _SPXDEFAULTPR_H_
30 
31 #include <assert.h>
32 
33 #include "soplex/spxpricer.h"
34 
35 namespace soplex
36 {
37 
38 /**@brief Dantzig pricer.
39  @ingroup Algo
40 
41  Class SPxDantzigPR is an implementation class of an SPxPricer implementing
42  Dantzig's default pricing strategy, i.e., maximal/minimal reduced cost or
43  maximally violated constraint.
44 
45  See SPxPricer for a class documentation.
46 */
47 template <class R>
48 class SPxDantzigPR : public SPxPricer<R>
49 {
50 private:
51  int selectLeaveSparse();/**< sparse pricing method for leaving Simplex */
52 
53  SPxId
54  selectEnterX(); /**< choose the best entering index among columns and rows but prefer sparsity */
56  SPxId& id); /**< sparse pricing method for entering Simplex (slack variables)*/
58  SPxId& id); /**< sparse pricing method for entering Simplex */
59  SPxId selectEnterDenseDim(R& best,
60  SPxId& id); /**< selectEnter() in dense case (slack variables) */
62  SPxId& id); /**< selectEnter() in dense case */
63 public:
64 
65  //-------------------------------------
66  /**@name Constructors / destructors */
67  ///@{
68  /// default constructor
70  : SPxPricer<R>("Dantzig")
71  {}
72  /// copy constructor
74  : SPxPricer<R>(old)
75  {}
76  /// assignment operator
78  {
79  if(this != &rhs)
80  {
82  }
83 
84  return *this;
85  }
86  /// destructor
87  virtual ~SPxDantzigPR()
88  {}
89  /// clone function for polymorphism
90  inline virtual SPxPricer<R>* clone() const
91  {
92  return new SPxDantzigPR(*this);
93  }
94  ///@}
95 
96 
97  //-------------------------------------
98  /**@name Select enter/leave */
99  ///@{
100  ///
101  virtual int selectLeave();
102  ///
103  virtual SPxId selectEnter();
104  ///@}
105 };
106 } // namespace soplex
107 
108 // For general tempalted functions
109 #include "spxdantzigpr.hpp"
110 
111 #endif // _SPXDEFAULTPRR_H_
Abstract pricer base class.
SPxPricer & operator=(const SPxPricer &rhs)
assignment operator
Definition: spxpricer.h:298
virtual SPxId selectEnter()
SPxId selectEnterSparseDim(R &best, SPxId &id)
virtual int selectLeave()
Generic Ids for LP rows or columns.Both SPxColIds and SPxRowIds may be treated uniformly as SPxIds: ...
Definition: spxid.h:94
SPxId selectEnterDenseDim(R &best, SPxId &id)
SPxDantzigPR & operator=(const SPxDantzigPR &rhs)
assignment operator
Definition: spxdantzigpr.h:77
virtual SPxPricer< R > * clone() const
clone function for polymorphism
Definition: spxdantzigpr.h:90
virtual ~SPxDantzigPR()
destructor
Definition: spxdantzigpr.h:87
SPxDantzigPR()
default constructor
Definition: spxdantzigpr.h:69
Abstract pricer base class.Class SPxPricer is a pure virtual class defining the interface for pricer ...
Definition: spxpricer.h:56
Everything should be within this namespace.
Dantzig pricer.Class SPxDantzigPR is an implementation class of an SPxPricer implementing Dantzig&#39;s d...
Definition: spxdantzigpr.h:48
SPxId selectEnterDenseCoDim(R &best, SPxId &id)
SPxId selectEnterSparseCoDim(R &best, SPxId &id)
SPxDantzigPR(const SPxDantzigPR &old)
copy constructor
Definition: spxdantzigpr.h:73