ClpGubDynamicMatrix.hpp
Go to the documentation of this file.
1 /* $Id: ClpGubDynamicMatrix.hpp 1525 2010-02-26 17:27:59Z mjs $ */
2 // Copyright (C) 2003, International Business Machines
3 // Corporation and others. All Rights Reserved.
4 #ifndef ClpGubDynamicMatrix_H
5 #define ClpGubDynamicMatrix_H
6 
7 
8 #include "CoinPragma.hpp"
9 
10 #include "ClpGubMatrix.hpp"
19 
20 public:
23  virtual void partialPricing(ClpSimplex * model, double start, double end,
25  int & bestSequence, int & numberWanted);
36  virtual int synchronize(ClpSimplex * model, int mode);
38  virtual void useEffectiveRhs(ClpSimplex * model, bool cheapest = true);
42  virtual int updatePivot(ClpSimplex * model, double oldInValue, double oldOutValue);
44  void insertNonBasic(int sequence, int iSet);
48  virtual double * rhsOffset(ClpSimplex * model, bool forceRefresh = false,
49  bool check = false);
50 
55  virtual void times(double scalar,
56  const double * x, double * y) const;
60  virtual int checkFeasible(ClpSimplex * model, double & sum) const;
62  void cleanData(ClpSimplex * model);
64 
65 
66 
72  virtual ~ClpGubDynamicMatrix();
74 
84  int numberColumns, const int * starts,
85  const double * lower, const double * upper,
86  const int * startColumn, const int * row,
87  const double * element, const double * cost,
88  const double * lowerColumn = NULL, const double * upperColumn = NULL,
89  const unsigned char * status = NULL);
90 
93  virtual ClpMatrixBase * clone() const ;
95 
97  enum DynamicStatus {
99  inSmall = 0x01,
100  atUpperBound = 0x02,
102  };
104  inline bool flagged(int i) const {
105  return (dynamicStatus_[i] & 8) != 0;
106  }
107  inline void setFlagged(int i) {
108  dynamicStatus_[i] = static_cast<unsigned char>(dynamicStatus_[i] | 8);
109  }
110  inline void unsetFlagged(int i) {
111  dynamicStatus_[i] = static_cast<unsigned char>(dynamicStatus_[i] & ~8);
112  }
113  inline void setDynamicStatus(int sequence, DynamicStatus status) {
114  unsigned char & st_byte = dynamicStatus_[sequence];
115  st_byte = static_cast<unsigned char>(st_byte & ~7);
116  st_byte = static_cast<unsigned char>(st_byte | status);
117  }
118  inline DynamicStatus getDynamicStatus(int sequence) const {
119  return static_cast<DynamicStatus> (dynamicStatus_[sequence] & 7);
120  }
122  inline double objectiveOffset() const {
123  return objectiveOffset_;
124  }
126  inline CoinBigIndex * startColumn() const {
127  return startColumn_;
128  }
130  inline int * row() const {
131  return row_;
132  }
134  inline double * element() const {
135  return element_;
136  }
138  inline double * cost() const {
139  return cost_;
140  }
142  inline int * fullStart() const {
143  return fullStart_;
144  }
146  inline int * id() const {
147  return id_;
148  }
150  inline double * lowerColumn() const {
151  return lowerColumn_;
152  }
154  inline double * upperColumn() const {
155  return upperColumn_;
156  }
158  inline double * lowerSet() const {
159  return lowerSet_;
160  }
162  inline double * upperSet() const {
163  return upperSet_;
164  }
166  inline int numberGubColumns() const {
167  return numberGubColumns_;
168  }
170  inline int firstAvailable() const {
171  return firstAvailable_;
172  }
174  inline void setFirstAvailable(int value) {
175  firstAvailable_ = value;
176  }
178  inline int firstDynamic() const {
179  return firstDynamic_;
180  }
182  inline int lastDynamic() const {
183  return lastDynamic_;
184  }
186  inline int numberElements() const {
187  return numberElements_;
188  }
190  inline unsigned char * gubRowStatus() const {
191  return status_;
192  }
194  inline unsigned char * dynamicStatus() const {
195  return dynamicStatus_;
196  }
198  int whichSet (int sequence) const;
200 
201 
202 protected:
206  double objectiveOffset_;
209  CoinBigIndex * startColumn_;
211  int * row_;
213  double * element_;
215  double * cost_;
217  int * fullStart_;
219  int * id_;
221  unsigned char * dynamicStatus_;
223  double * lowerColumn_;
225  double * upperColumn_;
227  double * lowerSet_;
229  double * upperSet_;
243 };
244 
245 #endif