Go to the documentation of this file.
9 #include "CoinPragma.hpp"
37 return matrix_->getNumElements();
55 return matrix_->getMutableElements();
63 return matrix_->getMutableIndices();
67 return matrix_->getVectorStarts();
70 return matrix_->getMutableVectorStarts();
74 return matrix_->getVectorLengths();
78 return matrix_->getMutableVectorLengths();
92 int & numberColumnBasic);
95 int & numberColumnBasic,
96 int * row,
int * start,
97 int * rowCount,
int * columnCount,
101 int & numberColumnBasic,
102 int * row,
int * start,
103 int * rowCount,
int * columnCount,
104 long double * element);
107 void scale(
int numberRowsAlreadyScaled);
125 void unpack(CoinIndexedVector & rowArray,
129 void add(CoinIndexedVector & rowArray,
int column,
double multiplier)
const ;
138 const double * x,
double * y)
const;
143 const double * x,
double * y)
const;
148 const double * x,
double * y)
const;
153 const double * x,
double * y)
const;
162 const double * x,
double * y)
const;
174 const CoinIndexedVector & x,
175 CoinIndexedVector & z)
const;
178 CoinPartitionedVector & tableauRow,
179 CoinPartitionedVector & candidateList)
const;
182 const CoinIndexedVector & update,
183 CoinPartitionedVector & tableauRow,
184 CoinPartitionedVector & candidateList)
const;
187 const CoinIndexedVector & update,
188 CoinPartitionedVector & tableauRow,
189 CoinPartitionedVector & candidateList)
const;
192 const CoinIndexedVector & update,
193 CoinPartitionedVector & tableauRow,
194 CoinPartitionedVector & candidateList)
const;
197 const CoinIndexedVector & update,
198 CoinPartitionedVector & tableauRow,
199 CoinPartitionedVector & candidateList)
const;
204 const CoinIndexedVector & update,
205 CoinPartitionedVector & tableauRow,
206 CoinPartitionedVector & candidateList)
const;
211 CoinPartitionedVector & spare)
const;
214 CoinPartitionedVector & spare,
215 double & bestValue)
const;
218 CoinPartitionedVector & tableauRow)
const;
221 const CoinIndexedVector & updateDjs,
222 CoinPartitionedVector & tableauRow)
const;
226 const double * weights)
const;
233 CoinPartitionedVector & updateForDjs,
234 const CoinIndexedVector & updateForWeights,
235 CoinPartitionedVector & spareColumn1,
236 double * infeasibilities,
237 double referenceIn,
double devex,
239 unsigned int * reference,
240 double * weights,
double scaleFactor)
const;
247 CoinPartitionedVector & updateForDjs,
248 const CoinIndexedVector & updateForWeights,
249 CoinPartitionedVector & spareColumn1,
250 double * infeasibilities,
251 double referenceIn,
double devex,
253 unsigned int * reference,
254 double * weights,
double scaleFactor)
const;
261 CoinPartitionedVector & updateForDjs,
262 const CoinIndexedVector & updateForWeights,
263 CoinPartitionedVector & spareColumn1,
264 CoinIndexedVector & infeasible,
265 double referenceIn,
double devex,
267 unsigned int * reference,
268 double * weights,
double scaleFactor)
const;
271 const CoinPartitionedVector & tableauRow,
272 CoinPartitionedVector & weights)
const;
275 int & bestSequence,
int & numberWanted);
280 CoinIndexedVector & z)
const;
283 CoinIndexedVector & z)
const;
288 inline CoinPackedMatrix *
matrix()
const {
386 int numberRows,
const int * whichRows,
387 int numberColumns,
const int * whichColumns);
389 int numberRows,
const int * whichRows,
390 int numberColumns,
const int * whichColumns);
407 #define NUMBER_ROW_BLOCKS 1
408 #define NUMBER_COLUMN_BLOCKS 1
409 #elif ABC_PARALLEL==1
410 #define NUMBER_ROW_BLOCKS 4
411 #define NUMBER_COLUMN_BLOCKS 4
413 #define NUMBER_ROW_BLOCKS 8
414 #define NUMBER_COLUMN_BLOCKS 8
435 CoinBigIndex countStart_[MAX_COUNT+1];
438 int countFirst_[MAX_COUNT+1];
440 int * countRealColumn_;
442 CoinBigIndex * countStartLarge_;
444 double * countElement_;
473 double acceptablePivot;
480 double * bestPossiblePtr;
481 double * upperThetaPtr;
483 double * freePivotPtr;
485 const unsigned short * count;
487 const CoinBigIndex * rowStart;
488 const double * element;
489 const unsigned short * column;
491 int numberInRowArray;
504 const CoinPackedMatrix * rowCopy,
505 const CoinIndexedVector & x,
506 CoinIndexedVector & spareArray,
507 CoinIndexedVector & z)
const;
552 pthread_t * threadId_;
553 dualColumn0Struct * info_;
574 CoinIndexedVector & output)
const;
577 const double * pi, CoinIndexedVector & dj1,
578 const double * piWeight,
579 double referenceIn,
double devex,
581 unsigned int * reference,
582 double * weights,
double scaleFactor);
void putIntofUseful(int sequence, CoinIndexedVector &spare)
Put into useful.
double * element_
Values by row.
CoinBigIndex * start_
Starts for odd/long vectors.
void add(CoinIndexedVector &rowArray, int column, double multiplier) const
Adds multiple of a column (or slack) into an CoinIndexedvector You can use quickAdd to add to vector.
void makeAllUseful(CoinIndexedVector &spare)
Make all useful.
int savedBestSequence_
Saved best sequence in pricing.
int getNumRows() const
Number of rows.
void transposeTimes(const CoinIndexedVector &x, CoinIndexedVector &z) const
Return -x *A in z
int pivotColumnDantzig(int iBlock, bool doByRow, const CoinIndexedVector &updates, CoinPartitionedVector &spare, double &bestValue) const
Get sequenceIn when Dantzig (One block)
blockStruct * block_
Blocks (ordinary start at 0 and go to first block)
int chooseBestDj(int iBlock, const CoinIndexedVector &infeasibilities, const double *weights) const
Chooses best weighted dj.
void setStartFraction(double value)
void transposeTimes2(const AbcSimplex *model, const double *pi, CoinIndexedVector &dj1, const double *piWeight, double referenceIn, double devex, unsigned int *reference, double *weights, double scaleFactor)
Updates two arrays for steepest.
CoinPackedMatrix * matrix() const
Returns CoinPackedMatrix (non const)
int * getMutableIndices() const
A vector containing the minor indices of the elements in the packed matrix.
CoinPackedMatrix * getPackedMatrix() const
Return a complete CoinPackedMatrix.
const CoinBigIndex * getVectorStarts() const
Starts.
void setSavedBestDj(double value)
int pivotColumnDantzig(const CoinIndexedVector &updates, CoinPartitionedVector &spare) const
Get sequenceIn when Dantzig.
int transposeTimesNonBasic(double scalar, const CoinIndexedVector &x, CoinIndexedVector &z) const
Return x * scalar * A/code> in z.
void takeOutOfUseful(int sequence, CoinIndexedVector &spare)
Take out of useful.
int blockStart_[NUMBER_ROW_BLOCKS+1]
Start of each block (in stored)
double * getMutableElements() const
Mutable elements.
bool isColOrdered() const
Whether the packed matrix is column major ordered or not.
double startFraction() const
Current start of search space in matrix (as fraction)
int minimumObjectsScan() const
Partial pricing tuning parameter - minimum number of "objects" to scan.
void setSavedBestSequence(int value)
int currentWanted() const
Current number of negative reduced costs which we still need.
int numberRowBlocks() const
Number of actual row blocks.
AbcMatrix2(AbcSimplex *model, const CoinPackedMatrix *rowCopy)
Constructor from copy.
CoinBigIndex getNumElements() const
Number of entries in the packed matrix.
int primalColumnDouble(CoinPartitionedVector &updateForTableauRow, CoinPartitionedVector &updateForDjs, const CoinIndexedVector &updateForWeights, CoinPartitionedVector &spareColumn1, CoinIndexedVector &infeasible, double referenceIn, double devex, unsigned int *reference, double *weights, double scaleFactor) const
does steepest edge double or triple update If scaleFactor!=0 then use with tableau row to update djs ...
AbcMatrix3(AbcSimplex *model, const CoinPackedMatrix *columnCopy)
Constructor from copy.
void sortUseful(CoinIndexedVector &spare)
Sort into useful.
CoinBigIndex countBasis(const int *whichColumn, int &numberColumnBasic)
Returns number of elements in column part of basis.
unsigned short * column_
columns within block
double * work_
work arrays
void setCurrentWanted(int value)
int getNumCols() const
Number of columns.
int blockStart(int block) const
Start of each block (in stored)
double dualColumn1Row(int iBlock, double upperThetaSlack, int &freeSequence, const CoinIndexedVector &update, CoinPartitionedVector &tableauRow, CoinPartitionedVector &candidateList) const
gets sorted tableau row and a possible value of theta
void setMinimumObjectsScan(int value)
const int * blockStart() const
Start of each block (in stored)
void copy(const AbcMatrix *from)
Copy contents - resizing if necessary - otherwise re-use memory.
int numberColumnBlocks() const
Number of actual column blocks.
void setModel(AbcSimplex *model)
Sets model.
int originalWanted() const
Initial number of negative reduced costs wanted.
int originalWanted_
Initial number of negative reduced costs wanted.
AbcMatrix(const CoinPackedMatrix &wholeModel, int numberRows, const int *whichRows, int numberColumns, const int *whichColumns)
unsigned short * count_
Counts of elements in each part of row.
AbcMatrix3()
Default constructor.
CoinBigIndex * rowStart_
Start of each row (per block) - last lot are useless first all row starts for block 0,...
double endFraction_
Current end of search space in matrix (as fraction)
void setOriginalWanted(int value)
int currentWanted_
Current number of negative reduced costs which we still need.
void fillBasis(const int *whichColumn, int &numberColumnBasic, int *row, int *start, int *rowCount, int *columnCount, CoinSimplexDouble *element)
Fills in column part of basis.
AbcMatrix2()
Default constructor.
bool usefulInfo() const
Returns true if copy has useful information.
void transposeTimesAll(const double *x, double *y) const
Return y - A * x in y.
const int * getIndices() const
A vector containing the minor indices of the elements in the packed matrix.
int minimumObjectsScan_
Partial pricing tuning parameter - minimum number of "objects" to scan.
void setMinimumGoodReducedCosts(int value)
int numberBlocks_
Number of blocks.
void sortBlocks(const AbcSimplex *model)
Sort blocks.
void createRowCopy()
Creates row copy.
int numberColumns_
Number of columns.
AbcSimplex * model_
Model.
AbcMatrix(const AbcMatrix &wholeModel, int numberRows, const int *whichRows, int numberColumns, const int *whichColumns)
Subset constructor (without gaps).
void transposeTimes(const AbcSimplex *model, const CoinPackedMatrix *rowCopy, const CoinIndexedVector &x, CoinIndexedVector &spareArray, CoinIndexedVector &z) const
Return x * -1 * A in z.
void timesModifyIncludingSlacks(double scalar, const double *x, double *y) const
Return y + A * scalar(+-1) *x in y.
AbcMatrix2 & operator=(const AbcMatrix2 &)
void rebalance() const
rebalance for parallel
void unpack(CoinIndexedVector &rowArray, int column) const
Unpacks a column into an CoinIndexedVector.
void transposeTimesNonBasic(double scalar, const double *x, double *y) const
Return A * scalar(+-1) *x + y in y.
int * startColumnBlock() const
Start of each column block.
AbcMatrix()
Default constructor.
CoinBigIndex * rowStart_
Row starts.
void swapOne(const AbcSimplex *model, const AbcMatrix *matrix, int iColumn)
Swap one variable.
int * offset_
Column offset for each block (plus one at end)
int minimumGoodReducedCosts_
Partial pricing tuning parameter - minimum number of negative reduced costs to get.
AbcMatrix3(const AbcMatrix3 &)
The copy constructor.
CoinPackedMatrix * reverseOrderedCopy() const
Returns a new matrix in reverse order without gaps.
int primalColumnRow(int iBlock, bool doByRow, const CoinIndexedVector &update, CoinPartitionedVector &tableauRow) const
gets tableau row - returns number of slacks in block
int numberRowBlocks_
Number of actual row blocks.
void scale(int numberRowsAlreadyScaled)
Scales and creates row copy.
int startColumnBlock_[NUMBER_COLUMN_BLOCKS+1]
Start of each column block.
int numberColumnBlocks_
Number of actual column blocks.
void inOutUseful(int sequenceIn, int sequenceOut)
Put in and out for useful.
double savedBestDj() const
Current best reduced cost.
double * rowElements() const
Row elements.
int numberRows_
Number of rows.
void timesModifyExcludingSlacks(double scalar, const double *x, double *y) const
Return y + A * scalar *x in y.
void transposeTimesBasic(double scalar, const double *x, double *y) const
Return y + A * scalar(+-1) *x in y.
#define NUMBER_COLUMN_BLOCKS
void subsetTransposeTimes(const CoinIndexedVector &x, CoinIndexedVector &z) const
Return x *A in z but just for indices Already in z.
AbcMatrix3 & operator=(const AbcMatrix3 &)
void transposeTimes(const AbcSimplex *model, const double *pi, CoinIndexedVector &output) const
Return x * -1 * A in z.
int minimumGoodReducedCosts() const
Partial pricing tuning parameter - minimum number of negative reduced costs to get.
CoinBigIndex * rowEnd() const
Row ends.
void setEndFraction(double value)
const double * getElements() const
A vector containing the elements in the packed matrix.
int * getMutableVectorLengths() const
The lengths of the major-dimension vectors.
double dualColumn1RowFew(int iBlock, double upperThetaSlack, int &freeSequence, const CoinIndexedVector &update, CoinPartitionedVector &tableauRow, CoinPartitionedVector &candidateList) const
gets sorted tableau row and a possible value of theta
int numberColumns() const
void moveLargestToStart()
Move largest in column to beginning (not used as doesn't help factorization)
AbcMatrix & operator=(const AbcMatrix &)
#define NUMBER_ROW_BLOCKS
int primalColumnDouble(int iBlock, CoinPartitionedVector &updateForTableauRow, CoinPartitionedVector &updateForDjs, const CoinIndexedVector &updateForWeights, CoinPartitionedVector &spareColumn1, double *infeasibilities, double referenceIn, double devex, unsigned int *reference, double *weights, double scaleFactor) const
does steepest edge double or triple update If scaleFactor!=0 then use with tableau row to update djs ...
double endFraction() const
Current end of search space in matrix (as fraction)
double startFraction_
Special row copy.
void partialPricing(double startFraction, double endFraction, int &bestSequence, int &numberWanted)
Partial pricing.
void fillBasis(const int *whichColumn, int &numberColumnBasic, int *row, int *start, int *rowCount, int *columnCount, long double *element)
Fills in column part of basis.
int * column_
Column indices and reverse lookup (within block)
CoinBigIndex * rowStart() const
Row starts.
double savedBestDj_
Best reduced cost so far.
CoinBigIndex * getMutableVectorStarts() const
AbcMatrix(const CoinPackedMatrix &)
The copy constructor from an CoinPackedMatrix.
AbcMatrix(const AbcMatrix &)
The copy constructor.
void dualColumn1Part(int iBlock, int &sequenceIn, double &upperTheta, const CoinIndexedVector &update, CoinPartitionedVector &tableauRow, CoinPartitionedVector &candidateList) const
gets sorted tableau row and a possible value of theta On input first,last give what to scan On output...
CoinPackedMatrix * matrix_
Data.
double dualColumn1Row1(double upperThetaSlack, int &freeSequence, const CoinIndexedVector &update, CoinPartitionedVector &tableauRow, CoinPartitionedVector &candidateList) const
gets sorted tableau row and a possible value of theta
CoinBigIndex startElements_
double * element_
Elements.
void primalColumnSubset(int iBlock, const CoinIndexedVector &update, const CoinPartitionedVector &tableauRow, CoinPartitionedVector &weights) const
gets subset updates
double dualColumn1(const CoinIndexedVector &update, CoinPartitionedVector &tableauRow, CoinPartitionedVector &candidateList) const
gets sorted tableau row and a possible value of theta
int numberRows() const
Number of rows.
const int * getVectorLengths() const
The lengths of the major-dimension vectors.
int savedBestSequence() const
Current best sequence.
int primalColumnSparseDouble(int iBlock, CoinPartitionedVector &updateForTableauRow, CoinPartitionedVector &updateForDjs, const CoinIndexedVector &updateForWeights, CoinPartitionedVector &spareColumn1, double *infeasibilities, double referenceIn, double devex, unsigned int *reference, double *weights, double scaleFactor) const
does steepest edge double or triple update If scaleFactor!=0 then use with tableau row to update djs ...
CoinSimplexInt * rowColumns() const
Row columns.
AbcMatrix2(const AbcMatrix2 &)
The copy constructor.
double dualColumn1Row2(double upperThetaSlack, int &freeSequence, const CoinIndexedVector &update, CoinPartitionedVector &tableauRow, CoinPartitionedVector &candidateList) const
gets sorted tableau row and a possible value of theta
int numberBlocks_
Number of blocks.
void timesIncludingSlacks(double scalar, const double *x, double *y) const
Return A * scalar(+-1) *x in y.
int primalColumnRowAndDjs(int iBlock, const CoinIndexedVector &updateTableau, const CoinIndexedVector &updateDjs, CoinPartitionedVector &tableauRow) const
gets tableau row and dj row - returns number of slacks in block