Loading...
Searching...
No Matches
ClpPlusMinusOneMatrix Class Reference

This implements a simple +- one matrix as derived from ClpMatrixBase. More...

`#include <ClpPlusMinusOneMatrix.hpp>`

Inheritance diagram for ClpPlusMinusOneMatrix:
[legend]
Collaboration diagram for ClpPlusMinusOneMatrix:
[legend]

## Public Member Functions

Useful methods
virtual CoinPackedMatrix * | getPackedMatrix () const
| Return a complete CoinPackedMatrix.
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.
virtual int | getNumCols () const
| Number of columns.
virtual int | getNumRows () const
| Number of rows.
virtual const double * | getElements () const
| A vector containing the elements in the packed matrix.
virtual const int * | getIndices () const
| A vector containing the minor indices of the elements in the packed matrix.
int * | getMutableIndices () const
virtual const CoinBigIndex * | getVectorStarts () const
virtual const int * | getVectorLengths () const
| The lengths of the major-dimension vectors.
virtual void | deleteCols (const int numDel, const int *indDel)
| Delete the columns whose indices are listed in `indDel`.
virtual void | deleteRows (const int numDel, const int *indDel)
| Delete the rows whose indices are listed in `indDel`.
virtual void | appendCols (int number, const CoinPackedVectorBase *const *columns)
| Append Columns.
virtual void | appendRows (int number, const CoinPackedVectorBase *const *rows)
| Append Rows.
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 ClpMatrixBase * | reverseOrderedCopy () const
| Returns a new matrix in reverse order without gaps.
virtual int | countBasis (const int *whichColumn, int &numberColumnBasic)
| Returns number of elements in column part of basis.
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 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 | rangeOfElements (double &smallestNegative, double &largestNegative, double &smallestPositive, double &largestPositive)
| Returns largest and smallest elements of both signs.
virtual void | unpack (const ClpSimplex *model, CoinIndexedVector *rowArray, int column) const
| Unpacks a column into an CoinIndexedvector.
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 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 void | add (const ClpSimplex *model, double *array, int column, double multiplier) const
| Adds multiple of a column into an array.
virtual void | releasePackedMatrix () const
| Allow any parts of a created CoinMatrix to be deleted.
virtual void | setDimensions (int numrows, int numcols)
| Set the dimensions of the matrix.
void | checkValid (bool detail) const
| Just checks matrix valid - will say if dimensions not quite right if detail.
Matrix times vector methods
virtual void | times (double scalar, const double *x, double *y) const
| Return `y + A * scalar *x` in `y`.
virtual void | times (double scalar, const double *x, double *y, const double *rowScale, const double *columnScale) const
| And for scaling.
virtual void | transposeTimes (double scalar, const double *x, double *y) const
| Return `y + x * scalar * A` in `y`.
virtual void | transposeTimes (double scalar, const double *x, double *y, const double *rowScale, const double *columnScale, double *spare=NULL) const
| And for scaling.
virtual void | transposeTimes (const ClpSimplex *model, double scalar, const CoinIndexedVector *x, CoinIndexedVector *y, CoinIndexedVector *z) const
| Return `x * scalar * A + y` in `z`.
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 | 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 bool | canCombine (const ClpSimplex *model, const CoinIndexedVector *pi) const
| Returns true if can combine transposeTimes and subsetTransposeTimes and if it would be faster.
virtual int | transposeTimes2 (const ClpSimplex *model, const CoinIndexedVector *pi1, CoinIndexedVector *dj1, const CoinIndexedVector *pi2, CoinIndexedVector *spare, double *infeas, double *reducedCost, double referenceIn, double devex, unsigned int *reference, double *weights, double scaleFactor)
| Updates two arrays for steepest and does devex weights Returns nonzero if updates reduced cost and infeas - new infeas in dj1.
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.
Other
CoinBigIndex * | startPositive () const
| Return starts of +1s.
CoinBigIndex * | startNegative () const
| Return starts of -1s.
Constructors, destructor
| ClpPlusMinusOneMatrix ()
| Default constructor.
virtual | ~ClpPlusMinusOneMatrix ()
| Destructor.
Copy method
| ClpPlusMinusOneMatrix (const ClpPlusMinusOneMatrix &)
| The copy constructor.
| ClpPlusMinusOneMatrix (const CoinPackedMatrix &)
| The copy constructor from an CoinPlusMinusOneMatrix.
| ClpPlusMinusOneMatrix (int numberRows, int numberColumns, bool columnOrdered, const int *indices, const CoinBigIndex *startPositive, const CoinBigIndex *startNegative)
| Constructor from arrays.
| ClpPlusMinusOneMatrix (const ClpPlusMinusOneMatrix &wholeModel, int numberRows, const int *whichRows, int numberColumns, const int *whichColumns)
| Subset constructor (without gaps).
ClpPlusMinusOneMatrix & | operator= (const ClpPlusMinusOneMatrix &)
virtual ClpMatrixBase * | clone () const
| Clone.
virtual ClpMatrixBase * | subsetClone (int numberRows, const int *whichRows, int numberColumns, const int *whichColumns) const
| Subset clone (without gaps).
void | passInCopy (int numberRows, int numberColumns, bool columnOrdered, int *indices, CoinBigIndex *startPositive, CoinBigIndex *startNegative)
| pass in copy (object takes ownership)
virtual bool | canDoPartialPricing () const
| Says whether it can do partial pricing.
virtual void | partialPricing (ClpSimplex *model, double start, double end, int &bestSequence, int &numberWanted)
| Partial pricing.
Public Member Functions inherited from ClpMatrixBase
virtual int | getVectorLength (int index) const
| The length of a single major-dimension vector.
virtual void | modifyCoefficient (int row, int column, double newElement, bool keepZero=false)
| Modify one element of packed matrix.
virtual int | scale (ClpModel *, ClpSimplex *=NULL) const
| Creates scales for column copy (rowCopy in model may be modified) default does not allow scaling returns non-zero if no scaling done.
virtual void | scaleRowCopy (ClpModel *) const
| Scales rowCopy if column copy scaled Only called if scales already exist.
virtual bool | canGetRowCopy () const
| Returns true if can create row copy.
virtual ClpMatrixBase * | scaledColumnCopy (ClpModel *) const
| Realy really scales column copy Only called if scales already exist.
virtual bool | allElementsInRange (ClpModel *, double, double, int=15)
| Checks if all elements are in valid range.
virtual int | refresh (ClpSimplex *)
| Purely for column generation and similar ideas.
virtual void | reallyScale (const double *rowScale, const double *columnScale)
virtual int | hiddenRows () const
| Returns number of hidden rows e.g. gub.
virtual int | extendUpdated (ClpSimplex *model, CoinIndexedVector *update, int mode)
| expands an updated column to allow for extra rows which the main solver does not know about and returns number added.
virtual void | primalExpanded (ClpSimplex *model, int mode)
| utility primal function for dealing with dynamic constraints mode=0 - Set up before "update" and "times" for primal solution using extended rows mode=1 - Cleanup primal solution after "times" using extended rows.
virtual void | dualExpanded (ClpSimplex *model, CoinIndexedVector *array, double *other, int mode)
| utility dual function for dealing with dynamic constraints mode=0 - Set up before "updateTranspose" and "transposeTimes" for duals using extended updates array (and may use other if dual values pass) mode=1 - Update dual solution after "transposeTimes" using extended rows.
virtual int | generalExpanded (ClpSimplex *model, int mode, int &number)

