6#ifndef ClpPlusMinusOneMatrix_H
7#define ClpPlusMinusOneMatrix_H
10#include "CoinPragma.hpp"
61 virtual void deleteCols(
const int numDel,
const int * indDel);
63 virtual void deleteRows(
const int numDel,
const int * indDel);
65 virtual void appendCols(
int number,
const CoinPackedVectorBase *
const * columns);
67 virtual void appendRows(
int number,
const CoinPackedVectorBase *
const * rows);
74 const CoinBigIndex * starts,
const int * index,
75 const double * element,
int numberOther = -1);
81 const int * whichColumn,
82 int & numberColumnBasic);
85 const int * whichColumn,
86 int & numberColumnBasic,
87 int * row,
int * start,
88 int * rowCount,
int * columnCount,
89 CoinFactorizationDouble * element);
99 double & smallestPositive,
double & largestPositive);
109 CoinIndexedVector * rowArray,
114 int column,
double multiplier)
const ;
117 int column,
double multiplier)
const;
136 const double * x,
double * y)
const;
139 const double * x,
double * y,
140 const double * rowScale,
141 const double * columnScale)
const;
146 const double * x,
double * y)
const;
149 const double * x,
double * y,
150 const double * rowScale,
151 const double * columnScale,
double * spare = NULL)
const;
157 const CoinIndexedVector * x,
158 CoinIndexedVector * y,
159 CoinIndexedVector * z)
const;
166 const CoinIndexedVector * x,
167 CoinIndexedVector * y,
168 CoinIndexedVector * z)
const;
173 const CoinIndexedVector * x,
174 const CoinIndexedVector * y,
175 CoinIndexedVector * z)
const;
179 const CoinIndexedVector * pi)
const;
182 const CoinIndexedVector * pi1, CoinIndexedVector * dj1,
183 const CoinIndexedVector * pi2,
184 CoinIndexedVector * spare,
185 double referenceIn,
double devex,
187 unsigned int * reference,
188 double * weights,
double scaleFactor);
191 CoinIndexedVector * dj1,
192 const CoinIndexedVector * pi2, CoinIndexedVector * dj2,
193 double referenceIn,
double devex,
195 unsigned int * reference,
196 double * weights,
double scaleFactor);
233 bool columnOrdered,
const int * indices,
238 int numberRows,
const int * whichRows,
239 int numberColumns,
const int * whichColumns);
247 int numberRows,
const int * whichRows,
248 int numberColumns,
const int * whichColumns)
const ;
251 bool columnOrdered,
int * indices,
257 int & bestSequence,
int & numberWanted);
278#ifdef CLP_PLUS_ONE_MATRIX
282 mutable int otherFlags_;
Abstract base class for Clp Matrices.
int type() const
Returns type.
This implements a simple +- one matrix as derived from ClpMatrixBase.
virtual void add(const ClpSimplex *model, double *array, int column, double multiplier) const
Adds multiple of a column into an array.
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 const CoinBigIndex * getVectorStarts() const
virtual bool canDoPartialPricing() const
Says whether it can do partial pricing.
virtual int getNumCols() const
Number of columns.
virtual const int * getIndices() const
A vector containing the minor indices of the elements in the packed matrix.
virtual const int * getVectorLengths() const
The lengths of the major-dimension vectors.
virtual void times(double scalar, const double *x, double *y) const
Return y + A * scalar *x in y.
virtual void setDimensions(int numrows, int numcols)
Set the dimensions of the matrix.
int * getMutableIndices() const
virtual const double * getElements() const
A vector containing the elements in the packed matrix.
virtual void deleteCols(const int numDel, const int *indDel)
Delete the columns whose indices are listed in indDel.
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 void deleteRows(const int numDel, const int *indDel)
Delete the rows whose indices are listed in indDel.
int numberRows_
Number of rows.
virtual void transposeTimes(double scalar, const double *x, double *y) const
Return y + x * scalar * A in y.
int *COIN_RESTRICT indices_
Data -1, then +1 rows in pairs (row==-1 if one entry)
virtual void partialPricing(ClpSimplex *model, double start, double end, int &bestSequence, int &numberWanted)
Partial pricing.
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.
ClpPlusMinusOneMatrix(const ClpPlusMinusOneMatrix &)
The copy constructor.
CoinPackedMatrix * matrix_
For fake CoinPackedMatrix.
void passInCopy(int numberRows, int numberColumns, bool columnOrdered, int *indices, CoinBigIndex *startPositive, CoinBigIndex *startNegative)
pass in copy (object takes ownership)
virtual void rangeOfElements(double &smallestNegative, double &largestNegative, double &smallestPositive, double &largestPositive)
Returns largest and smallest elements of both signs.
int numberColumns_
Number of columns.
ClpPlusMinusOneMatrix & operator=(const ClpPlusMinusOneMatrix &)
virtual void transposeTimes(double scalar, const double *x, double *y, const double *rowScale, const double *columnScale, double *spare=NULL) const
And for scaling.
CoinBigIndex * startNegative() const
Return starts of -1s.
bool columnOrdered_
True if column ordered.
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 appendCols(int number, const CoinPackedVectorBase *const *columns)
Append Columns.
virtual void appendRows(int number, const CoinPackedVectorBase *const *rows)
Append Rows.
void checkValid(bool detail) const
Just checks matrix valid - will say if dimensions not quite right if detail.
CoinBigIndex *COIN_RESTRICT startNegative_
Start of -1's for each.
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.
CoinBigIndex *COIN_RESTRICT startPositive_
Start of +1's for each.
virtual void releasePackedMatrix() const
Allow any parts of a created CoinMatrix to be deleted.
virtual bool canCombine(const ClpSimplex *model, const CoinIndexedVector *pi) const
Returns true if can combine transposeTimes and subsetTransposeTimes and if it would be faster.
virtual void transposeTimes(const ClpSimplex *model, double scalar, const CoinIndexedVector *x, CoinIndexedVector *y, CoinIndexedVector *z) const
Return x * scalar * A + y in z.
virtual ClpMatrixBase * reverseOrderedCopy() const
Returns a new matrix in reverse order without gaps.
virtual ~ClpPlusMinusOneMatrix()
Destructor.
ClpPlusMinusOneMatrix(const CoinPackedMatrix &)
The copy constructor from an CoinPlusMinusOneMatrix.
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 void unpack(const ClpSimplex *model, CoinIndexedVector *rowArray, int column) const
Unpacks a column into an CoinIndexedvector.
ClpPlusMinusOneMatrix()
Default constructor.
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 CoinBigIndex countBasis(const int *whichColumn, int &numberColumnBasic)
Returns number of elements in column part of basis.
virtual int getNumRows() const
Number of rows.
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 CoinPackedMatrix * getPackedMatrix() const
Return a complete CoinPackedMatrix.
virtual void transposeTimesByRow(const ClpSimplex *model, double scalar, const CoinIndexedVector *x, CoinIndexedVector *y, CoinIndexedVector *z) const
Return x * scalar * A + y in z.
virtual void times(double scalar, const double *x, double *y, const double *rowScale, const double *columnScale) const
And for scaling.
virtual CoinBigIndex getNumElements() const
Number of entries in the packed matrix.
ClpPlusMinusOneMatrix(int numberRows, int numberColumns, bool columnOrdered, const int *indices, const CoinBigIndex *startPositive, const CoinBigIndex *startNegative)
Constructor from arrays.
virtual bool isColOrdered() const
Whether the packed matrix is column major ordered or not.
virtual ClpMatrixBase * subsetClone(int numberRows, const int *whichRows, int numberColumns, const int *whichColumns) const
Subset clone (without gaps).
CoinBigIndex * startPositive() const
Return starts of +1s.
virtual ClpMatrixBase * clone() const
Clone.
ClpPlusMinusOneMatrix(const ClpPlusMinusOneMatrix &wholeModel, int numberRows, const int *whichRows, int numberColumns, const int *whichColumns)
Subset constructor (without gaps).
This solves LPs using the simplex method.