# source:branches/pre/include/ClpPrimalColumnPivot.hpp@180

Last change on this file since 180 was 180, checked in by forrest, 17 years ago

new stuff

• Property svn:eol-style set to `native`
• Property svn:keywords set to `Author Date Id Revision`
File size: 3.5 KB
RevLine
3#ifndef ClpPrimalcolumnPivot_H
4#define ClpPrimalcolumnPivot_H
5
6class ClpSimplex;
[50]7class CoinIndexedVector;
[2]8
9//#############################################################################
10
11/** Primal Column Pivot Abstract Base Class
12
13Abstract Base Class for describing an interface to an algorithm
14to choose column pivot in primal simplex algorithm.  For some algorithms
[74]15e.g. Dantzig choice then some functions may be null.  For Dantzig
16the only one of any importance is pivotColumn.
[2]17
[74]18If  you wish to inherit from this look at ClpPrimalColumnDantzig.cpp
19as that is simplest version.
[2]20*/
21
22class ClpPrimalColumnPivot  {
23
24public:
25
26  ///@name Algorithmic methods
27  //@{
28
29  /** Returns pivot column, -1 if none
[74]30
31      Normally updates reduced costs using result of last iteration
32      before selecting incoming column.
33
35      that is just +-weight where a feasibility changed.
36
37      Inside pivotColumn the pivotRow_ and reduced cost from last iteration
38      are also used.
39
40      So in the simplest case i.e. feasible we compute the row of the
41      tableau corresponding to last pivot and add a multiple of this
42      to current reduced costs.
43
[2]44      We can use other arrays to help updates
45  */
[50]46  virtual int pivotColumn(CoinIndexedVector * updates,
47                          CoinIndexedVector * spareRow1,
48                          CoinIndexedVector * spareRow2,
49                          CoinIndexedVector * spareColumn1,
50                          CoinIndexedVector * spareColumn2) = 0;
[2]51
52  /// Updates weights - part 1 (may be empty)
[50]53  virtual void updateWeights(CoinIndexedVector * input);
[2]54
55  /** Saves any weights round factorization as pivot rows may change
56      Will be empty unless steepest edge (will save model)
57      May also recompute infeasibility stuff
58      1) before factorization
59      2) after good factorization (if weights empty may initialize)
60      3) after something happened but no factorization
61         (e.g. check for infeasible)
62      4) as 2 but restore weights from previous snapshot
63      5) forces some initialization e.g. weights
64      Also sets model
65  */
66  virtual void saveWeights(ClpSimplex * model,int mode)=0;
67  /** Signals pivot row choice:
68      -2 (default) - use normal pivot row choice
69      -1 to numberRows-1 - use this (will be checked)
70      way should be -1 to go to lower bound, +1 to upper bound
71  */
72  virtual int pivotRow(double & way)
73  {way=0;return -2;};
[50]74  /// Gets rid of all arrays (may be empty)
75  virtual void clearArrays();
[180]76  /// Returns true if would not find any column
77  virtual bool looksOptimal() const
78  { return false;};
[2]79  //@}
80
81
82  ///@name Constructors and destructors
83  //@{
84  /// Default Constructor
85  ClpPrimalColumnPivot();
86
87  /// Copy constructor
88  ClpPrimalColumnPivot(const ClpPrimalColumnPivot &);
89
90  /// Assignment operator
91  ClpPrimalColumnPivot & operator=(const ClpPrimalColumnPivot& rhs);
92
93  /// Destructor
94  virtual ~ClpPrimalColumnPivot ();
95
96  /// Clone
97  virtual ClpPrimalColumnPivot * clone(bool copyData = true) const = 0;
98
99  //@}
100
101  ///@name Other
102  //@{
103  /// Returns model
104  inline ClpSimplex * model()
105  { return model_;};
106
[50]107  /// Returns type (above 63 is extra information)
[2]108  inline int type()
109  { return type_;};
110
111  //@}
112
113  //---------------------------------------------------------------------------
114
115protected:
116  ///@name Protected member data
117  //@{
118  /// Pointer to model
119  ClpSimplex * model_;
120  /// Type of column pivot algorithm
121  int type_;
122  //@}
123};
124
125#endif
Note: See TracBrowser for help on using the repository browser.