general utility function for dealing with dynamic constraints mode=0 - Create list of non-key basics in pivotVariable_ using number as numberBasic in and out mode=1 - Set all key variables as basic mode=2 - return number extra rows needed, number gives maximum number basic mode=3 - before replaceColumn mode=4 - return 1 if can do primal, 2 if dual, 3 if both mode=5 - save any status stuff (when in good state) mode=6 - restore status stuff mode=7 - flag given variable (normally sequenceIn) mode=8 - unflag all variables mode=9 - synchronize costs and bounds mode=10 - return 1 if there may be changing bounds on variable (column generation) mode=11 - make sure set is clean (used when a variable rejected - but not flagged) mode=12 - after factorize but before permute stuff mode=13 - at end of simplex to delete stuff

virtual int | updatePivot (ClpSimplex *model, double oldInValue, double oldOutValue)
| update information for a pivot (and effective rhs)
virtual void | createVariable (ClpSimplex *model, int &bestSequence)
| Creates a variable.
virtual int | checkFeasible (ClpSimplex *model, double &sum) const
| Just for debug if odd type matrix.
double | reducedCost (ClpSimplex *model, int sequence) const
| Returns reduced cost of a variable.
virtual void | correctSequence (const ClpSimplex *model, int &sequenceIn, int &sequenceOut)
| Correct sequence in and out to give true value (if both -1 maybe do whole matrix).
virtual void | times (double scalar, const double *COIN_RESTRICT x, double *COIN_RESTRICT y) const =0
| Return `y + A * x * scalar` in `y`.
virtual void | times (double scalar, const double *COIN_RESTRICT x, double *COIN_RESTRICT y, const double *COIN_RESTRICT rowScale, const double *COIN_RESTRICT columnScale) const
| And for scaling - default aborts for when scaling not supported (unless pointers NULL when as normal).
virtual void | transposeTimes (double scalar, const double *COIN_RESTRICT x, double *COIN_RESTRICT y) const =0
| Return `y + x * scalar * A` in `y`.
virtual void | transposeTimes (double scalar, const double *COIN_RESTRICT x, double *COIN_RESTRICT y, const double *COIN_RESTRICT rowScale, const double *COIN_RESTRICT columnScale, double *COIN_RESTRICT spare=NULL) const
| And for scaling - default aborts for when scaling not supported (unless pointers NULL when as normal).
virtual void | listTransposeTimes (const ClpSimplex *model, double *x, int *y, int number, double *z) const
| Return `x *A` in `z` but just for number indices in y.
virtual void | backToBasics ()
| Gets rid of any mutable by products.
int | type () const
| Returns type.
void | setType (int newtype)
| Sets type.
void | useEffectiveRhs (ClpSimplex *model)
| Sets up an effective RHS.
virtual double * | rhsOffset (ClpSimplex *model, bool forceRefresh=false, bool check=false)
| Returns effective RHS offset if it is being used.
int | lastRefresh () const
| If rhsOffset used this is iteration last refreshed.
int | refreshFrequency () const
| If rhsOffset used this is refresh frequency (0==off).
void | setRefreshFrequency (int value)
bool | skipDualCheck () const
| whether to skip dual checks most of time
void | setSkipDualCheck (bool yes)
int | minimumObjectsScan () const
| Partial pricing tuning parameter - minimum number of "objects" to scan.
void | setMinimumObjectsScan (int value)
int | minimumGoodReducedCosts () const
| Partial pricing tuning parameter - minimum number of negative reduced costs to get.
void | setMinimumGoodReducedCosts (int value)
double | startFraction () const
| Current start of search space in matrix (as fraction).
void | setStartFraction (double value)
double | endFraction () const
| Current end of search space in matrix (as fraction).
void | setEndFraction (double value)
double | savedBestDj () const
| Current best reduced cost.
void | setSavedBestDj (double value)
int | originalWanted () const
| Initial number of negative reduced costs wanted.
void | setOriginalWanted (int value)
int | currentWanted () const
| Current number of negative reduced costs which we still need.
void | setCurrentWanted (int value)
int | savedBestSequence () const
| Current best sequence.
void | setSavedBestSequence (int value)
virtual | ~ClpMatrixBase ()
| Destructor (has to be public).

