ClpDynamicExampleMatrix.hpp
Go to the documentation of this file.
1 /* $Id: ClpDynamicExampleMatrix.hpp 1936 2013-04-09 10:29:27Z forrest $ */
2 // Copyright (C) 2004, International Business Machines
3 // Corporation and others. All Rights Reserved.
4 // This code is licensed under the terms of the Eclipse Public License (EPL).
5 
6 #ifndef ClpDynamicExampleMatrix_H
7 #define ClpDynamicExampleMatrix_H
8 
9 
10 #include "CoinPragma.hpp"
11 
12 #include "ClpDynamicMatrix.hpp"
13 class ClpSimplex;
34 
35 public:
38  virtual void partialPricing(ClpSimplex * model, double start, double end,
40  int & bestSequence, int & numberWanted);
41 
45  virtual void createVariable(ClpSimplex * model, int & bestSequence);
50  virtual void packDown(const int * in, int numberToPack);
52 
53 
54 
66  int numberColumns, const int * starts,
67  const double * lower, const double * upper,
68  const int * startColumn, const int * row,
69  const double * element, const double * cost,
70  const double * columnLower = NULL, const double * columnUpper = NULL,
71  const unsigned char * status = NULL,
72  const unsigned char * dynamicStatus = NULL,
73  int numberIds = 0, const int *ids = NULL);
74 #if 0
75  ClpDynamicExampleMatrix(ClpSimplex * model, int numberSets,
77  int numberColumns, int * starts,
78  const double * lower, const double * upper,
79  int * startColumn, int * row,
80  double * element, double * cost,
81  double * columnLower = NULL, double * columnUpper = NULL,
82  const unsigned char * status = NULL,
83  const unsigned char * dynamicStatus = NULL,
84  int numberIds = 0, const int *ids = NULL);
85 #endif
86 
87  virtual ~ClpDynamicExampleMatrix();
89 
96  virtual ClpMatrixBase * clone() const ;
98 
100  inline CoinBigIndex * startColumnGen() const {
102  return startColumnGen_;
103  }
105  inline int * rowGen() const {
106  return rowGen_;
107  }
109  inline double * elementGen() const {
110  return elementGen_;
111  }
113  inline double * costGen() const {
114  return costGen_;
115  }
117  inline int * fullStartGen() const {
118  return fullStartGen_;
119  }
121  inline int * idGen() const {
122  return idGen_;
123  }
125  inline double * columnLowerGen() const {
126  return columnLowerGen_;
127  }
129  inline double * columnUpperGen() const {
130  return columnUpperGen_;
131  }
133  inline int numberColumns() const {
134  return numberColumns_;
135  }
136  inline void setDynamicStatusGen(int sequence, DynamicStatus status) {
137  unsigned char & st_byte = dynamicStatusGen_[sequence];
138  st_byte = static_cast<unsigned char>(st_byte & ~7);
139  st_byte = static_cast<unsigned char>(st_byte | status);
140  }
141  inline DynamicStatus getDynamicStatusGen(int sequence) const {
142  return static_cast<DynamicStatus> (dynamicStatusGen_[sequence] & 7);
143  }
145  inline bool flaggedGen(int i) const {
146  return (dynamicStatusGen_[i] & 8) != 0;
147  }
148  inline void setFlaggedGen(int i) {
149  dynamicStatusGen_[i] = static_cast<unsigned char>(dynamicStatusGen_[i] | 8);
150  }
151  inline void unsetFlagged(int i) {
152  dynamicStatusGen_[i] = static_cast<unsigned char>(dynamicStatusGen_[i] & ~8);
153  }
155 
156 
157 protected:
161  int numberColumns_;
166  int * rowGen_;
168  double * elementGen_;
170  double * costGen_;
174  unsigned char * dynamicStatusGen_;
178  int * idGen_;
180  double * columnLowerGen_;
182  double * columnUpperGen_;
184 };
185 
186 #endif
int CoinBigIndex
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 &quot;interesting rows&quot;...
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 &quot;interesting rows&quot;...
int * fullStartGen_
start of each set
ClpDynamicExampleMatrix & operator=(const ClpDynamicExampleMatrix &)
The copy constructor.
This solves LPs using the simplex method.
Definition: ClpSimplex.hpp:70
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