Clp  1.17.8
ClpDynamicExampleMatrix.hpp
Go to the documentation of this file.
1 /* $Id$ */
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 #include "CoinPragma.hpp"
10 
11 #include "ClpDynamicMatrix.hpp"
12 class ClpSimplex;
33 
34 public:
37  virtual void partialPricing(ClpSimplex *model, double start, double end,
39  int &bestSequence, int &numberWanted);
40 
44  virtual void createVariable(ClpSimplex *model, int &bestSequence);
49  virtual void packDown(const int *in, int numberToPack);
51 
63  int numberColumns, const CoinBigIndex *starts,
64  const double *lower, const double *upper,
65  const CoinBigIndex *startColumn, const int *row,
66  const double *element, const double *cost,
67  const double *columnLower = NULL, const double *columnUpper = NULL,
68  const unsigned char *status = NULL,
69  const unsigned char *dynamicStatus = NULL,
70  int numberIds = 0, const int *ids = NULL);
71 #if 0
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 #endif
83 
84  virtual ~ClpDynamicExampleMatrix();
86 
93  virtual ClpMatrixBase *clone() const;
95 
97  inline CoinBigIndex *startColumnGen() const
99  {
100  return startColumnGen_;
101  }
103  inline int *rowGen() const
104  {
105  return rowGen_;
106  }
108  inline double *elementGen() const
109  {
110  return elementGen_;
111  }
113  inline double *costGen() const
114  {
115  return costGen_;
116  }
118  inline CoinBigIndex *fullStartGen() const
119  {
120  return fullStartGen_;
121  }
123  inline int *idGen() const
124  {
125  return idGen_;
126  }
128  inline double *columnLowerGen() const
129  {
130  return columnLowerGen_;
131  }
133  inline double *columnUpperGen() const
134  {
135  return columnUpperGen_;
136  }
138  inline int numberColumns() const
139  {
140  return numberColumns_;
141  }
142  inline void setDynamicStatusGen(int sequence, DynamicStatus status)
143  {
144  unsigned char &st_byte = dynamicStatusGen_[sequence];
145  st_byte = static_cast< unsigned char >(st_byte & ~7);
146  st_byte = static_cast< unsigned char >(st_byte | status);
147  }
148  inline DynamicStatus getDynamicStatusGen(int sequence) const
149  {
150  return static_cast< DynamicStatus >(dynamicStatusGen_[sequence] & 7);
151  }
153  inline bool flaggedGen(int i) const
154  {
155  return (dynamicStatusGen_[i] & 8) != 0;
156  }
157  inline void setFlaggedGen(int i)
158  {
159  dynamicStatusGen_[i] = static_cast< unsigned char >(dynamicStatusGen_[i] | 8);
160  }
161  inline void unsetFlagged(int i)
162  {
163  dynamicStatusGen_[i] = static_cast< unsigned char >(dynamicStatusGen_[i] & ~8);
164  }
166 
167 protected:
171  int numberColumns_;
174  CoinBigIndex *startColumnGen_;
176  int *rowGen_;
178  double *elementGen_;
180  double *costGen_;
182  CoinBigIndex *fullStartGen_;
184  unsigned char *dynamicStatusGen_;
188  int *idGen_;
194 };
195 
196 #endif
197 
198 /* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2
199 */
ClpSimplex
This solves LPs using the simplex method.
Definition: ClpSimplex.hpp:106
ClpDynamicExampleMatrix::startColumnGen
CoinBigIndex * startColumnGen() const
Starts of each column.
Definition: ClpDynamicExampleMatrix.hpp:98
ClpDynamicExampleMatrix::rowGen_
int * rowGen_
rows
Definition: ClpDynamicExampleMatrix.hpp:176
ClpDynamicMatrix
This implements a dynamic matrix when we have a limit on the number of "interesting rows".
Definition: ClpDynamicMatrix.hpp:19
ClpDynamicExampleMatrix::fullStartGen_
CoinBigIndex * fullStartGen_
start of each set
Definition: ClpDynamicExampleMatrix.hpp:182
ClpDynamicExampleMatrix::idGen_
int * idGen_
identifier for each variable up one level (startColumn_, etc).
Definition: ClpDynamicExampleMatrix.hpp:188
ClpDynamicExampleMatrix::flaggedGen
bool flaggedGen(int i) const
Whether flagged.
Definition: ClpDynamicExampleMatrix.hpp:153
ClpDynamicExampleMatrix::fullStartGen
CoinBigIndex * fullStartGen() const
full starts
Definition: ClpDynamicExampleMatrix.hpp:118
ClpDynamicExampleMatrix::clone
virtual ClpMatrixBase * clone() const
Clone.
ClpDynamicExampleMatrix::startColumnGen_
CoinBigIndex * startColumnGen_
Starts of each column.
Definition: ClpDynamicExampleMatrix.hpp:174
ClpDynamicExampleMatrix::columnUpperGen
double * columnUpperGen() const
Optional upper bounds on columns.
Definition: ClpDynamicExampleMatrix.hpp:133
ClpDynamicMatrix::dynamicStatus
unsigned char * dynamicStatus() const
Status region for gub variables.
Definition: ClpDynamicMatrix.hpp:318
ClpDynamicExampleMatrix::idGen
int * idGen() const
ids in next level matrix
Definition: ClpDynamicExampleMatrix.hpp:123
ClpDynamicExampleMatrix::numberColumns_
int numberColumns_
size
Definition: ClpDynamicExampleMatrix.hpp:172
ClpDynamicExampleMatrix::costGen_
double * costGen_
costs
Definition: ClpDynamicExampleMatrix.hpp:180
ClpDynamicExampleMatrix::setFlaggedGen
void setFlaggedGen(int i)
Definition: ClpDynamicExampleMatrix.hpp:157
ClpDynamicMatrix::row
int * row() const
rows
Definition: ClpDynamicMatrix.hpp:237
ClpDynamicMatrix::cost
double * cost() const
costs
Definition: ClpDynamicMatrix.hpp:247
ClpDynamicExampleMatrix::unsetFlagged
void unsetFlagged(int i)
Definition: ClpDynamicExampleMatrix.hpp:161
ClpDynamicExampleMatrix::elementGen_
double * elementGen_
elements
Definition: ClpDynamicExampleMatrix.hpp:178
ClpDynamicExampleMatrix::getDynamicStatusGen
DynamicStatus getDynamicStatusGen(int sequence) const
Definition: ClpDynamicExampleMatrix.hpp:148
ClpDynamicExampleMatrix::setDynamicStatusGen
void setDynamicStatusGen(int sequence, DynamicStatus status)
Definition: ClpDynamicExampleMatrix.hpp:142
ClpDynamicExampleMatrix::costGen
double * costGen() const
costs
Definition: ClpDynamicExampleMatrix.hpp:113
ClpDynamicExampleMatrix::packDown
virtual void packDown(const int *in, int numberToPack)
If addColumn forces compression then this allows descendant to know what to do.
ClpDynamicExampleMatrix::ClpDynamicExampleMatrix
ClpDynamicExampleMatrix()
Default constructor.
ClpMatrixBase
Abstract base class for Clp Matrices.
Definition: ClpMatrixBase.hpp:38
ClpDynamicExampleMatrix::operator=
ClpDynamicExampleMatrix & operator=(const ClpDynamicExampleMatrix &)
ClpDynamicExampleMatrix::columnLowerGen
double * columnLowerGen() const
Optional lower bounds on columns.
Definition: ClpDynamicExampleMatrix.hpp:128
ClpDynamicExampleMatrix::numberColumns
int numberColumns() const
size
Definition: ClpDynamicExampleMatrix.hpp:138
ClpDynamicMatrix::numberSets
int numberSets() const
Number of sets (dynamic rows)
Definition: ClpDynamicMatrix.hpp:189
ClpDynamicExampleMatrix::createVariable
virtual void createVariable(ClpSimplex *model, int &bestSequence)
Creates a variable.
ClpDynamicMatrix.hpp
ClpDynamicExampleMatrix::~ClpDynamicExampleMatrix
virtual ~ClpDynamicExampleMatrix()
Destructor.
ClpDynamicMatrix::DynamicStatus
DynamicStatus
enums for status of various sorts
Definition: ClpDynamicMatrix.hpp:23
ClpDynamicExampleMatrix::columnUpperGen_
double * columnUpperGen_
Optional upper bounds on columns.
Definition: ClpDynamicExampleMatrix.hpp:192
ClpDynamicExampleMatrix::dynamicStatusGen_
unsigned char * dynamicStatusGen_
for status and which bound
Definition: ClpDynamicExampleMatrix.hpp:184
ClpDynamicMatrix::columnLower
double * columnLower() const
Optional lower bounds on columns.
Definition: ClpDynamicMatrix.hpp:257
ClpDynamicMatrix::element
double * element() const
elements
Definition: ClpDynamicMatrix.hpp:242
ClpDynamicExampleMatrix::elementGen
double * elementGen() const
elements
Definition: ClpDynamicExampleMatrix.hpp:108
ClpDynamicExampleMatrix::rowGen
int * rowGen() const
rows
Definition: ClpDynamicExampleMatrix.hpp:103
ClpDynamicMatrix::columnUpper
double * columnUpper() const
Optional upper bounds on columns.
Definition: ClpDynamicMatrix.hpp:262
ClpDynamicExampleMatrix::partialPricing
virtual void partialPricing(ClpSimplex *model, double start, double end, int &bestSequence, int &numberWanted)
Partial pricing.
ClpDynamicExampleMatrix
This implements a dynamic matrix when we have a limit on the number of "interesting rows".
Definition: ClpDynamicExampleMatrix.hpp:32
ClpDynamicExampleMatrix::columnLowerGen_
double * columnLowerGen_
Optional lower bounds on columns.
Definition: ClpDynamicExampleMatrix.hpp:190
ClpDynamicMatrix::startColumn
CoinBigIndex * startColumn() const
Starts of each column.
Definition: ClpDynamicMatrix.hpp:232