source: trunk/Clp/src/ClpPEPrimalColumnSteepest.hpp

Last change on this file was 2385, checked in by unxusr, 11 months ago

formatting

File size: 3.1 KB
Line 
1// Copyright (C) 2002, International Business Machines
2// Corporation and others.  All Rights Reserved.
3/*
4   Authors
5
6   Jeremy Omer, Mehdi Towhidi
7
8   Last update: april 10, 2015
9
10 */
11
12#ifndef ClpPEPrimalColumnSteepest_H
13#define ClpPEPrimalColumnSteepest_H
14
15#include "ClpPrimalColumnSteepest.hpp"
16#include "ClpFactorization.hpp"
17#include "ClpPESimplex.hpp"
18#include <bitset>
19
20//#############################################################################
21class CoinIndexedVector;
22
23/** Primal Column Pivot Steepest Edge Algorithm Class
24
25See Forrest-Goldfarb paper for algorithm
26
27*/
28
29class ClpPEPrimalColumnSteepest : public ClpPrimalColumnSteepest {
30public:
31  ///@name Constructors and destructors
32  //@{
33  /** Default Constructor
34         0 is exact devex, 1 full steepest, 2 is partial exact devex
35         3 switches between 0 and 2 depending on factorization
36         4 starts as partial dantzig/devex but then may switch between 0 and 2.
37         By partial exact devex is meant that the weights are updated as normal
38         but only part of the nonbasic variables are scanned.
39         This can be faster on very easy problems.
40     */
41  ClpPEPrimalColumnSteepest(double psi = 0.5, int mode = 3);
42
43  /// Copy constructor
44  ClpPEPrimalColumnSteepest(const ClpPEPrimalColumnSteepest &rhs);
45
46  /// Assignment operator
47  ClpPEPrimalColumnSteepest &operator=(const ClpPEPrimalColumnSteepest &rhs);
48
49  /// Destructor
50  virtual ~ClpPEPrimalColumnSteepest();
51
52  /// Clone
53  virtual ClpPrimalColumnPivot *clone(bool copyData = true) const;
54
55public:
56  ///@name Algorithmic methods
57  //@{
58
59  /** Returns pivot column, -1 if none.
60         The Packed CoinIndexedVector updates has cost updates - for normal LP
61         that is just +-weight where a feasibility changed.  It also has
62         reduced cost from last iteration in pivot row
63         Parts of operation split out into separate functions for
64         profiling and speed
65     */
66  virtual int pivotColumn(CoinIndexedVector *updates,
67    CoinIndexedVector *spareRow1,
68    CoinIndexedVector *spareRow2,
69    CoinIndexedVector *spareColumn1,
70    CoinIndexedVector *spareColumn2);
71
72  //@}
73  /** Save weights - this may initialize weights as well
74         This is as parent but may initialize ClpPESimplex
75     */
76  virtual void saveWeights(ClpSimplex *model, int mode);
77  /// Updates weights - as ordinary but checks for zero moves
78  virtual void updateWeights(CoinIndexedVector *input);
79  //---------------------------------------------------------------------------
80  // Psi
81  inline double psi() const
82  {
83    return psi_;
84  }
85
86private:
87  /* this PESimplex object is used to identify the compatible variables */
88  ClpPESimplex *modelPE_;
89
90  /* psi is the factor used in the bi-dimensional pricing, it is < 1 and
91       1/psi grows with the priority given to compatible variables */
92  double psi_;
93
94  /* useful counters for the update of the set of compatible variables */
95  int iCurrent_;
96  int iInterval_;
97
98  /* record if previous iterations concluded that compatibles should not be checked */
99  int coDegenCompatibles_;
100  int coConsecutiveCompatibles_;
101  bool updateCompatibles_;
102};
103
104#endif
105
106/* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2
107*/
Note: See TracBrowser for help on using the repository browser.