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 spxgeometsc.h 26 * @brief LP geometric mean scaling. 27 */ 28 #ifndef _SPXGEOMETSC_H_ 29 #define _SPXGEOMETSC_H_ 30 31 #include <assert.h> 32 33 #include "soplex/spxdefines.h" 34 #include "soplex/spxscaler.h" 35 36 namespace soplex 37 { 38 /**@brief Geometric mean row/column scaling. 39 @ingroup Algo 40 41 This SPxScaler implementation performs geometric mean scaling of the 42 LPs rows and columns. 43 */ 44 template <class R> 45 class SPxGeometSC : public SPxScaler<R> 46 { 47 protected: 48 49 //------------------------------------- 50 /**@name Data */ 51 ///@{ 52 const bool postequilibration; ///< equilibrate after geometric scaling? 53 const int m_maxIterations; ///< maximum number of scaling iterations. 54 const R m_minImprovement; ///< improvement necessary to carry on. (Bixby said Fourer said in MP 23, 274 ff. that 0.9 is a good value) 55 const R m_goodEnoughRatio; ///< no scaling needed if ratio is less than this. 56 ///@} 57 58 public: 59 60 //------------------------------------- 61 /**@name Construction / destruction */ 62 ///@{ 63 /// default constructor (this scaler makes no use of inherited members m_colFirst and m_doBoth) 64 explicit SPxGeometSC(bool equilibrate = false, int maxIters = 8, R minImpr = 0.85, 65 R goodEnough = 1e3); 66 /// copy constructor 67 SPxGeometSC(const SPxGeometSC& old); 68 /// assignment operator 69 SPxGeometSC& operator=(const SPxGeometSC&); 70 /// destructor 71 virtual ~SPxGeometSC() 72 {} 73 /// clone function for polymorphism 74 inline virtual SPxScaler<R>* clone() const override 75 { 76 return new SPxGeometSC(*this); 77 } 78 ///@} 79 80 //------------------------------------- 81 /**@name Scaling */ 82 ///@{ 83 /// Scale the loaded SPxLPBase<R>. 84 virtual void scale(SPxLPBase<R>& lp, bool persistent = true) override; 85 ///@} 86 87 }; 88 } // namespace soplex 89 90 #include "spxgeometsc.hpp" 91 92 #endif // _SPXGEOMETSC_H_ 93