SoPlex Doxygen Documentation
spxequilisc.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-2012 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 spxequilisc.cpp
17  * @brief Equilibrium row/column scaling.
18  */
19 #include <assert.h>
20 
21 #include "spxequilisc.h"
22 #include "spxout.h"
23 
24 namespace soplex
25 {
26 static const char* makename(bool doBoth)
27 {
28  return doBoth ? "bi-Equilibrium" : "uni-Equilibrium";
29 }
30 
32  : SPxScaler(makename(doBoth), false, doBoth)
33 {}
34 
36  : SPxScaler(old)
37 {}
38 
40 {
41  if(this != &rhs)
42  {
44  }
45 
46  return *this;
47 }
48 
49 Real SPxEquiliSC::computeScale(Real /*mini*/, Real maxi) const
50 {
51  METHOD( "SPxEquiliSC::computeScale()" );
52 
53  return maxi;
54 }
55 
57 {
58  METHOD( "SPxEquiliSC::scale()" );
59 
60  MSG_INFO1( spxout << "IEQUSC01 Equilibrium scaling LP" << std::endl; )
61 
62  setup(lp);
63 
64  /* We want to do that direction first, with the lower ratio.
65  * Reason:
66  * Rowratio
67  * 0.04 0.02 0.01 4
68  * 4000 20 1000 200
69  * Colratio 1e5 1e3 1e5
70  *
71  * Row first => Col next =>
72  * 1 0.5 0.25 1 1 1
73  * 1 0.05 0.25 1 0.1 1
74  *
75  * Col first => Row next =>
76  * 1e-5 1e-3 1e-5 0.01 1 0.01
77  * 1 1 1 1 1 1
78  *
79  */
80  Real colratio = maxColRatio(lp);
81  Real rowratio = maxRowRatio(lp);
82 
83  bool colFirst = colratio < rowratio;
84 
85  MSG_INFO2( spxout << "IEQUSC02 LP scaling statistics:"
86  << " min= " << lp.minAbsNzo()
87  << " max= " << lp.maxAbsNzo()
88  << " col-ratio= " << colratio
89  << " row-ratio= " << rowratio
90  << std::endl; )
91  if (colFirst)
92  {
94 
95  if (m_doBoth)
97  }
98  else
99  {
101 
102  if (m_doBoth)
104  }
105  applyScaling(lp);
106 
107  MSG_INFO3( spxout << "IEQUSC03 \tRow scaling min= " << minAbsRowscale()
108  << " max= " << maxAbsRowscale()
109  << std::endl
110  << "\tCol scaling min= " << minAbsColscale()
111  << " max= " << maxAbsColscale()
112  << std::endl; )
113 
114  MSG_INFO2( spxout << "IEQUSC04 LP scaling statistics:"
115  << " min= " << lp.minAbsNzo()
116  << " max= " << lp.maxAbsNzo()
117  << " col-ratio= " << maxColRatio(lp)
118  << " row-ratio= " << maxRowRatio(lp)
119  << std::endl; )
120 }
121 
122 } // namespace soplex
123 
124 //-----------------------------------------------------------------------------
125 //Emacs Local Variables:
126 //Emacs mode:c++
127 //Emacs c-basic-offset:3
128 //Emacs tab-width:8
129 //Emacs indent-tabs-mode:nil
130 //Emacs End:
131 //-----------------------------------------------------------------------------
132 
133 
134 
135 
136