SoPlex
Toggle main menu visibility
Loading...
Searching...
No Matches
src
soplex
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-2026 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
"
34
#include "
soplex/spxratiotester.h
"
35
36
namespace
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 */
49
template
<
class
R>
50
class
SPxHarrisRT
:
public
SPxRatioTester
<R>
51
{
52
private
:
53
54
//-------------------------------------
55
/**@name Private helpers */
56
///@{
57
///
58
R
degenerateEps
()
const
;
59
60
///
61
int
maxDelta
(
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
///
73
int
minDelta
(
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
85
public
:
86
87
//-------------------------------------
88
/**@name Construction / destruction */
89
///@{
90
/// default constructor
91
SPxHarrisRT
()
92
:
SPxRatioTester
<R>(
"Harris"
)
93
{}
94
/// copy constructor
95
SPxHarrisRT
(
const
SPxHarrisRT
& old)
96
:
SPxRatioTester
<R>(old)
97
{}
98
/// assignment operator
99
SPxHarrisRT
&
operator=
(
const
SPxHarrisRT
& rhs)
100
{
101
if
(
this
!= &rhs)
102
{
103
SPxRatioTester<R>::operator=
(rhs);
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_
soplex::SPxHarrisRT::SPxHarrisRT
SPxHarrisRT(const SPxHarrisRT &old)
copy constructor
Definition
spxharrisrt.h:95
soplex::SPxHarrisRT::clone
virtual SPxRatioTester< R > * clone() const
clone function for polymorphism
Definition
spxharrisrt.h:112
soplex::SPxHarrisRT::operator=
SPxHarrisRT & operator=(const SPxHarrisRT &rhs)
assignment operator
Definition
spxharrisrt.h:99
soplex::SPxHarrisRT::SPxHarrisRT
SPxHarrisRT()
default constructor
Definition
spxharrisrt.h:91
soplex::SPxHarrisRT::~SPxHarrisRT
virtual ~SPxHarrisRT()
destructor
Definition
spxharrisrt.h:109
soplex::SPxHarrisRT::degenerateEps
R degenerateEps() const
soplex::SPxHarrisRT::minDelta
int minDelta(R *, R *val, int num, const int *idx, const R *upd, const R *vec, const R *low, const R *up) const
soplex::SPxHarrisRT::maxDelta
int maxDelta(R *, R *val, int num, const int *idx, const R *upd, const R *vec, const R *low, const R *up) const
soplex::SPxHarrisRT::selectEnter
virtual SPxId selectEnter(R &val, int, bool)
soplex::SPxHarrisRT::selectLeave
virtual int selectLeave(R &val, R, bool)
soplex::SPxId
Generic Ids for LP rows or columns.
Definition
spxid.h:95
soplex::SPxRatioTester::SPxRatioTester
SPxRatioTester(const char *name)
default constructor
Definition
spxratiotester.h:192
soplex::SPxRatioTester::operator=
SPxRatioTester & operator=(const SPxRatioTester &rhs)
assignment operator
Definition
spxratiotester.h:206
soplex
Everything should be within this namespace.
spxdefines.h
Debugging, floating point type and parameter definitions.
spxratiotester.h
Abstract ratio test base class.
Generated by
1.17.0