9#include "CoinPragma.hpp"
40 return matrix_->getNumElements();
64 return matrix_->getMutableElements();
74 return matrix_->getMutableIndices();
79 return matrix_->getVectorStarts();
83 return matrix_->getMutableVectorStarts();
88 return matrix_->getVectorLengths();
93 return matrix_->getMutableVectorLengths();
107 int &numberColumnBasic);
110 int &numberColumnBasic,
111 int *row,
int *start,
112 int *rowCount,
int *columnCount,
116 int &numberColumnBasic,
117 int *row,
int *start,
118 int *rowCount,
int *columnCount,
119 long double *element);
122 void scale(
int numberRowsAlreadyScaled);
144 void add(CoinIndexedVector &rowArray,
int column,
double multiplier)
const;
153 const double *x,
double *y)
const;
158 const double *x,
double *y)
const;
163 const double *x,
double *y)
const;
168 const double *x,
double *y)
const;
177 const double *x,
double *y)
const;
189 const CoinIndexedVector &x,
190 CoinIndexedVector &z)
const;
193 CoinPartitionedVector &tableauRow,
194 CoinPartitionedVector &candidateList)
const;
197 const CoinIndexedVector &update,
198 CoinPartitionedVector &tableauRow,
199 CoinPartitionedVector &candidateList)
const;
202 const CoinIndexedVector &update,
203 CoinPartitionedVector &tableauRow,
204 CoinPartitionedVector &candidateList)
const;
207 const CoinIndexedVector &update,
208 CoinPartitionedVector &tableauRow,
209 CoinPartitionedVector &candidateList)
const;
212 const CoinIndexedVector &update,
213 CoinPartitionedVector &tableauRow,
214 CoinPartitionedVector &candidateList)
const;
219 const CoinIndexedVector &update,
220 CoinPartitionedVector &tableauRow,
221 CoinPartitionedVector &candidateList)
const;
226 CoinPartitionedVector &spare)
const;
229 CoinPartitionedVector &spare,
230 double &bestValue)
const;
233 CoinPartitionedVector &tableauRow)
const;
236 const CoinIndexedVector &updateDjs,
237 CoinPartitionedVector &tableauRow)
const;
241 const double *weights)
const;
248 CoinPartitionedVector &updateForDjs,
249 const CoinIndexedVector &updateForWeights,
250 CoinPartitionedVector &spareColumn1,
251 double *infeasibilities,
252 double referenceIn,
double devex,
254 unsigned int *reference,
255 double *weights,
double scaleFactor)
const;
262 CoinPartitionedVector &updateForDjs,
263 const CoinIndexedVector &updateForWeights,
264 CoinPartitionedVector &spareColumn1,
265 double *infeasibilities,
266 double referenceIn,
double devex,
268 unsigned int *reference,
269 double *weights,
double scaleFactor)
const;
276 CoinPartitionedVector &updateForDjs,
277 const CoinIndexedVector &updateForWeights,
278 CoinPartitionedVector &spareColumn1,
279 CoinIndexedVector &infeasible,
280 double referenceIn,
double devex,
282 unsigned int *reference,
283 double *weights,
double scaleFactor)
const;
286 const CoinPartitionedVector &tableauRow,
287 CoinPartitionedVector &weights)
const;
290 int &bestSequence,
int &numberWanted);
295 CoinIndexedVector &z)
const;
298 CoinIndexedVector &z)
const;
429 int numberRows,
const int *whichRows,
430 int numberColumns,
const int *whichColumns);
432 int numberRows,
const int *whichRows,
433 int numberColumns,
const int *whichColumns);
449#define NUMBER_ROW_BLOCKS 1
450#define NUMBER_COLUMN_BLOCKS 1
451#elif ABC_PARALLEL == 1
452#define NUMBER_ROW_BLOCKS 4
453#define NUMBER_COLUMN_BLOCKS 4
455#define NUMBER_ROW_BLOCKS 8
456#define NUMBER_COLUMN_BLOCKS 8
478 CoinBigIndex countStart_[MAX_COUNT + 1];
480 int countFirst_[MAX_COUNT + 1];
482 int *countRealColumn_;
484 CoinBigIndex *countStartLarge_;
486 double *countElement_;
515 double acceptablePivot;
522 double *bestPossiblePtr;
523 double *upperThetaPtr;
525 double *freePivotPtr;
527 const unsigned short *count;
529 const CoinBigIndex *rowStart;
530 const double *element;
531 const unsigned short *column;
533 int numberInRowArray;
546 const CoinPackedMatrix *rowCopy,
547 const CoinIndexedVector &x,
548 CoinIndexedVector &spareArray,
549 CoinIndexedVector &z)
const;
593 pthread_t *threadId_;
594 dualColumn0Struct *info_;
615 CoinIndexedVector &output)
const;
618 const double *pi, CoinIndexedVector &dj1,
619 const double *piWeight,
620 double referenceIn,
double devex,
622 unsigned int *reference,
623 double *weights,
double scaleFactor);
#define NUMBER_COLUMN_BLOCKS
#define NUMBER_ROW_BLOCKS
double * work_
work arrays
int numberRows_
Number of rows.
int * offset_
Column offset for each block (plus one at end)
unsigned short * column_
columns within block
void transposeTimes(const AbcSimplex *model, const CoinPackedMatrix *rowCopy, const CoinIndexedVector &x, CoinIndexedVector &spareArray, CoinIndexedVector &z) const
Return x * -1 * A in z.
AbcMatrix2 & operator=(const AbcMatrix2 &)
AbcMatrix2()
Default constructor.
AbcMatrix2(AbcSimplex *model, const CoinPackedMatrix *rowCopy)
Constructor from copy.
unsigned short * count_
Counts of elements in each part of row.
int numberBlocks_
Number of blocks.
bool usefulInfo() const
Returns true if copy has useful information.
AbcMatrix2(const AbcMatrix2 &)
The copy constructor.
CoinBigIndex * rowStart_
Row starts.
int numberColumns_
Number of columns.
int numberBlocks_
Number of blocks.
void swapOne(const AbcSimplex *model, const AbcMatrix *matrix, int iColumn)
Swap one variable.
AbcMatrix3 & operator=(const AbcMatrix3 &)
blockStruct * block_
Blocks (ordinary start at 0 and go to first block)
int * column_
Column indices and reverse lookup (within block)
AbcMatrix3(const AbcMatrix3 &)
The copy constructor.
CoinBigIndex * start_
Starts for odd/long vectors.
void sortBlocks(const AbcSimplex *model)
Sort blocks.
AbcMatrix3()
Default constructor.
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.
double * element_
Elements.
void transposeTimes(const AbcSimplex *model, const double *pi, CoinIndexedVector &output) const
Return x * -1 * A in z.
AbcMatrix3(AbcSimplex *model, const CoinPackedMatrix *columnCopy)
Constructor from copy.
double * getMutableElements() const
Mutable elements.
int getNumRows() const
Number of rows.
CoinBigIndex * rowStart_
Start of each row (per block) - last lot are useless first all row starts for block 0,...
AbcMatrix(const CoinPackedMatrix &)
The copy constructor from an CoinPackedMatrix.
int savedBestSequence() const
Current best sequence.
double savedBestDj_
Best reduced cost so far.
AbcMatrix(const AbcMatrix &)
The copy constructor.
void timesModifyExcludingSlacks(double scalar, const double *x, double *y) const
Return y + A * scalar *x in y.
int * startColumnBlock() const
Start of each column block.
AbcSimplex * model_
Model.
void subsetTransposeTimes(const CoinIndexedVector &x, CoinIndexedVector &z) const
Return x *A in z but just for indices Already in z.
int primalColumnRow(int iBlock, bool doByRow, const CoinIndexedVector &update, CoinPartitionedVector &tableauRow) const
gets tableau row - returns number of slacks in block
void rebalance() const
rebalance for parallel
void setSavedBestDj(double value)
int savedBestSequence_
Saved best sequence in pricing.
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.
int numberRowBlocks() const
Number of actual row blocks.
void moveLargestToStart()
Move largest in column to beginning (not used as doesn't help factorization)
CoinBigIndex * rowEnd() const
Row ends.
int getNumCols() const
Number of columns.
int numberRowBlocks_
Number of actual row blocks.
void takeOutOfUseful(int sequence, CoinIndexedVector &spare)
Take out of useful.
void transposeTimesNonBasic(double scalar, const double *x, double *y) const
Return A * scalar(+-1) *x + y in y.
void createRowCopy()
Creates row copy.
double savedBestDj() const
Current best reduced cost.
AbcMatrix & operator=(const AbcMatrix &)
double startFraction_
Special row copy.
int currentWanted_
Current number of negative reduced costs which we still need.
const double * getElements() const
A vector containing the elements in the packed matrix.
CoinPackedMatrix * matrix() const
Returns CoinPackedMatrix (non const)
double startFraction() const
Current start of search space in matrix (as fraction)
int numberColumnBlocks() const
Number of actual column blocks.
void copy(const AbcMatrix *from)
Copy contents - resizing if necessary - otherwise re-use memory.
double dualColumn1(const CoinIndexedVector &update, CoinPartitionedVector &tableauRow, CoinPartitionedVector &candidateList) const
gets sorted tableau row and a possible value of theta
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...
void setEndFraction(double value)
CoinPackedMatrix * getPackedMatrix() const
Return a complete CoinPackedMatrix.
void setStartFraction(double value)
CoinSimplexInt * rowColumns() const
Row columns.
double endFraction_
Current end of search space in matrix (as fraction)
void partialPricing(double startFraction, double endFraction, int &bestSequence, int &numberWanted)
Partial pricing.
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
CoinPackedMatrix * matrix_
Data.
CoinPackedMatrix * reverseOrderedCopy() const
Returns a new matrix in reverse order without gaps.
int minimumGoodReducedCosts_
Partial pricing tuning parameter - minimum number of negative reduced costs to get.
int minimumObjectsScan() const
Partial pricing tuning parameter - minimum number of "objects" to scan.
int blockStart(int block) const
Start of each block (in stored)
void unpack(CoinIndexedVector &rowArray, int column) const
Unpacks a column into an CoinIndexedVector.
void setCurrentWanted(int value)
int chooseBestDj(int iBlock, const CoinIndexedVector &infeasibilities, const double *weights) const
Chooses best weighted dj.
AbcMatrix()
Default constructor.
const int * getIndices() const
A vector containing the minor indices of the elements in the packed matrix.
CoinBigIndex * rowStart() const
Row starts.
int minimumGoodReducedCosts() const
Partial pricing tuning parameter - minimum number of negative reduced costs to get.
CoinBigIndex getNumElements() const
Number of entries in the packed matrix.
CoinBigIndex countBasis(const int *whichColumn, int &numberColumnBasic)
Returns number of elements in column part of basis.
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 ...
void setMinimumGoodReducedCosts(int value)
double * element_
Values by row.
void setSavedBestSequence(int value)
void transposeTimes(const CoinIndexedVector &x, CoinIndexedVector &z) const
Return -x *A in z
void transposeTimesAll(const double *x, double *y) const
Return y - A * x in y.
void scale(int numberRowsAlreadyScaled)
Scales and creates row copy.
double endFraction() const
Current end of search space in matrix (as fraction)
void primalColumnSubset(int iBlock, const CoinIndexedVector &update, const CoinPartitionedVector &tableauRow, CoinPartitionedVector &weights) const
gets subset updates
int blockStart_[NUMBER_ROW_BLOCKS+1]
Start of each block (in stored)
int * getMutableVectorLengths() const
The lengths of the major-dimension vectors.
int startColumnBlock_[NUMBER_COLUMN_BLOCKS+1]
Start of each column block.
int pivotColumnDantzig(int iBlock, bool doByRow, const CoinIndexedVector &updates, CoinPartitionedVector &spare, double &bestValue) const
Get sequenceIn when Dantzig (One block)
int numberColumnBlocks_
Number of actual column blocks.
const int * getVectorLengths() const
The lengths of the major-dimension vectors.
bool isColOrdered() const
Whether the packed matrix is column major ordered or not.
double * rowElements() const
Row elements.
AbcMatrix(const CoinPackedMatrix &wholeModel, int numberRows, const int *whichRows, int numberColumns, const int *whichColumns)
int pivotColumnDantzig(const CoinIndexedVector &updates, CoinPartitionedVector &spare) const
Get sequenceIn when Dantzig.
void setOriginalWanted(int value)
void transposeTimesBasic(double scalar, const double *x, double *y) const
Return y + A * scalar(+-1) *x in y.
void sortUseful(CoinIndexedVector &spare)
Sort into useful.
void timesIncludingSlacks(double scalar, const double *x, double *y) const
Return A * scalar(+-1) *x in y.
void setMinimumObjectsScan(int value)
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 ...
void fillBasis(const int *whichColumn, int &numberColumnBasic, int *row, int *start, int *rowCount, int *columnCount, long double *element)
Fills in column part of basis.
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
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
int minimumObjectsScan_
Partial pricing tuning parameter - minimum number of "objects" to scan.
void timesModifyIncludingSlacks(double scalar, const double *x, double *y) const
Return y + A * scalar(+-1) *x in y.
void setModel(AbcSimplex *model)
Sets model.
double dualColumn1Row1(double upperThetaSlack, int &freeSequence, const CoinIndexedVector &update, CoinPartitionedVector &tableauRow, CoinPartitionedVector &candidateList) const
gets sorted tableau row and a possible value of theta
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 * getMutableIndices() const
A vector containing the minor indices of the elements in the packed matrix.
void putIntofUseful(int sequence, CoinIndexedVector &spare)
Put into useful.
void inOutUseful(int sequenceIn, int sequenceOut)
Put in and out for useful.
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 ...
int transposeTimesNonBasic(double scalar, const CoinIndexedVector &x, CoinIndexedVector &z) const
Return x * scalar * A/code> in z.
const int * blockStart() const
Start of each block (in stored)
void fillBasis(const int *whichColumn, int &numberColumnBasic, int *row, int *start, int *rowCount, int *columnCount, CoinSimplexDouble *element)
Fills in column part of basis.
const CoinBigIndex * getVectorStarts() const
Starts.
int originalWanted() const
Initial number of negative reduced costs wanted.
int originalWanted_
Initial number of negative reduced costs wanted.
CoinBigIndex * getMutableVectorStarts() const
int currentWanted() const
Current number of negative reduced costs which we still need.
void makeAllUseful(CoinIndexedVector &spare)
Make all useful.
AbcMatrix(const AbcMatrix &wholeModel, int numberRows, const int *whichRows, int numberColumns, const int *whichColumns)
Subset constructor (without gaps).
int numberColumns() const
int numberRows() const
Number of rows.
CoinBigIndex startElements_