Clp trunk
ClpGubDynamicMatrix.hpp
Go to the documentation of this file.
00001 /* $Id$ */
00002 // Copyright (C) 2003, International Business Machines
00003 // Corporation and others.  All Rights Reserved.
00004 // This code is licensed under the terms of the Eclipse Public License (EPL).
00005 
00006 #ifndef ClpGubDynamicMatrix_H
00007 #define ClpGubDynamicMatrix_H
00008 
00009 
00010 #include "CoinPragma.hpp"
00011 
00012 #include "ClpGubMatrix.hpp"
00020 class ClpGubDynamicMatrix : public ClpGubMatrix {
00021 
00022 public:
00025 
00026      virtual void partialPricing(ClpSimplex * model, double start, double end,
00027                                  int & bestSequence, int & numberWanted);
00038      virtual int synchronize(ClpSimplex * model, int mode);
00040      virtual void useEffectiveRhs(ClpSimplex * model, bool cheapest = true);
00044      virtual int updatePivot(ClpSimplex * model, double oldInValue, double oldOutValue);
00046      void insertNonBasic(int sequence, int iSet);
00050      virtual double * rhsOffset(ClpSimplex * model, bool forceRefresh = false,
00051                                 bool check = false);
00052 
00053      using ClpPackedMatrix::times ;
00057      virtual void times(double scalar,
00058                         const double * x, double * y) const;
00062      virtual int checkFeasible(ClpSimplex * model, double & sum) const;
00064      void cleanData(ClpSimplex * model);
00066 
00067 
00068 
00072      ClpGubDynamicMatrix();
00074      virtual ~ClpGubDynamicMatrix();
00076 
00080      ClpGubDynamicMatrix(const ClpGubDynamicMatrix&);
00085      ClpGubDynamicMatrix(ClpSimplex * model, int numberSets,
00086                          int numberColumns, const int * starts,
00087                          const double * lower, const double * upper,
00088                          const int * startColumn, const int * row,
00089                          const double * element, const double * cost,
00090                          const double * lowerColumn = NULL, const double * upperColumn = NULL,
00091                          const unsigned char * status = NULL);
00092 
00093      ClpGubDynamicMatrix& operator=(const ClpGubDynamicMatrix&);
00095      virtual ClpMatrixBase * clone() const ;
00097 
00099 
00100      enum DynamicStatus {
00101           inSmall = 0x01,
00102           atUpperBound = 0x02,
00103           atLowerBound = 0x03
00104      };
00106      inline bool flagged(int i) const {
00107           return (dynamicStatus_[i] & 8) != 0;
00108      }
00109      inline void setFlagged(int i) {
00110           dynamicStatus_[i] = static_cast<unsigned char>(dynamicStatus_[i] | 8);
00111      }
00112      inline void unsetFlagged(int i) {
00113           dynamicStatus_[i] = static_cast<unsigned char>(dynamicStatus_[i] & ~8);
00114      }
00115      inline void setDynamicStatus(int sequence, DynamicStatus status) {
00116           unsigned char & st_byte = dynamicStatus_[sequence];
00117           st_byte = static_cast<unsigned char>(st_byte & ~7);
00118           st_byte = static_cast<unsigned char>(st_byte | status);
00119      }
00120      inline DynamicStatus getDynamicStatus(int sequence) const {
00121           return static_cast<DynamicStatus> (dynamicStatus_[sequence] & 7);
00122      }
00124      inline double objectiveOffset() const {
00125           return objectiveOffset_;
00126      }
00128      inline CoinBigIndex * startColumn() const {
00129           return startColumn_;
00130      }
00132      inline int * row() const {
00133           return row_;
00134      }
00136      inline double * element() const {
00137           return element_;
00138      }
00140      inline double * cost() const {
00141           return cost_;
00142      }
00144      inline int * fullStart() const {
00145           return fullStart_;
00146      }
00148      inline int * id() const {
00149           return id_;
00150      }
00152      inline double * lowerColumn() const {
00153           return lowerColumn_;
00154      }
00156      inline double * upperColumn() const {
00157           return upperColumn_;
00158      }
00160      inline double * lowerSet() const {
00161           return lowerSet_;
00162      }
00164      inline double * upperSet() const {
00165           return upperSet_;
00166      }
00168      inline int numberGubColumns() const {
00169           return numberGubColumns_;
00170      }
00172      inline int firstAvailable() const {
00173           return firstAvailable_;
00174      }
00176      inline void setFirstAvailable(int value) {
00177           firstAvailable_ = value;
00178      }
00180      inline int firstDynamic() const {
00181           return firstDynamic_;
00182      }
00184      inline int lastDynamic() const {
00185           return lastDynamic_;
00186      }
00188      inline int numberElements() const {
00189           return numberElements_;
00190      }
00192      inline unsigned char * gubRowStatus() const {
00193           return status_;
00194      }
00196      inline unsigned char * dynamicStatus() const {
00197           return dynamicStatus_;
00198      }
00200      int whichSet (int sequence) const;
00202 
00203 
00204 protected:
00208 
00209      double objectiveOffset_;
00211      CoinBigIndex * startColumn_;
00213      int * row_;
00215      double * element_;
00217      double * cost_;
00219      int * fullStart_;
00221      int * id_;
00223      unsigned char * dynamicStatus_;
00225      double * lowerColumn_;
00227      double * upperColumn_;
00229      double * lowerSet_;
00231      double * upperSet_;
00233      int numberGubColumns_;
00235      int firstAvailable_;
00237      int savedFirstAvailable_;
00239      int firstDynamic_;
00241      int lastDynamic_;
00243      int numberElements_;
00245 };
00246 
00247 #endif
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines