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-2023 Zuse Institute Berlin (ZIB) */
7 /* */
8 /* Licensed under the Apache License, Version 2.0 (the "License"); */
9 /* you may not use this file except in compliance with the License. */
10 /* You may obtain a copy of the License at */
11 /* */
12 /* http://www.apache.org/licenses/LICENSE-2.0 */
13 /* */
14 /* Unless required by applicable law or agreed to in writing, software */
15 /* distributed under the License is distributed on an "AS IS" BASIS, */
16 /* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */
17 /* See the License for the specific language governing permissions and */
18 /* limitations under the License. */
19 /* */
20 /* You should have received a copy of the Apache-2.0 license */
21 /* along with SoPlex; see the file LICENSE. If not email to soplex@zib.de. */
22 /* */
23 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
24 
25 /**@file spxleastsqsc.h
26  * @brief LP least squares scaling.
27  */
28 #ifndef _SPXLEASTSQSC_H_
29 #define _SPXLEASTSQSC_H_
30 
31 #include <assert.h>
32 #include "soplex/spxsolver.h"
33 #include "soplex/spxscaler.h"
34 #include "soplex/spxlp.h"
35 
36 
37 namespace soplex
38 {
39 
40 /**@brief Least squares scaling.
41  @ingroup Algo
42 
43  This SPxScaler implementation performs least squares scaling as suggested by Curtis and Reid in:
44  On the Automatic Scaling of Matrices for Gaussian Elimination (1972).
45 */
46 template <class R>
47 class SPxLeastSqSC : public SPxScaler<R>
48 {
49 public:
50  //-------------------------------------
51  /**@name Construction / destruction */
52  ///@{
53  /// default constructor (this scaler makes no use of inherited member m_colFirst)
54  explicit SPxLeastSqSC();
55  /// copy constructor
56  SPxLeastSqSC(const SPxLeastSqSC& old);
57  /// assignment operator
59  /// destructor
60  virtual ~SPxLeastSqSC()
61  {}
62  /// clone function for polymorphism
63  inline virtual SPxScaler<R>* clone() const override
64  {
65  return new SPxLeastSqSC(*this);
66  }
67  ///@}
68 
69  //-------------------------------------
70  /**@name Access / modification */
71  ///@{
72  /// set Real param (conjugate gradient accuracy)
73  virtual void setRealParam(R param, const char* name) override;
74  /// set int param (maximal conjugate gradient rounds)
75  virtual void setIntParam(int param, const char* name) override;
76  ///@}
77 
78  //-------------------------------------
79  /**@name Scaling */
80  ///@{
81  /// Scale the loaded SPxLP.
82  virtual void scale(SPxLPBase<R>& lp, bool persistent = true) override;
83 
84 
85 private:
86  R acrcydivisor = R(1000.0);
87  int maxrounds = 20;
88 
89 };
90 } // namespace soplex
91 
92 // For the general templated files
93 #include "spxleastsqsc.hpp"
94 
95 #endif // _SPXLEASTSQSC_H_
96 
Least squares scaling.This SPxScaler implementation performs least squares scaling as suggested by Cu...
Definition: spxleastsqsc.h:47
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:63
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:65
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:86
virtual void setRealParam(R param, const char *name) override
set Real param (conjugate gradient accuracy)
virtual ~SPxLeastSqSC()
destructor
Definition: spxleastsqsc.h:60
virtual void scale(SPxLPBase< R > &lp, bool persistent=true) override
Scale the loaded SPxLP.