CbcFathomDynamicProgramming.hpp
Go to the documentation of this file.
1 /* $Id: CbcFathomDynamicProgramming.hpp 1432 2010-02-07 19:33:53Z bjarni $ */
2 // Copyright (C) 2004, International Business Machines
3 // Corporation and others. All Rights Reserved.
4 #ifndef CbcFathomDynamicProgramming_H
5 #define CbcFathomDynamicProgramming_H
6 
7 #include "CbcFathom.hpp"
8 
9 //#############################################################################
27 public:
28  // Default Constructor
30 
31  // Constructor with model - assumed before cuts
33  // Copy constructor
35 
37 
39  virtual void setModel(CbcModel * model);
40 
42  virtual CbcFathom * clone() const;
43 
45  virtual void resetModel(CbcModel * model);
46 
55  virtual int fathom(double *& newSolution);
56 
58  inline int maximumSize() const {
59  return maximumSizeAllowed_;
60  }
61  inline void setMaximumSize(int value) {
62  maximumSizeAllowed_ = value;
63  }
65  int checkPossible(int allowableSize = 0);
66  // set algorithm
67  inline void setAlgorithm(int value) {
68  algorithm_ = value;
69  }
73  bool tryColumn(int numberElements, const int * rows,
74  const double * coefficients, double cost,
75  int upper = COIN_INT_MAX);
77  inline const double * cost() const {
78  return cost_;
79  }
81  inline const int * back() const {
82  return back_;
83  }
85  inline int target() const {
86  return target_;
87  }
89  inline void setTarget(int value) {
90  target_ = value;
91  }
92 private:
94  void gutsOfDelete();
95 
99  bool addOneColumn0(int numberElements, const int * rows,
100  double cost);
105  bool addOneColumn1(int numberElements, const int * rows,
106  const int * coefficients, double cost);
112  bool addOneColumn1A(int numberElements, const int * rows,
113  const int * coefficients, double cost);
115  int bitPattern(int numberElements, const int * rows,
116  const int * coefficients);
118  int bitPattern(int numberElements, const int * rows,
119  const double * coefficients);
121  int decodeBitPattern(int bitPattern, int * values, int numberRows);
122 
123 protected:
124 
126  int size_;
130  int type_;
132  double * cost_;
134  int * back_;
136  int * lookup_;
138  int * indices_;
144  int * startBit_;
146  int * numberBits_;
148  int * rhs_;
152  int target_;
159 private:
160 
163 
164 };
165 
166 #endif
167