Scippy

SoPlex

Sequential object-oriented simPlex

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 
34 {
35  steep.clear();
36  devex.clear();
37  thesolver = 0;
38 }
39 
41 {
42  steep.setEpsilon(eps);
43  devex.setEpsilon(eps);
44  theeps = eps;
45 }
46 
48 {
49  activepricer->setType(tp);
50 }
51 
53 {
54  steep.setRep(rep);
55  devex.setRep(rep);
56 }
57 
59 {
60  // switch to steep as soon as switchIters is reached
62  {
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  {
72  activepricer->setType(type);
73  return true;
74  }
75 
76  return false;
77 }
78 
80 {
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 
93 {
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