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

/home/coinadmin/Update/COIN/Clp/include/ClpPackedMatrix.hpp

Go to the documentation of this file.
00001 // Copyright (C) 2002, International Business Machines
00002 // Corporation and others.  All Rights Reserved.
00003 #ifndef ClpPackedMatrix_H
00004 #define ClpPackedMatrix_H
00005 
00006 
00007 #include "CoinPragma.hpp"
00008 
00009 #include "ClpMatrixBase.hpp"
00010 
00017 class ClpPackedMatrix : public ClpMatrixBase {
00018   
00019 public:
00022 
00023   virtual CoinPackedMatrix * getPackedMatrix() const { return matrix_;};
00025     virtual bool isColOrdered() const { return matrix_->isColOrdered(); }
00027   virtual  CoinBigIndex getNumElements() const 
00028   { return matrix_->getNumElements(); }
00030    virtual int getNumCols() const { return matrix_->getNumCols(); }
00032   virtual int getNumRows() const { return matrix_->getNumRows(); };
00033 
00038    virtual const double * getElements() const 
00039   { return matrix_->getElements();};
00045    virtual const int * getIndices() const 
00046   { return matrix_->getIndices();};
00047 
00048    virtual const CoinBigIndex * getVectorStarts() const 
00049   { return matrix_->getVectorStarts();};
00051    virtual const int * getVectorLengths() const 
00052   { return matrix_->getVectorLengths();} ;
00053 
00055     virtual void deleteCols(const int numDel, const int * indDel)
00056   { matrix_->deleteCols(numDel,indDel);numberActiveColumns_ = matrix_->getNumCols();};
00058     virtual void deleteRows(const int numDel, const int * indDel)
00059   { matrix_->deleteRows(numDel,indDel);numberActiveColumns_ = matrix_->getNumCols();};
00061   virtual void appendCols(int number, const CoinPackedVectorBase * const * columns)
00062   { matrix_->appendCols(number,columns);numberActiveColumns_ = matrix_->getNumCols();};
00064   virtual void appendRows(int number, const CoinPackedVectorBase * const * rows)
00065   { matrix_->appendRows(number,rows);numberActiveColumns_ = matrix_->getNumCols();};
00070   virtual void replaceVector(const int index,
00071                        const int numReplace, const double * newElements)
00072       {matrix_->replaceVector(index,numReplace,newElements);};
00074   virtual ClpMatrixBase * reverseOrderedCopy() const;
00077   virtual CoinBigIndex fillBasis(ClpSimplex * model,
00078                                  const int * whichColumn, 
00079                                  int numberRowBasic,
00080                                  int & numberColumnBasic,
00081                                  int * row, int * column,
00082                                  double * element)  ;
00085   virtual int scale(ClpModel * model) const ;
00088   virtual void scaleRowCopy(ClpModel * model) const ;
00092   virtual ClpMatrixBase * scaledColumnCopy(ClpModel * model) const ;
00098   virtual bool allElementsInRange(ClpModel * model,
00099                                   double smallest, double largest);
00103   virtual void rangeOfElements(double & smallestNegative, double & largestNegative,
00104                        double & smallestPositive, double & largestPositive);
00105 
00108   virtual void unpack(const ClpSimplex * model,CoinIndexedVector * rowArray,
00109                    int column) const ;
00114   virtual void unpackPacked(ClpSimplex * model,
00115                             CoinIndexedVector * rowArray,
00116                             int column) const;
00119   virtual void add(const ClpSimplex * model,CoinIndexedVector * rowArray,
00120                    int column, double multiplier) const ;
00122   virtual void add(const ClpSimplex * model,double * array,
00123                    int column, double multiplier) const;
00125    virtual void releasePackedMatrix() const { };
00130   virtual CoinBigIndex * dubiousWeights(const ClpSimplex * model,int * inputWeights) const;
00132   virtual bool canDoPartialPricing() const;
00134   virtual void partialPricing(ClpSimplex * model, double start, double end,
00135                       int & bestSequence, int & numberWanted);
00137   virtual int refresh(ClpSimplex * model);
00138   // Really scale matrix
00139   virtual void reallyScale(const double * rowScale, const double * columnScale);
00141 
00147   virtual void times(double scalar,
00148                        const double * x, double * y) const;
00150   virtual void times(double scalar,
00151                      const double * x, double * y,
00152                      const double * rowScale, 
00153                      const double * columnScale) const;
00157     virtual void transposeTimes(double scalar,
00158                                 const double * x, double * y) const;
00160     virtual void transposeTimes(double scalar,
00161                                 const double * x, double * y,
00162                                 const double * rowScale, 
00163                                 const double * columnScale) const;
00168   virtual void transposeTimes(const ClpSimplex * model, double scalar,
00169                               const CoinIndexedVector * x,
00170                               CoinIndexedVector * y,
00171                               CoinIndexedVector * z) const;
00176   void transposeTimesByColumn(const ClpSimplex * model, double scalar,
00177                               const CoinIndexedVector * x,
00178                               CoinIndexedVector * y,
00179                               CoinIndexedVector * z) const;
00184   void transposeTimesByColumn(const ClpSimplex * model, double scalar,
00185                               const CoinIndexedVector * x,
00186                               CoinIndexedVector * z) const;
00192   virtual void transposeTimesByRow(const ClpSimplex * model, double scalar,
00193                               const CoinIndexedVector * x,
00194                               CoinIndexedVector * y,
00195                               CoinIndexedVector * z) const;
00200   virtual void subsetTransposeTimes(const ClpSimplex * model,
00201                                     const CoinIndexedVector * x,
00202                                     const CoinIndexedVector * y,
00203                                     CoinIndexedVector * z) const;
00205   void useEffectiveRhs(ClpSimplex * model);
00207 
00210 
00211   inline CoinPackedMatrix * matrix() const { return matrix_;};
00215   inline void setMatrixNull()
00216   { matrix_=NULL;};
00218 
00219 
00223    ClpPackedMatrix();
00225    virtual ~ClpPackedMatrix();
00227 
00231    ClpPackedMatrix(const ClpPackedMatrix&);
00233    ClpPackedMatrix(const CoinPackedMatrix&);
00236   ClpPackedMatrix (const ClpPackedMatrix & wholeModel,
00237                     int numberRows, const int * whichRows,
00238                     int numberColumns, const int * whichColumns);
00239   ClpPackedMatrix (const CoinPackedMatrix & wholeModel,
00240                     int numberRows, const int * whichRows,
00241                     int numberColumns, const int * whichColumns);
00242 
00244    ClpPackedMatrix(CoinPackedMatrix * matrix);
00245 
00246    ClpPackedMatrix& operator=(const ClpPackedMatrix&);
00248   virtual ClpMatrixBase * clone() const ;
00251   virtual ClpMatrixBase * subsetClone (
00252                     int numberRows, const int * whichRows,
00253                     int numberColumns, const int * whichColumns) const ;
00255    
00256     
00257 protected:
00261 
00262   CoinPackedMatrix * matrix_;
00264   int numberActiveColumns_;
00266   bool zeroElements_;
00268   bool hasGaps_;
00270 };
00271 
00272 #endif

Generated on Fri Aug 6 02:01:32 2004 by doxygen1.3-rc2