## Protected Attributes

Data members
The data members are protected to allow access for derived classes.
CoinPackedMatrix * | matrix_
| For fake CoinPackedMatrix.
int * | lengths_
CoinBigIndex *COIN_RESTRICT | startPositive_
| Start of +1's for each.
CoinBigIndex *COIN_RESTRICT | startNegative_
| Start of -1's for each.
int *COIN_RESTRICT | indices_
| Data -1, then +1 rows in pairs (row==-1 if one entry).
int | numberRows_
| Number of rows.
int | numberColumns_
| Number of columns.
bool | columnOrdered_
| True if column ordered.
Protected Attributes inherited from ClpMatrixBase
double * | rhsOffset_
| Effective RHS offset if it is being used.
double | startFraction_
| Current start of search space in matrix (as fraction).
double | endFraction_
| Current end of search space in matrix (as fraction).
double | savedBestDj_
| Best reduced cost so far.
int | originalWanted_
| Initial number of negative reduced costs wanted.
int | currentWanted_
| Current number of negative reduced costs which we still need.
int | savedBestSequence_
| Saved best sequence in pricing.
int | type_
| type (may be useful)
int | lastRefresh_
| If rhsOffset used this is iteration last refreshed.
int | refreshFrequency_
| If rhsOffset used this is refresh frequency (0==off).
int | minimumObjectsScan_
| Partial pricing tuning parameter - minimum number of "objects" to scan.
int | minimumGoodReducedCosts_
| Partial pricing tuning parameter - minimum number of negative reduced costs to get.
int | trueSequenceIn_
| True sequence in (i.e. from larger problem).
int | trueSequenceOut_
| True sequence out (i.e. from larger problem).
bool | skipDualCheck_
| whether to skip dual checks most of time

