1 | /* $Id: AbcDualRowDantzig.hpp 1665 2011-01-04 17:55:54Z lou $ */ |
---|
2 | // Copyright (C) 2002, International Business Machines |
---|
3 | // Corporation and others, Copyright (C) 2012, FasterCoin. All Rights Reserved. |
---|
4 | // This code is licensed under the terms of the Eclipse Public License (EPL). |
---|
5 | |
---|
6 | #ifndef AbcDualRowDantzig_H |
---|
7 | #define AbcDualRowDantzig_H |
---|
8 | |
---|
9 | #include "AbcDualRowPivot.hpp" |
---|
10 | |
---|
11 | //############################################################################# |
---|
12 | |
---|
13 | /** Dual Row Pivot Dantzig Algorithm Class |
---|
14 | |
---|
15 | This is simplest choice - choose largest infeasibility |
---|
16 | |
---|
17 | */ |
---|
18 | |
---|
19 | class AbcDualRowDantzig : public AbcDualRowPivot { |
---|
20 | |
---|
21 | public: |
---|
22 | |
---|
23 | ///@name Algorithmic methods |
---|
24 | //@{ |
---|
25 | |
---|
26 | /// Returns pivot row, -1 if none |
---|
27 | virtual int pivotRow(); |
---|
28 | |
---|
29 | /** Updates weights and returns pivot alpha. |
---|
30 | Also does FT update */ |
---|
31 | virtual double updateWeights(CoinIndexedVector & input,CoinIndexedVector & updatedColumn); |
---|
32 | virtual double updateWeights1(CoinIndexedVector & input,CoinIndexedVector & updateColumn); |
---|
33 | virtual void updateWeightsOnly(CoinIndexedVector & /*input*/) {}; |
---|
34 | /// Actually updates weights |
---|
35 | virtual void updateWeights2(CoinIndexedVector & input,CoinIndexedVector & /*updateColumn*/) {input.clear();}; |
---|
36 | /** Updates primal solution (and maybe list of candidates) |
---|
37 | Uses input vector which it deletes |
---|
38 | Computes change in objective function |
---|
39 | */ |
---|
40 | virtual void updatePrimalSolution(CoinIndexedVector & input, |
---|
41 | double theta); |
---|
42 | /** Saves any weights round factorization as pivot rows may change |
---|
43 | Will be empty unless steepest edge (will save model) |
---|
44 | May also recompute infeasibility stuff |
---|
45 | 1) before factorization |
---|
46 | 2) after good factorization (if weights empty may initialize) |
---|
47 | 3) after something happened but no factorization |
---|
48 | (e.g. check for infeasible) |
---|
49 | 4) as 2 but restore weights from previous snapshot |
---|
50 | 5) for strong branching - initialize , infeasibilities |
---|
51 | */ |
---|
52 | virtual void saveWeights(AbcSimplex * model, int mode); |
---|
53 | /// Recompute infeasibilities |
---|
54 | virtual void recomputeInfeasibilities(); |
---|
55 | //@} |
---|
56 | |
---|
57 | |
---|
58 | ///@name Constructors and destructors |
---|
59 | //@{ |
---|
60 | /// Default Constructor |
---|
61 | AbcDualRowDantzig(); |
---|
62 | |
---|
63 | /// Copy constructor |
---|
64 | AbcDualRowDantzig(const AbcDualRowDantzig &); |
---|
65 | |
---|
66 | /// Assignment operator |
---|
67 | AbcDualRowDantzig & operator=(const AbcDualRowDantzig& rhs); |
---|
68 | |
---|
69 | /// Destructor |
---|
70 | virtual ~AbcDualRowDantzig (); |
---|
71 | |
---|
72 | /// Clone |
---|
73 | virtual AbcDualRowPivot * clone(bool copyData = true) const; |
---|
74 | |
---|
75 | //@} |
---|
76 | |
---|
77 | //--------------------------------------------------------------------------- |
---|
78 | |
---|
79 | private: |
---|
80 | ///@name Private member data |
---|
81 | /// infeasibility array (just for infeasible rows) |
---|
82 | CoinIndexedVector * infeasible_; |
---|
83 | //@} |
---|
84 | }; |
---|
85 | |
---|
86 | #endif |
---|