1 // Copyright (C) 2002, International Business Machines 2 // Corporation and others. All Rights Reserved. 3 /* 4 Authors 5 6 Jeremy Omer 7 8 Last update: april 10, 2015 9 10 */ 11 12 #ifndef ClpPEDualRowSteepest_H 13 #define ClpPEDualRowSteepest_H 14 15 #include "ClpDualRowSteepest.hpp" 16 #include "ClpPESimplex.hpp" 17 class CoinIndexedVector; 18 19 //############################################################################# 20 21 /** Dual Row Pivot Steepest Edge Algorithm Class 22 23 See Forrest-Goldfarb paper for algorithm 24 25 */ 26 27 class ClpPEDualRowSteepest : public ClpDualRowSteepest { 28 29 public: 30 /** Default Constructor 31 mode: 0 is uninitialized, 1 full, 2 is partial uninitialized, 32 3 starts as 2 but may switch to 1. 33 By partial is meant that the weights are updated as normal 34 but only part of the infeasible basic variables are scanned. 35 This can be faster on very easy problems. 36 */ 37 ClpPEDualRowSteepest(double psi = 0.5, int mode = 3); 38 39 /// Copy constructor 40 ClpPEDualRowSteepest(const ClpPEDualRowSteepest &); 41 42 /// Assignment operator 43 ClpPEDualRowSteepest &operator=(const ClpPEDualRowSteepest &rhs); 44 45 /// Destructor 46 virtual ~ClpPEDualRowSteepest(); 47 48 /// Clone 49 virtual ClpDualRowPivot *clone(bool copyData = true) const; 50 51 public: 52 ///@name Algorithmic methods 53 //@{ 54 55 /// Returns pivot row, -1 if none 56 virtual int pivotRow(); 57 58 /** Save weights - this may initialize weights as well 59 This is as parent but may initialize ClpPESimplex 60 */ 61 virtual void saveWeights(ClpSimplex *model, int mode); 62 /** Updates primal solution (and maybe list of candidates) 63 Uses input vector which it deletes 64 Computes change in objective function 65 As ordinary steepest but checks for zero moves 66 */ 67 virtual void updatePrimalSolution(CoinIndexedVector *input, 68 double theta, 69 double &changeInObjective); 70 //@} 71 72 // Psi psi() const73 inline double psi() const 74 { 75 return psi_; 76 } 77 78 //--------------------------------------------------------------------------- 79 80 private: 81 /* this PESimplex object is used to identify the compatible variables */ 82 ClpPESimplex *modelPE_; 83 84 /* psi is the factor used in the bi-dimensional pricing, it is < 1 and 85 1/psi grows with the priority given to compatible variables */ 86 double psi_; 87 88 /* useful counters for the update of the set of compatible variables */ 89 int iCurrent_; 90 int iInterval_; 91 92 /* record if previous iterations concluded that compatibles should not be checked */ 93 bool updateCompatibles_; 94 int coDegenCompatibles_, coConsecutiveCompatibles_; 95 }; 96 97 #endif 98 99 /* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2 100 */ 101