## Additional Inherited Members

| ClpMatrixBase ()
| Default constructor.
| ClpMatrixBase (const ClpMatrixBase &)
ClpMatrixBase & | operator= (const ClpMatrixBase &)

## Detailed Description

This implements a simple +- one matrix as derived from ClpMatrixBase.

Definition at line 17 of file ClpPlusMinusOneMatrix.hpp.

## Constructor & Destructor Documentation

## ClpPlusMinusOneMatrix() [1/5]

ClpPlusMinusOneMatrix::ClpPlusMinusOneMatrix | ( |  | ) |

Default constructor.

## ~ClpPlusMinusOneMatrix()

virtual ClpPlusMinusOneMatrix::~ClpPlusMinusOneMatrix | ( |  | ) |

virtual

Destructor.

## ClpPlusMinusOneMatrix() [2/5]

ClpPlusMinusOneMatrix::ClpPlusMinusOneMatrix | ( | const ClpPlusMinusOneMatrix & |  | ) |

The copy constructor.

## ClpPlusMinusOneMatrix() [3/5]

ClpPlusMinusOneMatrix::ClpPlusMinusOneMatrix | ( | const CoinPackedMatrix & |  | ) |

The copy constructor from an CoinPlusMinusOneMatrix.

If not a valid matrix then getIndices will be NULL and startPositive[0] will have number of +1, startPositive[1] will have number of -1, startPositive[2] will have number of others,

## ClpPlusMinusOneMatrix() [4/5]

ClpPlusMinusOneMatrix::ClpPlusMinusOneMatrix | ( | int | numberRows,
|  | int | numberColumns,
|  | bool | columnOrdered,
|  | const int * | indices,
|  | const CoinBigIndex * | startPositive,
|  | const CoinBigIndex * | startNegative )

Constructor from arrays.

## ClpPlusMinusOneMatrix() [5/5]

ClpPlusMinusOneMatrix::ClpPlusMinusOneMatrix | ( | const ClpPlusMinusOneMatrix & | wholeModel,
|  | int | numberRows,
|  | const int * | whichRows,
|  | int | numberColumns,
|  | const int * | whichColumns )

Subset constructor (without gaps).

Duplicates are allowed and order is as given

## Member Function Documentation

## getPackedMatrix()

