Cbc  2.9.9
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ClpDummyMatrix.hpp
Go to the documentation of this file.
1 /* $Id: ClpDummyMatrix.hpp 1665 2011-01-04 17:55:54Z lou $ */
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 
10 #include "CoinPragma.hpp"
11 
12 #include "ClpMatrixBase.hpp"
13 
20 class ClpDummyMatrix : public ClpMatrixBase {
21 
22 public:
25  virtual CoinPackedMatrix * getPackedMatrix() const;
28  virtual bool isColOrdered() const {
29  return true;
30  }
32  virtual CoinBigIndex getNumElements() const {
33  return numberElements_;
34  }
36  virtual int getNumCols() const {
37  return numberColumns_;
38  }
40  virtual int getNumRows() const {
41  return numberRows_;
42  }
43 
48  virtual const double * getElements() const;
54  virtual const int * getIndices() const;
55 
56  virtual const CoinBigIndex * getVectorStarts() const;
58  virtual const int * getVectorLengths() const;
59 
61  virtual void deleteCols(const int numDel, const int * indDel);
63  virtual void deleteRows(const int numDel, const int * indDel);
65  virtual ClpMatrixBase * reverseOrderedCopy() const;
67  virtual CoinBigIndex countBasis(const int * whichColumn,
68  int & numberColumnBasic);
70  virtual void fillBasis(ClpSimplex * model,
71  const int * whichColumn,
72  int & numberColumnBasic,
73  int * row, int * start,
74  int * rowCount, int * columnCount,
75  CoinFactorizationDouble * element);
78  virtual void unpack(const ClpSimplex * model, CoinIndexedVector * rowArray,
79  int column) const ;
84  virtual void unpackPacked(ClpSimplex * model,
85  CoinIndexedVector * rowArray,
86  int column) const;
89  virtual void add(const ClpSimplex * model, CoinIndexedVector * rowArray,
90  int column, double multiplier) const ;
92  virtual void add(const ClpSimplex * model, double * array,
93  int column, double multiplier) const;
96  virtual void releasePackedMatrix() const {}
98 
104  virtual void times(double scalar,
105  const double * x, double * y) const;
107  virtual void times(double scalar,
108  const double * x, double * y,
109  const double * rowScale,
110  const double * columnScale) const;
114  virtual void transposeTimes(double scalar,
115  const double * x, double * y) const;
117  virtual void transposeTimes(double scalar,
118  const double * x, double * y,
119  const double * rowScale,
120  const double * columnScale) const;
121 
126  virtual void transposeTimes(const ClpSimplex * model, double scalar,
127  const CoinIndexedVector * x,
128  CoinIndexedVector * y,
129  CoinIndexedVector * z) const;
134  virtual void subsetTransposeTimes(const ClpSimplex * model,
135  const CoinIndexedVector * x,
136  const CoinIndexedVector * y,
137  CoinIndexedVector * z) const;
139 
142 
143 
144 
148  ClpDummyMatrix();
150  ClpDummyMatrix(int numberColumns, int numberRows,
151  int numberElements);
153  virtual ~ClpDummyMatrix();
155 
162 
165  virtual ClpMatrixBase * clone() const ;
167 
168 
169 protected:
173  int numberRows_;
179 
181 };
182 
183 #endif
This implements a dummy matrix as derived from ClpMatrixBase.
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 const double * getElements() const
A vector containing the elements in the packed matrix.
virtual CoinPackedMatrix * getPackedMatrix() const
Return a complete CoinPackedMatrix.
virtual void times(double scalar, const double *x, double *y) const
Return y + A * scalar *x in y.
Abstract base class for Clp Matrices.
virtual void transposeTimes(double scalar, const double *x, double *y) const
Return y + x * scalar * A in y.
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 CoinBigIndex getNumElements() const
Number of entries in the packed matrix.
virtual ~ClpDummyMatrix()
Destructor.
virtual int getNumRows() const
Number of rows.
virtual void releasePackedMatrix() const
Allow any parts of a created CoinMatrix to be deleted Allow any parts of a created CoinPackedMatrix t...
virtual const int * getIndices() const
A vector containing the minor indices of the elements in the packed matrix.
int numberColumns_
Number of columns.
virtual void transposeTimes(double scalar, const double *COIN_RESTRICT x, double *COIN_RESTRICT y) const =0
Return y + x * scalar * A in y.
ClpDummyMatrix & operator=(const ClpDummyMatrix &)
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 void deleteRows(const int numDel, const int *indDel)
Delete the rows whose indices are listed in indDel.
int numberElements_
Number of elements.
double CoinFactorizationDouble
Definition: CoinTypes.hpp:57
virtual ClpMatrixBase * clone() const
Clone.
This solves LPs using the simplex method.
Definition: ClpSimplex.hpp:70
Indexed Vector.
ClpDummyMatrix()
Default constructor.
virtual CoinBigIndex countBasis(const int *whichColumn, int &numberColumnBasic)
Returns number of elements in column part of basis.
virtual void subsetTransposeTimes(const ClpSimplex *model, const CoinIndexedVector *x, const CoinIndexedVector *y, CoinIndexedVector *z) const
Return <code>x *A</code> in <code>z</code> but just for indices in y.
virtual bool isColOrdered() const
Whether the packed matrix is column major ordered or not.
virtual int getNumCols() const
Number of columns.
Sparse Matrix Base Class.
int CoinBigIndex
int numberRows_
Number of rows.
virtual const int * getVectorLengths() const
The lengths of the major-dimension vectors.
virtual const CoinBigIndex * getVectorStarts() const
virtual void unpack(const ClpSimplex *model, CoinIndexedVector *rowArray, int column) const
Unpacks a column into an CoinIndexedvector.
virtual void deleteCols(const int numDel, const int *indDel)
Delete the columns whose indices are listed in indDel.