ClpDummyMatrix.hpp
Go to the documentation of this file.
1 /* $Id: ClpDummyMatrix.hpp 1525 2010-02-26 17:27:59Z mjs $ */
2 // Copyright (C) 2003, International Business Machines
3 // Corporation and others. All Rights Reserved.
4 #ifndef ClpDummyMatrix_H
5 #define ClpDummyMatrix_H
6 
7 
8 #include "CoinPragma.hpp"
9 
10 #include "ClpMatrixBase.hpp"
11 
18 class ClpDummyMatrix : public ClpMatrixBase {
19 
20 public:
23  virtual CoinPackedMatrix * getPackedMatrix() const;
26  virtual bool isColOrdered() const {
27  return true;
28  }
30  virtual CoinBigIndex getNumElements() const {
31  return numberElements_;
32  }
34  virtual int getNumCols() const {
35  return numberColumns_;
36  }
38  virtual int getNumRows() const {
39  return numberRows_;
40  }
41 
46  virtual const double * getElements() const;
52  virtual const int * getIndices() const;
53 
54  virtual const CoinBigIndex * getVectorStarts() const;
56  virtual const int * getVectorLengths() const;
57 
59  virtual void deleteCols(const int numDel, const int * indDel);
61  virtual void deleteRows(const int numDel, const int * indDel);
63  virtual ClpMatrixBase * reverseOrderedCopy() const;
65  virtual CoinBigIndex countBasis(const int * whichColumn,
66  int & numberColumnBasic);
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);
76  virtual void unpack(const ClpSimplex * model, CoinIndexedVector * rowArray,
77  int column) const ;
82  virtual void unpackPacked(ClpSimplex * model,
83  CoinIndexedVector * rowArray,
84  int column) const;
87  virtual void add(const ClpSimplex * model, CoinIndexedVector * rowArray,
88  int column, double multiplier) const ;
90  virtual void add(const ClpSimplex * model, double * array,
91  int column, double multiplier) const;
94  virtual void releasePackedMatrix() const {}
96 
102  virtual void times(double scalar,
103  const double * x, double * y) const;
105  virtual void times(double scalar,
106  const double * x, double * y,
107  const double * rowScale,
108  const double * columnScale) const;
112  virtual void transposeTimes(double scalar,
113  const double * x, double * y) const;
115  virtual void transposeTimes(double scalar,
116  const double * x, double * y,
117  const double * rowScale,
118  const double * columnScale) const;
119 
124  virtual void transposeTimes(const ClpSimplex * model, double scalar,
125  const CoinIndexedVector * x,
126  CoinIndexedVector * y,
127  CoinIndexedVector * z) const;
132  virtual void subsetTransposeTimes(const ClpSimplex * model,
133  const CoinIndexedVector * x,
134  const CoinIndexedVector * y,
135  CoinIndexedVector * z) const;
137 
140 
141 
142 
146  ClpDummyMatrix();
148  ClpDummyMatrix(int numberColumns, int numberRows,
149  int numberElements);
151  virtual ~ClpDummyMatrix();
153 
159  ClpDummyMatrix(const CoinPackedMatrix&);
160 
163  virtual ClpMatrixBase * clone() const ;
165 
166 
167 protected:
171  int numberRows_;
177 
179 };
180 
181 #endif
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.
virtual int getNumRows() const
Number of rows.
virtual int getNumCols() const
Number of columns.
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.
virtual void deleteRows(const int numDel, const int *indDel)
Delete the rows whose indices are listed in indDel.
This implements a dummy matrix as derived from ClpMatrixBase.
virtual bool isColOrdered() const
Whether the packed matrix is column major ordered or not.
virtual const CoinBigIndex * getVectorStarts() const
Return a complete CoinPackedMatrix.
virtual ClpMatrixBase * clone() const
Clone.
ClpDummyMatrix()
Default constructor.
int numberColumns_
Number of columns.
virtual void transposeTimes(double scalar, const double *x, double *y) const
Return y + x * scalar * A in y.
virtual void releasePackedMatrix() const
Allow any parts of a created CoinMatrix to be deleted Allow any parts of a created CoinPackedMatrix t...
virtual CoinPackedMatrix * getPackedMatrix() const
Return a complete CoinPackedMatrix.
virtual const int * getVectorLengths() const
The lengths of the major-dimension vectors.
ClpDummyMatrix & operator=(const ClpDummyMatrix &)
The copy constructor.
virtual void unpack(const ClpSimplex *model, CoinIndexedVector *rowArray, int column) const
Unpacks a column into an CoinIndexedvector.
This solves LPs using the simplex method.
Definition: ClpSimplex.hpp:49
virtual void deleteCols(const int numDel, const int *indDel)
Delete the columns whose indices are listed in indDel.
Abstract base class for Clp Matrices.
virtual void times(double scalar, const double *x, double *y) const
Return y + A * scalar *x in y.
virtual CoinBigIndex countBasis(const int *whichColumn, int &numberColumnBasic)
Returns number of elements in column part of basis.
int numberRows_
Number of rows.
int numberElements_
Number of elements.
virtual const int * getIndices() const
A vector containing the minor indices of the elements in the packed matrix.
virtual ~ClpDummyMatrix()
Destructor.
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...
virtual ClpMatrixBase * reverseOrderedCopy() const
Returns a new matrix in reverse order without gaps.
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...
virtual const double * getElements() const
A vector containing the elements in the packed matrix.
virtual CoinBigIndex getNumElements() const
Number of entries in the packed matrix.
virtual void transposeTimes(double scalar, const double *x, double *y) const =0
Return y + x * scalar * A in y.