Cbc  2.10.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ClpDynamicExampleMatrix.hpp
Go to the documentation of this file.
1 /* $Id: ClpDynamicExampleMatrix.hpp 2385 2019-01-06 19:43:06Z unxusr $ */
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
72  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 #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_;
176  int *rowGen_;
178  double *elementGen_;
180  double *costGen_;
184  unsigned char *dynamicStatusGen_;
188  int *idGen_;
194 };
195 
196 #endif
197 
198 /* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2
199 */
double * columnUpperGen() const
Optional upper bounds on columns.
int * idGen() const
ids in next level matrix
double * cost() const
costs
virtual void partialPricing(ClpSimplex *model, double start, double end, int &bestSequence, int &numberWanted)
Partial pricing.
Abstract base class for Clp Matrices.
DynamicStatus
enums for status of various sorts
This implements a dynamic matrix when we have a limit on the number of &quot;interesting rows&quot;...
virtual ClpMatrixBase * clone() const
Clone.
double * columnLowerGen_
Optional lower bounds on columns.
void setDynamicStatusGen(int sequence, DynamicStatus status)
ClpDynamicExampleMatrix()
Default constructor.
DynamicStatus getDynamicStatusGen(int sequence) const
double * elementGen() const
elements
ClpDynamicExampleMatrix & operator=(const ClpDynamicExampleMatrix &)
double * columnUpper() const
Optional upper bounds on columns.
bool flaggedGen(int i) const
Whether flagged.
This solves LPs using the simplex method.
Definition: ClpSimplex.hpp:106
unsigned char * dynamicStatusGen_
for status and which bound
unsigned char * dynamicStatus() const
Status region for gub variables.
int numberSets() const
Number of sets (dynamic rows)
CoinBigIndex * fullStartGen() const
full starts
virtual void packDown(const int *in, int numberToPack)
If addColumn forces compression then this allows descendant to know what to do.
double * columnLower() const
Optional lower bounds on columns.
int CoinBigIndex
This implements a dynamic matrix when we have a limit on the number of &quot;interesting rows&quot;...
CoinBigIndex * startColumn() const
Starts of each column.
virtual void createVariable(ClpSimplex *model, int &bestSequence)
Creates a variable.
CoinBigIndex * startColumnGen() const
Starts of each column.
CoinBigIndex * fullStartGen_
start of each set
virtual ~ClpDynamicExampleMatrix()
Destructor.
double * costGen() const
costs
int * idGen_
identifier for each variable up one level (startColumn_, etc).
double * columnUpperGen_
Optional upper bounds on columns.
double * element() const
elements
double * columnLowerGen() const
Optional lower bounds on columns.
int * row() const
rows
CoinBigIndex * startColumnGen_
Starts of each column.