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