virtual CoinPackedMatrix * ClpPlusMinusOneMatrix::getPackedMatrix | ( |  | ) | const

virtual

Return a complete CoinPackedMatrix.

Implements ClpMatrixBase.

## isColOrdered()

virtual bool ClpPlusMinusOneMatrix::isColOrdered | ( |  | ) | const

virtual

Whether the packed matrix is column major ordered or not.

Implements ClpMatrixBase.

## getNumElements()

virtual CoinBigIndex ClpPlusMinusOneMatrix::getNumElements | ( |  | ) | const

virtual

Number of entries in the packed matrix.

Implements ClpMatrixBase.

## getNumCols()

virtual int ClpPlusMinusOneMatrix::getNumCols | ( |  | ) | const

inline virtual

Number of columns.

Implements ClpMatrixBase.

Definition at line 29 of file ClpPlusMinusOneMatrix.hpp.

## getNumRows()

virtual int ClpPlusMinusOneMatrix::getNumRows | ( |  | ) | const

inline virtual

Number of rows.

Implements ClpMatrixBase.

Definition at line 34 of file ClpPlusMinusOneMatrix.hpp.

## getElements()

virtual const double * ClpPlusMinusOneMatrix::getElements | ( |  | ) | const

virtual

A vector containing the elements in the packed matrix.

Note that there might be gaps in this list, entries that do not belong to any major-dimension vector. To get the actual elements one should look at this vector together with vectorStarts and vectorLengths.

Implements ClpMatrixBase.

## getIndices()

virtual const int * ClpPlusMinusOneMatrix::getIndices | ( |  | ) | const

inline virtual

A vector containing the minor indices of the elements in the packed matrix.

Note that there might be gaps in this list, entries that do not belong to any major-dimension vector. To get the actual elements one should look at this vector together with vectorStarts and vectorLengths.

Implements ClpMatrixBase.

Definition at line 49 of file ClpPlusMinusOneMatrix.hpp.

## getMutableIndices()

int * ClpPlusMinusOneMatrix::getMutableIndices | ( |  | ) | const

inline

Definition at line 54 of file ClpPlusMinusOneMatrix.hpp.

## getVectorStarts()

virtual const CoinBigIndex * ClpPlusMinusOneMatrix::getVectorStarts | ( |  | ) | const

virtual

Implements ClpMatrixBase.

## getVectorLengths()

virtual const int * ClpPlusMinusOneMatrix::getVectorLengths | ( |  | ) | const

virtual

The lengths of the major-dimension vectors.

Implements ClpMatrixBase.

## deleteCols()

virtual void ClpPlusMinusOneMatrix::deleteCols | ( | const int | numDel,
|  | const int * | indDel )

virtual

Delete the columns whose indices are listed in `indDel`.

Implements ClpMatrixBase.

## deleteRows()

virtual void ClpPlusMinusOneMatrix::deleteRows | ( | const int | numDel,
|  | const int * | indDel )

virtual

Delete the rows whose indices are listed in `indDel`.

Implements ClpMatrixBase.

## appendCols()

virtual void ClpPlusMinusOneMatrix::appendCols | ( | int | number,
|  | const CoinPackedVectorBase *const * | columns )

virtual

Append Columns.

Reimplemented from ClpMatrixBase.

## appendRows()

virtual void ClpPlusMinusOneMatrix::appendRows | ( | int | number,
|  | const CoinPackedVectorBase *const * | rows )

virtual

Append Rows.

Reimplemented from ClpMatrixBase.

## appendMatrix()

virtual int ClpPlusMinusOneMatrix::appendMatrix | ( | int | number,
|  | int | type,
|  | const CoinBigIndex * | starts,
|  | const int * | index,
|  | const double * | element,
|  | int | numberOther = -1 )

virtual

Append a set of rows/columns to the end of the matrix.

Returns number of errors i.e. if any of the new rows/columns contain an index that's larger than the number of columns-1/rows-1 (if numberOther>0) or duplicates If 0 then rows, 1 if columns

