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-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 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 ///
58 R degenerateEps() const;
59
60 ///
62 R* /*max*/, ///< max abs value in upd
63 R* val, ///< initial and chosen value
64 int num, ///< number of indices in idx
65 const int* idx, ///< nonzero indices in upd
66 const R* upd, ///< update VectorBase<R> for vec
67 const R* vec, ///< current vector
68 const R* low, ///< lower bounds for vec
69 const R* up ///< upper bounds for vec
70 ) const;
71
72 ///
74 R* /*max*/, ///< max abs value in upd
75 R* val, ///< initial and chosen value
76 int num, ///< of indices in idx
77 const int* idx, ///< nonzero indices in upd
78 const R* upd, ///< update VectorBase<R> for vec
79 const R* vec, ///< current vector
80 const R* low, ///< lower bounds for vec
81 const R* up ///< upper bounds for vec
82 ) const;
83 ///@}
84
85public:
86
87 //-------------------------------------
88 /**@name Construction / destruction */
89 ///@{
90 /// default constructor
92 : SPxRatioTester<R>("Harris")
93 {}
94 /// copy constructor
96 : SPxRatioTester<R>(old)
97 {}
98 /// assignment operator
100 {
101 if(this != &rhs)
102 {
104 }
105
106 return *this;
107 }
108 /// destructor
109 virtual ~SPxHarrisRT()
110 {}
111 /// clone function for polymorphism
112 inline virtual SPxRatioTester<R>* clone() const
113 {
114 return new SPxHarrisRT(*this);
115 }
116 ///@}
117
118 //-------------------------------------
119 /**@name Leave / enter */
120 ///@{
121 ///
122 virtual int selectLeave(R& val, R, bool);
123 ///
124 virtual SPxId selectEnter(R& val, int, bool);
125 ///@}
126
127};
128
129} // namespace soplex
130// For the general template
131#include "spxharrisrt.hpp"
132
133
134#endif // _SPXHARRISRT_H_
Harris pricing with shifting.
Definition: spxharrisrt.h:51
SPxHarrisRT(const SPxHarrisRT &old)
copy constructor
Definition: spxharrisrt.h:95
virtual SPxRatioTester< R > * clone() const
clone function for polymorphism
Definition: spxharrisrt.h:112
SPxHarrisRT & operator=(const SPxHarrisRT &rhs)
assignment operator
Definition: spxharrisrt.h:99
SPxHarrisRT()
default constructor
Definition: spxharrisrt.h:91
virtual ~SPxHarrisRT()
destructor
Definition: spxharrisrt.h:109
R degenerateEps() const
int minDelta(R *, R *val, int num, const int *idx, const R *upd, const R *vec, const R *low, const R *up) const
int maxDelta(R *, R *val, int num, const int *idx, const R *upd, const R *vec, const R *low, const R *up) 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.