Clp 1.17.5
Loading...
Searching...
No Matches
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"
12class ClpSimplex;
33
34public:
38 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
86
93 virtual ClpMatrixBase *clone() const;
95
98 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
167protected:
174 CoinBigIndex *startColumnGen_;
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*/
This implements a dynamic matrix when we have a limit on the number of "interesting rows".
DynamicStatus getDynamicStatusGen(int sequence) const
virtual ~ClpDynamicExampleMatrix()
Destructor.
void setDynamicStatusGen(int sequence, DynamicStatus status)
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.
int * idGen() const
ids in next level matrix
virtual ClpMatrixBase * clone() const
Clone.
double * columnUpperGen() const
Optional upper bounds on columns.
unsigned char * dynamicStatusGen_
for status and which bound
CoinBigIndex * fullStartGen_
start of each set
ClpDynamicExampleMatrix()
Default constructor.
int * idGen_
identifier for each variable up one level (startColumn_, etc).
ClpDynamicExampleMatrix & operator=(const ClpDynamicExampleMatrix &)
double * columnUpperGen_
Optional upper bounds on columns.
double * columnLowerGen_
Optional lower bounds on columns.
ClpDynamicExampleMatrix(const ClpDynamicExampleMatrix &)
The copy constructor.
bool flaggedGen(int i) const
Whether flagged.
CoinBigIndex * startColumnGen_
Starts of each column.
double * columnLowerGen() const
Optional lower bounds on columns.
virtual void partialPricing(ClpSimplex *model, double start, double end, int &bestSequence, int &numberWanted)
Partial pricing.
ClpDynamicExampleMatrix(ClpSimplex *model, int numberSets, int numberColumns, const CoinBigIndex *starts, const double *lower, const double *upper, const CoinBigIndex *startColumn, const int *row, const double *element, const double *cost, const double *columnLower=NULL, const double *columnUpper=NULL, const unsigned char *status=NULL, const unsigned char *dynamicStatus=NULL, int numberIds=0, const int *ids=NULL)
This is the real constructor.
double * elementGen() const
elements
CoinBigIndex * startColumnGen() const
Starts of each column.
virtual void createVariable(ClpSimplex *model, int &bestSequence)
Creates a variable.
This implements a dynamic matrix when we have a limit on the number of "interesting rows".
double * columnUpper() const
Optional upper bounds on columns.
DynamicStatus
enums for status of various sorts
int * row() const
rows
double * columnLower() const
Optional lower bounds on columns.
double * cost() const
costs
int numberSets() const
Number of sets (dynamic rows)
unsigned char * dynamicStatus() const
Status region for gub variables.
double * element() const
elements
CoinBigIndex * startColumn() const
Starts of each column.
Abstract base class for Clp Matrices.
This solves LPs using the simplex method.