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.cpp
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
#include <iostream>
17
18
#include "
spxdefines.h
"
19
#include "
spxautopr.h
"
20
#include "
spxout.h
"
21
22
namespace
soplex
23
{
24
25
void
SPxAutoPR::load
(
SPxSolver
* p_solver)
26
{
27
steep
.
load
(p_solver);
28
devex
.
load
(p_solver);
29
thesolver
= p_solver;
30
setType
(p_solver->
type
());
31
}
32
33
void
SPxAutoPR::clear
()
34
{
35
steep
.
clear
();
36
devex
.
clear
();
37
thesolver
= 0;
38
}
39
40
void
SPxAutoPR::setEpsilon
(
Real
eps)
41
{
42
steep
.
setEpsilon
(eps);
43
devex
.
setEpsilon
(eps);
44
theeps
= eps;
45
}
46
47
void
SPxAutoPR::setType
(
SPxSolver::Type
tp)
48
{
49
activepricer
->
setType
(tp);
50
}
51
52
void
SPxAutoPR::setRep
(
SPxSolver::Representation
rep)
53
{
54
steep
.
setRep
(rep);
55
devex
.
setRep
(rep);
56
}
57
58
bool
SPxAutoPR::setActivePricer
(
SPxSolver::Type
type)
59
{
60
// switch to steep as soon as switchIters is reached
61
if
(
activepricer
== &
devex
&&
thesolver
->
iterations
() >=
switchIters
)
62
{
63
activepricer
= &
steep
;
64
activepricer
->
setType
(type);
65
return
true
;
66
}
67
68
// use devex for the iterations < switchIters
69
else
if
(
activepricer
== &
steep
&&
thesolver
->
iterations
() <
switchIters
)
70
{
71
activepricer
= &
devex
;
72
activepricer
->
setType
(type);
73
return
true
;
74
}
75
76
return
false
;
77
}
78
79
int
SPxAutoPR::selectLeave
()
80
{
81
if
(
setActivePricer
(
SPxSolver::LEAVE
) )
82
MSG_INFO1
( (*
thesolver
->
spxout
), (*
thesolver
->
spxout
) <<
" --- active pricer: "
<<
activepricer
->
getName
() << std::endl; )
83
84
return
activepricer
->
selectLeave
();
85
}
86
87
void
SPxAutoPR::left4
(
int
n,
SPxId
id
)
88
{
89
activepricer
->
left4
(n,
id
);
90
}
91
92
SPxId
SPxAutoPR::selectEnter
()
93
{
94
if
(
setActivePricer
(
SPxSolver::ENTER
) )
95
MSG_INFO1
( (*
thesolver
->
spxout
), (*
thesolver
->
spxout
) <<
" --- active pricer: "
<<
activepricer
->
getName
() << std::endl; )
96
97
return
activepricer
->
selectEnter
();
98
}
99
100
void
SPxAutoPR::entered4
(
SPxId
id
,
int
n)
101
{
102
activepricer
->
entered4
(
id
, n);
103
}
104
105
}
// namespace soplex