Go to the documentation of this file.00001
00002
00003
00004 #ifndef ClpDynamicExampleMatrix_H
00005 #define ClpDynamicExampleMatrix_H
00006
00007
00008 #include "CoinPragma.hpp"
00009
00010 #include "ClpDynamicMatrix.hpp"
00011 class ClpSimplex;
00031 class ClpDynamicExampleMatrix : public ClpDynamicMatrix {
00032
00033 public:
00036
00037 virtual void partialPricing(ClpSimplex * model, double start, double end,
00038 int & bestSequence, int & numberWanted);
00039
00043 virtual void createVariable(ClpSimplex * model, int & bestSequence);
00048 virtual void packDown(const int * in, int numberToPack);
00050
00051
00052
00056 ClpDynamicExampleMatrix();
00063 ClpDynamicExampleMatrix(ClpSimplex * model, int numberSets,
00064 int numberColumns, const int * starts,
00065 const double * lower, const double * upper,
00066 const int * startColumn, const int * row,
00067 const double * element, const double * cost,
00068 const double * columnLower=NULL, const double * columnUpper=NULL,
00069 const unsigned char * status=NULL,
00070 const unsigned char * dynamicStatus=NULL,
00071 int numberIds=0,const int *ids=NULL);
00073 ClpDynamicExampleMatrix(ClpSimplex * model, int numberSets,
00074 int numberColumns, int * starts,
00075 const double * lower, const double * upper,
00076 int * startColumn, int * row,
00077 double * element, double * cost,
00078 double * columnLower=NULL, double * columnUpper=NULL,
00079 const unsigned char * status=NULL,
00080 const unsigned char * dynamicStatus=NULL,
00081 int numberIds=0,const int *ids=NULL);
00082
00084 virtual ~ClpDynamicExampleMatrix();
00086
00090 ClpDynamicExampleMatrix(const ClpDynamicExampleMatrix&);
00091 ClpDynamicExampleMatrix& operator=(const ClpDynamicExampleMatrix&);
00093 virtual ClpMatrixBase * clone() const ;
00095
00097
00098 inline CoinBigIndex * startColumnGen() const
00099 { return startColumnGen_;}
00101 inline int * rowGen() const
00102 { return rowGen_;}
00104 inline double * elementGen() const
00105 { return elementGen_;}
00107 inline double * costGen() const
00108 { return costGen_;}
00110 inline int * fullStartGen() const
00111 { return fullStartGen_;}
00113 inline int * idGen() const
00114 { return idGen_;}
00116 inline double * columnLowerGen() const
00117 { return columnLowerGen_;}
00119 inline double * columnUpperGen() const
00120 { return columnUpperGen_;}
00122 inline int numberColumns() const
00123 { return numberColumns_;}
00124 inline void setDynamicStatusGen(int sequence, DynamicStatus status)
00125 {
00126 unsigned char & st_byte = dynamicStatusGen_[sequence];
00127 st_byte = static_cast<unsigned char>(st_byte & ~7);
00128 st_byte = static_cast<unsigned char>(st_byte | status);
00129 }
00130 inline DynamicStatus getDynamicStatusGen(int sequence) const
00131 {return static_cast<DynamicStatus> (dynamicStatusGen_[sequence]&7);}
00133 inline bool flaggedGen(int i) const {
00134 return (dynamicStatusGen_[i]&8)!=0;
00135 }
00136 inline void setFlaggedGen(int i) {
00137 dynamicStatusGen_[i] = static_cast<unsigned char>(dynamicStatusGen_[i] | 8);
00138 }
00139 inline void unsetFlagged(int i) {
00140 dynamicStatusGen_[i] = static_cast<unsigned char>(dynamicStatusGen_[i] & ~8);
00141 }
00143
00144
00145 protected:
00149
00150 int numberColumns_;
00152 CoinBigIndex * startColumnGen_;
00154 int * rowGen_;
00156 double * elementGen_;
00158 double * costGen_;
00160 int * fullStartGen_;
00162 unsigned char * dynamicStatusGen_;
00166 int * idGen_;
00168 double * columnLowerGen_;
00170 double * columnUpperGen_;
00172 };
00173
00174 #endif