Go to the documentation of this file.00001
00002
00003
00004 #ifndef ClpGubDynamicMatrix_H
00005 #define ClpGubDynamicMatrix_H
00006
00007
00008 #include "CoinPragma.hpp"
00009
00010 #include "ClpGubMatrix.hpp"
00018 class ClpGubDynamicMatrix : public ClpGubMatrix {
00019
00020 public:
00023
00024 virtual void partialPricing(ClpSimplex * model, double start, double end,
00025 int & bestSequence, int & numberWanted);
00036 virtual int synchronize(ClpSimplex * model,int mode);
00038 virtual void useEffectiveRhs(ClpSimplex * model,bool cheapest=true);
00042 virtual int updatePivot(ClpSimplex * model,double oldInValue, double oldOutValue);
00044 void insertNonBasic(int sequence, int iSet);
00048 virtual double * rhsOffset(ClpSimplex * model,bool forceRefresh=false,
00049 bool check=false);
00050
00051 using ClpPackedMatrix::times ;
00055 virtual void times(double scalar,
00056 const double * x, double * y) const;
00060 virtual int checkFeasible(ClpSimplex * model,double & sum) const;
00062 void cleanData(ClpSimplex * model);
00064
00065
00066
00070 ClpGubDynamicMatrix();
00072 virtual ~ClpGubDynamicMatrix();
00074
00078 ClpGubDynamicMatrix(const ClpGubDynamicMatrix&);
00083 ClpGubDynamicMatrix(ClpSimplex * model, int numberSets,
00084 int numberColumns, const int * starts,
00085 const double * lower, const double * upper,
00086 const int * startColumn, const int * row,
00087 const double * element, const double * cost,
00088 const double * lowerColumn=NULL, const double * upperColumn=NULL,
00089 const unsigned char * status=NULL);
00090
00091 ClpGubDynamicMatrix& operator=(const ClpGubDynamicMatrix&);
00093 virtual ClpMatrixBase * clone() const ;
00095
00097
00098 enum DynamicStatus {
00099 inSmall = 0x01,
00100 atUpperBound = 0x02,
00101 atLowerBound = 0x03
00102 };
00104 inline bool flagged(int i) const {
00105 return (dynamicStatus_[i]&8)!=0;
00106 }
00107 inline void setFlagged(int i) {
00108 dynamicStatus_[i] = static_cast<unsigned char>(dynamicStatus_[i] | 8);
00109 }
00110 inline void unsetFlagged(int i) {
00111 dynamicStatus_[i] = static_cast<unsigned char>(dynamicStatus_[i] & ~8);
00112 }
00113 inline void setDynamicStatus(int sequence, DynamicStatus status)
00114 {
00115 unsigned char & st_byte = dynamicStatus_[sequence];
00116 st_byte = static_cast<unsigned char>(st_byte & ~7);
00117 st_byte = static_cast<unsigned char>(st_byte | status);
00118 }
00119 inline DynamicStatus getDynamicStatus(int sequence) const
00120 {return static_cast<DynamicStatus> (dynamicStatus_[sequence]&7);}
00122 inline double objectiveOffset() const
00123 { return objectiveOffset_;}
00125 inline CoinBigIndex * startColumn() const
00126 { return startColumn_;}
00128 inline int * row() const
00129 { return row_;}
00131 inline double * element() const
00132 { return element_;}
00134 inline double * cost() const
00135 { return cost_;}
00137 inline int * fullStart() const
00138 { return fullStart_;}
00140 inline int * id() const
00141 { return id_;}
00143 inline double * lowerColumn() const
00144 { return lowerColumn_;}
00146 inline double * upperColumn() const
00147 { return upperColumn_;}
00149 inline double * lowerSet() const
00150 { return lowerSet_;}
00152 inline double * upperSet() const
00153 { return upperSet_;}
00155 inline int numberGubColumns() const
00156 { return numberGubColumns_;}
00158 inline int firstAvailable() const
00159 { return firstAvailable_;}
00161 inline void setFirstAvailable(int value)
00162 { firstAvailable_ = value;}
00164 inline int firstDynamic() const
00165 { return firstDynamic_;}
00167 inline int lastDynamic() const
00168 { return lastDynamic_;}
00170 inline int numberElements() const
00171 { return numberElements_;}
00173 inline unsigned char * gubRowStatus() const
00174 { return status_;}
00176 inline unsigned char * dynamicStatus() const
00177 { return dynamicStatus_;}
00179 int whichSet (int sequence) const;
00181
00182
00183 protected:
00187
00188 double objectiveOffset_;
00190 CoinBigIndex * startColumn_;
00192 int * row_;
00194 double * element_;
00196 double * cost_;
00198 int * fullStart_;
00200 int * id_;
00202 unsigned char * dynamicStatus_;
00204 double * lowerColumn_;
00206 double * upperColumn_;
00208 double * lowerSet_;
00210 double * upperSet_;
00212 int numberGubColumns_;
00214 int firstAvailable_;
00216 int savedFirstAvailable_;
00218 int firstDynamic_;
00220 int lastDynamic_;
00222 int numberElements_;
00224 };
00225
00226 #endif