source: trunk/Clp/src/ClpDualRowPivot.hpp @ 1370

Last change on this file since 1370 was 1370, checked in by forrest, 10 years ago

add ids

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 3.2 KB
Line 
1/* $Id: ClpDualRowPivot.hpp 1370 2009-06-04 09:37:13Z forrest $ */
2// Copyright (C) 2002, International Business Machines
3// Corporation and others.  All Rights Reserved.
4#ifndef ClpDualRowPivot_H
5#define ClpDualRowPivot_H
6
7class ClpSimplex;
8class CoinIndexedVector;
9
10//#############################################################################
11
12/** Dual Row Pivot Abstract Base Class
13
14Abstract Base Class for describing an interface to an algorithm
15to choose row pivot in dual simplex algorithm.  For some algorithms
16e.g. Dantzig choice then some functions may be null.
17
18*/
19
20class ClpDualRowPivot  {
21 
22public:
23 
24  ///@name Algorithmic methods
25  //@{
26 
27  /// Returns pivot row, -1 if none
28  virtual int pivotRow() = 0;
29 
30  /** Updates weights and returns pivot alpha.
31      Also does FT update */
32  virtual double updateWeights(CoinIndexedVector * input,
33                             CoinIndexedVector * spare,
34                             CoinIndexedVector * spare2,
35                             CoinIndexedVector * updatedColumn) = 0;
36 
37  /** Updates primal solution (and maybe list of candidates)
38      Uses input vector which it deletes
39      Computes change in objective function
40      Would be faster if we kept basic regions, but on other hand it
41      means everything is always in sync
42  */
43   /* FIXME: this was pure virtul (=0). Why? */
44  virtual void updatePrimalSolution(CoinIndexedVector * input,
45                                    double theta,
46                                    double & changeInObjective) = 0;
47  /** Saves any weights round factorization as pivot rows may change
48      Will be empty unless steepest edge (will save model)
49      May also recompute infeasibility stuff
50      1) before factorization
51      2) after good factorization (if weights empty may initialize)
52      3) after something happened but no factorization
53         (e.g. check for infeasible)
54      4) as 2 but restore weights from previous snapshot
55      5) for strong branching - initialize  , infeasibilities
56  */
57  virtual void saveWeights(ClpSimplex * model,int mode);
58  /// checks accuracy and may re-initialize (may be empty)
59  virtual void checkAccuracy();
60  /// Gets rid of last update (may be empty)
61  virtual void unrollWeights();
62  /// Gets rid of all arrays (may be empty)
63  virtual void clearArrays();
64  /// Returns true if would not find any row
65  virtual bool looksOptimal() const
66  { return false;}
67  /// Called when maximum pivots changes
68  virtual void maximumPivotsChanged() {}
69  //@}
70 
71 
72  ///@name Constructors and destructors
73  //@{
74  /// Default Constructor
75  ClpDualRowPivot(); 
76 
77  /// Copy constructor
78  ClpDualRowPivot(const ClpDualRowPivot &);
79 
80  /// Assignment operator
81  ClpDualRowPivot & operator=(const ClpDualRowPivot& rhs);
82 
83  /// Destructor
84  virtual ~ClpDualRowPivot ();
85
86  /// Clone
87  virtual ClpDualRowPivot * clone(bool copyData = true) const = 0;
88 
89  //@}
90
91  ///@name Other
92  //@{
93  /// Returns model
94  inline ClpSimplex * model()
95  { return model_;}
96 
97  /// Sets model (normally to NULL)
98  inline void setModel(ClpSimplex * model)
99  { model_=model;}
100 
101  /// Returns type (above 63 is extra information)
102  inline int type()
103  { return type_;}
104 
105  //@}
106
107  //---------------------------------------------------------------------------
108 
109protected:
110  ///@name Protected member data
111  //@{
112  /// Pointer to model
113  ClpSimplex * model_;
114  /// Type of row pivot algorithm
115  int type_;
116  //@}
117};
118
119#endif
Note: See TracBrowser for help on using the repository browser.