Toggle navigation
SCIP Optimization Suite
SCIP
SoPlex
ZIMPL
UG
GCG
Documentation
SoPlex 6.0.3
SoPlex 5.0.2
SoPlex 4.0.2
SoPlex 3.1.0
SoPlex 3.0.1
SoPlex 2.2.1
SoPlex
Sequential object-oriented simPlex
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
soplex-repo
src
spxautopr.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-2015 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 spxautopr.h
17
* @brief Auto pricer.
18
*/
19
#ifndef _SPXAUTOPR_H_
20
#define _SPXAUTOPR_H_
21
22
#include <assert.h>
23
24
#include "
spxpricer.h
"
25
#include "
spxdevexpr.h
"
26
#include "
spxsteeppr.h
"
27
28
29
namespace
soplex
30
{
31
32
/**@brief Auto pricer.
33
@ingroup Algo
34
35
This pricer switches between Devex and Steepest edge pricer based on the difficulty of the problem
36
which is determined by the number of iterations.
37
38
See SPxPricer for a class documentation.
39
*/
40
class
SPxAutoPR
:
public
SPxPricer
41
{
42
private
:
43
44
int
switchIters
;
///< number of iterations before switching pricers
45
SPxPricer
*
activepricer
;
///< pointer to currently selected pricer
46
SPxDevexPR
devex
;
///< internal Devex pricer
47
SPxSteepPR
steep
;
///< internal Steepest edge pricer
48
49
bool
setActivePricer
(
SPxSolver::Type
type);
///< switches active pricing method
50
51
public
:
52
53
//-------------------------------------
54
/**@name Constructors / destructors */
55
//@{
56
/// default constructor
57
SPxAutoPR
()
58
:
SPxPricer
(
"Auto"
)
59
,
switchIters
(10000)
60
,
activepricer
(&
devex
)
61
,
devex
()
62
,
steep
()
63
{}
64
/// copy constructor
65
SPxAutoPR
(
const
SPxAutoPR
& old )
66
:
SPxPricer
(old)
67
,
switchIters
(old.
switchIters
)
68
,
devex
(old.
devex
)
69
,
steep
(old.
steep
)
70
{
71
assert(old.
activepricer
== &old.
devex
|| old.
activepricer
== &old.
steep
);
72
if
( old.
activepricer
== &old.
devex
)
73
activepricer
= &
devex
;
74
else
75
activepricer
= &
steep
;
76
}
77
/// assignment operator
78
SPxAutoPR
&
operator=
(
const
SPxAutoPR
& rhs)
79
{
80
if
(
this
!= &rhs)
81
{
82
SPxPricer::operator=
(rhs);
83
switchIters
= rhs.
switchIters
;
84
devex
= rhs.
devex
;
85
steep
= rhs.
steep
;
86
87
assert(rhs.
activepricer
== &rhs.
devex
|| rhs.
activepricer
== &rhs.
steep
);
88
if
( rhs.
activepricer
== &rhs.
devex
)
89
activepricer
= &
devex
;
90
else
91
activepricer
= &
steep
;
92
}
93
94
return
*
this
;
95
}
96
/// destructor
97
virtual
~SPxAutoPR
()
98
{}
99
/// clone function for polymorphism
100
inline
virtual
SPxPricer
*
clone
()
const
101
{
102
return
new
SPxAutoPR
(*
this
);
103
}
104
//@}
105
106
//-------------------------------------
107
/**@name Access / modification */
108
//@{
109
/// set max number of iterations before switching pricers
110
void
setSwitchIters
(
int
iters);
111
/// clear the data
112
void
clear
();
113
/// set epsilon of internal pricers
114
void
setEpsilon
(
Real
eps);
115
/// set the solver
116
virtual
void
load
(
SPxSolver
* base);
117
/// set entering/leaving algorithm
118
virtual
void
setType
(
SPxSolver::Type
);
119
/// set row/column representation
120
virtual
void
setRep
(
SPxSolver::Representation
);
121
///
122
virtual
int
selectLeave
();
123
///
124
virtual
SPxId
selectEnter
();
125
///
126
virtual
void
left4
(
int
n,
SPxId
id
);
127
///
128
virtual
void
entered4
(
SPxId
id
,
int
n);
129
//@}
130
};
131
}
// namespace soplex
132
#endif // _SPXAUTOPR_H_