Reimplemented from ClpMatrixBase.

## reverseOrderedCopy()

virtual ClpMatrixBase * ClpPlusMinusOneMatrix::reverseOrderedCopy | ( |  | ) | const

virtual

Returns a new matrix in reverse order without gaps.

Reimplemented from ClpMatrixBase.

## countBasis()

virtual int ClpPlusMinusOneMatrix::countBasis | ( | const int * | whichColumn,
|  | int & | numberColumnBasic )

virtual

Returns number of elements in column part of basis.

Implements ClpMatrixBase.

## fillBasis()

virtual void ClpPlusMinusOneMatrix::fillBasis | ( | ClpSimplex * | model,
|  | const int * | whichColumn,
|  | int & | numberColumnBasic,
|  | int * | row,
|  | int * | start,
|  | int * | rowCount,
|  | int * | columnCount,
|  | CoinFactorizationDouble * | element )

virtual

Fills in column part of basis.

Implements ClpMatrixBase.

## dubiousWeights()

virtual CoinBigIndex * ClpPlusMinusOneMatrix::dubiousWeights | ( | const ClpSimplex * | model,
|  | int * | inputWeights ) const

virtual

Given positive integer weights for each row fills in sum of weights for each column (and slack).

Returns weights vector

Reimplemented from ClpMatrixBase.

## rangeOfElements()

virtual void ClpPlusMinusOneMatrix::rangeOfElements | ( | double & | smallestNegative,
|  | double & | largestNegative,
|  | double & | smallestPositive,
|  | double & | largestPositive )

virtual

Returns largest and smallest elements of both signs.

Largest refers to largest absolute value.

Reimplemented from ClpMatrixBase.

## unpack()

virtual void ClpPlusMinusOneMatrix::unpack | ( | const ClpSimplex * | model,
|  | CoinIndexedVector * | rowArray,
|  | int | column ) const

virtual

Unpacks a column into an CoinIndexedvector.

Implements ClpMatrixBase.

## unpackPacked()

virtual void ClpPlusMinusOneMatrix::unpackPacked | ( | ClpSimplex * | model,
|  | CoinIndexedVector * | rowArray,
|  | int | column ) const

virtual

Unpacks a column into an CoinIndexedvector in packed foramt Note that model is NOT const.

Bounds and objective could be modified if doing column generation (just for this variable)

Implements ClpMatrixBase.

## add() [1/2]

virtual void ClpPlusMinusOneMatrix::add | ( | const ClpSimplex * | model,
|  | CoinIndexedVector * | rowArray,
|  | int | column,
|  | double | multiplier ) const

virtual

Adds multiple of a column into an CoinIndexedvector You can use quickAdd to add to vector.

Implements ClpMatrixBase.

## add() [2/2]

virtual void ClpPlusMinusOneMatrix::add | ( | const ClpSimplex * | model,
|  | double * | array,
|  | int | column,
|  | double | multiplier ) const

virtual

Adds multiple of a column into an array.

Implements ClpMatrixBase.

## releasePackedMatrix()

virtual void ClpPlusMinusOneMatrix::releasePackedMatrix | ( |  | ) | const

virtual

Allow any parts of a created CoinMatrix to be deleted.

Implements ClpMatrixBase.

## setDimensions()

virtual void ClpPlusMinusOneMatrix::setDimensions | ( | int | numrows,
|  | int | numcols )

virtual

Set the dimensions of the matrix.

In effect, append new empty columns/rows to the matrix. A negative number for either dimension means that that dimension doesn't change. Otherwise the new dimensions MUST be at least as large as the current ones otherwise an exception is thrown.

Reimplemented from ClpMatrixBase.

## checkValid()

void ClpPlusMinusOneMatrix::checkValid | ( | bool | detail | ) | const

Just checks matrix valid - will say if dimensions not quite right if detail.

## times() [1/2]

virtual void ClpPlusMinusOneMatrix::times | ( | double | scalar,
|  | const double * | x,
|  | double * | y ) const

