Clp  1.16.11
AbcDualRowSteepest.hpp
Go to the documentation of this file.
1 /* $Id: AbcDualRowSteepest.hpp 1910 2013-01-27 02:00:13Z stefan $ */
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 //#############################################################################
14 
22 
23 public:
24 
26 
27 
29  virtual int pivotRow();
30 
33  virtual double updateWeights(CoinIndexedVector & input,CoinIndexedVector & updatedColumn);
34  virtual double updateWeights1(CoinIndexedVector & input,CoinIndexedVector & updateColumn);
35  virtual void updateWeightsOnly(CoinIndexedVector & input);
37  virtual void updateWeights2(CoinIndexedVector & input,CoinIndexedVector & updateColumn);
38 
42  virtual void updatePrimalSolution(CoinIndexedVector & input,
43  double theta);
44 
45  virtual void updatePrimalSolutionAndWeights(CoinIndexedVector & weightsVector,
46  CoinIndexedVector & updateColumn,
47  double theta);
58  virtual void saveWeights(AbcSimplex * model, int mode);
60  virtual void recomputeInfeasibilities();
62  virtual void clearArrays();
64  virtual bool looksOptimal() const;
66 
69  enum Persistence {
70  normal = 0x00, // create (if necessary) and destroy
71  keep = 0x01 // create (if necessary) and leave
72  };
73 
75 
76 
84 
87 
90 
92  void fill(const AbcDualRowSteepest& rhs);
93 
95  virtual ~AbcDualRowSteepest ();
96 
98  virtual AbcDualRowPivot * clone(bool copyData = true) const;
99 
101 
103  inline int mode() const {
105  return mode_;
106  }
108  inline void setPersistence(Persistence life) {
109  persistence_ = life;
110  }
111  inline Persistence persistence() const {
112  return persistence_ ;
113  }
115  inline CoinIndexedVector * infeasible() const
116  { return infeasible_;}
118  inline CoinIndexedVector * weights() const
119  { return weights_;}
121  inline AbcSimplex * model() const
122  { return model_;}
124 
125  //---------------------------------------------------------------------------
126 
127 private:
130  double norm_;
132  double factorizationRatio_;
138  int state_;
141  int mode_;
143  Persistence persistence_;
145  CoinIndexedVector * weights_;
147  CoinIndexedVector * infeasible_;
149  CoinIndexedVector * savedWeights_;
151 };
152 
153 // For Devex stuff
154 #undef DEVEX_TRY_NORM
155 #define DEVEX_TRY_NORM 1.0e-8
156 #define DEVEX_ADD_ONE 1.0
157 #endif
AbcDualRowSteepest::model
AbcSimplex * model() const
Model.
Definition: AbcDualRowSteepest.hpp:121
AbcDualRowSteepest::looksOptimal
virtual bool looksOptimal() const
Returns true if would not find any row.
AbcDualRowSteepest::updateWeights
virtual double updateWeights(CoinIndexedVector &input, CoinIndexedVector &updatedColumn)
Updates weights and returns pivot alpha.
AbcDualRowSteepest::updateWeights1
virtual double updateWeights1(CoinIndexedVector &input, CoinIndexedVector &updateColumn)
Does most of work for weights and returns pivot alpha.
AbcDualRowSteepest::clone
virtual AbcDualRowPivot * clone(bool copyData=true) const
Clone.
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::clearArrays
virtual void clearArrays()
Gets rid of all arrays.
AbcDualRowSteepest
Dual Row Pivot Steepest Edge Algorithm Class.
Definition: AbcDualRowSteepest.hpp:21
AbcDualRowSteepest::Persistence
Persistence
enums for persistence
Definition: AbcDualRowSteepest.hpp:69
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::updateWeightsOnly
virtual void updateWeightsOnly(CoinIndexedVector &input)
AbcDualRowPivot
Dual Row Pivot Abstract Base Class.
Definition: AbcDualRowPivot.hpp:23
AbcDualRowSteepest::keep
@ keep
Definition: AbcDualRowSteepest.hpp:71
AbcDualRowSteepest::fill
void fill(const AbcDualRowSteepest &rhs)
Fill most values.
AbcDualRowSteepest::mode
int mode() const
Mode.
Definition: AbcDualRowSteepest.hpp:104
AbcDualRowSteepest::persistence
Persistence persistence() const
Definition: AbcDualRowSteepest.hpp:111
AbcDualRowSteepest::updatePrimalSolution
virtual void updatePrimalSolution(CoinIndexedVector &input, double theta)
Updates primal solution (and maybe list of candidates) Uses input vector which it deletes.
AbcSimplex
Definition: AbcSimplex.hpp:62
AbcDualRowSteepest::updatePrimalSolutionAndWeights
virtual void updatePrimalSolutionAndWeights(CoinIndexedVector &weightsVector, CoinIndexedVector &updateColumn, double theta)
AbcDualRowSteepest::infeasible
CoinIndexedVector * infeasible() const
Infeasible vector.
Definition: AbcDualRowSteepest.hpp:115
AbcDualRowSteepest::~AbcDualRowSteepest
virtual ~AbcDualRowSteepest()
Destructor.
AbcDualRowSteepest::AbcDualRowSteepest
AbcDualRowSteepest(const AbcDualRowSteepest &)
Copy constructor.
AbcDualRowSteepest::weights
CoinIndexedVector * weights() const
Weights vector.
Definition: AbcDualRowSteepest.hpp:118
AbcDualRowSteepest::pivotRow
virtual int pivotRow()
Returns pivot row, -1 if none.
AbcDualRowSteepest::operator=
AbcDualRowSteepest & operator=(const AbcDualRowSteepest &rhs)
Assignment operator.
AbcDualRowPivot.hpp
AbcDualRowPivot::model_
AbcSimplex * model_
Pointer to model.
Definition: AbcDualRowPivot.hpp:119
AbcDualRowSteepest::setPersistence
void setPersistence(Persistence life)
Set/ get persistence.
Definition: AbcDualRowSteepest.hpp:108
AbcDualRowSteepest::normal
@ normal
Definition: AbcDualRowSteepest.hpp:70
AbcDualRowSteepest::updateWeights2
virtual void updateWeights2(CoinIndexedVector &input, CoinIndexedVector &updateColumn)
Actually updates weights.
AbcDualRowSteepest::recomputeInfeasibilities
virtual void recomputeInfeasibilities()
Recompute infeasibilities.