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