4 #ifndef ClpPlusMinusOneMatrix_H
5 #define ClpPlusMinusOneMatrix_H
8 #include "CoinPragma.hpp"
59 virtual void deleteCols(
const int numDel,
const int * indDel);
61 virtual void deleteRows(
const int numDel,
const int * indDel);
63 virtual void appendCols(
int number,
const CoinPackedVectorBase *
const * columns);
65 virtual void appendRows(
int number,
const CoinPackedVectorBase *
const * rows);
72 const CoinBigIndex * starts,
const int * index,
73 const double * element,
int numberOther = -1);
79 const int * whichColumn,
80 int & numberColumnBasic);
83 const int * whichColumn,
84 int & numberColumnBasic,
85 int * row,
int * start,
86 int * rowCount,
int * columnCount,
87 CoinFactorizationDouble * element);
96 virtual void rangeOfElements(
double & smallestNegative,
double & largestNegative,
97 double & smallestPositive,
double & largestPositive);
107 CoinIndexedVector * rowArray,
111 virtual void add(
const ClpSimplex * model, CoinIndexedVector * rowArray,
112 int column,
double multiplier)
const ;
115 int column,
double multiplier)
const;
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;
144 const double * x,
double * y)
const;
147 const double * x,
double * y,
148 const double * rowScale,
149 const double * columnScale,
double * spare = NULL)
const;
155 const CoinIndexedVector * x,
156 CoinIndexedVector * y,
157 CoinIndexedVector * z)
const;
164 const CoinIndexedVector * x,
165 CoinIndexedVector * y,
166 CoinIndexedVector * z)
const;
171 const CoinIndexedVector * x,
172 const CoinIndexedVector * y,
173 CoinIndexedVector * z)
const;
177 const CoinIndexedVector * pi)
const;
180 const CoinIndexedVector * pi1, CoinIndexedVector * dj1,
181 const CoinIndexedVector * pi2,
182 CoinIndexedVector * spare,
183 double referenceIn,
double devex,
185 unsigned int * reference,
186 double * weights,
double scaleFactor);
189 CoinIndexedVector * dj1,
190 const CoinIndexedVector * pi2, CoinIndexedVector * dj2,
191 double referenceIn,
double devex,
193 unsigned int * reference,
194 double * weights,
double scaleFactor);
231 bool columnOrdered,
const int * indices,
236 int numberRows,
const int * whichRows,
237 int numberColumns,
const int * whichColumns);
245 int numberRows,
const int * whichRows,
246 int numberColumns,
const int * whichColumns)
const ;
248 void passInCopy(
int numberRows,
int numberColumns,
249 bool columnOrdered,
int * indices,
255 int & bestSequence,
int & numberWanted);
263 mutable CoinPackedMatrix *
matrix_;
int numberColumns_
Number of columns.
virtual ClpMatrixBase * subsetClone(int numberRows, const int *whichRows, int numberColumns, const int *whichColumns) const
Subset clone (without gaps).
virtual const int * getIndices() const
A vector containing the minor indices of the elements in the packed matrix.
CoinPackedMatrix * matrix_
For fake CoinPackedMatrix.
virtual int getNumCols() const
Number of columns.
virtual void transposeTimes2(const ClpSimplex *model, const CoinIndexedVector *pi1, CoinIndexedVector *dj1, const CoinIndexedVector *pi2, CoinIndexedVector *spare, double referenceIn, double devex, unsigned int *reference, double *weights, double scaleFactor)
Updates two arrays for steepest.
virtual void releasePackedMatrix() const
Allow any parts of a created CoinMatrix to be deleted.
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)...
virtual const CoinBigIndex * getVectorStarts() const
Return a complete CoinPackedMatrix.
virtual void transposeTimes(double scalar, const double *x, double *y) const
Return y + x * scalar * A in y.
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.
int * lengths_
For fake CoinPackedMatrix.
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...
bool columnOrdered_
True if column ordered.
virtual void unpack(const ClpSimplex *model, CoinIndexedVector *rowArray, int column) const
Unpacks a column into an CoinIndexedvector.
virtual bool canDoPartialPricing() const
Says whether it can do partial pricing.
ClpPlusMinusOneMatrix & operator=(const ClpPlusMinusOneMatrix &)
The copy constructor.
virtual const int * getVectorLengths() const
The lengths of the major-dimension vectors.
virtual const double * getElements() const
A vector containing the elements in the packed matrix.
int type() const
Returns type.
int * getMutableIndices() const
Return a complete CoinPackedMatrix.
virtual bool canCombine(const ClpSimplex *model, const CoinIndexedVector *pi) const
Returns true if can combine transposeTimes and subsetTransposeTimes and if it would be faster...
void checkValid(bool detail) const
Just checks matrix valid - will say if dimensions not quite right if detail.
ClpPlusMinusOneMatrix()
Default constructor.
virtual void rangeOfElements(double &smallestNegative, double &largestNegative, double &smallestPositive, double &largestPositive)
Returns largest and smallest elements of both signs.
virtual void appendRows(int number, const CoinPackedVectorBase *const *rows)
Append Rows.
virtual ~ClpPlusMinusOneMatrix()
Destructor.
virtual int getNumRows() const
Number of rows.
virtual void transposeTimesByRow(const ClpSimplex *model, double scalar, const CoinIndexedVector *x, CoinIndexedVector *y, CoinIndexedVector *z) const
Return x * scalar * A + y in z.
This solves LPs using the simplex method.
virtual CoinBigIndex countBasis(const int *whichColumn, int &numberColumnBasic)
Returns number of elements in column part of basis.
CoinBigIndex * startPositive() const
Return starts of +1s.
Abstract base class for Clp Matrices.
virtual void partialPricing(ClpSimplex *model, double start, double end, int &bestSequence, int &numberWanted)
Partial pricing.
int numberRows_
Number of rows.
virtual void deleteRows(const int numDel, const int *indDel)
Delete the rows whose indices are listed in indDel.
virtual void setDimensions(int numrows, int numcols)
Set the dimensions of the matrix.
virtual void appendCols(int number, const CoinPackedVectorBase *const *columns)
Append 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 CoinPackedMatrix * getPackedMatrix() const
Return a complete CoinPackedMatrix.
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...
CoinBigIndex * startNegative() const
Return starts of -1s.
virtual ClpMatrixBase * reverseOrderedCopy() const
Returns a new matrix in reverse order without gaps.
void passInCopy(int numberRows, int numberColumns, bool columnOrdered, int *indices, CoinBigIndex *startPositive, CoinBigIndex *startNegative)
pass in copy (object takes ownership)
virtual void deleteCols(const int numDel, const int *indDel)
Delete the columns whose indices are listed in indDel.
virtual void times(double scalar, const double *x, double *y) const
Return y + A * scalar *x in y.
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.
virtual void subsetTimes2(const ClpSimplex *model, CoinIndexedVector *dj1, const CoinIndexedVector *pi2, CoinIndexedVector *dj2, double referenceIn, double devex, unsigned int *reference, double *weights, double scaleFactor)
Updates second array for steepest and does devex weights.
virtual ClpMatrixBase * clone() const
Clone.
CoinBigIndex * startNegative_
Start of -1's for each.
CoinBigIndex * startPositive_
Start of +1's for each.
This implements a simple +- one matrix as derived from ClpMatrixBase.
virtual bool isColOrdered() const
Whether the packed matrix is column major ordered or not.
virtual CoinBigIndex getNumElements() const
Number of entries in the packed matrix.
int * indices_
Data -1, then +1 rows in pairs (row==-1 if one entry)