Clp 1.16.9
Loading...
Searching...
No Matches
ClpGubDynamicMatrix.hpp
Go to the documentation of this file.
1/* $Id: ClpGubDynamicMatrix.hpp 1665 2011-01-04 17:55:54Z lou $ */
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
10#include "CoinPragma.hpp"
11
12#include "ClpGubMatrix.hpp"
21
22public:
26 virtual void partialPricing(ClpSimplex * model, double start, double end,
27 int & bestSequence, int & numberWanted);
38 virtual int synchronize(ClpSimplex * model, int mode);
40 virtual void useEffectiveRhs(ClpSimplex * model, bool cheapest = true);
44 virtual int updatePivot(ClpSimplex * model, double oldInValue, double oldOutValue);
46 void insertNonBasic(int sequence, int iSet);
50 virtual double * rhsOffset(ClpSimplex * model, bool forceRefresh = false,
51 bool check = false);
52
57 virtual void times(double scalar,
58 const double * x, double * y) const;
62 virtual int checkFeasible(ClpSimplex * model, double & sum) const;
64 void cleanData(ClpSimplex * model);
66
67
68
76
86 int numberColumns, const int * starts,
87 const double * lower, const double * upper,
88 const int * startColumn, const int * row,
89 const double * element, const double * cost,
90 const double * lowerColumn = NULL, const double * upperColumn = NULL,
91 const unsigned char * status = NULL);
92
95 virtual ClpMatrixBase * clone() const ;
97
101 inSmall = 0x01,
103 atLowerBound = 0x03
104 };
106 inline bool flagged(int i) const {
107 return (dynamicStatus_[i] & 8) != 0;
108 }
109 inline void setFlagged(int i) {
110 dynamicStatus_[i] = static_cast<unsigned char>(dynamicStatus_[i] | 8);
111 }
112 inline void unsetFlagged(int i) {
113 dynamicStatus_[i] = static_cast<unsigned char>(dynamicStatus_[i] & ~8);
114 }
115 inline void setDynamicStatus(int sequence, DynamicStatus status) {
116 unsigned char & st_byte = dynamicStatus_[sequence];
117 st_byte = static_cast<unsigned char>(st_byte & ~7);
118 st_byte = static_cast<unsigned char>(st_byte | status);
119 }
120 inline DynamicStatus getDynamicStatus(int sequence) const {
121 return static_cast<DynamicStatus> (dynamicStatus_[sequence] & 7);
122 }
124 inline double objectiveOffset() const {
125 return objectiveOffset_;
126 }
128 inline CoinBigIndex * startColumn() const {
129 return startColumn_;
130 }
132 inline int * row() const {
133 return row_;
134 }
136 inline double * element() const {
137 return element_;
138 }
140 inline double * cost() const {
141 return cost_;
142 }
144 inline int * fullStart() const {
145 return fullStart_;
146 }
148 inline int * id() const {
149 return id_;
150 }
152 inline double * lowerColumn() const {
153 return lowerColumn_;
154 }
156 inline double * upperColumn() const {
157 return upperColumn_;
158 }
160 inline double * lowerSet() const {
161 return lowerSet_;
162 }
164 inline double * upperSet() const {
165 return upperSet_;
166 }
168 inline int numberGubColumns() const {
169 return numberGubColumns_;
170 }
172 inline int firstAvailable() const {
173 return firstAvailable_;
174 }
176 inline void setFirstAvailable(int value) {
177 firstAvailable_ = value;
178 }
180 inline int firstDynamic() const {
181 return firstDynamic_;
182 }
184 inline int lastDynamic() const {
185 return lastDynamic_;
186 }
188 inline int numberElements() const {
189 return numberElements_;
190 }
192 inline unsigned char * gubRowStatus() const {
193 return status_;
194 }
196 inline unsigned char * dynamicStatus() const {
197 return dynamicStatus_;
198 }
200 int whichSet (int sequence) const;
202
203
204protected:
211 CoinBigIndex * startColumn_;
213 int * row_;
215 double * element_;
217 double * cost_;
221 int * id_;
223 unsigned char * dynamicStatus_;
225 double * lowerColumn_;
227 double * upperColumn_;
229 double * lowerSet_;
231 double * upperSet_;
245};
246
247#endif
This implements Gub rows plus a ClpPackedMatrix.
virtual int checkFeasible(ClpSimplex *model, double &sum) const
Just for debug Returns sum and number of primal infeasibilities.
double objectiveOffset() const
Saved value of objective offset.
unsigned char * dynamicStatus() const
Status region for gub variables.
virtual void useEffectiveRhs(ClpSimplex *model, bool cheapest=true)
Sets up an effective RHS and does gub crash if needed.
ClpGubDynamicMatrix(ClpSimplex *model, int numberSets, int numberColumns, const int *starts, const double *lower, const double *upper, const int *startColumn, const int *row, const double *element, const double *cost, const double *lowerColumn=NULL, const double *upperColumn=NULL, const unsigned char *status=NULL)
This is the real constructor.
int * fullStart_
full starts
double * lowerSet() const
Optional true lower bounds on sets.
double objectiveOffset_
Saved value of objective offset.
unsigned char * gubRowStatus() const
Status region for gub slacks.
ClpGubDynamicMatrix()
Default constructor.
bool flagged(int i) const
Whether flagged.
int numberElements() const
size of working matrix (max)
int numberElements_
size of working matrix (max)
unsigned char * dynamicStatus_
for status and which bound
virtual void partialPricing(ClpSimplex *model, double start, double end, int &bestSequence, int &numberWanted)
Partial pricing.
int firstDynamic_
first dynamic
double * lowerColumn_
Optional lower bounds on columns.
CoinBigIndex * startColumn_
Starts of each column.
double * upperSet() const
Optional true upper bounds on sets.
CoinBigIndex * startColumn() const
Starts of each column.
double * upperSet_
Optional true upper bounds on sets.
double * cost() const
costs
int lastDynamic_
number of columns in dynamic model
virtual double * rhsOffset(ClpSimplex *model, bool forceRefresh=false, bool check=false)
Returns effective RHS offset if it is being used.
virtual ClpMatrixBase * clone() const
Clone.
ClpGubDynamicMatrix(const ClpGubDynamicMatrix &)
The copy constructor.
void insertNonBasic(int sequence, int iSet)
Add a new variable to a set.
ClpGubDynamicMatrix & operator=(const ClpGubDynamicMatrix &)
void cleanData(ClpSimplex *model)
Cleans data after setWarmStart.
void setDynamicStatus(int sequence, DynamicStatus status)
void setFirstAvailable(int value)
set first free
int lastDynamic() const
number of columns in dynamic model
int whichSet(int sequence) const
Returns which set a variable is in.
DynamicStatus
enums for status of various sorts
int * id() const
ids of active columns (just index here)
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...
virtual void times(double scalar, const double *x, double *y) const
Return y + A * scalar *x in y.
int firstDynamic() const
first dynamic
int firstAvailable() const
first free
int * id_
ids of active columns (just index here)
DynamicStatus getDynamicStatus(int sequence) const
virtual int updatePivot(ClpSimplex *model, double oldInValue, double oldOutValue)
update information for a pivot (and effective rhs)
int savedFirstAvailable_
saved first free
double * upperColumn_
Optional upper bounds on columns.
virtual ~ClpGubDynamicMatrix()
Destructor.
double * element() const
elements
int numberGubColumns() const
size
double * lowerColumn() const
Optional lower bounds on columns.
int * fullStart() const
full starts
double * upperColumn() const
Optional upper bounds on columns.
double * lowerSet_
Optional true lower bounds on sets.
This implements Gub rows plus a ClpPackedMatrix.
int * start() const
Starts.
double * upper() const
Upper bounds on sets.
unsigned char * status_
Status of slacks.
int * end() const
End.
double * lower() const
Lower bounds on sets.
int numberSets() const
Number of sets (gub rows)
Abstract base class for Clp Matrices.
virtual void times(double scalar, const double *x, double *y) const
Return y + A * scalar *x in y.
This solves LPs using the simplex method.
Definition: ClpSimplex.hpp:70