Scippy

SoPlex

Sequential object-oriented simPlex

spxleastsqsc.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 spxleastsqsc.h
17  * @brief LP least squares scaling.
18  */
19 #ifndef _SPXLEASTSQSC_H_
20 #define _SPXLEASTSQSC_H_
21 
22 #include <assert.h>
23 #include "soplex/spxsolver.h"
24 #include "soplex/spxscaler.h"
25 #include "soplex/spxlp.h"
26 
27 
28 namespace soplex
29 {
30 
31 /**@brief Least squares scaling.
32  @ingroup Algo
33 
34  This SPxScaler implementation performs least squares scaling as suggested by Curtis and Reid in:
35  On the Automatic Scaling of Matrices for Gaussian Elimination (1972).
36 */
37 template <class R>
38 class SPxLeastSqSC : public SPxScaler<R>
39 {
40 public:
41  //-------------------------------------
42  /**@name Construction / destruction */
43  ///@{
44  /// default constructor (this scaler makes no use of inherited member m_colFirst)
45  explicit SPxLeastSqSC();
46  /// copy constructor
47  SPxLeastSqSC(const SPxLeastSqSC& old);
48  /// assignment operator
50  /// destructor
51  virtual ~SPxLeastSqSC()
52  {}
53  /// clone function for polymorphism
54  inline virtual SPxScaler<R>* clone() const override
55  {
56  return new SPxLeastSqSC(*this);
57  }
58  ///@}
59 
60  //-------------------------------------
61  /**@name Access / modification */
62  ///@{
63  /// set Real param (conjugate gradient accuracy)
64  virtual void setRealParam(R param, const char* name) override;
65  /// set int param (maximal conjugate gradient rounds)
66  virtual void setIntParam(int param, const char* name) override;
67  ///@}
68 
69  //-------------------------------------
70  /**@name Scaling */
71  ///@{
72  /// Scale the loaded SPxLP.
73  virtual void scale(SPxLPBase<R>& lp, bool persistent = true) override;
74 
75 
76 private:
77  R acrcydivisor = R(1000.0);
78  int maxrounds = 20;
79 
80 };
81 } // namespace soplex
82 
83 // For the general templated files
84 #include "spxleastsqsc.hpp"
85 
86 #endif // _SPXLEASTSQSC_H_
87 
Least squares scaling.This SPxScaler implementation performs least squares scaling as suggested by Cu...
Definition: spxleastsqsc.h:38
SPxLeastSqSC()
default constructor (this scaler makes no use of inherited member m_colFirst)
SPxLeastSqSC & operator=(const SPxLeastSqSC &)
assignment operator
virtual SPxScaler< R > * clone() const override
clone function for polymorphism
Definition: spxleastsqsc.h:54
main LP solver class
virtual void setIntParam(int param, const char *name) override
set int param (maximal conjugate gradient rounds)
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.
Saving LPs in a form suitable for SoPlex.
LP scaler abstract base class.Instances of classes derived from SPxScaler may be loaded to SoPlex in ...
Definition: spxscaler.h:77
virtual void setRealParam(R param, const char *name) override
set Real param (conjugate gradient accuracy)
virtual ~SPxLeastSqSC()
destructor
Definition: spxleastsqsc.h:51
virtual void scale(SPxLPBase< R > &lp, bool persistent=true) override
Scale the loaded SPxLP.