Loading...
Searching...
No Matches
ClpPackedMatrix.hpp
Go to the documentation of this file.
/* $Id$ */
// Copyright (C) 2002, International Business Machines
// Corporation and others. All Rights Reserved.
// This code is licensed under the terms of the Eclipse Public License (EPL).
#ifndef ClpPackedMatrix_H
#define ClpPackedMatrix_H
#include "CoinPragma.hpp"
#include "ClpMatrixBase.hpp"
#include "ClpPrimalColumnSteepest.hpp"
class ClpPackedMatrix2;
class ClpPackedMatrix3;
class CoinDoubleArrayWithLength;
class ClpPackedMatrix : public ClpMatrixBase {
public:
virtual CoinPackedMatrix *getPackedMatrix() const
{
return matrix_;
}
virtual bool isColOrdered() const
{
return matrix_->isColOrdered();
}
virtual CoinBigIndex getNumElements() const
{
return matrix_->getNumElements();
}
virtual int getNumCols() const
{
return matrix_->getNumCols();
}
virtual int getNumRows() const
{
return matrix_->getNumRows();
}
virtual const double *getElements() const
{
return matrix_->getElements();
}
inline double *getMutableElements() const
{
return matrix_->getMutableElements();
}
virtual const int *getIndices() const
{
return matrix_->getIndices();
}
virtual const CoinBigIndex *getVectorStarts() const
{
return matrix_->getVectorStarts();
}
virtual const int *getVectorLengths() const
{
return matrix_->getVectorLengths();
}
virtual int getVectorLength(int index) const
{
return matrix_->getVectorSize(index);
}
virtual void deleteCols(const int numDel, const int *indDel);
virtual void deleteRows(const int numDel, const int *indDel);
#ifndef CLP_NO_VECTOR
virtual void appendCols(int number, const CoinPackedVectorBase *const *columns);
virtual void appendRows(int number, const CoinPackedVectorBase *const *rows);
#endif
virtual int appendMatrix(int number, int type,
const CoinBigIndex *starts, const int *index,
const double *element, int numberOther = -1);
virtual void replaceVector(const int index,
const int numReplace, const double *newElements)
{
matrix_->replaceVector(index, numReplace, newElements);
}
virtual void modifyCoefficient(int row, int column, double newElement,
bool keepZero = false)
{
matrix_->modifyCoefficient(row, column, newElement, keepZero);
}
virtual ClpMatrixBase *reverseOrderedCopy() const;
virtual int countBasis(const int *whichColumn,
int &numberColumnBasic);
virtual void fillBasis(ClpSimplex *model,
const int *whichColumn,
int &numberColumnBasic,
int *row, int *start,
int *rowCount, int *columnCount,
CoinFactorizationDouble *element);
virtual int scale(ClpModel *model, ClpSimplex *simplex = NULL) const;
virtual void scaleRowCopy(ClpModel *model) const;
void createScaledMatrix(ClpSimplex *model) const;
virtual ClpMatrixBase *scaledColumnCopy(ClpModel *model) const;
virtual bool allElementsInRange(ClpModel *model,
double smallest, double largest,
int check = 15);
virtual void rangeOfElements(double &smallestNegative, double &largestNegative,
double &smallestPositive, double &largestPositive);
virtual void unpack(const ClpSimplex *model, CoinIndexedVector *rowArray,
int column) const;
virtual void unpackPacked(ClpSimplex *model,
CoinIndexedVector *rowArray,
int column) const;
virtual void add(const ClpSimplex *model, CoinIndexedVector *rowArray,
int column, double multiplier) const;
virtual void add(const ClpSimplex *model, double *array,
int column, double multiplier) const;
virtual void releasePackedMatrix() const {}
virtual CoinBigIndex *dubiousWeights(const ClpSimplex *model, int *inputWeights) const;
virtual bool canDoPartialPricing() const;
virtual void partialPricing(ClpSimplex *model, double start, double end,
int &bestSequence, int &numberWanted);
virtual int refresh(ClpSimplex *model);
// Really scale matrix
virtual void reallyScale(const double *rowScale, const double *columnScale);
virtual void setDimensions(int numrows, int numcols);
virtual void times(double scalar,
const double *x, double *y) const;
virtual void times(double scalar,
const double *x, double *y,
const double *rowScale,
const double *columnScale) const;
virtual void transposeTimes(double scalar,
const double *x, double *y) const;
virtual void transposeTimes(double scalar,
const double *x, double *y,
const double *rowScale,
const double *columnScale,
double *spare = NULL) const;
void transposeTimesSubset(int number,
const int *which,
const double *pi, double *y,
const double *rowScale,
const double *columnScale,
double *spare = NULL) const;
virtual void transposeTimes(const ClpSimplex *model, double scalar,
const CoinIndexedVector *x,
CoinIndexedVector *y,
CoinIndexedVector *z) const;
void transposeTimesByColumn(const ClpSimplex *model, double scalar,
const CoinIndexedVector *x,
CoinIndexedVector *y,
CoinIndexedVector *z) const;
virtual void transposeTimesByRow(const ClpSimplex *model, double scalar,
const CoinIndexedVector *x,
CoinIndexedVector *y,
CoinIndexedVector *z) const;
virtual void subsetTransposeTimes(const ClpSimplex *model,
const CoinIndexedVector *x,
const CoinIndexedVector *y,
CoinIndexedVector *z) const;
virtual bool canCombine(const ClpSimplex *model,
const CoinIndexedVector *pi) const;
virtual int transposeTimes2(const ClpSimplex *model,
const CoinIndexedVector *pi1, CoinIndexedVector *dj1,
const CoinIndexedVector *pi2,
CoinIndexedVector *spare,
double *infeas, double *reducedCost,
double referenceIn, double devex,
// Array for exact devex to say what is in reference framework
unsigned int *reference,
double *weights, double scaleFactor);
virtual void subsetTimes2(const ClpSimplex *model,
CoinIndexedVector *dj1,
const CoinIndexedVector *pi2, CoinIndexedVector *dj2,
double referenceIn, double devex,
// Array for exact devex to say what is in reference framework
unsigned int *reference,
double *weights, double scaleFactor);
void useEffectiveRhs(ClpSimplex *model);
#if COIN_LONG_WORK
// For long double versions
virtual void times(CoinWorkDouble scalar,
const CoinWorkDouble *x, CoinWorkDouble *y) const;
virtual void transposeTimes(CoinWorkDouble scalar,
const CoinWorkDouble *x, CoinWorkDouble *y) const;
#endif
inline CoinPackedMatrix *matrix() const
{
return matrix_;
}
inline void setMatrixNull()
{
matrix_ = NULL;
}
inline void makeSpecialColumnCopy()
{
flags_ |= 16;
}
void releaseSpecialColumnCopy();
inline bool zeros() const
{
return ((flags_ & 1) != 0);
}
inline bool wantsSpecialColumnCopy() const
{
return ((flags_ & 16) != 0);
}
inline int flags() const
{
return flags_;
}
inline void checkGaps()
{
flags_ = (matrix_->hasGaps()) ? (flags_ | 2) : (flags_ & (~2));
}
inline int numberActiveColumns() const
{
return numberActiveColumns_;
}
inline void setNumberActiveColumns(int value)
{
numberActiveColumns_ = value;
}
ClpPackedMatrix();
virtual ~ClpPackedMatrix();
ClpPackedMatrix(const ClpPackedMatrix &);
ClpPackedMatrix(const CoinPackedMatrix &);
ClpPackedMatrix(const ClpPackedMatrix &wholeModel,
int numberRows, const int *whichRows,
int numberColumns, const int *whichColumns);
ClpPackedMatrix(const CoinPackedMatrix &wholeModel,
int numberRows, const int *whichRows,
int numberColumns, const int *whichColumns);
ClpPackedMatrix(CoinPackedMatrix *matrix);
ClpPackedMatrix &operator=(const ClpPackedMatrix &);
virtual ClpMatrixBase *clone() const;
virtual void copy(const ClpPackedMatrix *from);
virtual ClpMatrixBase *subsetClone(
int numberRows, const int *whichRows,
int numberColumns, const int *whichColumns) const;
void specialRowCopy(ClpSimplex *model, const ClpMatrixBase *rowCopy);
void specialColumnCopy(ClpSimplex *model);
virtual void correctSequence(const ClpSimplex *model, int &sequenceIn, int &sequenceOut);
private:
int gutsOfTransposeTimesUnscaled(const double *COIN_RESTRICT pi,
int *COIN_RESTRICT index,
double *COIN_RESTRICT array,
const double tolerance) const;
int gutsOfTransposeTimesScaled(const double *COIN_RESTRICT pi,
const double *COIN_RESTRICT columnScale,
int *COIN_RESTRICT index,
double *COIN_RESTRICT array,
const double tolerance) const;
int gutsOfTransposeTimesUnscaled(const double *COIN_RESTRICT pi,
int *COIN_RESTRICT index,
double *COIN_RESTRICT array,
const unsigned char *status,
const double tolerance) const;
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 acceptablePivot,
double dualTolerance,
int &numberRemaining,
const double zeroTolerance) const;
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;
int gutsOfTransposeTimesByRowGEK(const CoinIndexedVector *COIN_RESTRICT piVector,
int *COIN_RESTRICT index,
double *COIN_RESTRICT output,
int numberColumns,
const double tolerance,
const double scalar) const;
int gutsOfTransposeTimesByRowGE3(const CoinIndexedVector *COIN_RESTRICT piVector,
int *COIN_RESTRICT index,
double *COIN_RESTRICT output,
double *COIN_RESTRICT array2,
const double tolerance,
const double scalar) const;
int gutsOfTransposeTimesByRowGE3a(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;
void gutsOfTransposeTimesByRowEQ2(const CoinIndexedVector *piVector, CoinIndexedVector *output,
CoinIndexedVector *spareVector, const double tolerance, const double scalar) const;
void gutsOfTransposeTimesByRowEQ1(const CoinIndexedVector *piVector, CoinIndexedVector *output,
const double tolerance, const double scalar) const;
void clearCopies();
protected:
void checkFlags(int type) const;
CoinPackedMatrix *matrix_;
int numberActiveColumns_;
mutable int flags_;
ClpPackedMatrix2 *rowCopy_;
ClpPackedMatrix3 *columnCopy_;
};
#ifdef THREAD
#include <pthread.h>
typedef struct {
double acceptablePivot;
const ClpSimplex *model;
double *spare;
int *spareIndex;
double *arrayTemp;
int *indexTemp;
int *numberInPtr;
//double * bestPossiblePtr;
double *upperThetaPtr;
int *posFreePtr;
double *freePivotPtr;
int *numberOutPtr;
const unsigned short *count;
const double *pi;
const CoinBigIndex *rowStart;
const double *element;
const unsigned short *column;
int offset;
int numberInRowArray;
int numberLook;
} dualColumn0Struct;
#endif
class ClpPackedMatrix2 {
public:
void transposeTimes(const ClpSimplex *model,
const CoinPackedMatrix *rowCopy,
const CoinIndexedVector *x,
CoinIndexedVector *spareArray,
CoinIndexedVector *z) const;
inline bool usefulInfo() const
{
return rowStart_ != NULL;
}
ClpPackedMatrix2();
ClpPackedMatrix2(ClpSimplex *model, const CoinPackedMatrix *rowCopy);
virtual ~ClpPackedMatrix2();
ClpPackedMatrix2(const ClpPackedMatrix2 &);
ClpPackedMatrix2 &operator=(const ClpPackedMatrix2 &);
protected:
int numberBlocks_;
int numberRows_;
int *offset_;
mutable unsigned short *count_;
mutable CoinBigIndex *rowStart_;
unsigned short *column_;
double *work_;
#ifdef THREAD
pthread_t *threadId_;
dualColumn0Struct *info_;
#endif
};
typedef struct {
CoinBigIndex startElements_; // point to data
CoinBigIndex startRows_; // point to data later
int startIndices_; // point to column_
int numberInBlock_;
int numberScan_; // i.e. miss out basic and fixed
/* order is -
free or superbasic
at lower
at upper
fixed or basic */
int firstAtLower_;
int firstAtUpper_;
int firstBasic_; // or fixed
int numberElements_; // number elements per column
int numberOnes_; // later
} blockStruct;
class ClpPackedMatrix3 {
public:
void transposeTimes(const ClpSimplex *model,
const double *pi,
CoinIndexedVector *output) const;
void transposeTimes(const ClpSimplex *model,
const double *pi,
CoinIndexedVector *output,
CoinIndexedVector *candidate,
const CoinIndexedVector *rowArray) const;
void transposeTimes2(const ClpSimplex *model,
const double *pi, CoinIndexedVector *dj1,
const double *piWeight,
double *COIN_RESTRICT infeas,
double *COIN_RESTRICT reducedCost,
double referenceIn, double devex,
// Array for exact devex to say what is in reference framework
unsigned int *reference,
double *weights, double scaleFactor);
ClpPackedMatrix3();
ClpPackedMatrix3(ClpSimplex *model, const CoinPackedMatrix *columnCopy);
virtual ~ClpPackedMatrix3();
ClpPackedMatrix3(const ClpPackedMatrix3 &);
ClpPackedMatrix3 &operator=(const ClpPackedMatrix3 &);
void sortBlocks(const ClpSimplex *model);
void swapOne(const ClpSimplex *model, const ClpPackedMatrix *matrix,
int iColumn);
void swapOne(int iBlock, int kA, int kB);
void checkBlocks(const ClpSimplex *model);
int redoInfeasibilities(const ClpSimplex *model,
ClpPrimalColumnSteepest *pivotChoose,
int type);
protected:
int numberBlocks_;
int numberColumns_;
int numberColumnsWithGaps_;
#if ABOCA_LITE
int numberChunks_;
#endif
CoinBigIndex numberElements_;
int maxBlockSize_;
int *column_;
CoinBigIndex *start_;
int *row_;
double *element_;
CoinDoubleArrayWithLength *temporary_;
#if ABOCA_LITE
int endChunk_[2 * ABOCA_LITE + 1];
#endif
blockStruct *block_;
int ifActive_;
};
#elif INCLUDE_MATRIX3_PRICING
int iColumn = *column;
column++;
if (fabs(value) > zeroTolerance) {
double thisWeight = weights[iColumn];
double pivot = value * scaleFactor;
double pivotSquared = pivot * pivot;
thisWeight += pivotSquared * devex + pivot * modification;
if (thisWeight < DEVEX_TRY_NORM) {
if (referenceIn < 0.0) {
// steepest
thisWeight = CoinMax(DEVEX_TRY_NORM, DEVEX_ADD_ONE + pivotSquared);
} else {
// exact
thisWeight = referenceIn * pivotSquared;
if (reference(iColumn))
thisWeight += 1.0;
thisWeight = CoinMax(thisWeight, DEVEX_TRY_NORM);
}
}
// out basic or fixed
weights[iColumn] = thisWeight;
value = reducedCost[iColumn] - value;
reducedCost[iColumn] = value;
unsigned char thisStatus = status[iColumn] & 7;
assert(thisStatus != 0 && thisStatus != 4);
if (thisStatus == 3) {
//} else if ((thisStatus&1)!=0) {
// basic or fixed
//value=0.0;
} else {
assert(thisStatus == 2);
value = -value;
}
if (value < dualTolerance) {
value *= value;
if (value > bestRatio * weights[iColumn]) {
bestSequence = iColumn;
bestRatio = value / weights[iColumn];
#if NO_CHANGE_MULTIPLIER != 1
bestRatio2 = bestRatio * NO_CHANGE_MULTIPLIER;
#endif
}
}
} else {
// interesting - was faster without this?!
value = reducedCost[iColumn];
unsigned char thisStatus = status[iColumn] & 7;
assert(thisStatus != 0 && thisStatus != 4);
if (thisStatus == 3) {
} else if ((thisStatus & 1) != 0) {
// basic or fixed
value = 0.0;
} else {
value = -value;
}
if (value < dualTolerance) {
value *= value;
if (value > bestRatio2 * weights[iColumn]) {
bestSequence = iColumn;
bestRatio2 = value / weights[iColumn];
#if NO_CHANGE_MULTIPLIER != 1
bestRatio = bestRatio2 * INVERSE_MULTIPLIER;
#endif
}
}
}
#endif
/* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2
*/
DEVEX_TRY_NORM
#define DEVEX_TRY_NORM
Definition AbcDualRowSteepest.hpp:162
DEVEX_ADD_ONE
#define DEVEX_ADD_ONE
Definition AbcDualRowSteepest.hpp:163
type
CbcOrClpParameterType type() const
type
Definition CbcOrClpParam.hpp:462
ClpMatrixBase.hpp
COIN_RESTRICT
#define COIN_RESTRICT
Definition ClpMatrixBase.hpp:21
ClpPrimalColumnSteepest.hpp
ClpMatrixBase::reducedCost
double reducedCost(ClpSimplex *model, int sequence) const
Returns reduced cost of a variable.
ClpMatrixBase::ClpMatrixBase
ClpMatrixBase()
Default constructor.
ClpMatrixBase::type
int type() const
Returns type.
Definition ClpMatrixBase.hpp:383
ClpModel
Definition ClpModel.hpp:38
ClpPackedMatrix2
Definition ClpPackedMatrix.hpp:526
ClpPackedMatrix2::ClpPackedMatrix2
ClpPackedMatrix2(ClpSimplex *model, const CoinPackedMatrix *rowCopy)
Constructor from copy.
ClpPackedMatrix2::work_
double * work_
work arrays
Definition ClpPackedMatrix.hpp:580
ClpPackedMatrix2::operator=
ClpPackedMatrix2 & operator=(const ClpPackedMatrix2 &)
ClpPackedMatrix2::ClpPackedMatrix2
ClpPackedMatrix2()
Default constructor.
ClpPackedMatrix2::ClpPackedMatrix2
ClpPackedMatrix2(const ClpPackedMatrix2 &)
The copy constructor.
ClpPackedMatrix2::numberBlocks_
int numberBlocks_
Number of blocks.
Definition ClpPackedMatrix.hpp:568
ClpPackedMatrix2::transposeTimes
void transposeTimes(const ClpSimplex *model, const CoinPackedMatrix *rowCopy, const CoinIndexedVector *x, CoinIndexedVector *spareArray, CoinIndexedVector *z) const
Return x * -1 * A in z.
ClpPackedMatrix2::~ClpPackedMatrix2
virtual ~ClpPackedMatrix2()
Destructor.
ClpPackedMatrix2::count_
unsigned short * count_
Counts of elements in each part of row.
Definition ClpPackedMatrix.hpp:574
ClpPackedMatrix2::numberRows_
int numberRows_
Number of rows.
Definition ClpPackedMatrix.hpp:570
ClpPackedMatrix2::offset_
int * offset_
Column offset for each block (plus one at end).
Definition ClpPackedMatrix.hpp:572
ClpPackedMatrix2::column_
unsigned short * column_
columns within block
Definition ClpPackedMatrix.hpp:578
ClpPackedMatrix2::rowStart_
CoinBigIndex * rowStart_
Row starts.
Definition ClpPackedMatrix.hpp:576
ClpPackedMatrix2::usefulInfo
bool usefulInfo() const
Returns true if copy has useful information.
Definition ClpPackedMatrix.hpp:540
ClpPackedMatrix3
Definition ClpPackedMatrix.hpp:604
ClpPackedMatrix3::operator=
ClpPackedMatrix3 & operator=(const ClpPackedMatrix3 &)
ClpPackedMatrix3::element_
double * element_
Elements.
Definition ClpPackedMatrix.hpp:695
ClpPackedMatrix3::ClpPackedMatrix3
ClpPackedMatrix3(const ClpPackedMatrix3 &)
The copy constructor.
ClpPackedMatrix3::transposeTimes2
void transposeTimes2(const ClpSimplex *model, const double *pi, CoinIndexedVector *dj1, const double *piWeight, double *COIN_RESTRICT infeas, double *COIN_RESTRICT reducedCost, double referenceIn, double devex, unsigned int *reference, double *weights, double scaleFactor)
ClpPackedMatrix3::sortBlocks
void sortBlocks(const ClpSimplex *model)
Sort blocks.
ClpPackedMatrix3::temporary_
CoinDoubleArrayWithLength * temporary_
Temporary work area (aligned).
Definition ClpPackedMatrix.hpp:697
ClpPackedMatrix3::ClpPackedMatrix3
ClpPackedMatrix3()
Default constructor.
ClpPackedMatrix3::block_
blockStruct * block_
Blocks (ordinary start at 0 and go to first block).
Definition ClpPackedMatrix.hpp:703
ClpPackedMatrix3::ClpPackedMatrix3
ClpPackedMatrix3(ClpSimplex *model, const CoinPackedMatrix *columnCopy)
Constructor from copy.
ClpPackedMatrix3::transposeTimes
void transposeTimes(const ClpSimplex *model, const double *pi, CoinIndexedVector *output, CoinIndexedVector *candidate, const CoinIndexedVector *rowArray) const
This version does dualColumn0 Updates two arrays for steepest.
ClpPackedMatrix3::numberColumnsWithGaps_
int numberColumnsWithGaps_
Number of columns including gaps.
Definition ClpPackedMatrix.hpp:679
ClpPackedMatrix3::maxBlockSize_
int maxBlockSize_
Maximum size of any block.
Definition ClpPackedMatrix.hpp:687
ClpPackedMatrix3::column_
int * column_
Column indices and reverse lookup (within block).
Definition ClpPackedMatrix.hpp:689
ClpPackedMatrix3::swapOne
void swapOne(const ClpSimplex *model, const ClpPackedMatrix *matrix, int iColumn)
Swap one variable.
ClpPackedMatrix3::numberBlocks_
int numberBlocks_
Number of blocks.
Definition ClpPackedMatrix.hpp:675
ClpPackedMatrix3::transposeTimes
void transposeTimes(const ClpSimplex *model, const double *pi, CoinIndexedVector *output) const
Return x * -1 * A in z.
ClpPackedMatrix3::ifActive_
int ifActive_
If active.
Definition ClpPackedMatrix.hpp:705
ClpPackedMatrix3::redoInfeasibilities
int redoInfeasibilities(const ClpSimplex *model, ClpPrimalColumnSteepest *pivotChoose, int type)
type - 1 redo infeasible, 2 choose sequenceIn, 3 both returns sequenceIn (or -1) for type 2
ClpPackedMatrix3::checkBlocks
void checkBlocks(const ClpSimplex *model)
Debug - check blocks.
ClpPackedMatrix3::numberElements_
CoinBigIndex numberElements_
Number of elements (including gaps).
Definition ClpPackedMatrix.hpp:685
ClpPackedMatrix3::row_
int * row_
Rows.
Definition ClpPackedMatrix.hpp:693
ClpPackedMatrix3::numberColumns_
int numberColumns_
Number of columns.
Definition ClpPackedMatrix.hpp:677
ClpPackedMatrix3::start_
CoinBigIndex * start_
Starts for odd/long vectors??
Definition ClpPackedMatrix.hpp:691
ClpPackedMatrix3::~ClpPackedMatrix3
virtual ~ClpPackedMatrix3()
Destructor.
ClpPackedMatrix3::swapOne
void swapOne(int iBlock, int kA, int kB)
Part of above.
ClpPackedMatrix
Definition ClpPackedMatrix.hpp:23
ClpPackedMatrix::gutsOfTransposeTimesUnscaled
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 acceptablePivot, double dualTolerance, int &numberRemaining, const double zeroTolerance) const
Meat of transposeTimes by column when not scaled and skipping and doing part of dualColumn.
ClpPackedMatrix::~ClpPackedMatrix
virtual ~ClpPackedMatrix()
Destructor.
ClpPackedMatrix::useEffectiveRhs
void useEffectiveRhs(ClpSimplex *model)
Sets up an effective RHS.
ClpPackedMatrix::gutsOfTransposeTimesByRowGE3a
int gutsOfTransposeTimesByRowGE3a(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.
ClpPackedMatrix::clone
virtual ClpMatrixBase * clone() const
Clone.
ClpPackedMatrix::countBasis
virtual int countBasis(const int *whichColumn, int &numberColumnBasic)
Returns number of elements in column part of basis.
ClpPackedMatrix::checkFlags
void checkFlags(int type) const
Check validity.
ClpPackedMatrix::getMutableElements
double * getMutableElements() const
Mutable elements.
Definition ClpPackedMatrix.hpp:63
ClpPackedMatrix::ClpPackedMatrix
ClpPackedMatrix(const CoinPackedMatrix &)
The copy constructor from an CoinPackedMatrix.
ClpPackedMatrix::getNumElements
virtual CoinBigIndex getNumElements() const
Number of entries in the packed matrix.
Definition ClpPackedMatrix.hpp:39
ClpPackedMatrix::canDoPartialPricing
virtual bool canDoPartialPricing() const
Says whether it can do partial pricing.
ClpPackedMatrix::appendCols
virtual void appendCols(int number, const CoinPackedVectorBase *const *columns)
Append Columns.
ClpPackedMatrix::appendRows
virtual void appendRows(int number, const CoinPackedVectorBase *const *rows)
Append Rows.
ClpPackedMatrix::scale
virtual int scale(ClpModel *model, ClpSimplex *simplex=NULL) const
Creates scales for column copy (rowCopy in model may be modified) returns non-zero if no scaling done...
ClpPackedMatrix::checkGaps
void checkGaps()
Sets flags_ correctly.
Definition ClpPackedMatrix.hpp:348
ClpPackedMatrix::reallyScale
virtual void reallyScale(const double *rowScale, const double *columnScale)
ClpPackedMatrix::wantsSpecialColumnCopy
bool wantsSpecialColumnCopy() const
Do we want special column copy.
Definition ClpPackedMatrix.hpp:338
ClpPackedMatrix::allElementsInRange
virtual bool allElementsInRange(ClpModel *model, double smallest, double largest, int check=15)
Checks if all elements are in valid range.
ClpPackedMatrix::zeros
bool zeros() const
Are there zeros?
Definition ClpPackedMatrix.hpp:333
ClpPackedMatrix::isColOrdered
virtual bool isColOrdered() const
Whether the packed matrix is column major ordered or not.
Definition ClpPackedMatrix.hpp:34
ClpPackedMatrix::releaseSpecialColumnCopy
void releaseSpecialColumnCopy()
Say we don't want special column copy.
ClpPackedMatrix::getVectorLength
virtual int getVectorLength(int index) const
The length of a single major-dimension vector.
Definition ClpPackedMatrix.hpp:87
ClpPackedMatrix::gutsOfTransposeTimesByRowEQ2
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.
ClpPackedMatrix::replaceVector
virtual void replaceVector(const int index, const int numReplace, const double *newElements)
Replace the elements of a vector.
Definition ClpPackedMatrix.hpp:113
ClpPackedMatrix::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.
ClpPackedMatrix::ClpPackedMatrix
ClpPackedMatrix(const ClpPackedMatrix &)
The copy constructor.
ClpPackedMatrix::setNumberActiveColumns
void setNumberActiveColumns(int value)
Set number of active columns (normally same as number of columns).
Definition ClpPackedMatrix.hpp:358
ClpPackedMatrix::setMatrixNull
void setMatrixNull()
Just sets matrix_ to NULL so it can be used elsewhere.
Definition ClpPackedMatrix.hpp:321
ClpPackedMatrix::clearCopies
void clearCopies()
Gets rid of special copies.
ClpPackedMatrix::releasePackedMatrix
virtual void releasePackedMatrix() const
Allow any parts of a created CoinPackedMatrix to be deleted.
Definition ClpPackedMatrix.hpp:188
ClpPackedMatrix::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.
ClpPackedMatrix::transposeTimes2
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 in...
ClpPackedMatrix::times
virtual void times(double scalar, const double *x, double *y) const
Return y + A * scalar *x in y.
ClpPackedMatrix::copy
virtual void copy(const ClpPackedMatrix *from)
Copy contents - resizing if necessary - otherwise re-use memory.
ClpPackedMatrix::ClpPackedMatrix
ClpPackedMatrix()
Default constructor.
ClpPackedMatrix::ClpPackedMatrix
ClpPackedMatrix(const CoinPackedMatrix &wholeModel, int numberRows, const int *whichRows, int numberColumns, const int *whichColumns)
ClpPackedMatrix::canCombine
virtual bool canCombine(const ClpSimplex *model, const CoinIndexedVector *pi) const
Returns true if can combine transposeTimes and subsetTransposeTimes and if it would be faster.
ClpPackedMatrix::scaleRowCopy
virtual void scaleRowCopy(ClpModel *model) const
Scales rowCopy if column copy scaled Only called if scales already exist.
ClpPackedMatrix::flags_
int flags_
Flags - 1 - has zero elements 2 - has gaps 4 - has special row copy 8 - has special column copy 16 - ...
Definition ClpPackedMatrix.hpp:494
ClpPackedMatrix::subsetClone
virtual ClpMatrixBase * subsetClone(int numberRows, const int *whichRows, int numberColumns, const int *whichColumns) const
Subset clone (without gaps).
ClpPackedMatrix::partialPricing
virtual void partialPricing(ClpSimplex *model, double start, double end, int &bestSequence, int &numberWanted)
Partial pricing.
ClpPackedMatrix::gutsOfTransposeTimesUnscaled
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.
ClpPackedMatrix::unpack
virtual void unpack(const ClpSimplex *model, CoinIndexedVector *rowArray, int column) const
Unpacks a column into an CoinIndexedvector.
ClpPackedMatrix::getPackedMatrix
virtual CoinPackedMatrix * getPackedMatrix() const
Return a complete CoinPackedMatrix.
Definition ClpPackedMatrix.hpp:29
ClpPackedMatrix::gutsOfTransposeTimesScaled
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.
ClpPackedMatrix::refresh
virtual int refresh(ClpSimplex *model)
makes sure active columns correct
ClpPackedMatrix::transposeTimesByColumn
void transposeTimesByColumn(const ClpSimplex *model, double scalar, const CoinIndexedVector *x, CoinIndexedVector *y, CoinIndexedVector *z) const
Return x * scalar * A in z.
ClpPackedMatrix::deleteCols
virtual void deleteCols(const int numDel, const int *indDel)
Delete the columns whose indices are listed in indDel.
ClpPackedMatrix::transposeTimes
virtual void transposeTimes(double scalar, const double *x, double *y, const double *rowScale, const double *columnScale, double *spare=NULL) const
And for scaling.
ClpPackedMatrix::gutsOfTransposeTimesUnscaled
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.
ClpPackedMatrix::correctSequence
virtual void correctSequence(const ClpSimplex *model, int &sequenceIn, int &sequenceOut)
Correct sequence in and out to give true value.
ClpPackedMatrix::makeSpecialColumnCopy
void makeSpecialColumnCopy()
Say we want special column copy.
Definition ClpPackedMatrix.hpp:326
ClpPackedMatrix::specialColumnCopy
void specialColumnCopy(ClpSimplex *model)
make special column copy
ClpPackedMatrix::columnCopy_
ClpPackedMatrix3 * columnCopy_
Special column copy.
Definition ClpPackedMatrix.hpp:498
ClpPackedMatrix::modifyCoefficient
virtual void modifyCoefficient(int row, int column, double newElement, bool keepZero=false)
Modify one element of packed matrix.
Definition ClpPackedMatrix.hpp:121
ClpPackedMatrix::unpackPacked
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.
ClpPackedMatrix::rangeOfElements
virtual void rangeOfElements(double &smallestNegative, double &largestNegative, double &smallestPositive, double &largestPositive)
Returns largest and smallest elements of both signs.
ClpPackedMatrix::numberActiveColumns_
int numberActiveColumns_
number of active columns (normally same as number of columns)
Definition ClpPackedMatrix.hpp:486
ClpPackedMatrix::transposeTimesSubset
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.
ClpPackedMatrix::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.
ClpPackedMatrix::numberActiveColumns
int numberActiveColumns() const
number of active columns (normally same as number of columns)
Definition ClpPackedMatrix.hpp:353
ClpPackedMatrix::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).
ClpPackedMatrix::getVectorStarts
virtual const CoinBigIndex * getVectorStarts() const
Definition ClpPackedMatrix.hpp:77
ClpPackedMatrix::transposeTimes
virtual void transposeTimes(double scalar, const double *x, double *y) const
Return y + x * scalar * A in y.
ClpPackedMatrix::matrix
CoinPackedMatrix * matrix() const
Returns CoinPackedMatrix (non const).
Definition ClpPackedMatrix.hpp:314
ClpPackedMatrix::add
virtual void add(const ClpSimplex *model, double *array, int column, double multiplier) const
Adds multiple of a column into an array.
ClpPackedMatrix::getNumRows
virtual int getNumRows() const
Number of rows.
Definition ClpPackedMatrix.hpp:49
ClpPackedMatrix::scaledColumnCopy
virtual ClpMatrixBase * scaledColumnCopy(ClpModel *model) const
Realy really scales column copy Only called if scales already exist.
ClpPackedMatrix::transposeTimesByRow
virtual void transposeTimesByRow(const ClpSimplex *model, double scalar, const CoinIndexedVector *x, CoinIndexedVector *y, CoinIndexedVector *z) const
Return x * scalar * A in z.
ClpPackedMatrix::ClpPackedMatrix
ClpPackedMatrix(CoinPackedMatrix *matrix)
This takes over ownership (for space reasons).
ClpPackedMatrix::matrix_
CoinPackedMatrix * matrix_
Data.
Definition ClpPackedMatrix.hpp:484
ClpPackedMatrix::reverseOrderedCopy
virtual ClpMatrixBase * reverseOrderedCopy() const
Returns a new matrix in reverse order without gaps.
ClpPackedMatrix::getVectorLengths
virtual const int * getVectorLengths() const
The lengths of the major-dimension vectors.
Definition ClpPackedMatrix.hpp:82
ClpPackedMatrix::getElements
virtual const double * getElements() const
A vector containing the elements in the packed matrix.
Definition ClpPackedMatrix.hpp:58
ClpPackedMatrix::subsetTransposeTimes
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.
ClpPackedMatrix::specialRowCopy
void specialRowCopy(ClpSimplex *model, const ClpMatrixBase *rowCopy)
make special row copy
ClpPackedMatrix::operator=
ClpPackedMatrix & operator=(const ClpPackedMatrix &)
ClpPackedMatrix::flags
int flags() const
Flags.
Definition ClpPackedMatrix.hpp:343
ClpPackedMatrix::gutsOfTransposeTimesByRowGE3
int gutsOfTransposeTimesByRowGE3(const CoinIndexedVector *COIN_RESTRICT piVector, int *COIN_RESTRICT index, double *COIN_RESTRICT output, double *COIN_RESTRICT array2, const double tolerance, const double scalar) const
Meat of transposeTimes by row n > 2 if packed - returns number nonzero.
ClpPackedMatrix::setDimensions
virtual void setDimensions(int numrows, int numcols)
Set the dimensions of the matrix.
ClpPackedMatrix::subsetTimes2
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.
ClpPackedMatrix::rowCopy_
ClpPackedMatrix2 * rowCopy_
Special row copy.
Definition ClpPackedMatrix.hpp:496
ClpPackedMatrix::createScaledMatrix
void createScaledMatrix(ClpSimplex *model) const
Creates scaled column copy if scales exist.
ClpPackedMatrix::transposeTimes
virtual void transposeTimes(const ClpSimplex *model, double scalar, const CoinIndexedVector *x, CoinIndexedVector *y, CoinIndexedVector *z) const
Return x * scalar * A in z.
ClpPackedMatrix::getNumCols
virtual int getNumCols() const
Number of columns.
Definition ClpPackedMatrix.hpp:44
ClpPackedMatrix::gutsOfTransposeTimesByRowGEK
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.
ClpPackedMatrix::gutsOfTransposeTimesByRowEQ1
void gutsOfTransposeTimesByRowEQ1(const CoinIndexedVector *piVector, CoinIndexedVector *output, const double tolerance, const double scalar) const
Meat of transposeTimes by row n == 1 if packed.
ClpPackedMatrix::deleteRows
virtual void deleteRows(const int numDel, const int *indDel)
Delete the rows whose indices are listed in indDel.
ClpPackedMatrix::gutsOfTransposeTimesScaled
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.
ClpPackedMatrix::times
virtual void times(double scalar, const double *x, double *y, const double *rowScale, const double *columnScale) const
And for scaling.
ClpPackedMatrix::ClpPackedMatrix
ClpPackedMatrix(const ClpPackedMatrix &wholeModel, int numberRows, const int *whichRows, int numberColumns, const int *whichColumns)
Subset constructor (without gaps).
ClpPackedMatrix::getIndices
virtual const int * getIndices() const
A vector containing the minor indices of the elements in the packed matrix.
Definition ClpPackedMatrix.hpp:72
ClpPrimalColumnSteepest
Primal Column Pivot Steepest Edge Algorithm Class.
Definition ClpPrimalColumnSteepest.hpp:21
ClpSimplex
This solves LPs using the simplex method.
Definition ClpSimplex.hpp:106
blockStruct
Definition ClpPackedMatrix.hpp:587
blockStruct::firstAtUpper_
int firstAtUpper_
Definition ClpPackedMatrix.hpp:599
blockStruct::numberOnes_
int numberOnes_
Definition ClpPackedMatrix.hpp:602
blockStruct::numberInBlock_
int numberInBlock_
Definition ClpPackedMatrix.hpp:591
blockStruct::numberElements_
int numberElements_
Definition ClpPackedMatrix.hpp:601
blockStruct::firstAtLower_
int firstAtLower_
Definition ClpPackedMatrix.hpp:598
blockStruct::numberScan_
int numberScan_
Definition ClpPackedMatrix.hpp:592
blockStruct::startRows_
CoinBigIndex startRows_
Definition ClpPackedMatrix.hpp:589
blockStruct::firstBasic_
int firstBasic_
Definition ClpPackedMatrix.hpp:600
blockStruct::startElements_
CoinBigIndex startElements_
Definition ClpPackedMatrix.hpp:588
blockStruct::startIndices_
int startIndices_
Definition ClpPackedMatrix.hpp:590