ClpDynamicExampleMatrix.hpp
Go to the documentation of this file.
1 /* $Id: ClpDynamicExampleMatrix.hpp 1525 2010-02-26 17:27:59Z mjs $ */
2 // Copyright (C) 2004, International Business Machines
3 // Corporation and others. All Rights Reserved.
4 #ifndef ClpDynamicExampleMatrix_H
5 #define ClpDynamicExampleMatrix_H
6 
7 
8 #include "CoinPragma.hpp"
9 
10 #include "ClpDynamicMatrix.hpp"
11 class ClpSimplex;
32 
33 public:
36  virtual void partialPricing(ClpSimplex * model, double start, double end,
38  int & bestSequence, int & numberWanted);
39 
43  virtual void createVariable(ClpSimplex * model, int & bestSequence);
48  virtual void packDown(const int * in, int numberToPack);
50 
51 
52 
64  int numberColumns, const int * starts,
65  const double * lower, const double * upper,
66  const int * startColumn, const int * row,
67  const double * element, const double * cost,
68  const double * columnLower = NULL, const double * columnUpper = NULL,
69  const unsigned char * status = NULL,
70  const unsigned char * dynamicStatus = NULL,
71  int numberIds = 0, const int *ids = NULL);
73  ClpDynamicExampleMatrix(ClpSimplex * model, int numberSets,
74  int numberColumns, int * starts,
75  const double * lower, const double * upper,
76  int * startColumn, int * row,
77  double * element, double * cost,
78  double * columnLower = NULL, double * columnUpper = NULL,
79  const unsigned char * status = NULL,
80  const unsigned char * dynamicStatus = NULL,
81  int numberIds = 0, const int *ids = NULL);
82 
84  virtual ~ClpDynamicExampleMatrix();
86 
93  virtual ClpMatrixBase * clone() const ;
95 
97  inline CoinBigIndex * startColumnGen() const {
99  return startColumnGen_;
100  }
102  inline int * rowGen() const {
103  return rowGen_;
104  }
106  inline double * elementGen() const {
107  return elementGen_;
108  }
110  inline double * costGen() const {
111  return costGen_;
112  }
114  inline int * fullStartGen() const {
115  return fullStartGen_;
116  }
118  inline int * idGen() const {
119  return idGen_;
120  }
122  inline double * columnLowerGen() const {
123  return columnLowerGen_;
124  }
126  inline double * columnUpperGen() const {
127  return columnUpperGen_;
128  }
130  inline int numberColumns() const {
131  return numberColumns_;
132  }
133  inline void setDynamicStatusGen(int sequence, DynamicStatus status) {
134  unsigned char & st_byte = dynamicStatusGen_[sequence];
135  st_byte = static_cast<unsigned char>(st_byte & ~7);
136  st_byte = static_cast<unsigned char>(st_byte | status);
137  }
138  inline DynamicStatus getDynamicStatusGen(int sequence) const {
139  return static_cast<DynamicStatus> (dynamicStatusGen_[sequence] & 7);
140  }
142  inline bool flaggedGen(int i) const {
143  return (dynamicStatusGen_[i] & 8) != 0;
144  }
145  inline void setFlaggedGen(int i) {
146  dynamicStatusGen_[i] = static_cast<unsigned char>(dynamicStatusGen_[i] | 8);
147  }
148  inline void unsetFlagged(int i) {
149  dynamicStatusGen_[i] = static_cast<unsigned char>(dynamicStatusGen_[i] & ~8);
150  }
152 
153 
154 protected:
158  int numberColumns_;
161  CoinBigIndex * startColumnGen_;
163  int * rowGen_;
165  double * elementGen_;
167  double * costGen_;
171  unsigned char * dynamicStatusGen_;
175  int * idGen_;
177  double * columnLowerGen_;
179  double * columnUpperGen_;
181 };
182 
183 #endif
double * columnUpper() const
Optional upper bounds on columns.
virtual ~ClpDynamicExampleMatrix()
Destructor.
virtual void packDown(const int *in, int numberToPack)
If addColumn forces compression then this allows descendant to know what to do.
double * element() const
elements
CoinBigIndex * startColumnGen_
Starts of each column.
unsigned char * dynamicStatus() const
Status region for gub variables.
DynamicStatus
enums for status of various sorts
void setFlaggedGen(int i)
Starts of each column.
double * columnLower() const
Optional lower bounds on columns.
int numberSets() const
Number of sets (dynamic rows)
virtual ClpMatrixBase * clone() const
Clone.
double * cost() const
costs
void setDynamicStatusGen(int sequence, DynamicStatus status)
Starts of each column.
double * columnLowerGen() const
Optional lower bounds on columns.
virtual void createVariable(ClpSimplex *model, int &bestSequence)
Creates a variable.
int * idGen_
identifier for each variable up one level (startColumn_, etc).
virtual void partialPricing(ClpSimplex *model, double start, double end, int &bestSequence, int &numberWanted)
Partial pricing.
CoinBigIndex * startColumn() const
Starts of each column.
DynamicStatus getDynamicStatusGen(int sequence) const
Starts of each column.
This implements a dynamic matrix when we have a limit on the number of "interesting rows"...
double * columnLowerGen_
Optional lower bounds on columns.
ClpDynamicExampleMatrix()
Default constructor.
int * row() const
rows
double * columnUpperGen() const
Optional upper bounds on columns.
double * costGen() const
costs
bool flaggedGen(int i) const
Whether flagged.
This implements a dynamic matrix when we have a limit on the number of "interesting rows"...
int * fullStartGen_
start of each set
ClpDynamicExampleMatrix & operator=(const ClpDynamicExampleMatrix &)
The copy constructor.
This solves LPs using the simplex method.
Definition: ClpSimplex.hpp:49
Abstract base class for Clp Matrices.
double * columnUpperGen_
Optional upper bounds on columns.
int * idGen() const
ids in next level matrix
unsigned char * dynamicStatusGen_
for status and which bound
void unsetFlagged(int i)
Starts of each column.
CoinBigIndex * startColumnGen() const
Starts of each column.
double * elementGen() const
elements
int * fullStartGen() const
full starts