- Main Page
- Modules
- Namespaces
- Classes
- Files
- Related Pages

- File List
- File Members

# /home/coin/SVN-release/Cgl-0.53.1/Clp/src/ClpGubMatrix.hpp

Go to the documentation of this file.

    00001 // Copyright (C) 2003, International Business Machines
    00002 // Corporation and others.  All Rights Reserved.
    00003 #ifndef ClpGubMatrix_H
    00004 #define ClpGubMatrix_H
    00005
    00006
    00007 #include "CoinPragma.hpp"
    00008
    00009 #include "ClpPackedMatrix.hpp"
    00010 class ClpSimplex;
    00019 class ClpGubMatrix : public ClpPackedMatrix {
    00020
    00021 public:
    00025   virtual ClpMatrixBase * reverseOrderedCopy() const;
    00027   virtual CoinBigIndex countBasis(ClpSimplex * model,
    00028                                  const int * whichColumn,
    00029                                  int numberRowBasic,
    00030                                   int & numberColumnBasic);
    00032   virtual void fillBasis(ClpSimplex * model,
    00033                                  const int * whichColumn,
    00034                                  int & numberColumnBasic,
    00035                                  int * row, int * start,
    00036                                  int * rowCount, int * columnCount,
    00037                                  double * element);
    00040   virtual void unpack(const ClpSimplex * model,CoinIndexedVector * rowArray,
    00041                    int column) const ;
    00046   virtual void unpackPacked(ClpSimplex * model,
    00047                             CoinIndexedVector * rowArray,
    00048                             int column) const;
    00051   virtual void add(const ClpSimplex * model,CoinIndexedVector * rowArray,
    00052                    int column, double multiplier) const ;
    00054   virtual void add(const ClpSimplex * model,double * array,
    00055                    int column, double multiplier) const;
    00057   virtual void partialPricing(ClpSimplex * model, double start, double end,
    00058                       int & bestSequence, int & numberWanted);
    00060   virtual int hiddenRows() const;
    00062
    00065
    00066   using ClpPackedMatrix::transposeTimes ;
    00071   virtual void transposeTimes(const ClpSimplex * model, double scalar,
    00072                               const CoinIndexedVector * x,
    00073                               CoinIndexedVector * y,
    00074                               CoinIndexedVector * z) const;
    00080   virtual void transposeTimesByRow(const ClpSimplex * model, double scalar,
    00081                               const CoinIndexedVector * x,
    00082                               CoinIndexedVector * y,
    00083                               CoinIndexedVector * z) const;
    00087   virtual void subsetTransposeTimes(const ClpSimplex * model,
    00088                                     const CoinIndexedVector * x,
    00089                                     const CoinIndexedVector * y,
    00090                                     CoinIndexedVector * z) const;
    00097   virtual int extendUpdated(ClpSimplex * model,CoinIndexedVector * update,int mode);
    00103   virtual void primalExpanded(ClpSimplex * model,int mode);
    00112   virtual void dualExpanded(ClpSimplex * model,CoinIndexedVector * array,
    00113                             double * other,int mode);
    00131   virtual int generalExpanded(ClpSimplex * model,int mode,int & number);
    00135   virtual int updatePivot(ClpSimplex * model,double oldInValue, double oldOutValue);
    00137   virtual void useEffectiveRhs(ClpSimplex * model,bool cheapest=true);
    00141   virtual double * rhsOffset(ClpSimplex * model,bool forceRefresh=false,
    00142                                 bool check=false);
    00155   virtual int synchronize(ClpSimplex * model,int mode);
    00157   virtual void correctSequence(const ClpSimplex * model,int & sequenceIn, int & sequenceOut) ;
    00159
    00160
    00161
    00165    ClpGubMatrix();
    00167    virtual ~ClpGubMatrix();
    00169
    00173    ClpGubMatrix(const ClpGubMatrix&);
    00175    ClpGubMatrix(const CoinPackedMatrix&);
    00178   ClpGubMatrix (const ClpGubMatrix & wholeModel,
    00179                     int numberRows, const int * whichRows,
    00180                     int numberColumns, const int * whichColumns);
    00181   ClpGubMatrix (const CoinPackedMatrix & wholeModel,
    00182                     int numberRows, const int * whichRows,
    00183                     int numberColumns, const int * whichColumns);
    00184
    00186    ClpGubMatrix(CoinPackedMatrix * matrix);
    00187
    00190    ClpGubMatrix(ClpPackedMatrix * matrix, int numberSets,
    00191                 const int * start, const int * end,
    00192                 const double * lower, const double * upper,
    00193                 const unsigned char * status=NULL);
    00194
    00195    ClpGubMatrix& operator=(const ClpGubMatrix&);
    00197   virtual ClpMatrixBase * clone() const ;
    00200   virtual ClpMatrixBase * subsetClone (
    00201                     int numberRows, const int * whichRows,
    00202                     int numberColumns, const int * whichColumns) const ;
    00204   void redoSet(ClpSimplex * model,int newKey, int oldKey, int iSet);
    00206
    00208
    00209   inline ClpSimplex::Status getStatus(int sequence) const
    00210   {return static_cast<ClpSimplex::Status> (status_[sequence]&7);}
    00211   inline void setStatus(int sequence, ClpSimplex::Status status)
    00212   {
    00213     unsigned char & st_byte = status_[sequence];
    00214     st_byte = static_cast<unsigned char>(st_byte & ~7);
    00215     st_byte = static_cast<unsigned char>(st_byte | status);
    00216   }
    00218   inline void setFlagged( int sequence)
    00219   {
    00220     status_[sequence] = static_cast<unsigned char>(status_[sequence] | 64);
    00221   }
    00222   inline void clearFlagged( int sequence)
    00223   {
    00224     status_[sequence] = static_cast<unsigned char>(status_[sequence] & ~64);
    00225   }
    00226   inline bool flagged(int sequence) const
    00227   {return ((status_[sequence]&64)!=0);}
    00229   inline void setAbove( int sequence)
    00230   {
    00231     unsigned char iStat = status_[sequence];
    00232     iStat = static_cast<unsigned char>(iStat & ~24);
    00233     status_[sequence] = static_cast<unsigned char>(iStat|16);
    00234   }
    00236   inline void setFeasible( int sequence)
    00237   {
    00238     unsigned char iStat = status_[sequence];
    00239     iStat = static_cast<unsigned char>(iStat & ~24);
    00240     status_[sequence] = static_cast<unsigned char>(iStat|8);
    00241   }
    00243   inline void setBelow( int sequence)
    00244   {
    00245     unsigned char iStat = status_[sequence];
    00246     iStat = static_cast<unsigned char>(iStat & ~24);
    00247     status_[sequence] = iStat;
    00248   }
    00249   inline double weight( int sequence) const
    00250   {
    00251     int iStat = status_[sequence]&31;
    00252     iStat = iStat>>3;
    00253     return (double) (iStat-1);
    00254   }
    00256   inline int * start() const
    00257   { return start_;}
    00259   inline int * end() const
    00260   { return end_;}
    00262   inline double * lower() const
    00263   { return lower_;}
    00265   inline double * upper() const
    00266   { return upper_;}
    00268   inline int * keyVariable() const
    00269   { return keyVariable_;}
    00271   inline int * backward() const
    00272   { return backward_;}
    00274   inline int numberSets() const
    00275   { return numberSets_;}
    00277   void switchOffCheck();
    00279
    00280
    00281 protected:
    00285
    00286   double sumDualInfeasibilities_;
    00288   double sumPrimalInfeasibilities_;
    00290   double sumOfRelaxedDualInfeasibilities_;
    00292   double sumOfRelaxedPrimalInfeasibilities_;
    00294   double infeasibilityWeight_;
    00296   int * start_;
    00298   int * end_;
    00300   double * lower_;
    00302   double * upper_;
    00304   mutable unsigned char * status_;
    00306   unsigned char * saveStatus_;
    00308   int * savedKeyVariable_;
    00310   int * backward_;
    00312   int * backToPivotRow_;
    00314   double * changeCost_;
    00316   mutable int * keyVariable_;
    00320   mutable int * next_;
    00322   int * toIndex_;
    00323   // Reverse pointer from index to set
    00324   int * fromIndex_;
    00326   ClpSimplex * model_;
    00328   int numberDualInfeasibilities_;
    00330   int numberPrimalInfeasibilities_;
    00336   int noCheck_;
    00338   int numberSets_;
    00340   int saveNumber_;
    00342   int possiblePivotKey_;
    00344   int gubSlackIn_;
    00346   int firstGub_;
    00348   int lastGub_;
    00351   int gubType_;
    00353 };
    00354
    00355 #endif