00001
00002
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);};
00058 virtual void deleteRows(const int numDel, const int * indDel)
00059 { matrix_->deleteRows(numDel,indDel);};
00061 virtual void appendCols(int number, const CoinPackedVectorBase * const * columns)
00062 { matrix_->appendCols(number,columns);};
00064 virtual void appendRows(int number, const CoinPackedVectorBase * const * rows)
00065 { matrix_->appendRows(number,rows);};
00070 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 numberInBasis(const int * columnIsBasic) const ;
00079 virtual CoinBigIndex fillBasis(const ClpSimplex * model,
00080 const int * columnIsBasic, int & numberBasic,
00081 int * row, int * column,
00082 double * element) const ;
00085 virtual CoinBigIndex fillBasis(const ClpSimplex * model,
00086 const int * whichColumn,
00087 int numberRowBasic,
00088 int numberColumnBasic,
00089 int * row, int * column,
00090 double * element) const ;
00093 virtual int scale(ClpSimplex * model) const ;
00099 virtual bool allElementsInRange(ClpModel * model,
00100 double smallest, double largest);
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 ;
00115 virtual void unpackPacked(ClpSimplex * model,
00116 CoinIndexedVector * rowArray,
00117 int column) const;
00120 virtual void add(const ClpSimplex * model,CoinIndexedVector * rowArray,
00121 int column, double multiplier) const ;
00123 virtual void releasePackedMatrix() const { };
00128 virtual CoinBigIndex * dubiousWeights(const ClpSimplex * model,int * inputWeights) const;
00130 virtual bool canDoPartialPricing() const;
00132 virtual void partialPricing(ClpSimplex * model, int start, int end,
00133 int & bestSequence, int & numberWanted);
00135
00141 virtual void times(double scalar,
00142 const double * x, double * y) const;
00144 virtual void times(double scalar,
00145 const double * x, double * y,
00146 const double * rowScale,
00147 const double * columnScale) const;
00151 virtual void transposeTimes(double scalar,
00152 const double * x, double * y) const;
00154 virtual void transposeTimes(double scalar,
00155 const double * x, double * y,
00156 const double * rowScale,
00157 const double * columnScale) const;
00162 virtual void transposeTimes(const ClpSimplex * model, double scalar,
00163 const CoinIndexedVector * x,
00164 CoinIndexedVector * y,
00165 CoinIndexedVector * z) const;
00171 virtual void transposeTimesByRow(const ClpSimplex * model, double scalar,
00172 const CoinIndexedVector * x,
00173 CoinIndexedVector * y,
00174 CoinIndexedVector * z) const;
00179 virtual void subsetTransposeTimes(const ClpSimplex * model,
00180 const CoinIndexedVector * x,
00181 const CoinIndexedVector * y,
00182 CoinIndexedVector * z) const;
00184
00187
00188 inline CoinPackedMatrix * matrix() const { return matrix_;};
00190
00191
00195 ClpPackedMatrix();
00197 virtual ~ClpPackedMatrix();
00199
00203 ClpPackedMatrix(const ClpPackedMatrix&);
00205 ClpPackedMatrix(const CoinPackedMatrix&);
00208 ClpPackedMatrix (const ClpPackedMatrix & wholeModel,
00209 int numberRows, const int * whichRows,
00210 int numberColumns, const int * whichColumns);
00211 ClpPackedMatrix (const CoinPackedMatrix & wholeModel,
00212 int numberRows, const int * whichRows,
00213 int numberColumns, const int * whichColumns);
00214
00216 ClpPackedMatrix(CoinPackedMatrix * matrix);
00217
00218 ClpPackedMatrix& operator=(const ClpPackedMatrix&);
00220 virtual ClpMatrixBase * clone() const ;
00223 virtual ClpMatrixBase * subsetClone (
00224 int numberRows, const int * whichRows,
00225 int numberColumns, const int * whichColumns) const ;
00227
00228
00229 protected:
00233
00234 CoinPackedMatrix * matrix_;
00236 bool zeroElements_;
00238 };
00239
00240 #endif