virtual

Return `y + A * scalar *x` in `y`.

Precondition
  `x` must be of size `numColumns()`
  `y` must be of size `numRows()`

## times() [2/2]

virtual void ClpPlusMinusOneMatrix::times | ( | double | scalar,
|  | const double * | x,
|  | double * | y,
|  | const double * | rowScale,
|  | const double * | columnScale ) const

virtual

And for scaling.

## transposeTimes() [1/3]

virtual void ClpPlusMinusOneMatrix::transposeTimes | ( | double | scalar,
|  | const double * | x,
|  | double * | y ) const

virtual

Return `y + x * scalar * A` in `y`.

Precondition
  `x` must be of size `numRows()`
  `y` must be of size `numColumns()`

## transposeTimes() [2/3]

virtual void ClpPlusMinusOneMatrix::transposeTimes | ( | double | scalar,
|  | const double * | x,
|  | double * | y,
|  | const double * | rowScale,
|  | const double * | columnScale,
|  | double * | spare = NULL ) const

virtual

And for scaling.

## transposeTimes() [3/3]

virtual void ClpPlusMinusOneMatrix::transposeTimes | ( | const ClpSimplex * | model,
|  | double | scalar,
|  | const CoinIndexedVector * | x,
|  | CoinIndexedVector * | y,
|  | CoinIndexedVector * | z ) const

virtual

Return `x * scalar * A + y` in `z`.

Can use y as temporary array (will be empty at end) Note - If x packed mode - then z packed mode Squashes small elements and knows about ClpSimplex

Implements ClpMatrixBase.

## transposeTimesByRow()

virtual void ClpPlusMinusOneMatrix::transposeTimesByRow | ( | const ClpSimplex * | model,
|  | double | scalar,
|  | const CoinIndexedVector * | x,
|  | CoinIndexedVector * | y,
|  | CoinIndexedVector * | z ) const

virtual

Return `x * scalar * A + y` in `z`.

Can use y as temporary array (will be empty at end) Note - If x packed mode - then z packed mode Squashes small elements and knows about ClpSimplex. This version uses row copy

## subsetTransposeTimes()

virtual void ClpPlusMinusOneMatrix::subsetTransposeTimes | ( | const ClpSimplex * | model,
|  | const CoinIndexedVector * | x,
|  | const CoinIndexedVector * | y,
|  | CoinIndexedVector * | z ) const

virtual

Return `x *A` in `z` but just for indices in y.

Note - z always packed mode

Implements ClpMatrixBase.

## canCombine()

virtual bool ClpPlusMinusOneMatrix::canCombine | ( | const ClpSimplex * | model,
|  | const CoinIndexedVector * | pi ) const

virtual

Returns true if can combine transposeTimes and subsetTransposeTimes and if it would be faster.

Reimplemented from ClpMatrixBase.

## transposeTimes2()

virtual int ClpPlusMinusOneMatrix::transposeTimes2 | ( | const ClpSimplex * | model,
|  | const CoinIndexedVector * | pi1,
|  | CoinIndexedVector * | dj1,
|  | const CoinIndexedVector * | pi2,
|  | CoinIndexedVector * | spare,
|  | double * | infeas,
|  | double * | reducedCost,
|  | double | referenceIn,
|  | double | devex,
|  | unsigned int * | reference,
|  | double * | weights,
|  | double | scaleFactor )

virtual

Updates two arrays for steepest and does devex weights Returns nonzero if updates reduced cost and infeas - new infeas in dj1.

Reimplemented from ClpMatrixBase.

## subsetTimes2()

virtual void ClpPlusMinusOneMatrix::subsetTimes2 | ( | const ClpSimplex * | model,
|  | CoinIndexedVector * | dj1,
|  | const CoinIndexedVector * | pi2,
|  | CoinIndexedVector * | dj2,
|  | double | referenceIn,
|  | double | devex,
|  | unsigned int * | reference,
|  | double * | weights,
|  | double | scaleFactor )

