Changeset 1502 for trunk/Clp/src/ClpDummyMatrix.hpp
 Timestamp:
 Jan 29, 2010 9:25:07 AM (9 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/Clp/src/ClpDummyMatrix.hpp
r1402 r1502 17 17 18 18 class ClpDummyMatrix : public ClpMatrixBase { 19 19 20 20 public: 21 /**@name Useful methods */22 //@{23 /// Return a complete CoinPackedMatrix24 virtual CoinPackedMatrix * getPackedMatrix() const;21 /**@name Useful methods */ 22 //@{ 23 /// Return a complete CoinPackedMatrix 24 virtual CoinPackedMatrix * getPackedMatrix() const; 25 25 /** Whether the packed matrix is column major ordered or not. */ 26 virtual bool isColOrdered() const { return true; } 27 /** Number of entries in the packed matrix. */ 28 virtual CoinBigIndex getNumElements() const 29 { return numberElements_; } 30 /** Number of columns. */ 31 virtual int getNumCols() const { return numberColumns_; } 32 /** Number of rows. */ 33 virtual int getNumRows() const { return numberRows_; } 26 virtual bool isColOrdered() const { 27 return true; 28 } 29 /** Number of entries in the packed matrix. */ 30 virtual CoinBigIndex getNumElements() const { 31 return numberElements_; 32 } 33 /** Number of columns. */ 34 virtual int getNumCols() const { 35 return numberColumns_; 36 } 37 /** Number of rows. */ 38 virtual int getNumRows() const { 39 return numberRows_; 40 } 34 41 35 /** A vector containing the elements in the packed matrix. Note that there36 37 38 39 virtual const double * getElements() const;40 /** A vector containing the minor indices of the elements in the packed41 matrix. Note that there might be gaps in this list, entries that do not42 belong to any majordimension vector. To get the actual elements one43 should look at this vector together with vectorStarts and44 vectorLengths. */45 virtual const int * getIndices() const;42 /** A vector containing the elements in the packed matrix. Note that there 43 might be gaps in this list, entries that do not belong to any 44 majordimension vector. To get the actual elements one should look at 45 this vector together with vectorStarts and vectorLengths. */ 46 virtual const double * getElements() const; 47 /** A vector containing the minor indices of the elements in the packed 48 matrix. Note that there might be gaps in this list, entries that do not 49 belong to any majordimension vector. To get the actual elements one 50 should look at this vector together with vectorStarts and 51 vectorLengths. */ 52 virtual const int * getIndices() const; 46 53 47 virtual const CoinBigIndex * getVectorStarts() const;48 /** The lengths of the majordimension vectors. */49 virtual const int * getVectorLengths() const;54 virtual const CoinBigIndex * getVectorStarts() const; 55 /** The lengths of the majordimension vectors. */ 56 virtual const int * getVectorLengths() const; 50 57 51 58 /** Delete the columns whose indices are listed in <code>indDel</code>. */ 52 virtual void deleteCols(const int numDel, const int * indDel);59 virtual void deleteCols(const int numDel, const int * indDel); 53 60 /** Delete the rows whose indices are listed in <code>indDel</code>. */ 54 virtual void deleteRows(const int numDel, const int * indDel);55 /** Returns a new matrix in reverse order without gaps */56 virtual ClpMatrixBase * reverseOrderedCopy() const;57 /// Returns number of elements in column part of basis58 virtual CoinBigIndex countBasis(const int * whichColumn,59 60 /// Fills in column part of basis61 virtual void fillBasis(ClpSimplex * model,62 const int * whichColumn, 63 64 65 66 67 /** Unpacks a column into an CoinIndexedvector68 */69 virtual void unpack(const ClpSimplex * model,CoinIndexedVector * rowArray,70 71 /** Unpacks a column into an CoinIndexedvector72 ** in packed foramt73 Note that model is NOT const. Bounds and objective could74 be modified if doing column generation (just for this variable) */75 virtual void unpackPacked(ClpSimplex * model,76 77 78 /** Adds multiple of a column into an CoinIndexedvector79 You can use quickAdd to add to vector */80 virtual void add(const ClpSimplex * model,CoinIndexedVector * rowArray,81 82 /** Adds multiple of a column into an array */83 virtual void add(const ClpSimplex * model,double * array,84 85 /// Allow any parts of a created CoinMatrix to be deleted86 /// Allow any parts of a created CoinPackedMatrix to be deleted87 virtual void releasePackedMatrix() const {}88 //@}61 virtual void deleteRows(const int numDel, const int * indDel); 62 /** Returns a new matrix in reverse order without gaps */ 63 virtual ClpMatrixBase * reverseOrderedCopy() const; 64 /// Returns number of elements in column part of basis 65 virtual CoinBigIndex countBasis(const int * whichColumn, 66 int & numberColumnBasic); 67 /// Fills in column part of basis 68 virtual void fillBasis(ClpSimplex * model, 69 const int * whichColumn, 70 int & numberColumnBasic, 71 int * row, int * start, 72 int * rowCount, int * columnCount, 73 CoinFactorizationDouble * element); 74 /** Unpacks a column into an CoinIndexedvector 75 */ 76 virtual void unpack(const ClpSimplex * model, CoinIndexedVector * rowArray, 77 int column) const ; 78 /** Unpacks a column into an CoinIndexedvector 79 ** in packed foramt 80 Note that model is NOT const. Bounds and objective could 81 be modified if doing column generation (just for this variable) */ 82 virtual void unpackPacked(ClpSimplex * model, 83 CoinIndexedVector * rowArray, 84 int column) const; 85 /** Adds multiple of a column into an CoinIndexedvector 86 You can use quickAdd to add to vector */ 87 virtual void add(const ClpSimplex * model, CoinIndexedVector * rowArray, 88 int column, double multiplier) const ; 89 /** Adds multiple of a column into an array */ 90 virtual void add(const ClpSimplex * model, double * array, 91 int column, double multiplier) const; 92 /// Allow any parts of a created CoinMatrix to be deleted 93 /// Allow any parts of a created CoinPackedMatrix to be deleted 94 virtual void releasePackedMatrix() const {} 95 //@} 89 96 90 /**@name Matrix times vector methods */91 //@{97 /**@name Matrix times vector methods */ 98 //@{ 92 99 /** Return <code>y + A * scalar *x</code> in <code>y</code>. 93 100 @pre <code>x</code> must be of size <code>numColumns()</code> 94 101 @pre <code>y</code> must be of size <code>numRows()</code> */ 95 virtual void times(double scalar,96 97 /// And for scaling98 virtual void times(double scalar,99 100 const double * rowScale, 101 102 virtual void times(double scalar, 103 const double * x, double * y) const; 104 /// And for scaling 105 virtual void times(double scalar, 106 const double * x, double * y, 107 const double * rowScale, 108 const double * columnScale) const; 102 109 /** Return <code>y + x * scalar * A</code> in <code>y</code>. 103 110 @pre <code>x</code> must be of size <code>numRows()</code> 104 111 @pre <code>y</code> must be of size <code>numColumns()</code> */ 105 112 virtual void transposeTimes(double scalar, 106 107 /// And for scaling113 const double * x, double * y) const; 114 /// And for scaling 108 115 virtual void transposeTimes(double scalar, 109 110 const double * rowScale, 111 116 const double * x, double * y, 117 const double * rowScale, 118 const double * columnScale) const; 112 119 113 using ClpMatrixBase::transposeTimes ;114 /** Return <code>x * scalar * A + y</code> in <code>z</code>. 115 116 117 virtual void transposeTimes(const ClpSimplex * model, double scalar,118 119 120 120 using ClpMatrixBase::transposeTimes ; 121 /** Return <code>x * scalar * A + y</code> in <code>z</code>. 122 Can use y as temporary array (will be empty at end) 123 Note  If x packed mode  then z packed mode */ 124 virtual void transposeTimes(const ClpSimplex * model, double scalar, 125 const CoinIndexedVector * x, 126 CoinIndexedVector * y, 127 CoinIndexedVector * z) const; 121 128 /** Return <code>x *A</code> in <code>z</code> but 122 123 124 125 virtual void subsetTransposeTimes(const ClpSimplex * model,126 127 128 129 //@}129 just for indices in y. 130 Note  If x packed mode  then z packed mode 131 Squashes small elements and knows about ClpSimplex */ 132 virtual void subsetTransposeTimes(const ClpSimplex * model, 133 const CoinIndexedVector * x, 134 const CoinIndexedVector * y, 135 CoinIndexedVector * z) const; 136 //@} 130 137 131 /**@name Other */132 //@{133 //@}138 /**@name Other */ 139 //@{ 140 //@} 134 141 135 142 136 /**@name Constructors, destructor */137 //@{138 /** Default constructor. */139 ClpDummyMatrix();140 /// Constructor with data141 ClpDummyMatrix(int numberColumns, int numberRows,142 143 /** Destructor */144 virtual ~ClpDummyMatrix();145 //@}143 /**@name Constructors, destructor */ 144 //@{ 145 /** Default constructor. */ 146 ClpDummyMatrix(); 147 /// Constructor with data 148 ClpDummyMatrix(int numberColumns, int numberRows, 149 int numberElements); 150 /** Destructor */ 151 virtual ~ClpDummyMatrix(); 152 //@} 146 153 147 /**@name Copy method */148 //@{149 /** The copy constructor. */150 ClpDummyMatrix(const ClpDummyMatrix&);151 /** The copy constructor from an CoinDummyMatrix. */152 ClpDummyMatrix(const CoinPackedMatrix&);154 /**@name Copy method */ 155 //@{ 156 /** The copy constructor. */ 157 ClpDummyMatrix(const ClpDummyMatrix&); 158 /** The copy constructor from an CoinDummyMatrix. */ 159 ClpDummyMatrix(const CoinPackedMatrix&); 153 160 154 ClpDummyMatrix& operator=(const ClpDummyMatrix&);155 /// Clone156 virtual ClpMatrixBase * clone() const ;157 //@}158 159 161 ClpDummyMatrix& operator=(const ClpDummyMatrix&); 162 /// Clone 163 virtual ClpMatrixBase * clone() const ; 164 //@} 165 166 160 167 protected: 161 /**@name Data members162 The data members are protected to allow access for derived classes. */163 //@{164 /// Number of rows165 int numberRows_;166 /// Number of columns167 int numberColumns_;168 /// Number of elements169 int numberElements_;170 171 //@}168 /**@name Data members 169 The data members are protected to allow access for derived classes. */ 170 //@{ 171 /// Number of rows 172 int numberRows_; 173 /// Number of columns 174 int numberColumns_; 175 /// Number of elements 176 int numberElements_; 177 178 //@} 172 179 }; 173 180
Note: See TracChangeset
for help on using the changeset viewer.