Cbc  2.9.9
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AbcDualRowPivot.hpp
Go to the documentation of this file.
1 /* $Id: AbcDualRowPivot.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 AbcDualRowPivot_H
7 #define AbcDualRowPivot_H
8 #include "AbcCommon.hpp"
9 
10 class AbcSimplex;
11 class CoinIndexedVector;
12 
13 //#############################################################################
14 
24 
25 public:
26 
28 
29 
31  virtual int pivotRow() = 0;
32 
35  virtual double updateWeights1(CoinIndexedVector & input,CoinIndexedVector & updateColumn) = 0;
36  virtual void updateWeightsOnly(CoinIndexedVector & input) = 0;
37  virtual double updateWeights(CoinIndexedVector & input,CoinIndexedVector & updateColumn) = 0;
39  virtual void updateWeights2(CoinIndexedVector & input,CoinIndexedVector & updateColumn) = 0;
40 
46  virtual void updatePrimalSolution(CoinIndexedVector & updateColumn,
47  double theta) = 0;
48  virtual void updatePrimalSolutionAndWeights(CoinIndexedVector & weightsVector,
49  CoinIndexedVector & updateColumn,
50  double theta);
61  virtual void saveWeights(AbcSimplex * model, int mode);
63  virtual void recomputeInfeasibilities();
65  virtual void checkAccuracy();
67  virtual void clearArrays();
69  virtual bool looksOptimal() const {
70  return false;
71  }
73 
74 
76 
79 
82 
85 
87  virtual ~AbcDualRowPivot ();
88 
90  virtual AbcDualRowPivot * clone(bool copyData = true) const = 0;
91 
93 
95 
96  inline AbcSimplex * model() {
98  return model_;
99  }
100 
102  inline void setModel(AbcSimplex * newmodel) {
103  model_ = newmodel;
104  }
105 
107  inline int type() {
108  return type_;
109  }
110 
112 
113  //---------------------------------------------------------------------------
114 
115 protected:
117 
118  AbcSimplex * model_;
121  int type_;
123 };
124 #ifndef CLP_DUAL_COLUMN_MULTIPLIER
125 //#define CLP_DUAL_COLUMN_MULTIPLIER 0.99999
126 #endif
127 #endif
virtual void checkAccuracy()
checks accuracy and may re-initialize (may be empty)
virtual void updateWeightsOnly(CoinIndexedVector &input)=0
virtual double updateWeights(CoinIndexedVector &input, CoinIndexedVector &updateColumn)=0
virtual int pivotRow()=0
Returns pivot row, -1 if none.
virtual void updatePrimalSolutionAndWeights(CoinIndexedVector &weightsVector, CoinIndexedVector &updateColumn, double theta)
virtual double updateWeights1(CoinIndexedVector &input, CoinIndexedVector &updateColumn)=0
Does most of work for weights and returns pivot alpha.
Dual Row Pivot Abstract Base Class.
Indexed Vector.
AbcDualRowPivot & operator=(const AbcDualRowPivot &rhs)
Assignment operator.
void setModel(AbcSimplex *newmodel)
Sets model (normally to NULL)
int type()
Returns type (above 63 is extra information)
AbcDualRowPivot()
Default Constructor.
virtual void recomputeInfeasibilities()
Recompute infeasibilities.
AbcSimplex * model_
Pointer to model.
virtual void updatePrimalSolution(CoinIndexedVector &updateColumn, double theta)=0
Updates primal solution (and maybe list of candidates) Uses input vector which it deletes Would be fa...
virtual void updateWeights2(CoinIndexedVector &input, CoinIndexedVector &updateColumn)=0
Actually updates weights.
virtual bool looksOptimal() const
Returns true if would not find any row.
AbcSimplex * model()
Returns model.
int type_
Type of row pivot algorithm.
virtual void clearArrays()
Gets rid of all arrays (may be empty)
virtual void saveWeights(AbcSimplex *model, int mode)
Saves any weights round factorization as pivot rows may change Will be empty unless steepest edge (wi...
virtual ~AbcDualRowPivot()
Destructor.
virtual AbcDualRowPivot * clone(bool copyData=true) const =0
Clone.