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

Last change on this file since 1055 was 1055, checked in by forrest, 12 years ago

out };

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