Clp 1.17.6

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AbcDualRowSteepest.hpp
Go to the documentation of this file.
1 /* $Id: AbcDualRowSteepest.hpp 2385 2019-01-06 19:43:06Z unxusr $ */
2 // Copyright (C) 2002, International Business Machines
3 // Corporation and others, Copyright (C) 2012, FasterCoin. All Rights Reserved.
4 // This code is licensed under the terms of the Eclipse Public License (EPL).
5
6 #ifndef AbcDualRowSteepest_H
7 #define AbcDualRowSteepest_H
8
9 #include "AbcDualRowPivot.hpp"
10 class CoinIndexedVector;
11
12 //#############################################################################
13
20 class AbcDualRowSteepest : public AbcDualRowPivot {
21
22 public:
24
25
27 virtual int pivotRow();
28
31 virtual double updateWeights(CoinIndexedVector &input, CoinIndexedVector &updatedColumn);
32 virtual double updateWeights1(CoinIndexedVector &input, CoinIndexedVector &updateColumn);
33 virtual void updateWeightsOnly(CoinIndexedVector &input);
35 virtual void updateWeights2(CoinIndexedVector &input, CoinIndexedVector &updateColumn);
36
40 virtual void updatePrimalSolution(CoinIndexedVector &input,
41 double theta);
42
43 virtual void updatePrimalSolutionAndWeights(CoinIndexedVector &weightsVector,
44 CoinIndexedVector &updateColumn,
45 double theta);
56 virtual void saveWeights(AbcSimplex *model, int mode);
58 virtual void recomputeInfeasibilities();
60 virtual void clearArrays();
62 virtual bool looksOptimal() const;
64
67 enum Persistence {
68 normal = 0x00, // create (if necessary) and destroy
69 keep = 0x01 // create (if necessary) and leave
70 };
71
73
74
81 AbcDualRowSteepest(int mode = 3);
82
84 AbcDualRowSteepest(const AbcDualRowSteepest &);
85
87 AbcDualRowSteepest &operator=(const AbcDualRowSteepest &rhs);
88
90 void fill(const AbcDualRowSteepest &rhs);
91
93 virtual ~AbcDualRowSteepest();
94
96 virtual AbcDualRowPivot *clone(bool copyData = true) const;
97
99
101 inline int mode() const
103 {
104 return mode_;
105 }
107 inline void setPersistence(Persistence life)
108 {
109 persistence_ = life;
110 }
111 inline Persistence persistence() const
112 {
113 return persistence_;
114 }
116 inline CoinIndexedVector *infeasible() const
117 {
118 return infeasible_;
119 }
121 inline CoinIndexedVector *weights() const
122 {
123 return weights_;
124 }
126 inline AbcSimplex *model() const
127 {
128 return model_;
129 }
131
132 //---------------------------------------------------------------------------
133
134 private:
137 double norm_;
139 double factorizationRatio_;
145 int state_;
148 int mode_;
150 Persistence persistence_;
152 CoinIndexedVector *weights_;
154 CoinIndexedVector *infeasible_;
156 CoinIndexedVector *savedWeights_;
158 };
159
160 // For Devex stuff
161 #undef DEVEX_TRY_NORM
162 #define DEVEX_TRY_NORM 1.0e-8
163 #define DEVEX_ADD_ONE 1.0
164 #endif
165
166 /* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2
167 */
AbcDualRowSteepest::persistence_
Persistence persistence_
Life of weights.
Definition: AbcDualRowSteepest.hpp:150
AbcDualRowSteepest::updateWeights2
virtual void updateWeights2(CoinIndexedVector &input, CoinIndexedVector &updateColumn)
Actually updates weights.
AbcSimplex
Definition: AbcSimplex.hpp:62
AbcDualRowSteepest::infeasible_
CoinIndexedVector * infeasible_
square of infeasibility array (just for infeasible rows)
Definition: AbcDualRowSteepest.hpp:154
AbcDualRowSteepest::~AbcDualRowSteepest
virtual ~AbcDualRowSteepest()
Destructor.
AbcDualRowSteepest::model
AbcSimplex * model() const
Model.
Definition: AbcDualRowSteepest.hpp:126
AbcDualRowSteepest::updatePrimalSolutionAndWeights
virtual void updatePrimalSolutionAndWeights(CoinIndexedVector &weightsVector, CoinIndexedVector &updateColumn, double theta)
AbcDualRowSteepest::updatePrimalSolution
virtual void updatePrimalSolution(CoinIndexedVector &input, double theta)
Updates primal solution (and maybe list of candidates) Uses input vector which it deletes...
AbcDualRowSteepest::mode
int mode() const
Mode.
Definition: AbcDualRowSteepest.hpp:102
AbcDualRowSteepest::Persistence
Persistence
enums for persistence
Definition: AbcDualRowSteepest.hpp:67
AbcDualRowSteepest::keep
Definition: AbcDualRowSteepest.hpp:69
AbcDualRowSteepest::looksOptimal
virtual bool looksOptimal() const
Returns true if would not find any row.
AbcDualRowSteepest
Dual Row Pivot Steepest Edge Algorithm Class.
Definition: AbcDualRowSteepest.hpp:20
AbcDualRowSteepest::pivotRow
virtual int pivotRow()
Returns pivot row, -1 if none.
AbcDualRowSteepest::norm_
double norm_
Definition: AbcDualRowSteepest.hpp:137
AbcDualRowSteepest::state_
int state_
Status 0) Normal -1) Needs initialization 1) Weights are stored by sequence number.
Definition: AbcDualRowSteepest.hpp:145
AbcDualRowSteepest::operator=
AbcDualRowSteepest & operator=(const AbcDualRowSteepest &rhs)
Assignment operator.
AbcDualRowSteepest::recomputeInfeasibilities
virtual void recomputeInfeasibilities()
Recompute infeasibilities.
AbcDualRowSteepest::setPersistence
void setPersistence(Persistence life)
Set/ get persistence.
Definition: AbcDualRowSteepest.hpp:107
AbcDualRowPivot
Dual Row Pivot Abstract Base Class.
Definition: AbcDualRowPivot.hpp:23
CoinIndexedVector
Indexed Vector.
Definition: CoinIndexedVector.hpp:104
AbcDualRowSteepest::infeasible
CoinIndexedVector * infeasible() const
Infeasible vector.
Definition: AbcDualRowSteepest.hpp:116
AbcDualRowPivot::model_
AbcSimplex * model_
Pointer to model.
Definition: AbcDualRowPivot.hpp:122
AbcDualRowSteepest::clearArrays
virtual void clearArrays()
Gets rid of all arrays.
AbcDualRowSteepest::clone
virtual AbcDualRowPivot * clone(bool copyData=true) const
Clone.
AbcDualRowSteepest::updateWeights
virtual double updateWeights(CoinIndexedVector &input, CoinIndexedVector &updatedColumn)
Updates weights and returns pivot alpha.
AbcDualRowSteepest::saveWeights
virtual void saveWeights(AbcSimplex *model, int mode)
Saves any weights round factorization as pivot rows may change Save model May also recompute infeasib...
AbcDualRowSteepest::savedWeights_
CoinIndexedVector * savedWeights_
save weight array (so we can use checkpoint)
Definition: AbcDualRowSteepest.hpp:156
AbcDualRowSteepest::weights_
CoinIndexedVector * weights_
weight array
Definition: AbcDualRowSteepest.hpp:152
AbcDualRowSteepest::persistence
Persistence persistence() const
Definition: AbcDualRowSteepest.hpp:111
AbcDualRowSteepest::normal
Definition: AbcDualRowSteepest.hpp:68
AbcDualRowSteepest::AbcDualRowSteepest
AbcDualRowSteepest(int mode=3)
Default Constructor 0 is uninitialized, 1 full, 2 is partial uninitialized, 3 starts as 2 but may swi...
AbcDualRowSteepest::mode_
int mode_
If 0 then we are using uninitialized weights, 1 then full, if 2 then uninitialized partial...
Definition: AbcDualRowSteepest.hpp:148
AbcDualRowSteepest::weights
CoinIndexedVector * weights() const
Weights vector.
Definition: AbcDualRowSteepest.hpp:121
AbcDualRowSteepest::updateWeightsOnly
virtual void updateWeightsOnly(CoinIndexedVector &input)
AbcDualRowSteepest::updateWeights1
virtual double updateWeights1(CoinIndexedVector &input, CoinIndexedVector &updateColumn)
Does most of work for weights and returns pivot alpha.
AbcDualRowSteepest::factorizationRatio_
double factorizationRatio_
Ratio of size of factorization to number of rows.
Definition: AbcDualRowSteepest.hpp:139
AbcDualRowPivot.hpp
AbcDualRowSteepest::fill
void fill(const AbcDualRowSteepest &rhs)
Fill most values.