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

Last change on this file since 2070 was 2070, checked in by forrest, 5 years ago

for some cbc ideas

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