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

- File List
- File Members

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

Go to the documentation of this file.

    00001 /* $Id: ClpGubMatrix.hpp 1458 2009-11-05 12:34:07Z forrest $ */
    00002 // Copyright (C) 2003, International Business Machines
    00003 // Corporation and others.  All Rights Reserved.
    00004 #ifndef ClpGubMatrix_H
    00005 #define ClpGubMatrix_H
    00006
    00007
    00008 #include "CoinPragma.hpp"
    00009
    00010 #include "ClpPackedMatrix.hpp"
    00011 class ClpSimplex;
    00020 class ClpGubMatrix : public ClpPackedMatrix {
    00021
    00022 public:
    00026   virtual ClpMatrixBase * reverseOrderedCopy() const;
    00028   virtual CoinBigIndex countBasis(const int * whichColumn,
    00029                                   int & numberColumnBasic);
    00031   virtual void fillBasis(ClpSimplex * model,
    00032                                  const int * whichColumn,
    00033                                  int & numberColumnBasic,
    00034                                  int * row, int * start,
    00035                                  int * rowCount, int * columnCount,
    00036                                  CoinFactorizationDouble * element);
    00039   virtual void unpack(const ClpSimplex * model,CoinIndexedVector * rowArray,
    00040                    int column) const ;
    00045   virtual void unpackPacked(ClpSimplex * model,
    00046                             CoinIndexedVector * rowArray,
    00047                             int column) const;
    00050   virtual void add(const ClpSimplex * model,CoinIndexedVector * rowArray,
    00051                    int column, double multiplier) const ;
    00053   virtual void add(const ClpSimplex * model,double * array,
    00054                    int column, double multiplier) const;
    00056   virtual void partialPricing(ClpSimplex * model, double start, double end,
    00057                       int & bestSequence, int & numberWanted);
    00059   virtual int hiddenRows() const;
    00061
    00064
    00065   using ClpPackedMatrix::transposeTimes ;
    00070   virtual void transposeTimes(const ClpSimplex * model, double scalar,
    00071                               const CoinIndexedVector * x,
    00072                               CoinIndexedVector * y,
    00073                               CoinIndexedVector * z) const;
    00079   virtual void transposeTimesByRow(const ClpSimplex * model, double scalar,
    00080                               const CoinIndexedVector * x,
    00081                               CoinIndexedVector * y,
    00082                               CoinIndexedVector * z) const;
    00086   virtual void subsetTransposeTimes(const ClpSimplex * model,
    00087                                     const CoinIndexedVector * x,
    00088                                     const CoinIndexedVector * y,
    00089                                     CoinIndexedVector * z) const;
    00096   virtual int extendUpdated(ClpSimplex * model,CoinIndexedVector * update,int mode);
    00102   virtual void primalExpanded(ClpSimplex * model,int mode);
    00111   virtual void dualExpanded(ClpSimplex * model,CoinIndexedVector * array,
    00112                             double * other,int mode);
    00130   virtual int generalExpanded(ClpSimplex * model,int mode,int & number);
    00134   virtual int updatePivot(ClpSimplex * model,double oldInValue, double oldOutValue);
    00136   virtual void useEffectiveRhs(ClpSimplex * model,bool cheapest=true);
    00140   virtual double * rhsOffset(ClpSimplex * model,bool forceRefresh=false,
    00141                                 bool check=false);
    00154   virtual int synchronize(ClpSimplex * model,int mode);
    00156   virtual void correctSequence(const ClpSimplex * model,int & sequenceIn, int & sequenceOut) ;
    00158
    00159
    00160
    00164    ClpGubMatrix();
    00166    virtual ~ClpGubMatrix();
    00168
    00172    ClpGubMatrix(const ClpGubMatrix&);
    00174    ClpGubMatrix(const CoinPackedMatrix&);
    00177   ClpGubMatrix (const ClpGubMatrix & wholeModel,
    00178                     int numberRows, const int * whichRows,
    00179                     int numberColumns, const int * whichColumns);
    00180   ClpGubMatrix (const CoinPackedMatrix & wholeModel,
    00181                     int numberRows, const int * whichRows,
    00182                     int numberColumns, const int * whichColumns);
    00183
    00185    ClpGubMatrix(CoinPackedMatrix * matrix);
    00186
    00189    ClpGubMatrix(ClpPackedMatrix * matrix, int numberSets,
    00190                 const int * start, const int * end,
    00191                 const double * lower, const double * upper,
    00192                 const unsigned char * status=NULL);
    00193
    00194    ClpGubMatrix& operator=(const ClpGubMatrix&);
    00196   virtual ClpMatrixBase * clone() const ;
    00199   virtual ClpMatrixBase * subsetClone (
    00200                     int numberRows, const int * whichRows,
    00201                     int numberColumns, const int * whichColumns) const ;
    00203   void redoSet(ClpSimplex * model,int newKey, int oldKey, int iSet);
    00205
    00207
    00208   inline ClpSimplex::Status getStatus(int sequence) const
    00209   {return static_cast<ClpSimplex::Status> (status_[sequence]&7);}
    00210   inline void setStatus(int sequence, ClpSimplex::Status status)
    00211   {
    00212     unsigned char & st_byte = status_[sequence];
    00213     st_byte = static_cast<unsigned char>(st_byte & ~7);
    00214     st_byte = static_cast<unsigned char>(st_byte | status);
    00215   }
    00217   inline void setFlagged( int sequence)
    00218   {
    00219     status_[sequence] = static_cast<unsigned char>(status_[sequence] | 64);
    00220   }
    00221   inline void clearFlagged( int sequence)
    00222   {
    00223     status_[sequence] = static_cast<unsigned char>(status_[sequence] & ~64);
    00224   }
    00225   inline bool flagged(int sequence) const
    00226   {return ((status_[sequence]&64)!=0);}
    00228   inline void setAbove( int sequence)
    00229   {
    00230     unsigned char iStat = status_[sequence];
    00231     iStat = static_cast<unsigned char>(iStat & ~24);
    00232     status_[sequence] = static_cast<unsigned char>(iStat|16);
    00233   }
    00235   inline void setFeasible( int sequence)
    00236   {
    00237     unsigned char iStat = status_[sequence];
    00238     iStat = static_cast<unsigned char>(iStat & ~24);
    00239     status_[sequence] = static_cast<unsigned char>(iStat|8);
    00240   }
    00242   inline void setBelow( int sequence)
    00243   {
    00244     unsigned char iStat = status_[sequence];
    00245     iStat = static_cast<unsigned char>(iStat & ~24);
    00246     status_[sequence] = iStat;
    00247   }
    00248   inline double weight( int sequence) const
    00249   {
    00250     int iStat = status_[sequence]&31;
    00251     iStat = iStat>>3;
    00252     return static_cast<double> (iStat-1);
    00253   }
    00255   inline int * start() const
    00256   { return start_;}
    00258   inline int * end() const
    00259   { return end_;}
    00261   inline double * lower() const
    00262   { return lower_;}
    00264   inline double * upper() const
    00265   { return upper_;}
    00267   inline int * keyVariable() const
    00268   { return keyVariable_;}
    00270   inline int * backward() const
    00271   { return backward_;}
    00273   inline int numberSets() const
    00274   { return numberSets_;}
    00276   void switchOffCheck();
    00278
    00279
    00280 protected:
    00284
    00285   double sumDualInfeasibilities_;
    00287   double sumPrimalInfeasibilities_;
    00289   double sumOfRelaxedDualInfeasibilities_;
    00291   double sumOfRelaxedPrimalInfeasibilities_;
    00293   double infeasibilityWeight_;
    00295   int * start_;
    00297   int * end_;
    00299   double * lower_;
    00301   double * upper_;
    00303   mutable unsigned char * status_;
    00305   unsigned char * saveStatus_;
    00307   int * savedKeyVariable_;
    00309   int * backward_;
    00311   int * backToPivotRow_;
    00313   double * changeCost_;
    00315   mutable int * keyVariable_;
    00319   mutable int * next_;
    00321   int * toIndex_;
    00322   // Reverse pointer from index to set
    00323   int * fromIndex_;
    00325   ClpSimplex * model_;
    00327   int numberDualInfeasibilities_;
    00329   int numberPrimalInfeasibilities_;
    00335   int noCheck_;
    00337   int numberSets_;
    00339   int saveNumber_;
    00341   int possiblePivotKey_;
    00343   int gubSlackIn_;
    00345   int firstGub_;
    00347   int lastGub_;
    00350   int gubType_;
    00352 };
    00353
    00354 #endif