Clp  1.17.8
ClpDummyMatrix.hpp
Go to the documentation of this file.
1 /* $Id$ */
2 // Copyright (C) 2003, International Business Machines
3 // Corporation and others. All Rights Reserved.
4 // This code is licensed under the terms of the Eclipse Public License (EPL).
5 
6 #ifndef ClpDummyMatrix_H
7 #define ClpDummyMatrix_H
8 
9 #include "CoinPragma.hpp"
10 
11 #include "ClpMatrixBase.hpp"
12 
18 class ClpDummyMatrix : public ClpMatrixBase {
19 
20 public:
23  virtual CoinPackedMatrix *getPackedMatrix() const;
26  virtual bool isColOrdered() const
27  {
28  return true;
29  }
31  virtual CoinBigIndex getNumElements() const
32  {
33  return numberElements_;
34  }
36  virtual int getNumCols() const
37  {
38  return numberColumns_;
39  }
41  virtual int getNumRows() const
42  {
43  return numberRows_;
44  }
45 
50  virtual const double *getElements() const;
56  virtual const int *getIndices() const;
57 
58  virtual const CoinBigIndex *getVectorStarts() const;
60  virtual const int *getVectorLengths() const;
61 
63  virtual void deleteCols(const int numDel, const int *indDel);
65  virtual void deleteRows(const int numDel, const int *indDel);
67  virtual ClpMatrixBase *reverseOrderedCopy() const;
69  virtual int countBasis(const int *whichColumn,
70  int &numberColumnBasic);
72  virtual void fillBasis(ClpSimplex *model,
73  const int *whichColumn,
74  int &numberColumnBasic,
75  int *row, int *start,
76  int *rowCount, int *columnCount,
77  CoinFactorizationDouble *element);
80  virtual void unpack(const ClpSimplex *model, CoinIndexedVector *rowArray,
81  int column) const;
86  virtual void unpackPacked(ClpSimplex *model,
87  CoinIndexedVector *rowArray,
88  int column) const;
91  virtual void add(const ClpSimplex *model, CoinIndexedVector *rowArray,
92  int column, double multiplier) const;
94  virtual void add(const ClpSimplex *model, double *array,
95  int column, double multiplier) const;
98  virtual void releasePackedMatrix() const {}
100 
106  virtual void times(double scalar,
107  const double *x, double *y) const;
109  virtual void times(double scalar,
110  const double *x, double *y,
111  const double *rowScale,
112  const double *columnScale) const;
116  virtual void transposeTimes(double scalar,
117  const double *x, double *y) const;
119  virtual void transposeTimes(double scalar,
120  const double *x, double *y,
121  const double *rowScale,
122  const double *columnScale) const;
123 
128  virtual void transposeTimes(const ClpSimplex *model, double scalar,
129  const CoinIndexedVector *x,
130  CoinIndexedVector *y,
131  CoinIndexedVector *z) const;
136  virtual void subsetTransposeTimes(const ClpSimplex *model,
137  const CoinIndexedVector *x,
138  const CoinIndexedVector *y,
139  CoinIndexedVector *z) const;
141 
144 
145 
149  ClpDummyMatrix();
151  ClpDummyMatrix(int numberColumns, int numberRows,
152  int numberElements);
154  virtual ~ClpDummyMatrix();
156 
162  ClpDummyMatrix(const CoinPackedMatrix &);
163 
166  virtual ClpMatrixBase *clone() const;
168 
169 protected:
173  int numberRows_;
179 
181 };
182 
183 #endif
184 
185 /* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2
186 */
ClpSimplex
This solves LPs using the simplex method.
Definition: ClpSimplex.hpp:106
ClpDummyMatrix::operator=
ClpDummyMatrix & operator=(const ClpDummyMatrix &)
ClpDummyMatrix::times
virtual void times(double scalar, const double *x, double *y) const
Return y + A * scalar *x in y.
ClpDummyMatrix::deleteCols
virtual void deleteCols(const int numDel, const int *indDel)
Delete the columns whose indices are listed in indDel.
ClpDummyMatrix::numberElements_
int numberElements_
Number of elements.
Definition: ClpDummyMatrix.hpp:178
ClpDummyMatrix::transposeTimes
virtual void transposeTimes(double scalar, const double *x, double *y) const
Return y + x * scalar * A in y.
ClpDummyMatrix::getIndices
virtual const int * getIndices() const
A vector containing the minor indices of the elements in the packed matrix.
ClpDummyMatrix::unpackPacked
virtual void unpackPacked(ClpSimplex *model, CoinIndexedVector *rowArray, int column) const
Unpacks a column into an CoinIndexedvector in packed foramt Note that model is NOT const.
ClpDummyMatrix::isColOrdered
virtual bool isColOrdered() const
Whether the packed matrix is column major ordered or not.
Definition: ClpDummyMatrix.hpp:26
ClpDummyMatrix::getNumRows
virtual int getNumRows() const
Number of rows.
Definition: ClpDummyMatrix.hpp:41
ClpMatrixBase.hpp
ClpDummyMatrix::deleteRows
virtual void deleteRows(const int numDel, const int *indDel)
Delete the rows whose indices are listed in indDel.
ClpDummyMatrix::releasePackedMatrix
virtual void releasePackedMatrix() const
Allow any parts of a created CoinMatrix to be deleted Allow any parts of a created CoinPackedMatrix t...
Definition: ClpDummyMatrix.hpp:98
ClpDummyMatrix::getNumCols
virtual int getNumCols() const
Number of columns.
Definition: ClpDummyMatrix.hpp:36
ClpDummyMatrix::clone
virtual ClpMatrixBase * clone() const
Clone.
ClpDummyMatrix::getVectorStarts
virtual const CoinBigIndex * getVectorStarts() const
ClpDummyMatrix::reverseOrderedCopy
virtual ClpMatrixBase * reverseOrderedCopy() const
Returns a new matrix in reverse order without gaps.
ClpMatrixBase
Abstract base class for Clp Matrices.
Definition: ClpMatrixBase.hpp:38
ClpDummyMatrix::subsetTransposeTimes
virtual void subsetTransposeTimes(const ClpSimplex *model, const CoinIndexedVector *x, const CoinIndexedVector *y, CoinIndexedVector *z) const
Return x *A in z but just for indices in y.
ClpMatrixBase::transposeTimes
virtual void transposeTimes(double scalar, const double *COIN_RESTRICT x, double *COIN_RESTRICT y) const =0
Return y + x * scalar * A in y.
ClpDummyMatrix::getVectorLengths
virtual const int * getVectorLengths() const
The lengths of the major-dimension vectors.
ClpDummyMatrix::add
virtual void add(const ClpSimplex *model, CoinIndexedVector *rowArray, int column, double multiplier) const
Adds multiple of a column into an CoinIndexedvector You can use quickAdd to add to vector.
ClpDummyMatrix::unpack
virtual void unpack(const ClpSimplex *model, CoinIndexedVector *rowArray, int column) const
Unpacks a column into an CoinIndexedvector.
ClpDummyMatrix::countBasis
virtual int countBasis(const int *whichColumn, int &numberColumnBasic)
Returns number of elements in column part of basis.
ClpDummyMatrix::getPackedMatrix
virtual CoinPackedMatrix * getPackedMatrix() const
Return a complete CoinPackedMatrix.
ClpDummyMatrix::numberColumns_
int numberColumns_
Number of columns.
Definition: ClpDummyMatrix.hpp:176
ClpDummyMatrix::numberRows_
int numberRows_
Number of rows.
Definition: ClpDummyMatrix.hpp:174
ClpDummyMatrix::fillBasis
virtual void fillBasis(ClpSimplex *model, const int *whichColumn, int &numberColumnBasic, int *row, int *start, int *rowCount, int *columnCount, CoinFactorizationDouble *element)
Fills in column part of basis.
ClpDummyMatrix::~ClpDummyMatrix
virtual ~ClpDummyMatrix()
Destructor.
ClpDummyMatrix::getElements
virtual const double * getElements() const
A vector containing the elements in the packed matrix.
ClpDummyMatrix
This implements a dummy matrix as derived from ClpMatrixBase.
Definition: ClpDummyMatrix.hpp:18
ClpDummyMatrix::ClpDummyMatrix
ClpDummyMatrix()
Default constructor.
ClpDummyMatrix::getNumElements
virtual CoinBigIndex getNumElements() const
Number of entries in the packed matrix.
Definition: ClpDummyMatrix.hpp:31