Protected Member Functions | Private Member Functions
ClpPackedMatrix Class Reference

#include <ClpPackedMatrix.hpp>

Inheritance diagram for ClpPackedMatrix:
Inheritance graph
[legend]
Collaboration diagram for ClpPackedMatrix:
Collaboration graph
[legend]

List of all members.

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.
double * getMutableElements () const
 Mutable elements.
virtual const int * getIndices () const
 A vector containing the minor indices of the elements in the packed matrix.
virtual const CoinBigIndex * getVectorStarts () const
 Return a complete CoinPackedMatrix.
virtual const int * getVectorLengths () const
 The lengths of the major-dimension vectors.
virtual int getVectorLength (int index) const
 The length of a single major-dimension vector.
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 void replaceVector (const int index, const int numReplace, const double *newElements)
 Replace the elements of a vector.
virtual void modifyCoefficient (int row, int column, double newElement, bool keepZero=false)
 Modify one element of packed matrix.
virtual ClpMatrixBasereverseOrderedCopy () const
 Returns a new matrix in reverse order without gaps.
virtual CoinBigIndex 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 int scale (ClpModel *model, const ClpSimplex *baseModel=NULL) const
 Creates scales for column copy (rowCopy in model may be modified) returns non-zero if no scaling done.
virtual void scaleRowCopy (ClpModel *model) const
 Scales rowCopy if column copy scaled Only called if scales already exist.
void createScaledMatrix (ClpSimplex *model) const
 Creates scaled column copy if scales exist.
virtual ClpMatrixBasescaledColumnCopy (ClpModel *model) const
 Realy really scales column copy Only called if scales already exist.
virtual bool allElementsInRange (ClpModel *model, double smallest, double largest, int check=15)
 Checks if all elements are in valid range.
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 CoinPackedMatrix 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 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.
virtual int refresh (ClpSimplex *model)
 makes sure active columns correct
virtual void reallyScale (const double *rowScale, const double *columnScale)
 Return a complete CoinPackedMatrix.
virtual void setDimensions (int numrows, int numcols)
 Set the dimensions of the matrix.
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.
void transposeTimesSubset (int number, const int *which, const double *pi, double *y, const double *rowScale, const double *columnScale, double *spare=NULL) const
 Return y - pi * A in y.
virtual void transposeTimes (const ClpSimplex *model, double scalar, const CoinIndexedVector *x, CoinIndexedVector *y, CoinIndexedVector *z) const
 Return x * scalar * A + y in z.
