- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

ClpNetworkMatrix.hpp
Go to the documentation of this file.
1 /* $Id: ClpNetworkMatrix.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 ClpNetworkMatrix_H
7 #define ClpNetworkMatrix_H
8
9
10 #include "CoinPragma.hpp"
11
12 #include "ClpMatrixBase.hpp"
13
19 class ClpNetworkMatrix : public ClpMatrixBase {
20
21 public:
24 virtual CoinPackedMatrix * getPackedMatrix() const;
27 virtual bool isColOrdered() const {
28 return true;
29 }
31 virtual CoinBigIndex getNumElements() const {
32 return 2 * numberColumns_;
33 }
35 virtual int getNumCols() const {
36 return numberColumns_;
37 }
39 virtual int getNumRows() const {
40 return numberRows_;
41 }
42
47 virtual const double * getElements() const;
53 virtual const int * getIndices() const {
54 return indices_;
55 }
56
57 virtual const CoinBigIndex * getVectorStarts() const;
59 virtual const int * getVectorLengths() const;
60
62 virtual void deleteCols(const int numDel, const int * indDel);
64 virtual void deleteRows(const int numDel, const int * indDel);
66 virtual void appendCols(int number, const CoinPackedVectorBase * const * columns);
68 virtual void appendRows(int number, const CoinPackedVectorBase * const * rows);
69 #ifndef SLIM_CLP
70
74 virtual int appendMatrix(int number, int type,
75 const CoinBigIndex * starts, const int * index,
76 const double * element, int numberOther = -1);
77 #endif
78
79 virtual ClpMatrixBase * reverseOrderedCopy() const;
81 virtual CoinBigIndex countBasis(
82 const int * whichColumn,
83 int & numberColumnBasic);
85 virtual void fillBasis(ClpSimplex * model,
86 const int * whichColumn,
87 int & numberColumnBasic,
88 int * row, int * start,
89 int * rowCount, int * columnCount,
90 CoinFactorizationDouble * element);
95 virtual CoinBigIndex * dubiousWeights(const ClpSimplex * model, int * inputWeights) const;
99 virtual void rangeOfElements(double & smallestNegative, double & largestNegative,
100 double & smallestPositive, double & largestPositive);
103 virtual void unpack(const ClpSimplex * model, CoinIndexedVector * rowArray,
104 int column) const ;
109 virtual void unpackPacked(ClpSimplex * model,
110 CoinIndexedVector * rowArray,
111 int column) const;
114 virtual void add(const ClpSimplex * model, CoinIndexedVector * rowArray,
115 int column, double multiplier) const ;
117 virtual void add(const ClpSimplex * model, double * array,
118 int column, double multiplier) const;
120 virtual void releasePackedMatrix() const ;
122 virtual bool canDoPartialPricing() const;
124 virtual void partialPricing(ClpSimplex * model, double start, double end,
125 int & bestSequence, int & numberWanted);
127
133 virtual void times(double scalar,
134 const double * x, double * y) const;
136 virtual void times(double scalar,
137 const double * x, double * y,
138 const double * rowScale,
139 const double * columnScale) const;
143 virtual void transposeTimes(double scalar,
144 const double * x, double * y) const;
146 virtual void transposeTimes(double scalar,
147 const double * x, double * y,
148 const double * rowScale,
149 const double * columnScale, double * spare = NULL) const;
154 virtual void transposeTimes(const ClpSimplex * model, double scalar,
155 const CoinIndexedVector * x,
156 CoinIndexedVector * y,
157 CoinIndexedVector * z) const;
161 virtual void subsetTransposeTimes(const ClpSimplex * model,
162 const CoinIndexedVector * x,
163 const CoinIndexedVector * y,
164 CoinIndexedVector * z) const;
166
169 inline bool trueNetwork() const {
171 return trueNetwork_;
172 }
174
175
179 ClpNetworkMatrix();
181 ClpNetworkMatrix(int numberColumns, const int * head,
182 const int * tail);
184 virtual ~ClpNetworkMatrix();
186
190 ClpNetworkMatrix(const ClpNetworkMatrix&);
192 ClpNetworkMatrix(const CoinPackedMatrix&);
193
194 ClpNetworkMatrix& operator=(const ClpNetworkMatrix&);
196 virtual ClpMatrixBase * clone() const ;
199 ClpNetworkMatrix (const ClpNetworkMatrix & wholeModel,
200 int numberRows, const int * whichRows,
201 int numberColumns, const int * whichColumns);
204 virtual ClpMatrixBase * subsetClone (
205 int numberRows, const int * whichRows,
206 int numberColumns, const int * whichColumns) const ;
208
209
210 protected:
214 mutable CoinPackedMatrix * matrix_;
216 mutable int * lengths_;
218 int * indices_;
220 int numberRows_;
222 int numberColumns_;
224 bool trueNetwork_;
225
227 };
228
229 #endif
CoinBigIndex
int CoinBigIndex
Definition: Coin_C_defines.h:105
ClpNetworkMatrix::getNumCols
virtual int getNumCols() const
Number of columns.
Definition: ClpNetworkMatrix.hpp:35
ClpNetworkMatrix::getNumElements
virtual CoinBigIndex getNumElements() const
Number of entries in the packed matrix.
Definition: ClpNetworkMatrix.hpp:31
ClpNetworkMatrix::getElements
virtual const double * getElements() const
A vector containing the elements in the packed matrix.
ClpNetworkMatrix::getIndices
virtual const int * getIndices() const
A vector containing the minor indices of the elements in the packed matrix.
Definition: ClpNetworkMatrix.hpp:53
ClpNetworkMatrix::releasePackedMatrix
virtual void releasePackedMatrix() const
Allow any parts of a created CoinMatrix to be deleted.
ClpNetworkMatrix::canDoPartialPricing
virtual bool canDoPartialPricing() const
Says whether it can do partial pricing.
ClpNetworkMatrix::getVectorStarts
virtual const CoinBigIndex * getVectorStarts() const
Return a complete CoinPackedMatrix.
ClpNetworkMatrix::matrix_
CoinPackedMatrix * matrix_
For fake CoinPackedMatrix.
Definition: ClpNetworkMatrix.hpp:215
ClpNetworkMatrix::numberColumns_
int numberColumns_
Number of columns.
Definition: ClpNetworkMatrix.hpp:222
ClpNetworkMatrix::indices_
int * indices_
Data -1, then +1 rows in pairs (row==-1 if one entry)
Definition: ClpNetworkMatrix.hpp:218
CoinPackedMatrix
Sparse Matrix Base Class.
Definition: CoinPackedMatrix.hpp:79
ClpNetworkMatrix::countBasis
virtual CoinBigIndex countBasis(const int *whichColumn, int &numberColumnBasic)
Returns number of elements in column part of basis.
ClpNetworkMatrix::~ClpNetworkMatrix
virtual ~ClpNetworkMatrix()
Destructor.
ClpNetworkMatrix::isColOrdered
virtual bool isColOrdered() const
Whether the packed matrix is column major ordered or not.
Definition: ClpNetworkMatrix.hpp:27
CoinPackedVectorBase
Abstract base class for various sparse vectors.
Definition: CoinPackedVectorBase.hpp:23
ClpNetworkMatrix::rangeOfElements
virtual void rangeOfElements(double &smallestNegative, double &largestNegative, double &smallestPositive, double &largestPositive)
Returns largest and smallest elements of both signs.
ClpMatrixBase.hpp
ClpNetworkMatrix::dubiousWeights
virtual CoinBigIndex * dubiousWeights(const ClpSimplex *model, int *inputWeights) const
Given positive integer weights for each row fills in sum of weights for each column (and slack)...
ClpMatrixBase::type
int type() const
Returns type.
Definition: ClpMatrixBase.hpp:370
ClpNetworkMatrix::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...
ClpNetworkMatrix::trueNetwork
bool trueNetwork() const
Return true if really network, false if has slacks.
Definition: ClpNetworkMatrix.hpp:170
ClpNetworkMatrix
This implements a simple network matrix as derived from ClpMatrixBase.
Definition: ClpNetworkMatrix.hpp:19
ClpNetworkMatrix::deleteRows
virtual void deleteRows(const int numDel, const int *indDel)
Delete the rows whose indices are listed in indDel.
CoinFactorizationDouble
double CoinFactorizationDouble
Definition: CoinTypes.hpp:57
ClpNetworkMatrix::clone
virtual ClpMatrixBase * clone() const
Clone.
ClpNetworkMatrix::reverseOrderedCopy
virtual ClpMatrixBase * reverseOrderedCopy() const
Returns a new matrix in reverse order without gaps.
ClpNetworkMatrix::transposeTimes
virtual void transposeTimes(double scalar, const double *x, double *y) const
Return y + x * scalar * A in y.
ClpNetworkMatrix::deleteCols
virtual void deleteCols(const int numDel, const int *indDel)
Delete the columns whose indices are listed in indDel.
ClpNetworkMatrix::subsetClone
virtual ClpMatrixBase * subsetClone(int numberRows, const int *whichRows, int numberColumns, const int *whichColumns) const
Subset clone (without gaps).
ClpNetworkMatrix::unpackPacked
virtual void unpackPacked(ClpSimplex *model, CoinIndexedVector *rowArray, int column) const
Unpacks a column into an CoinIndexedvector in packed format Note that model is NOT const...
CoinIndexedVector
Indexed Vector.
Definition: CoinIndexedVector.hpp:104
ClpNetworkMatrix::numberRows_
int numberRows_
Number of rows.
Definition: ClpNetworkMatrix.hpp:220
ClpNetworkMatrix::ClpNetworkMatrix
ClpNetworkMatrix()
Default constructor.
ClpNetworkMatrix::operator=
ClpNetworkMatrix & operator=(const ClpNetworkMatrix &)
The copy constructor.
ClpNetworkMatrix::lengths_
int * lengths_
For fake CoinPackedMatrix.
Definition: ClpNetworkMatrix.hpp:216
ClpSimplex
This solves LPs using the simplex method.
Definition: ClpSimplex.hpp:70
ClpNetworkMatrix::getVectorLengths
virtual const int * getVectorLengths() const
The lengths of the major-dimension vectors.
ClpMatrixBase
Abstract base class for Clp Matrices.
Definition: ClpMatrixBase.hpp:38
ClpNetworkMatrix::unpack
virtual void unpack(const ClpSimplex *model, CoinIndexedVector *rowArray, int column) const
Unpacks a column into an CoinIndexedvector.
ClpNetworkMatrix::trueNetwork_
bool trueNetwork_
True if all entries have two elements.
Definition: ClpNetworkMatrix.hpp:224
CoinPragma.hpp
ClpNetworkMatrix::subsetTransposeTimes
virtual void subsetTransposeTimes(const ClpSimplex *model, const CoinIndexedVector *x, const CoinIndexedVector *y, CoinIndexedVector *z) const
Return &lt;code&gt;x *A&lt;/code&gt; in &lt;code&gt;z&lt;/code&gt; but just for indices in y.
ClpNetworkMatrix::appendCols
virtual void appendCols(int number, const CoinPackedVectorBase *const *columns)
Append Columns.
ClpNetworkMatrix::getNumRows
virtual int getNumRows() const
Number of rows.
Definition: ClpNetworkMatrix.hpp:39
ClpNetworkMatrix::times
virtual void times(double scalar, const double *x, double *y) const
Return y + A * scalar *x in y.
ClpNetworkMatrix::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.
ClpNetworkMatrix::appendMatrix
virtual int appendMatrix(int number, int type, const CoinBigIndex *starts, const int *index, const double *element, int numberOther=-1)
Append a set of rows/columns to the end of the matrix.
ClpNetworkMatrix::partialPricing
virtual void partialPricing(ClpSimplex *model, double start, double end, int &bestSequence, int &numberWanted)
Partial pricing.
ClpNetworkMatrix::appendRows
virtual void appendRows(int number, const CoinPackedVectorBase *const *rows)
Append Rows.
ClpNetworkMatrix::getPackedMatrix
virtual CoinPackedMatrix * getPackedMatrix() const
Return a complete CoinPackedMatrix.