source: branches/pre/include/ClpPrimalColumnPivot.hpp @ 177

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

Comments

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.4 KB
Line 
1// Copyright (C) 2002, International Business Machines
2// Corporation and others.  All Rights Reserved.
3#ifndef ClpPrimalcolumnPivot_H
4#define ClpPrimalcolumnPivot_H
5
6class ClpSimplex;
7class CoinIndexedVector;
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
15e.g. Dantzig choice then some functions may be null.  For Dantzig
16the only one of any importance is pivotColumn.
17
18If  you wish to inherit from this look at ClpPrimalColumnDantzig.cpp
19as that is simplest version.
20*/
21
22class ClpPrimalColumnPivot  {
23 
24public:
25 
26  ///@name Algorithmic methods
27  //@{
28 
29  /** Returns pivot column, -1 if none
30
31      Normally updates reduced costs using result of last iteration
32      before selecting incoming column.
33
34      The CoinIndexedVector updates has cost updates - for normal LP
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
44      We can use other arrays to help updates
45  */
46  virtual int pivotColumn(CoinIndexedVector * updates,
47                          CoinIndexedVector * spareRow1,
48                          CoinIndexedVector * spareRow2,
49                          CoinIndexedVector * spareColumn1,
50                          CoinIndexedVector * spareColumn2) = 0;
51 
52  /// Updates weights - part 1 (may be empty)
53  virtual void updateWeights(CoinIndexedVector * input);
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;};
74  /// Gets rid of all arrays (may be empty)
75  virtual void clearArrays();
76  //@}
77 
78 
79  ///@name Constructors and destructors
80  //@{
81  /// Default Constructor
82  ClpPrimalColumnPivot(); 
83 
84  /// Copy constructor
85  ClpPrimalColumnPivot(const ClpPrimalColumnPivot &);
86 
87  /// Assignment operator
88  ClpPrimalColumnPivot & operator=(const ClpPrimalColumnPivot& rhs);
89 
90  /// Destructor
91  virtual ~ClpPrimalColumnPivot ();
92
93  /// Clone
94  virtual ClpPrimalColumnPivot * clone(bool copyData = true) const = 0;
95 
96  //@}
97
98  ///@name Other
99  //@{
100  /// Returns model
101  inline ClpSimplex * model()
102  { return model_;};
103 
104  /// Returns type (above 63 is extra information)
105  inline int type()
106  { return type_;};
107 
108  //@}
109
110  //---------------------------------------------------------------------------
111 
112protected:
113  ///@name Protected member data
114  //@{
115  /// Pointer to model
116  ClpSimplex * model_;
117  /// Type of column pivot algorithm
118  int type_;
119  //@}
120};
121
122#endif
Note: See TracBrowser for help on using the repository browser.