void transposeTimesByColumn (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 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 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.
void useEffectiveRhs (ClpSimplex *model)
 Sets up an effective RHS.
Other
CoinPackedMatrix * matrix () const
 Returns CoinPackedMatrix (non const)
void setMatrixNull ()
 Just sets matrix_ to NULL so it can be used elsewhere.
void makeSpecialColumnCopy ()
 Say we want special column copy.
void releaseSpecialColumnCopy ()
 Say we don't want special column copy.
bool zeros () const
 Are there zeros?
bool wantsSpecialColumnCopy () const
 Do we want special column copy.
int flags () const
 Flags.
void checkGaps ()
 Sets flags_ correctly.
Constructors, destructor
 ClpPackedMatrix ()
 Default constructor.
virtual ~ClpPackedMatrix ()
 Destructor.
Copy method
 ClpPackedMatrix (const ClpPackedMatrix &)
 The copy constructor.
 ClpPackedMatrix (const CoinPackedMatrix &)
 The copy constructor from an CoinPackedMatrix.
 ClpPackedMatrix (const ClpPackedMatrix &wholeModel, int numberRows, const int *whichRows, int numberColumns, const int *whichColumns)
 Subset constructor (without gaps).
 ClpPackedMatrix (const CoinPackedMatrix &wholeModel, int numberRows, const int *whichRows, int numberColumns, const int *whichColumns)
 The copy constructor.
 ClpPackedMatrix (CoinPackedMatrix *matrix)
 This takes over ownership (for space reasons)
ClpPackedMatrixoperator= (const ClpPackedMatrix &)
 The copy constructor.
virtual ClpMatrixBaseclone () const
 Clone.
virtual void copy (const ClpPackedMatrix *from)
 Copy contents - resizing if necessary - otherwise re-use memory.
virtual ClpMatrixBasesubsetClone (int numberRows, const int *whichRows, int numberColumns, const int *whichColumns) const
 Subset clone (without gaps).
void specialRowCopy (ClpSimplex *model, const ClpMatrixBase *rowCopy)
 make special row copy
void specialColumnCopy (ClpSimplex *model)
 make special column copy
virtual void correctSequence (const ClpSimplex *model, int &sequenceIn, int &sequenceOut)
 Correct sequence in and out to give true value.

Protected Member Functions

void checkFlags (int type) const
 Check validity.

Protected Attributes

Data members

The data members are protected to allow access for derived classes.

CoinPackedMatrix * matrix_
 Data.
int numberActiveColumns_
 number of active columns (normally same as number of columns)
int flags_
 Flags - 1 - has zero elements 2 - has gaps 4 - has special row copy 8 - has special column copy 16 - wants special column copy.
ClpPackedMatrix2rowCopy_
 Special row copy.
ClpPackedMatrix3columnCopy_
 Special column copy.

Private Member Functions

int gutsOfTransposeTimesUnscaled (const double *COIN_RESTRICT pi, int *COIN_RESTRICT index, double *COIN_RESTRICT array, const double tolerance) const
 Meat of transposeTimes by column when not scaled.
int gutsOfTransposeTimesScaled (const double *COIN_RESTRICT pi, const double *COIN_RESTRICT columnScale, int *COIN_RESTRICT index, double *COIN_RESTRICT array, const double tolerance) const
 Meat of transposeTimes by column when scaled.
int gutsOfTransposeTimesUnscaled (const double *COIN_RESTRICT pi, int *COIN_RESTRICT index, double *COIN_RESTRICT array, const unsigned char *status, const double tolerance) const
 Meat of transposeTimes by column when not scaled and skipping.
int gutsOfTransposeTimesUnscaled (const double *COIN_RESTRICT pi, int *COIN_RESTRICT index, double *COIN_RESTRICT array, const unsigned char *status, int *COIN_RESTRICT spareIndex, double *COIN_RESTRICT spareArray, const double *COIN_RESTRICT reducedCost, double &upperTheta, double &bestPossible, double acceptablePivot, double dualTolerance, int &numberRemaining, const double zeroTolerance) const
 Meat of transposeTimes by column when not scaled and skipping and doing part of dualColumn.
int gutsOfTransposeTimesScaled (const double *COIN_RESTRICT pi, const double *COIN_RESTRICT columnScale, int *COIN_RESTRICT index, double *COIN_RESTRICT array, const unsigned char *status, const double tolerance) const
 Meat of transposeTimes by column when scaled and skipping.
int gutsOfTransposeTimesByRowGEK (const CoinIndexedVector *COIN_RESTRICT piVector, int *COIN_RESTRICT index, double *COIN_RESTRICT output, int numberColumns, const double tolerance, const double scalar) const
 Meat of transposeTimes by row n > K if packed - returns number nonzero.
int gutsOfTransposeTimesByRowGE3 (const CoinIndexedVector *COIN_RESTRICT piVector, int *COIN_RESTRICT index, double *COIN_RESTRICT output, int *COIN_RESTRICT lookup, char *COIN_RESTRICT marked, const double tolerance, const double scalar) const
 Meat of transposeTimes by row n > 2 if packed - returns number nonzero.
void gutsOfTransposeTimesByRowEQ2 (const CoinIndexedVector *piVector, CoinIndexedVector *output, CoinIndexedVector *spareVector, const double tolerance, const double scalar) const
 Meat of transposeTimes by row n == 2 if packed.
void gutsOfTransposeTimesByRowEQ1 (const CoinIndexedVector *piVector, CoinIndexedVector *output, const double tolerance, const double scalar) const
 Meat of transposeTimes by row n == 1 if packed.
void clearCopies ()
 Gets rid of special copies.

Detailed Description

Definition at line 19 of file ClpPackedMatrix.hpp.


Constructor & Destructor Documentation

Default constructor.

virtual ClpPackedMatrix::~ClpPackedMatrix ( ) [virtual]

Destructor.

The copy constructor.

ClpPackedMatrix::ClpPackedMatrix ( const CoinPackedMatrix &  )

The copy constructor from an CoinPackedMatrix.

ClpPackedMatrix::ClpPackedMatrix ( const ClpPackedMatrix wholeModel,
int  numberRows,
const int *  whichRows,
int  numberColumns,
const int *  whichColumns 
)

Subset constructor (without gaps).

Duplicates are allowed and order is as given

ClpPackedMatrix::ClpPackedMatrix ( const CoinPackedMatrix &  wholeModel,
int  numberRows,
const int *  whichRows,
int  numberColumns,
const int *  whichColumns 
)

The copy constructor.

ClpPackedMatrix::ClpPackedMatrix ( CoinPackedMatrix *  matrix)

This takes over ownership (for space reasons)


Member Function Documentation

virtual CoinPackedMatrix* ClpPackedMatrix::getPackedMatrix ( ) const [inline, virtual]

Return a complete CoinPackedMatrix.

Implements ClpMatrixBase.

Definition at line 25 of file ClpPackedMatrix.hpp.

virtual bool ClpPackedMatrix::isColOrdered ( ) const [inline, virtual]

Whether the packed matrix is column major ordered or not.

Implements ClpMatrixBase.

Definition at line 29 of file ClpPackedMatrix.hpp.

virtual CoinBigIndex ClpPackedMatrix::getNumElements ( ) const [inline, virtual]

Number of entries in the packed matrix.

Implements ClpMatrixBase.

Definition at line 33 of file ClpPackedMatrix.hpp.

virtual int ClpPackedMatrix::getNumCols ( ) const [inline, virtual]

Number of columns.

Implements ClpMatrixBase.

Definition at line 37 of file ClpPackedMatrix.hpp.

virtual int ClpPackedMatrix::getNumRows ( ) const [inline, virtual]

Number of rows.

Implements ClpMatrixBase.

Definition at line 41 of file ClpPackedMatrix.hpp.

virtual const double* ClpPackedMatrix::getElements ( ) const [inline, 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.

Definition at line 49 of file ClpPackedMatrix.hpp.

double* ClpPackedMatrix::getMutableElements ( ) const [inline]

Mutable elements.

Definition at line 53 of file ClpPackedMatrix.hpp.

virtual const int* ClpPackedMatrix::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 61 of file ClpPackedMatrix.hpp.

virtual const CoinBigIndex* ClpPackedMatrix::getVectorStarts ( ) const [inline, virtual]

Return a complete CoinPackedMatrix.

Implements ClpMatrixBase.

Definition at line 65 of file ClpPackedMatrix.hpp.

virtual const int* ClpPackedMatrix::getVectorLengths ( ) const [inline, virtual]

The lengths of the major-dimension vectors.

Implements ClpMatrixBase.

Definition at line 69 of file ClpPackedMatrix.hpp.

virtual int ClpPackedMatrix::getVectorLength ( int  index) const [inline, virtual]

The length of a single major-dimension vector.

Reimplemented from ClpMatrixBase.

Definition at line 73 of file ClpPackedMatrix.hpp.

virtual void ClpPackedMatrix::deleteCols ( const int  numDel,
const int *  indDel 
) [virtual]

Delete the columns whose indices are listed in indDel.

Implements ClpMatrixBase.

virtual void ClpPackedMatrix::deleteRows ( const int  numDel,
const int *  indDel 
) [virtual]

Delete the rows whose indices are listed in indDel.

Implements ClpMatrixBase.

virtual void ClpPackedMatrix::appendCols ( int  number,
const CoinPackedVectorBase *const *  columns 
) [virtual]

Append Columns.

Reimplemented from ClpMatrixBase.

virtual void ClpPackedMatrix::appendRows ( int  number,
const CoinPackedVectorBase *const *  rows 
) [virtual]

Append Rows.

Reimplemented from ClpMatrixBase.

virtual int ClpPackedMatrix::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.

virtual void ClpPackedMatrix::replaceVector ( const int  index,
const int  numReplace,
const double *  newElements 
) [inline, virtual]

Replace the elements of a vector.

The indices remain the same. This is only needed if scaling and a row copy is used. At most the number specified will be replaced. The index is between 0 and major dimension of matrix

Definition at line 98 of file ClpPackedMatrix.hpp.

virtual void ClpPackedMatrix::modifyCoefficient ( int  row,
int  column,
double  newElement,
bool  keepZero = false 
) [inline, virtual]

Modify one element of packed matrix.

An element may be added. This works for either ordering If the new element is zero it will be deleted unless keepZero true

Reimplemented from ClpMatrixBase.

Definition at line 105 of file ClpPackedMatrix.hpp.

virtual ClpMatrixBase* ClpPackedMatrix::reverseOrderedCopy ( ) const [virtual]

Returns a new matrix in reverse order without gaps.

Reimplemented from ClpMatrixBase.

Reimplemented in ClpGubMatrix.

virtual CoinBigIndex ClpPackedMatrix::countBasis ( const int *  whichColumn,
int &  numberColumnBasic 
) [virtual]

Returns number of elements in column part of basis.

Implements ClpMatrixBase.

Reimplemented in ClpGubMatrix.

virtual void ClpPackedMatrix::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.

Reimplemented in ClpGubMatrix.

virtual int ClpPackedMatrix::scale ( ClpModel model,
const ClpSimplex baseModel = NULL 
) const [virtual]

Creates scales for column copy (rowCopy in model may be modified) returns non-zero if no scaling done.

Reimplemented from ClpMatrixBase.

virtual void ClpPackedMatrix::scaleRowCopy ( ClpModel model) const [virtual]

Scales rowCopy if column copy scaled Only called if scales already exist.

Reimplemented from ClpMatrixBase.

Creates scaled column copy if scales exist.

virtual ClpMatrixBase* ClpPackedMatrix::scaledColumnCopy ( ClpModel model) const [virtual]

Realy really scales column copy Only called if scales already exist.

Up to user ro delete

Reimplemented from ClpMatrixBase.

virtual bool ClpPackedMatrix::allElementsInRange ( ClpModel model,
double  smallest,
double  largest,
int  check = 15 
) [virtual]

Checks if all elements are in valid range.

Can just return true if you are not paranoid. For Clp I will probably expect no zeros. Code can modify matrix to get rid of small elements. check bits (can be turned off to save time) : 1 - check if matrix has gaps 2 - check if zero elements 4 - check and compress duplicates 8 - report on large and small

Reimplemented from ClpMatrixBase.

virtual void ClpPackedMatrix::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.

virtual void ClpPackedMatrix::unpack ( const ClpSimplex model,
CoinIndexedVector *  rowArray,
int  column 
) const [virtual]

Unpacks a column into an CoinIndexedvector.

Implements ClpMatrixBase.

Reimplemented in ClpGubMatrix.

virtual void ClpPackedMatrix::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.

Reimplemented in ClpGubMatrix.

virtual void ClpPackedMatrix::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.

Reimplemented in ClpGubMatrix.

virtual void ClpPackedMatrix::add ( const ClpSimplex model,
double *  array,
int  column,
double  multiplier 
) const [virtual]

Adds multiple of a column into an array.

Implements ClpMatrixBase.

Reimplemented in ClpGubMatrix.

virtual void ClpPackedMatrix::releasePackedMatrix ( ) const [inline, virtual]

Allow any parts of a created CoinPackedMatrix to be deleted.

Implements ClpMatrixBase.

Definition at line 171 of file ClpPackedMatrix.hpp.

virtual CoinBigIndex* ClpPackedMatrix::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.

virtual bool ClpPackedMatrix::canDoPartialPricing ( ) const [virtual]

Says whether it can do partial pricing.

Reimplemented from ClpMatrixBase.

virtual void ClpPackedMatrix::partialPricing ( ClpSimplex model,
double  start,
double  end,
int &  bestSequence,
int &  numberWanted 
) [virtual]

Partial pricing.

Reimplemented from ClpMatrixBase.

Reimplemented in ClpGubMatrix, ClpDynamicExampleMatrix, ClpDynamicMatrix, and ClpGubDynamicMatrix.

virtual int ClpPackedMatrix::refresh ( ClpSimplex model) [virtual]

makes sure active columns correct

Reimplemented from ClpMatrixBase.

Reimplemented in ClpDynamicMatrix.

virtual void ClpPackedMatrix::reallyScale ( const double *  rowScale,
const double *  columnScale 
) [virtual]

Return a complete CoinPackedMatrix.

Reimplemented from ClpMatrixBase.

virtual void ClpPackedMatrix::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.

virtual void ClpPackedMatrix::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()

Implements ClpMatrixBase.

Reimplemented in ClpGubDynamicMatrix, and ClpDynamicMatrix.

virtual void ClpPackedMatrix::times ( double  scalar,
const double *  x,
double *  y,
const double *  rowScale,
const double *  columnScale 
) const [virtual]

And for scaling.

Reimplemented from ClpMatrixBase.

virtual void ClpPackedMatrix::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()

Implements ClpMatrixBase.

virtual void ClpPackedMatrix::transposeTimes ( double  scalar,
const double *  x,
double *  y,
const double *  rowScale,
const double *  columnScale,
double *  spare = NULL 
) const [virtual]

And for scaling.

Reimplemented from ClpMatrixBase.

void ClpPackedMatrix::transposeTimesSubset ( int  number,
const int *  which,
const double *  pi,
double *  y,
const double *  rowScale,
const double *  columnScale,
double *  spare = NULL 
) const

Return y - pi * A in y.

Precondition:
pi must be of size numRows()
y must be of size numColumns() This just does subset (but puts in correct place in y)
virtual void ClpPackedMatrix::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.

Reimplemented in ClpGubMatrix.

void ClpPackedMatrix::transposeTimesByColumn ( const ClpSimplex model,
double  scalar,
const CoinIndexedVector *  x,
CoinIndexedVector *  y,
CoinIndexedVector *  z 
) const

Return x * scalar * A + y in z.

Note - If x packed mode - then z packed mode This does by column and knows no gaps Squashes small elements and knows about ClpSimplex

virtual void ClpPackedMatrix::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

Reimplemented in ClpGubMatrix.

virtual void ClpPackedMatrix::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.

Reimplemented in ClpGubMatrix.

virtual bool ClpPackedMatrix::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.

virtual void ClpPackedMatrix::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 
) [virtual]

Updates two arrays for steepest.

Reimplemented from ClpMatrixBase.

virtual void ClpPackedMatrix::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.

Sets up an effective RHS.

Reimplemented from ClpMatrixBase.

CoinPackedMatrix* ClpPackedMatrix::matrix ( ) const [inline]

Returns CoinPackedMatrix (non const)

Definition at line 294 of file ClpPackedMatrix.hpp.

void ClpPackedMatrix::setMatrixNull ( ) [inline]

Just sets matrix_ to NULL so it can be used elsewhere.

used in GUB

Definition at line 300 of file ClpPackedMatrix.hpp.

Say we want special column copy.

Definition at line 304 of file ClpPackedMatrix.hpp.

Say we don't want special column copy.

bool ClpPackedMatrix::zeros ( ) const [inline]

Are there zeros?

Definition at line 310 of file ClpPackedMatrix.hpp.

bool ClpPackedMatrix::wantsSpecialColumnCopy ( ) const [inline]

Do we want special column copy.

Definition at line 314 of file ClpPackedMatrix.hpp.

int ClpPackedMatrix::flags ( ) const [inline]

Flags.

Definition at line 318 of file ClpPackedMatrix.hpp.

void ClpPackedMatrix::checkGaps ( ) [inline]

Sets flags_ correctly.

Definition at line 322 of file ClpPackedMatrix.hpp.

ClpPackedMatrix& ClpPackedMatrix::operator= ( const ClpPackedMatrix )

The copy constructor.

virtual ClpMatrixBase* ClpPackedMatrix::clone ( ) const [virtual]
virtual void ClpPackedMatrix::copy ( const ClpPackedMatrix from) [virtual]

Copy contents - resizing if necessary - otherwise re-use memory.

virtual ClpMatrixBase* ClpPackedMatrix::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.

Reimplemented in ClpGubMatrix.

void ClpPackedMatrix::specialRowCopy ( ClpSimplex model,
const ClpMatrixBase rowCopy 
)

make special row copy

make special column copy

virtual void ClpPackedMatrix::correctSequence ( const ClpSimplex model,
int &  sequenceIn,
int &  sequenceOut 
) [virtual]

Correct sequence in and out to give true value.

Reimplemented from ClpMatrixBase.

Reimplemented in ClpGubMatrix.

int ClpPackedMatrix::gutsOfTransposeTimesUnscaled ( const double *COIN_RESTRICT  pi,
int *COIN_RESTRICT  index,
double *COIN_RESTRICT  array,
const double  tolerance 
) const [private]

Meat of transposeTimes by column when not scaled.

int ClpPackedMatrix::gutsOfTransposeTimesScaled ( const double *COIN_RESTRICT  pi,
const double *COIN_RESTRICT  columnScale,
int *COIN_RESTRICT  index,
double *COIN_RESTRICT  array,
const double  tolerance 
) const [private]

Meat of transposeTimes by column when scaled.

int ClpPackedMatrix::gutsOfTransposeTimesUnscaled ( const double *COIN_RESTRICT  pi,
int *COIN_RESTRICT  index,
double *COIN_RESTRICT  array,
const unsigned char *  status,
const double  tolerance 
) const [private]

Meat of transposeTimes by column when not scaled and skipping.

int ClpPackedMatrix::gutsOfTransposeTimesUnscaled ( const double *COIN_RESTRICT  pi,
int *COIN_RESTRICT  index,
double *COIN_RESTRICT  array,
const unsigned char *  status,
int *COIN_RESTRICT  spareIndex,
double *COIN_RESTRICT  spareArray,
const double *COIN_RESTRICT  reducedCost,
double &  upperTheta,
double &  bestPossible,
double  acceptablePivot,
double  dualTolerance,
int &  numberRemaining,
const double  zeroTolerance 
) const [private]

Meat of transposeTimes by column when not scaled and skipping and doing part of dualColumn.

int ClpPackedMatrix::gutsOfTransposeTimesScaled ( const double *COIN_RESTRICT  pi,
const double *COIN_RESTRICT  columnScale,
int *COIN_RESTRICT  index,
double *COIN_RESTRICT  array,
const unsigned char *  status,
const double  tolerance 
) const [private]

Meat of transposeTimes by column when scaled and skipping.

int ClpPackedMatrix::gutsOfTransposeTimesByRowGEK ( const CoinIndexedVector *COIN_RESTRICT  piVector,
int *COIN_RESTRICT  index,
double *COIN_RESTRICT  output,
int  numberColumns,
const double  tolerance,
const double  scalar 
) const [private]

Meat of transposeTimes by row n > K if packed - returns number nonzero.

int ClpPackedMatrix::gutsOfTransposeTimesByRowGE3 ( const CoinIndexedVector *COIN_RESTRICT  piVector,
int *COIN_RESTRICT  index,
double *COIN_RESTRICT  output,
int *COIN_RESTRICT  lookup,
char *COIN_RESTRICT  marked,
const double  tolerance,
const double  scalar 
) const [private]

Meat of transposeTimes by row n > 2 if packed - returns number nonzero.

void ClpPackedMatrix::gutsOfTransposeTimesByRowEQ2 ( const CoinIndexedVector *  piVector,
CoinIndexedVector *  output,
CoinIndexedVector *  spareVector,
const double  tolerance,
const double  scalar 
) const [private]

Meat of transposeTimes by row n == 2 if packed.

void ClpPackedMatrix::gutsOfTransposeTimesByRowEQ1 ( const CoinIndexedVector *  piVector,
CoinIndexedVector *  output,
const double  tolerance,
const double  scalar 
) const [private]

Meat of transposeTimes by row n == 1 if packed.

void ClpPackedMatrix::clearCopies ( ) [private]

Gets rid of special copies.

void ClpPackedMatrix::checkFlags ( int  type) const [protected]

Check validity.


Member Data Documentation

CoinPackedMatrix* ClpPackedMatrix::matrix_ [protected]

Data.

Definition at line 443 of file ClpPackedMatrix.hpp.

number of active columns (normally same as number of columns)

Definition at line 445 of file ClpPackedMatrix.hpp.

int ClpPackedMatrix::flags_ [protected]

Flags - 1 - has zero elements 2 - has gaps 4 - has special row copy 8 - has special column copy 16 - wants special column copy.

Definition at line 453 of file ClpPackedMatrix.hpp.

Special row copy.

Definition at line 455 of file ClpPackedMatrix.hpp.

Special column copy.

Definition at line 457 of file ClpPackedMatrix.hpp.


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