Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members

ClpMatrixBase.hpp

00001 // Copyright (C) 2002, International Business Machines
00002 // Corporation and others.  All Rights Reserved.
00003 #ifndef ClpMatrixBase_H
00004 #define ClpMatrixBase_H
00005 
00006 #include "CoinPragma.hpp"
00007 
00008 #include "CoinPackedMatrix.hpp"
00009 class CoinIndexedVector;
00010 class ClpSimplex;
00011 class ClpModel;
00012 
00026 class ClpMatrixBase  {
00027   
00028 public:
00031 
00032    virtual CoinPackedMatrix * getPackedMatrix() const = 0;
00034   virtual bool isColOrdered() const = 0;
00036   virtual CoinBigIndex getNumElements() const = 0;
00038   virtual int getNumCols() const = 0;
00040   virtual int getNumRows() const = 0;
00041 
00046    virtual const double * getElements() const = 0;
00052    virtual const int * getIndices() const = 0;
00053 
00054    virtual const CoinBigIndex * getVectorStarts() const = 0;
00056    virtual const int * getVectorLengths() const = 0 ;
00058     virtual void deleteCols(const int numDel, const int * indDel) = 0;
00060     virtual void deleteRows(const int numDel, const int * indDel) = 0;
00062   virtual void appendCols(int number, const CoinPackedVectorBase * const * columns);
00064   virtual void appendRows(int number, const CoinPackedVectorBase * const * rows);
00065 
00068   virtual ClpMatrixBase * reverseOrderedCopy() const {return NULL;};
00069 
00070   // OLD - out soon
00073   virtual CoinBigIndex numberInBasis(const int * columnIsBasic) const = 0;
00075   virtual CoinBigIndex fillBasis(const ClpSimplex * model,
00076                                 const int * columnIsBasic, int & numberBasic,
00077                                 int * row, int * column,
00078                                 double * element) const = 0;
00081   virtual CoinBigIndex fillBasis(const ClpSimplex * model,
00082                                  const int * whichColumn, 
00083                                  int numberRowBasic,
00084                                  int numberColumnBasic,
00085                                  int * row, int * column,
00086                                  double * element) const = 0;
00090   virtual int scale(ClpSimplex * model) const 
00091   { return 1;};
00092 
00098   virtual bool allElementsInRange(ClpModel * model,
00099                                   double smallest, double largest)
00100   { return true;};
00104   virtual void rangeOfElements(double & smallestNegative, double & largestNegative,
00105                        double & smallestPositive, double & largestPositive);
00106 
00109   virtual void unpack(const ClpSimplex * model,CoinIndexedVector * rowArray,
00110                    int column) const =0;
00115   virtual void unpackPacked(ClpSimplex * model,
00116                             CoinIndexedVector * rowArray,
00117                             int column) const =0;
00122   int refresh(ClpSimplex * model)
00123     { return 0;};
00129   virtual CoinBigIndex * dubiousWeights(const ClpSimplex * model,int * inputWeights) const;
00132   virtual void add(const ClpSimplex * model,CoinIndexedVector * rowArray,
00133                    int column, double multiplier) const =0;
00135    virtual void releasePackedMatrix() const {};
00137   virtual bool canDoPartialPricing() const;
00139   virtual void partialPricing(ClpSimplex * model, int start, int end,
00140                       int & bestSequence, int & numberWanted);
00142 
00143   //---------------------------------------------------------------------------
00151   virtual void times(double scalar,
00152                        const double * x, double * y) const=0;
00156   virtual void times(double scalar,
00157                      const double * x, double * y,
00158                      const double * rowScale, 
00159                      const double * columnScale) const;
00163     virtual void transposeTimes(double scalar,
00164                                 const double * x, double * y) const = 0;
00168   virtual void transposeTimes(double scalar,
00169                                 const double * x, double * y,
00170                                 const double * rowScale, 
00171                                 const double * columnScale) const;
00176   virtual void transposeTimes(const ClpSimplex * model, double scalar,
00177                               const CoinIndexedVector * x,
00178                               CoinIndexedVector * y,
00179                               CoinIndexedVector * z) const = 0;
00185   virtual void subsetTransposeTimes(const ClpSimplex * model,
00186                               const CoinIndexedVector * x,
00187                               const CoinIndexedVector * y,
00188                               CoinIndexedVector * z) const = 0;
00190 
00191 
00192 
00193   virtual ClpMatrixBase * clone() const = 0;
00198   virtual ClpMatrixBase * subsetClone (
00199                     int numberRows, const int * whichRows,
00200                     int numberColumns, const int * whichColumns) const;
00201  
00203   inline int type() const
00204   { return type_;};
00206   void setType(int type) {type_=type;};
00208   
00209   
00210 protected:
00211 
00217    ClpMatrixBase();
00219 public:
00220    virtual ~ClpMatrixBase();
00221 protected:
00222   // Copy
00223    ClpMatrixBase(const ClpMatrixBase&);
00224   // Assignment
00225    ClpMatrixBase& operator=(const ClpMatrixBase&);
00227    
00228     
00229 protected:
00233 
00234    int type_;
00236 };
00237 // bias for free variables
00238 #define FREE_BIAS 1.0e1
00239 // Acceptance criteria for free variables
00240 #define FREE_ACCEPT 1.0e2
00241 
00242 #endif

Generated on Wed Dec 3 14:37:26 2003 for CLP by doxygen 1.3.5