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
spxhybridpr.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 "
spxhybridpr.h
"
20
#include "
spxout.h
"
21
22
namespace
soplex
23
{
24
25
bool
SPxHybridPR::isConsistent
()
const
26
{
27
#ifdef ENABLE_CONSISTENCY_CHECKS
28
if
(
thesolver
!= 0 &&
29
(
thesolver
!=
steep
.
solver
() ||
30
thesolver
!=
devex
.
solver
() ||
31
thesolver
!=
parmult
.
solver
()))
32
return
MSGinconsistent
(
"SPxHybridPR"
);
33
34
return
steep
.
isConsistent
()
35
&&
devex
.
isConsistent
()
36
&&
parmult
.
isConsistent
();
37
#else
38
return
true
;
39
#endif
40
}
41
42
void
SPxHybridPR::load
(
SPxSolver
* p_solver)
43
{
44
steep
.
load
(p_solver);
45
devex
.
load
(p_solver);
46
parmult
.
load
(p_solver);
47
thesolver
= p_solver;
48
setType
(p_solver->
type
());
49
}
50
51
void
SPxHybridPR::clear
()
52
{
53
steep
.
clear
();
54
devex
.
clear
();
55
parmult
.
clear
();
56
thesolver
= 0;
57
}
58
59
void
SPxHybridPR::setEpsilon
(
Real
eps)
60
{
61
steep
.
setEpsilon
(eps);
62
devex
.
setEpsilon
(eps);
63
parmult
.
setEpsilon
(eps);
64
}
65
66
void
SPxHybridPR::setType
(
SPxSolver::Type
tp)
67
{
68
if
(tp ==
SPxSolver::LEAVE
)
69
{
70
thepricer
= &
steep
;
71
thesolver
->
setPricing
(
SPxSolver::FULL
);
72
}
73
else
74
{
75
if
(
thesolver
->
dim
() >
hybridFactor
*
thesolver
->
coDim
())
76
{
77
/**@todo I changed from devex to steepest edge pricing here
78
* because of numerical difficulties, this should be
79
* investigated.
80
*/
81
// thepricer = &devex;
82
thepricer
= &
steep
;
83
thesolver
->
setPricing
(
SPxSolver::FULL
);
84
}
85
else
86
{
87
thepricer
= &
parmult
;
88
thesolver
->
setPricing
(
SPxSolver::PARTIAL
);
89
}
90
}
91
92
MSG_INFO1
( (*
thesolver
->
spxout
), (*
thesolver
->
spxout
) <<
"IPRHYB01 switching to "
93
<<
thepricer
->
getName
() << std::endl; )
94
95
thepricer
->
setType
(tp);
96
}
97
98
void
SPxHybridPR::setRep
(
SPxSolver::Representation
rep)
99
{
100
steep
.
setRep
(rep);
101
devex
.
setRep
(rep);
102
parmult
.
setRep
(rep);
103
}
104
105
int
SPxHybridPR::selectLeave
()
106
{
107
return
thepricer
->
selectLeave
();
108
}
109
110
void
SPxHybridPR::left4
(
int
n,
SPxId
id
)
111
{
112
thepricer
->
left4
(n,
id
);
113
}
114
115
SPxId
SPxHybridPR::selectEnter
()
116
{
117
return
thepricer
->
selectEnter
();
118
}
119
120
void
SPxHybridPR::entered4
(
SPxId
id
,
int
n)
121
{
122
thepricer
->
entered4
(
id
, n);
123
}
124
125
void
SPxHybridPR::addedVecs
(
int
n)
126
{
127
steep
.
addedVecs
(n);
128
devex
.
addedVecs
(n);
129
parmult
.
addedVecs
(n);
130
}
131
132
void
SPxHybridPR::addedCoVecs
(
int
n)
133
{
134
steep
.
addedCoVecs
(n);
135
devex
.
addedCoVecs
(n);
136
parmult
.
addedCoVecs
(n);
137
}
138
139
}
// namespace soplex