/home/coin/SVN-release/CoinAll-1.1.0/Clp/src/ClpNetworkMatrix.hpp

Go to the documentation of this file.
00001 // Copyright (C) 2003, International Business Machines
00002 // Corporation and others.  All Rights Reserved.
00003 #ifndef ClpNetworkMatrix_H
00004 #define ClpNetworkMatrix_H
00005 
00006 
00007 #include "CoinPragma.hpp"
00008 
00009 #include "ClpMatrixBase.hpp"
00010 
00016 class ClpNetworkMatrix : public ClpMatrixBase {
00017   
00018 public:
00021 
00022    virtual CoinPackedMatrix * getPackedMatrix() const;
00024    virtual bool isColOrdered() const { return true; }
00026   virtual  CoinBigIndex getNumElements() const 
00027   { return 2*numberColumns_; }
00029    virtual int getNumCols() const { return numberColumns_; }
00031   virtual int getNumRows() const { return numberRows_; }
00032 
00037   virtual const double * getElements() const; 
00043   virtual const int * getIndices() const
00044   { return indices_;}
00045 
00046   virtual const CoinBigIndex * getVectorStarts() const;
00048   virtual const int * getVectorLengths() const;
00049 
00051   virtual void deleteCols(const int numDel, const int * indDel);
00053   virtual void deleteRows(const int numDel, const int * indDel);
00055   virtual void appendCols(int number, const CoinPackedVectorBase * const * columns);
00057   virtual void appendRows(int number, const CoinPackedVectorBase * const * rows);
00058 #ifndef SLIM_CLP
00059 
00063   virtual int appendMatrix(int number, int type,
00064                            const CoinBigIndex * starts, const int * index,
00065                            const double * element, int numberOther=-1);
00066 #endif
00067 
00068   virtual ClpMatrixBase * reverseOrderedCopy() const;
00070   virtual CoinBigIndex countBasis(ClpSimplex * model,
00071                                  const int * whichColumn, 
00072                                  int numberRowBasic,
00073                                   int & numberColumnBasic);
00075   virtual void fillBasis(ClpSimplex * model,
00076                                  const int * whichColumn, 
00077                                  int & numberColumnBasic,
00078                                  int * row, int * start,
00079                                  int * rowCount, int * columnCount,
00080                                  double * element);
00085   virtual CoinBigIndex * dubiousWeights(const ClpSimplex * model,int * inputWeights) const;
00089   virtual void rangeOfElements(double & smallestNegative, double & largestNegative,
00090                        double & smallestPositive, double & largestPositive);
00093   virtual void unpack(const ClpSimplex * model,CoinIndexedVector * rowArray,
00094                    int column) const ;
00099   virtual void unpackPacked(ClpSimplex * model,
00100                             CoinIndexedVector * rowArray,
00101                             int column) const;
00104   virtual void add(const ClpSimplex * model,CoinIndexedVector * rowArray,
00105                    int column, double multiplier) const ;
00107   virtual void add(const ClpSimplex * model,double * array,
00108                    int column, double multiplier) const;
00110    virtual void releasePackedMatrix() const ;
00112   virtual bool canDoPartialPricing() const;
00114   virtual void partialPricing(ClpSimplex * model, double start, double end,
00115                       int & bestSequence, int & numberWanted);
00117 
00123   virtual void times(double scalar,
00124                        const double * x, double * y) const;
00126   virtual void times(double scalar,
00127                      const double * x, double * y,
00128                      const double * rowScale, 
00129                      const double * columnScale) const;
00133     virtual void transposeTimes(double scalar,
00134                                 const double * x, double * y) const;
00136     virtual void transposeTimes(double scalar,
00137                                 const double * x, double * y,
00138                                 const double * rowScale, 
00139                                 const double * columnScale, double * spare=NULL) const;
00144   virtual void transposeTimes(const ClpSimplex * model, double scalar,
00145                               const CoinIndexedVector * x,
00146                               CoinIndexedVector * y,
00147                               CoinIndexedVector * z) const;
00151   virtual void subsetTransposeTimes(const ClpSimplex * model,
00152                                     const CoinIndexedVector * x,
00153                                     const CoinIndexedVector * y,
00154                                     CoinIndexedVector * z) const;
00156 
00159 
00160   inline bool trueNetwork() const
00161   { return trueNetwork_;}
00163 
00164 
00168    ClpNetworkMatrix();
00170   ClpNetworkMatrix(int numberColumns, const int * head,
00171                    const int * tail);
00173    virtual ~ClpNetworkMatrix();
00175 
00179    ClpNetworkMatrix(const ClpNetworkMatrix&);
00181    ClpNetworkMatrix(const CoinPackedMatrix&);
00182 
00183    ClpNetworkMatrix& operator=(const ClpNetworkMatrix&);
00185   virtual ClpMatrixBase * clone() const ;
00188   ClpNetworkMatrix (const ClpNetworkMatrix & wholeModel,
00189                     int numberRows, const int * whichRows,
00190                     int numberColumns, const int * whichColumns);
00193   virtual ClpMatrixBase * subsetClone (
00194                     int numberRows, const int * whichRows,
00195                     int numberColumns, const int * whichColumns) const ;
00197    
00198     
00199 protected:
00203 
00204   mutable CoinPackedMatrix * matrix_;
00205   mutable int * lengths_;
00207   int * indices_;
00209   int numberRows_;
00211   int numberColumns_;
00213   bool trueNetwork_;
00214   
00216 };
00217 
00218 #endif

Generated on Sun Nov 14 14:06:32 2010 for Coin-All by  doxygen 1.4.7