Clp 1.16.9
Loading...
Searching...
No Matches
ClpDynamicExampleMatrix.hpp
Go to the documentation of this file.
1/* $Id: ClpDynamicExampleMatrix.hpp 1936 2013-04-09 10:29:27Z forrest $ */
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
10#include "CoinPragma.hpp"
11
12#include "ClpDynamicMatrix.hpp"
13class ClpSimplex;
34
35public:
39 virtual void partialPricing(ClpSimplex * model, double start, double end,
40 int & bestSequence, int & numberWanted);
41
45 virtual void createVariable(ClpSimplex * model, int & bestSequence);
50 virtual void packDown(const int * in, int numberToPack);
52
53
54
66 int numberColumns, const int * starts,
67 const double * lower, const double * upper,
68 const int * startColumn, const int * row,
69 const double * element, const double * cost,
70 const double * columnLower = NULL, const double * columnUpper = NULL,
71 const unsigned char * status = NULL,
72 const unsigned char * dynamicStatus = NULL,
73 int numberIds = 0, const int *ids = NULL);
74#if 0
77 int numberColumns, int * starts,
78 const double * lower, const double * upper,
79 int * startColumn, int * row,
80 double * element, double * cost,
81 double * columnLower = NULL, double * columnUpper = NULL,
82 const unsigned char * status = NULL,
83 const unsigned char * dynamicStatus = NULL,
84 int numberIds = 0, const int *ids = NULL);
85#endif
89
96 virtual ClpMatrixBase * clone() const ;
98
101 inline CoinBigIndex * startColumnGen() const {
102 return startColumnGen_;
103 }
105 inline int * rowGen() const {
106 return rowGen_;
107 }
109 inline double * elementGen() const {
110 return elementGen_;
111 }
113 inline double * costGen() const {
114 return costGen_;
115 }
117 inline int * fullStartGen() const {
118 return fullStartGen_;
119 }
121 inline int * idGen() const {
122 return idGen_;
123 }
125 inline double * columnLowerGen() const {
126 return columnLowerGen_;
127 }
129 inline double * columnUpperGen() const {
130 return columnUpperGen_;
131 }
133 inline int numberColumns() const {
134 return numberColumns_;
135 }
136 inline void setDynamicStatusGen(int sequence, DynamicStatus status) {
137 unsigned char & st_byte = dynamicStatusGen_[sequence];
138 st_byte = static_cast<unsigned char>(st_byte & ~7);
139 st_byte = static_cast<unsigned char>(st_byte | status);
140 }
141 inline DynamicStatus getDynamicStatusGen(int sequence) const {
142 return static_cast<DynamicStatus> (dynamicStatusGen_[sequence] & 7);
143 }
145 inline bool flaggedGen(int i) const {
146 return (dynamicStatusGen_[i] & 8) != 0;
147 }
148 inline void setFlaggedGen(int i) {
149 dynamicStatusGen_[i] = static_cast<unsigned char>(dynamicStatusGen_[i] | 8);
150 }
151 inline void unsetFlagged(int i) {
152 dynamicStatusGen_[i] = static_cast<unsigned char>(dynamicStatusGen_[i] & ~8);
153 }
155
156
157protected:
164 CoinBigIndex * startColumnGen_;
166 int * rowGen_;
168 double * elementGen_;
170 double * costGen_;
174 unsigned char * dynamicStatusGen_;
178 int * idGen_;
184};
185
186#endif
This implements a dynamic matrix when we have a limit on the number of "interesting rows".
DynamicStatus getDynamicStatusGen(int sequence) const
int * fullStartGen_
start of each set
virtual ~ClpDynamicExampleMatrix()
Destructor.
void setDynamicStatusGen(int sequence, DynamicStatus status)
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
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.
ClpDynamicExampleMatrix(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 *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.
virtual void partialPricing(ClpSimplex *model, double start, double end, int &bestSequence, int &numberWanted)
Partial pricing.
double * elementGen() const
elements
CoinBigIndex * startColumnGen() const
Starts of each column.
int * fullStartGen() const
full starts
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.
Definition: ClpSimplex.hpp:70