source: stable/1.6/Clp/src/ClpDualRowSteepest.hpp @ 1609

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

out };

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.7 KB
Line 
1// Copyright (C) 2002, International Business Machines
2// Corporation and others.  All Rights Reserved.
3#ifndef ClpDualRowSteepest_H
4#define ClpDualRowSteepest_H
5
6#include "ClpDualRowPivot.hpp"
7class CoinIndexedVector;
8
9
10//#############################################################################
11
12/** Dual Row Pivot Steepest Edge Algorithm Class
13
14See Forrest-Goldfarb paper for algorithm
15
16*/
17
18class ClpDualRowSteepest : public ClpDualRowPivot {
19 
20public:
21 
22  ///@name Algorithmic methods
23  //@{
24 
25  /// Returns pivot row, -1 if none
26  virtual int pivotRow();
27 
28  /// Updates weights and returns pivot alpha
29  virtual double updateWeights(CoinIndexedVector * input,
30                             CoinIndexedVector * spare,
31                             CoinIndexedVector * updatedColumn);
32 
33  /** Updates primal solution (and maybe list of candidates)
34      Uses input vector which it deletes
35      Computes change in objective function
36  */
37  virtual void updatePrimalSolution(CoinIndexedVector * input,
38                                    double theta,
39                                    double & changeInObjective);
40
41  /** Saves any weights round factorization as pivot rows may change
42      Save model
43      May also recompute infeasibility stuff
44      1) before factorization
45      2) after good factorization (if weights empty may initialize)
46      3) after something happened but no factorization
47         (e.g. check for infeasible)
48      4) as 2 but restore weights from previous snapshot
49      5) for strong branching - initialize (uninitialized) , infeasibilities
50  */
51  virtual void saveWeights(ClpSimplex * model, int mode);
52  /// Gets rid of last update
53  virtual void unrollWeights();
54  /// Gets rid of all arrays
55  virtual void clearArrays();
56  /// Returns true if would not find any row
57  virtual bool looksOptimal() const;
58  /// Called when maximum pivots changes
59  virtual void maximumPivotsChanged();
60  //@}
61 
62  /** enums for persistence
63  */
64  enum Persistence {
65    normal = 0x00, // create (if necessary) and destroy
66    keep = 0x01 // create (if necessary) and leave
67  };
68 
69  ///@name Constructors and destructors
70  //@{
71  /** Default Constructor
72      0 is uninitialized, 1 full, 2 is partial uninitialized,
73      3 starts as 2 but may switch to 1.
74      By partial is meant that the weights are updated as normal
75      but only part of the infeasible basic variables are scanned. 
76      This can be faster on very easy problems.
77  */
78  ClpDualRowSteepest(int mode=3); 
79 
80  /// Copy constructor
81  ClpDualRowSteepest(const ClpDualRowSteepest &);
82 
83  /// Assignment operator
84  ClpDualRowSteepest & operator=(const ClpDualRowSteepest& rhs);
85 
86  /// Destructor
87  virtual ~ClpDualRowSteepest ();
88
89  /// Clone
90  virtual ClpDualRowPivot * clone(bool copyData = true) const;
91 
92   //@}
93  /**@name gets and sets */
94  //@{
95  /// Mode
96  inline int mode() const
97    { return mode_;}
98  /// Set/ get persistence
99  inline void setPersistence(Persistence life)
100  { persistence_ = life;}
101  inline Persistence persistence() const
102  { return persistence_ ;}
103 //@}
104
105  //---------------------------------------------------------------------------
106 
107private:
108  ///@name Private member data
109  /** Status
110      0) Normal
111      -1) Needs initialization
112      1) Weights are stored by sequence number
113  */
114  int state_;
115  /** If 0 then we are using uninitialized weights, 1 then full,
116      if 2 then uninitialized partial, 3 switchable */
117  int mode_;
118  /// Life of weights
119  Persistence persistence_;
120  /// weight array
121  double * weights_;
122  /// square of infeasibility array (just for infeasible rows)
123  CoinIndexedVector * infeasible_;
124  /// alternate weight array (so we can unroll)
125  CoinIndexedVector * alternateWeights_;
126  /// save weight array (so we can use checkpoint)
127  CoinIndexedVector * savedWeights_;
128  /// Dubious weights
129  int * dubiousWeights_;
130  //@}
131};
132
133#endif
Note: See TracBrowser for help on using the repository browser.