Scippy

SoPlex

Sequential object-oriented simPlex

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 
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 
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 
52 {
53  steep.clear();
54  devex.clear();
55  parmult.clear();
56  thesolver = 0;
57 }
58 
60 {
61  steep.setEpsilon(eps);
62  devex.setEpsilon(eps);
63  parmult.setEpsilon(eps);
64 }
65 
67 {
68  if (tp == SPxSolver::LEAVE)
69  {
70  thepricer = &steep;
72  }
73  else
74  {
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;
84  }
85  else
86  {
87  thepricer = &parmult;
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 
99 {
100  steep.setRep(rep);
101  devex.setRep(rep);
102  parmult.setRep(rep);
103 }
104 
106 {
107  return thepricer->selectLeave();
108 }
109 
110 void SPxHybridPR::left4(int n, SPxId id)
111 {
112  thepricer->left4(n, id);
113 }
114 
116 {
117  return thepricer->selectEnter();
118 }
119 
121 {
122  thepricer->entered4(id, n);
123 }
124 
126 {
127  steep.addedVecs(n);
128  devex.addedVecs(n);
129  parmult.addedVecs(n);
130 }
131 
133 {
134  steep.addedCoVecs(n);
135  devex.addedCoVecs(n);
136  parmult.addedCoVecs(n);
137 }
138 
139 } // namespace soplex