Scippy

SoPlex

Sequential object-oriented simPlex

spxequilisc.h
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-2022 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.h
17  * @brief LP equilibrium scaling.
18  */
19 #ifndef _SPXEQUILISC_H_
20 #define _SPXEQUILISC_H_
21 
22 #include <assert.h>
23 
24 #include "soplex/spxdefines.h"
25 #include "soplex/spxscaler.h"
26 
27 namespace soplex
28 {
29 /**@brief Equilibrium row/column scaling.
30  @ingroup Algo
31 
32  This SPxScaler implementation performs equilibrium scaling of the
33  LPs rows and columns.
34 */
35 template <class R>
36 class SPxEquiliSC : public SPxScaler<R>
37 {
38 public:
39  /// compute equilibrium scaling vector rounded to power of two
40  static void computeEquiExpVec(const SVSetBase<R>* vecset, const DataArray<int>& coScaleExp,
41  DataArray<int>& scaleExp);
42 
43  /// compute equilibrium scaling vector rounded to power of two
44  static void computeEquiExpVec(const SVSetBase<R>* vecset, const std::vector<R>& coScaleVal,
45  DataArray<int>& scaleExp);
46 
47  /// compute equilibrium scaling rounded to power of 2 for existing R scaling factors (preRowscale, preColscale)
48  static void computePostequiExpVecs(const SPxLPBase<R>& lp, const std::vector<R>& preRowscale,
49  const std::vector<R>& preColscale,
50  DataArray<int>& rowscaleExp, DataArray<int>& colscaleExp);
51  //-------------------------------------
52  /**@name Construction / destruction */
53  ///@{
54  /// default constructor (this scaler makes no use of inherited member m_colFirst)
55  explicit SPxEquiliSC(bool doBoth = true);
56  /// copy constructor
57  SPxEquiliSC(const SPxEquiliSC& old);
58  /// assignment operator
60  /// destructor
61  virtual ~SPxEquiliSC()
62  {}
63  /// clone function for polymorphism
64  inline virtual SPxScaler<R>* clone() const override
65  {
66  return new SPxEquiliSC<R>(*this);
67  }
68  ///@}
69 
70  //-------------------------------------
71  /**@name Scaling */
72  ///@{
73  /// Scale the loaded SPxLP.
74  virtual void scale(SPxLPBase<R>& lp, bool persistent = false) override;
75  ///@}
76 };
77 } // namespace soplex
78 
79 #include "spxequilisc.hpp"
80 
81 #endif // _SPXEQUILISC_H_
virtual SPxScaler< R > * clone() const override
clone function for polymorphism
Definition: spxequilisc.h:64
static void computePostequiExpVecs(const SPxLPBase< R > &lp, const std::vector< R > &preRowscale, const std::vector< R > &preColscale, DataArray< int > &rowscaleExp, DataArray< int > &colscaleExp)
compute equilibrium scaling rounded to power of 2 for existing R scaling factors (preRowscale, preColscale)
static void computeEquiExpVec(const SVSetBase< R > *vecset, const DataArray< int > &coScaleExp, DataArray< int > &scaleExp)
compute equilibrium scaling vector rounded to power of two
SPxEquiliSC(bool doBoth=true)
default constructor (this scaler makes no use of inherited member m_colFirst)
virtual void scale(SPxLPBase< R > &lp, bool persistent=false) override
Scale the loaded SPxLP.
virtual ~SPxEquiliSC()
destructor
Definition: spxequilisc.h:61
Debugging, floating point type and parameter definitions.
Everything should be within this namespace.
Saving LPs in a form suitable for SoPlex.Class SPxLPBase provides the data structures required for sa...
Definition: spxlpbase.h:56
LP scaling base class.
LP scaler abstract base class.Instances of classes derived from SPxScaler may be loaded to SoPlex in ...
Definition: spxscaler.h:77
SPxEquiliSC & operator=(const SPxEquiliSC &)
assignment operator
Equilibrium row/column scaling.This SPxScaler implementation performs equilibrium scaling of the LPs ...
Definition: spxequilisc.h:36
Sparse vector set.Class SVSetBase provides a set of sparse vectors SVectorBase. All SVectorBases in a...
Definition: ssvectorbase.h:35