virtual

Updates second array for steepest and does devex weights.

Reimplemented from ClpMatrixBase.

## startPositive()

CoinBigIndex * ClpPlusMinusOneMatrix::startPositive | ( |  | ) | const

inline

Return starts of +1s.

Definition at line 208 of file ClpPlusMinusOneMatrix.hpp.

## startNegative()

CoinBigIndex * ClpPlusMinusOneMatrix::startNegative | ( |  | ) | const

inline

Return starts of -1s.

Definition at line 213 of file ClpPlusMinusOneMatrix.hpp.

## operator=()

ClpPlusMinusOneMatrix & ClpPlusMinusOneMatrix::operator= | ( | const ClpPlusMinusOneMatrix & |  | ) |

## clone()

virtual ClpMatrixBase * ClpPlusMinusOneMatrix::clone | ( |  | ) | const

virtual

Clone.

Implements ClpMatrixBase.

## subsetClone()

virtual ClpMatrixBase * ClpPlusMinusOneMatrix::subsetClone | ( | int | numberRows,
|  | const int * | whichRows,
|  | int | numberColumns,
|  | const int * | whichColumns ) const

virtual

Subset clone (without gaps).

Duplicates are allowed and order is as given

Reimplemented from ClpMatrixBase.

## passInCopy()

void ClpPlusMinusOneMatrix::passInCopy | ( | int | numberRows,
|  | int | numberColumns,
|  | bool | columnOrdered,
|  | int * | indices,
|  | CoinBigIndex * | startPositive,
|  | CoinBigIndex * | startNegative )

pass in copy (object takes ownership)

## canDoPartialPricing()

virtual bool ClpPlusMinusOneMatrix::canDoPartialPricing | ( |  | ) | const

virtual

Says whether it can do partial pricing.

Reimplemented from ClpMatrixBase.

## partialPricing()

virtual void ClpPlusMinusOneMatrix::partialPricing | ( | ClpSimplex * | model,
|  | double | start,
|  | double | end,
|  | int & | bestSequence,
|  | int & | numberWanted )

virtual

Partial pricing.

Reimplemented from ClpMatrixBase.

## Member Data Documentation

## matrix_

CoinPackedMatrix* ClpPlusMinusOneMatrix::matrix_

mutable protected

For fake CoinPackedMatrix.

Definition at line 272 of file ClpPlusMinusOneMatrix.hpp.

## lengths_

int* ClpPlusMinusOneMatrix::lengths_

mutable protected

Definition at line 273 of file ClpPlusMinusOneMatrix.hpp.

## startPositive_

CoinBigIndex* COIN_RESTRICT ClpPlusMinusOneMatrix::startPositive_

protected

Start of +1's for each.

Definition at line 275 of file ClpPlusMinusOneMatrix.hpp.

## startNegative_

CoinBigIndex* COIN_RESTRICT ClpPlusMinusOneMatrix::startNegative_

protected

Start of -1's for each.

Definition at line 277 of file ClpPlusMinusOneMatrix.hpp.

## indices_

int* COIN_RESTRICT ClpPlusMinusOneMatrix::indices_

protected

Data -1, then +1 rows in pairs (row==-1 if one entry).

Definition at line 279 of file ClpPlusMinusOneMatrix.hpp.

## numberRows_

int ClpPlusMinusOneMatrix::numberRows_

protected

Number of rows.

Definition at line 281 of file ClpPlusMinusOneMatrix.hpp.

## numberColumns_

int ClpPlusMinusOneMatrix::numberColumns_

protected

Number of columns.

Definition at line 283 of file ClpPlusMinusOneMatrix.hpp.

## columnOrdered_

bool ClpPlusMinusOneMatrix::columnOrdered_

protected

True if column ordered.

Definition at line 291 of file ClpPlusMinusOneMatrix.hpp.

The documentation for this class was generated from the following file:

- Clp/src/ClpPlusMinusOneMatrix.hpp