Cgl 0.60.2

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ClpGubDynamicMatrix.hpp
Go to the documentation of this file.
1 /* $Id: ClpGubDynamicMatrix.hpp 2385 2019-01-06 19:43:06Z unxusr $ */
2 // Copyright (C) 2003, 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 ClpGubDynamicMatrix_H
7 #define ClpGubDynamicMatrix_H
8
9 #include "CoinPragma.hpp"
10
11 #include "ClpGubMatrix.hpp"
19 class ClpGubDynamicMatrix : public ClpGubMatrix {
20
21 public:
24 virtual void partialPricing(ClpSimplex *model, double start, double end,
26 int &bestSequence, int &numberWanted);
37 virtual int synchronize(ClpSimplex *model, int mode);
39 virtual void useEffectiveRhs(ClpSimplex *model, bool cheapest = true);
43 virtual int updatePivot(ClpSimplex *model, double oldInValue, double oldOutValue);
45 void insertNonBasic(int sequence, int iSet);
49 virtual double *rhsOffset(ClpSimplex *model, bool forceRefresh = false,
50 bool check = false);
51
52 using ClpPackedMatrix::times;
56 virtual void times(double scalar,
57 const double *x, double *y) const;
61 virtual int checkFeasible(ClpSimplex *model, double &sum) const;
63 void cleanData(ClpSimplex *model);
65
69 ClpGubDynamicMatrix();
71 virtual ~ClpGubDynamicMatrix();
73
77 ClpGubDynamicMatrix(const ClpGubDynamicMatrix &);
82 ClpGubDynamicMatrix(ClpSimplex *model, int numberSets,
83 int numberColumns, const int *starts,
84 const double *lower, const double *upper,
85 const CoinBigIndex *startColumn, const int *row,
86 const double *element, const double *cost,
87 const double *lowerColumn = NULL, const double *upperColumn = NULL,
88 const unsigned char *status = NULL);
89
90 ClpGubDynamicMatrix &operator=(const ClpGubDynamicMatrix &);
92 virtual ClpMatrixBase *clone() const;
94
96 enum DynamicStatus {
98 inSmall = 0x01,
99 atUpperBound = 0x02,
100 atLowerBound = 0x03
101 };
103 inline bool flagged(int i) const
104 {
105 return (dynamicStatus_[i] & 8) != 0;
106 }
107 inline void setFlagged(int i)
108 {
109 dynamicStatus_[i] = static_cast< unsigned char >(dynamicStatus_[i] | 8);
110 }
111 inline void unsetFlagged(int i)
112 {
113 dynamicStatus_[i] = static_cast< unsigned char >(dynamicStatus_[i] & ~8);
114 }
115 inline void setDynamicStatus(int sequence, DynamicStatus status)
116 {
117 unsigned char &st_byte = dynamicStatus_[sequence];
118 st_byte = static_cast< unsigned char >(st_byte & ~7);
119 st_byte = static_cast< unsigned char >(st_byte | status);
120 }
121 inline DynamicStatus getDynamicStatus(int sequence) const
122 {
123 return static_cast< DynamicStatus >(dynamicStatus_[sequence] & 7);
124 }
126 inline double objectiveOffset() const
127 {
128 return objectiveOffset_;
129 }
131 inline CoinBigIndex *startColumn() const
132 {
133 return startColumn_;
134 }
136 inline int *row() const
137 {
138 return row_;
139 }
141 inline double *element() const
142 {
143 return element_;
144 }
146 inline double *cost() const
147 {
148 return cost_;
149 }
151 inline int *fullStart() const
152 {
153 return fullStart_;
154 }
156 inline int *id() const
157 {
158 return id_;
159 }
161 inline double *lowerColumn() const
162 {
163 return lowerColumn_;
164 }
166 inline double *upperColumn() const
167 {
168 return upperColumn_;
169 }
171 inline double *lowerSet() const
172 {
173 return lowerSet_;
174 }
176 inline double *upperSet() const
177 {
178 return upperSet_;
179 }
181 inline int numberGubColumns() const
182 {
183 return numberGubColumns_;
184 }
186 inline int firstAvailable() const
187 {
188 return firstAvailable_;
189 }
191 inline void setFirstAvailable(int value)
192 {
193 firstAvailable_ = value;
194 }
196 inline int firstDynamic() const
197 {
198 return firstDynamic_;
199 }
201 inline int lastDynamic() const
202 {
203 return lastDynamic_;
204 }
206 inline CoinBigIndex numberElements() const
207 {
208 return numberElements_;
209 }
211 inline unsigned char *gubRowStatus() const
212 {
213 return status_;
214 }
216 inline unsigned char *dynamicStatus() const
217 {
218 return dynamicStatus_;
219 }
221 int whichSet(int sequence) const;
223
224 protected:
228 double objectiveOffset_;
231 CoinBigIndex *startColumn_;
233 int *row_;
235 double *element_;
237 double *cost_;
239 int *fullStart_;
241 int *id_;
243 unsigned char *dynamicStatus_;
245 double *lowerColumn_;
247 double *upperColumn_;
249 double *lowerSet_;
251 double *upperSet_;
253 int numberGubColumns_;
255 int firstAvailable_;
257 int savedFirstAvailable_;
259 int firstDynamic_;
261 int lastDynamic_;
263 CoinBigIndex numberElements_;
265 };
266
267 #endif
268
269 /* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2
270 */
ClpGubDynamicMatrix::upperColumn
double * upperColumn() const
Optional upper bounds on columns.
Definition: ClpGubDynamicMatrix.hpp:166
ClpGubDynamicMatrix::partialPricing
virtual void partialPricing(ClpSimplex *model, double start, double end, int &bestSequence, int &numberWanted)
Partial pricing.
ClpGubDynamicMatrix
This implements Gub rows plus a ClpPackedMatrix.
Definition: ClpGubDynamicMatrix.hpp:19
ClpGubMatrix::numberSets
int numberSets() const
Number of sets (gub rows)
Definition: ClpGubMatrix.hpp:288
ClpGubDynamicMatrix::checkFeasible
virtual int checkFeasible(ClpSimplex *model, double &sum) const
Just for debug Returns sum and number of primal infeasibilities.
ClpGubMatrix::upper
double * upper() const
Upper bounds on sets.
Definition: ClpGubMatrix.hpp:273
ClpGubDynamicMatrix::setDynamicStatus
void setDynamicStatus(int sequence, DynamicStatus status)
Definition: ClpGubDynamicMatrix.hpp:115
ClpGubDynamicMatrix::lowerColumn_
double * lowerColumn_
Optional lower bounds on columns.
Definition: ClpGubDynamicMatrix.hpp:245
ClpMatrixBase
Abstract base class for Clp Matrices.
Definition: ClpMatrixBase.hpp:38
ClpGubDynamicMatrix::row
int * row() const
rows
Definition: ClpGubDynamicMatrix.hpp:136
ClpGubDynamicMatrix::operator=
ClpGubDynamicMatrix & operator=(const ClpGubDynamicMatrix &)
ClpGubMatrix
This implements Gub rows plus a ClpPackedMatrix.
Definition: ClpGubMatrix.hpp:21
ClpGubMatrix::status_
unsigned char * status_
Status of slacks.
Definition: ClpGubMatrix.hpp:319
ClpGubDynamicMatrix::setFlagged
void setFlagged(int i)
Definition: ClpGubDynamicMatrix.hpp:107
ClpGubDynamicMatrix::upperSet
double * upperSet() const
Optional true upper bounds on sets.
Definition: ClpGubDynamicMatrix.hpp:176
ClpGubDynamicMatrix::firstDynamic_
int firstDynamic_
first dynamic
Definition: ClpGubDynamicMatrix.hpp:259
ClpGubDynamicMatrix::dynamicStatus
unsigned char * dynamicStatus() const
Status region for gub variables.
Definition: ClpGubDynamicMatrix.hpp:216
ClpGubDynamicMatrix::id_
int * id_
ids of active columns (just index here)
Definition: ClpGubDynamicMatrix.hpp:241
ClpGubDynamicMatrix::upperSet_
double * upperSet_
Optional true upper bounds on sets.
Definition: ClpGubDynamicMatrix.hpp:251
ClpGubDynamicMatrix::fullStart
int * fullStart() const
full starts
Definition: ClpGubDynamicMatrix.hpp:151
ClpGubDynamicMatrix::lastDynamic_
int lastDynamic_
number of columns in dynamic model
Definition: ClpGubDynamicMatrix.hpp:261
ClpGubDynamicMatrix::objectiveOffset
double objectiveOffset() const
Saved value of objective offset.
Definition: ClpGubDynamicMatrix.hpp:126
ClpGubMatrix::end
int * end() const
End.
Definition: ClpGubMatrix.hpp:263
ClpGubDynamicMatrix::row_
int * row_
rows
Definition: ClpGubDynamicMatrix.hpp:233
ClpGubDynamicMatrix::useEffectiveRhs
virtual void useEffectiveRhs(ClpSimplex *model, bool cheapest=true)
Sets up an effective RHS and does gub crash if needed.
ClpGubMatrix.hpp
ClpGubDynamicMatrix::id
int * id() const
ids of active columns (just index here)
Definition: ClpGubDynamicMatrix.hpp:156
ClpGubDynamicMatrix::cost
double * cost() const
costs
Definition: ClpGubDynamicMatrix.hpp:146
ClpPackedMatrix::times
virtual void times(double scalar, const double *x, double *y) const
Return y + A * scalar *x in y.
ClpGubDynamicMatrix::insertNonBasic
void insertNonBasic(int sequence, int iSet)
Add a new variable to a set.
ClpGubDynamicMatrix::clone
virtual ClpMatrixBase * clone() const
Clone.
ClpGubDynamicMatrix::cleanData
void cleanData(ClpSimplex *model)
Cleans data after setWarmStart.
ClpGubDynamicMatrix::rhsOffset
virtual double * rhsOffset(ClpSimplex *model, bool forceRefresh=false, bool check=false)
Returns effective RHS offset if it is being used.
ClpGubDynamicMatrix::lowerSet
double * lowerSet() const
Optional true lower bounds on sets.
Definition: ClpGubDynamicMatrix.hpp:171
ClpGubDynamicMatrix::DynamicStatus
DynamicStatus
enums for status of various sorts
Definition: ClpGubDynamicMatrix.hpp:97
ClpGubDynamicMatrix::element_
double * element_
elements
Definition: ClpGubDynamicMatrix.hpp:235
ClpGubDynamicMatrix::gubRowStatus
unsigned char * gubRowStatus() const
Status region for gub slacks.
Definition: ClpGubDynamicMatrix.hpp:211
ClpGubDynamicMatrix::synchronize
virtual int synchronize(ClpSimplex *model, int mode)
This is local to Gub to allow synchronization: mode=0 when status of basis is good mode=1 when variab...
ClpGubDynamicMatrix::atLowerBound
Definition: ClpGubDynamicMatrix.hpp:100
ClpSimplex
This solves LPs using the simplex method.
Definition: ClpSimplex.hpp:106
ClpGubDynamicMatrix::objectiveOffset_
double objectiveOffset_
Saved value of objective offset.
Definition: ClpGubDynamicMatrix.hpp:229
ClpGubDynamicMatrix::firstDynamic
int firstDynamic() const
first dynamic
Definition: ClpGubDynamicMatrix.hpp:196
CoinPragma.hpp
ClpGubDynamicMatrix::setFirstAvailable
void setFirstAvailable(int value)
set first free
Definition: ClpGubDynamicMatrix.hpp:191
ClpGubDynamicMatrix::updatePivot
virtual int updatePivot(ClpSimplex *model, double oldInValue, double oldOutValue)
update information for a pivot (and effective rhs)
ClpGubDynamicMatrix::numberGubColumns_
int numberGubColumns_
size
Definition: ClpGubDynamicMatrix.hpp:253
ClpGubDynamicMatrix::atUpperBound
Definition: ClpGubDynamicMatrix.hpp:99
ClpGubMatrix::lower
double * lower() const
Lower bounds on sets.
Definition: ClpGubMatrix.hpp:268
ClpGubDynamicMatrix::startColumn_
CoinBigIndex * startColumn_
Starts of each column.
Definition: ClpGubDynamicMatrix.hpp:231
ClpGubDynamicMatrix::fullStart_
int * fullStart_
full starts
Definition: ClpGubDynamicMatrix.hpp:239
ClpGubDynamicMatrix::firstAvailable
int firstAvailable() const
first free
Definition: ClpGubDynamicMatrix.hpp:186
ClpGubDynamicMatrix::dynamicStatus_
unsigned char * dynamicStatus_
for status and which bound
Definition: ClpGubDynamicMatrix.hpp:243
ClpGubDynamicMatrix::numberGubColumns
int numberGubColumns() const
size
Definition: ClpGubDynamicMatrix.hpp:181
ClpGubDynamicMatrix::times
virtual void times(double scalar, const double *x, double *y) const
Return y + A * scalar *x in y.
ClpGubMatrix::start
int * start() const
Starts.
Definition: ClpGubMatrix.hpp:258
CoinBigIndex
int CoinBigIndex
Definition: Coin_C_defines.h:136
ClpGubDynamicMatrix::numberElements
CoinBigIndex numberElements() const
size of working matrix (max)
Definition: ClpGubDynamicMatrix.hpp:206
ClpGubDynamicMatrix::inSmall
Definition: ClpGubDynamicMatrix.hpp:98
ClpGubDynamicMatrix::savedFirstAvailable_
int savedFirstAvailable_
saved first free
Definition: ClpGubDynamicMatrix.hpp:257
ClpGubDynamicMatrix::lastDynamic
int lastDynamic() const
number of columns in dynamic model
Definition: ClpGubDynamicMatrix.hpp:201
ClpGubDynamicMatrix::~ClpGubDynamicMatrix
virtual ~ClpGubDynamicMatrix()
Destructor.
ClpGubDynamicMatrix::cost_
double * cost_
costs
Definition: ClpGubDynamicMatrix.hpp:237
ClpGubDynamicMatrix::ClpGubDynamicMatrix
ClpGubDynamicMatrix()
Default constructor.
ClpGubDynamicMatrix::startColumn
CoinBigIndex * startColumn() const
Starts of each column.
Definition: ClpGubDynamicMatrix.hpp:131
ClpGubDynamicMatrix::numberElements_
CoinBigIndex numberElements_
size of working matrix (max)
Definition: ClpGubDynamicMatrix.hpp:263
ClpGubDynamicMatrix::lowerColumn
double * lowerColumn() const
Optional lower bounds on columns.
Definition: ClpGubDynamicMatrix.hpp:161
ClpGubDynamicMatrix::unsetFlagged
void unsetFlagged(int i)
Definition: ClpGubDynamicMatrix.hpp:111
ClpGubDynamicMatrix::flagged
bool flagged(int i) const
Whether flagged.
Definition: ClpGubDynamicMatrix.hpp:103
ClpGubDynamicMatrix::getDynamicStatus
DynamicStatus getDynamicStatus(int sequence) const
Definition: ClpGubDynamicMatrix.hpp:121
ClpGubDynamicMatrix::firstAvailable_
int firstAvailable_
first free
Definition: ClpGubDynamicMatrix.hpp:255
ClpGubDynamicMatrix::upperColumn_
double * upperColumn_
Optional upper bounds on columns.
Definition: ClpGubDynamicMatrix.hpp:247
ClpGubDynamicMatrix::element
double * element() const
elements
Definition: ClpGubDynamicMatrix.hpp:141
ClpGubDynamicMatrix::whichSet
int whichSet(int sequence) const
Returns which set a variable is in.
ClpGubDynamicMatrix::lowerSet_
double * lowerSet_
Optional true lower bounds on sets.
Definition: ClpGubDynamicMatrix.hpp:249