Scippy

SoPlex

Sequential object-oriented simPlex

spxharrisrt.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 spxharrisrt.h
17  * @brief Harris pricing with shifting.
18  */
19 #ifndef _SPXHARRISRT_H_
20 #define _SPXHARRISRT_H_
21 
22 #include <assert.h>
23 
24 #include "soplex/spxdefines.h"
25 #include "soplex/spxratiotester.h"
26 
27 namespace soplex
28 {
29 
30 /**@brief Harris pricing with shifting.
31  @ingroup Algo
32 
33  Class SPxHarrisRT is a stable implementation of a SPxRatioTester class
34  along the lines of Harris' two phase algorithm. Additionally it uses
35  shifting of bounds in order to avoid cycling.
36 
37  See SPxRatioTester for a class documentation.
38 */
39 /**@todo HarrisRT leads to cycling in dcmulti.sub.lp */
40 template <class R>
41 class SPxHarrisRT : public SPxRatioTester<R>
42 {
43 private:
44 
45  //-------------------------------------
46  /**@name Private helpers */
47  ///@{
48  ///
49  R degenerateEps() const;
50 
51  ///
52  int maxDelta(
53  R* /*max*/, ///< max abs value in \p upd
54  R* val, ///< initial and chosen value
55  int num, ///< number of indices in \p idx
56  const int* idx, ///< nonzero indices in \p upd
57  const R* upd, ///< update VectorBase<R> for \p vec
58  const R* vec, ///< current vector
59  const R* low, ///< lower bounds for \p vec
60  const R* up, ///< upper bounds for \p vec
61  R epsilon ///< what is 0?
62  ) const;
63 
64  ///
65  int minDelta(
66  R* /*max*/, ///< max abs value in \p upd
67  R* val, ///< initial and chosen value
68  int num, ///< of indices in \p idx
69  const int* idx, ///< nonzero indices in \p upd
70  const R* upd, ///< update VectorBase<R> for \p vec
71  const R* vec, ///< current vector
72  const R* low, ///< lower bounds for \p vec
73  const R* up, ///< upper bounds for \p vec
74  R epsilon ///< what is 0?
75  ) const;
76  ///@}
77 
78 public:
79 
80  //-------------------------------------
81  /**@name Construction / destruction */
82  ///@{
83  /// default constructor
85  : SPxRatioTester<R>("Harris")
86  {}
87  /// copy constructor
89  : SPxRatioTester<R>(old)
90  {}
91  /// assignment operator
93  {
94  if(this != &rhs)
95  {
97  }
98 
99  return *this;
100  }
101  /// destructor
102  virtual ~SPxHarrisRT()
103  {}
104  /// clone function for polymorphism
105  inline virtual SPxRatioTester<R>* clone() const
106  {
107  return new SPxHarrisRT(*this);
108  }
109  ///@}
110 
111  //-------------------------------------
112  /**@name Leave / enter */
113  ///@{
114  ///
115  virtual int selectLeave(R& val, R, bool);
116  ///
117  virtual SPxId selectEnter(R& val, int, bool);
118  ///@}
119 
120 };
121 
122 } // namespace soplex
123 // For the general template
124 #include "spxharrisrt.hpp"
125 
126 
127 #endif // _SPXHARRISRT_H_
R degenerateEps() const
Abstract ratio test base class.
Abstract ratio test base class.Class SPxRatioTester is the virtual base class for computing the ratio...
int minDelta(R *, R *val, int num, const int *idx, const R *upd, const R *vec, const R *low, const R *up, R epsilon) const
Generic Ids for LP rows or columns.Both SPxColIds and SPxRowIds may be treated uniformly as SPxIds: ...
Definition: spxid.h:85
virtual int selectLeave(R &val, R, bool)
virtual ~SPxHarrisRT()
destructor
Definition: spxharrisrt.h:102
SPxHarrisRT & operator=(const SPxHarrisRT &rhs)
assignment operator
Definition: spxharrisrt.h:92
SPxRatioTester & operator=(const SPxRatioTester &rhs)
assignment operator
virtual SPxId selectEnter(R &val, int, bool)
virtual SPxRatioTester< R > * clone() const
clone function for polymorphism
Definition: spxharrisrt.h:105
Debugging, floating point type and parameter definitions.
Everything should be within this namespace.
int maxDelta(R *, R *val, int num, const int *idx, const R *upd, const R *vec, const R *low, const R *up, R epsilon) const
SPxHarrisRT()
default constructor
Definition: spxharrisrt.h:84
SPxHarrisRT(const SPxHarrisRT &old)
copy constructor
Definition: spxharrisrt.h:88
Harris pricing with shifting.Class SPxHarrisRT is a stable implementation of a SPxRatioTester class a...
Definition: spxharrisrt.h:41