Clp  1.17.8
AbcMatrix.hpp
Go to the documentation of this file.
1 /* $Id$ */
2 // Copyright (C) 2002, International Business Machines
3 // Corporation and others, Copyright (C) 2012, FasterCoin. All Rights Reserved.
4 // This code is licensed under the terms of the Eclipse Public License (EPL).
5 
6 #ifndef AbcMatrix_H
7 #define AbcMatrix_H
8 
9 #include "CoinPragma.hpp"
10 
11 #include "ClpMatrixBase.hpp"
12 #include "AbcSimplex.hpp"
20 class AbcMatrix2;
21 class AbcMatrix3;
22 class AbcMatrix {
23 
24 public:
27  inline CoinPackedMatrix *getPackedMatrix() const
29  {
30  return matrix_;
31  }
33  inline bool isColOrdered() const
34  {
35  return true;
36  }
38  inline CoinBigIndex getNumElements() const
39  {
40  return matrix_->getNumElements();
41  }
43  inline int getNumCols() const
44  {
45  assert(matrix_->getNumCols() == model_->numberColumns());
46  return matrix_->getNumCols();
47  }
49  inline int getNumRows() const
50  {
51  assert(matrix_->getNumRows() == model_->numberRows());
52  return matrix_->getNumRows();
53  }
55  void setModel(AbcSimplex *model);
57  inline const double *getElements() const
58  {
59  return matrix_->getElements();
60  }
62  inline double *getMutableElements() const
63  {
64  return matrix_->getMutableElements();
65  }
67  inline const int *getIndices() const
68  {
69  return matrix_->getIndices();
70  }
72  inline int *getMutableIndices() const
73  {
74  return matrix_->getMutableIndices();
75  }
77  inline const CoinBigIndex *getVectorStarts() const
78  {
79  return matrix_->getVectorStarts();
80  }
81  inline CoinBigIndex *getMutableVectorStarts() const
82  {
83  return matrix_->getMutableVectorStarts();
84  }
86  inline const int *getVectorLengths() const
87  {
88  return matrix_->getVectorLengths();
89  }
91  inline int *getMutableVectorLengths() const
92  {
93  return matrix_->getMutableVectorLengths();
94  }
96  CoinBigIndex *rowStart() const;
98  CoinBigIndex *rowEnd() const;
100  double *rowElements() const;
102  CoinSimplexInt *rowColumns() const;
104  CoinPackedMatrix *reverseOrderedCopy() const;
106  CoinBigIndex countBasis(const int *whichColumn,
107  int &numberColumnBasic);
109  void fillBasis(const int *whichColumn,
110  int &numberColumnBasic,
111  int *row, int *start,
112  int *rowCount, int *columnCount,
113  CoinSimplexDouble *element);
115  void fillBasis(const int *whichColumn,
116  int &numberColumnBasic,
117  int *row, int *start,
118  int *rowCount, int *columnCount,
119  long double *element);
122  void scale(int numberRowsAlreadyScaled);
124  void createRowCopy();
126  void takeOutOfUseful(int sequence, CoinIndexedVector &spare);
128  void putIntofUseful(int sequence, CoinIndexedVector &spare);
130  void inOutUseful(int sequenceIn, int sequenceOut);
132  void makeAllUseful(CoinIndexedVector &spare);
134  void sortUseful(CoinIndexedVector &spare);
136  void moveLargestToStart();
137 
140  void unpack(CoinIndexedVector &rowArray,
141  int column) const;
144  void add(CoinIndexedVector &rowArray, int column, double multiplier) const;
146 
152  void timesModifyExcludingSlacks(double scalar,
153  const double *x, double *y) const;
157  void timesModifyIncludingSlacks(double scalar,
158  const double *x, double *y) const;
162  void timesIncludingSlacks(double scalar,
163  const double *x, double *y) const;
167  void transposeTimesNonBasic(double scalar,
168  const double *x, double *y) const;
172  void transposeTimesAll(const double *x, double *y) const;
176  void transposeTimesBasic(double scalar,
177  const double *x, double *y) const;
188  int transposeTimesNonBasic(double scalar,
189  const CoinIndexedVector &x,
190  CoinIndexedVector &z) const;
192  double dualColumn1(const CoinIndexedVector &update,
193  CoinPartitionedVector &tableauRow,
194  CoinPartitionedVector &candidateList) const;
196  double dualColumn1Row(int iBlock, double upperThetaSlack, int &freeSequence,
197  const CoinIndexedVector &update,
198  CoinPartitionedVector &tableauRow,
199  CoinPartitionedVector &candidateList) const;
201  double dualColumn1RowFew(int iBlock, double upperThetaSlack, int &freeSequence,
202  const CoinIndexedVector &update,
203  CoinPartitionedVector &tableauRow,
204  CoinPartitionedVector &candidateList) const;
206  double dualColumn1Row2(double upperThetaSlack, int &freeSequence,
207  const CoinIndexedVector &update,
208  CoinPartitionedVector &tableauRow,
209  CoinPartitionedVector &candidateList) const;
211  double dualColumn1Row1(double upperThetaSlack, int &freeSequence,
212  const CoinIndexedVector &update,
213  CoinPartitionedVector &tableauRow,
214  CoinPartitionedVector &candidateList) const;
218  void dualColumn1Part(int iBlock, int &sequenceIn, double &upperTheta,
219  const CoinIndexedVector &update,
220  CoinPartitionedVector &tableauRow,
221  CoinPartitionedVector &candidateList) const;
223  void rebalance() const;
225  int pivotColumnDantzig(const CoinIndexedVector &updates,
226  CoinPartitionedVector &spare) const;
228  int pivotColumnDantzig(int iBlock, bool doByRow, const CoinIndexedVector &updates,
229  CoinPartitionedVector &spare,
230  double &bestValue) const;
232  int primalColumnRow(int iBlock, bool doByRow, const CoinIndexedVector &update,
233  CoinPartitionedVector &tableauRow) const;
235  int primalColumnRowAndDjs(int iBlock, const CoinIndexedVector &updateTableau,
236  const CoinIndexedVector &updateDjs,
237  CoinPartitionedVector &tableauRow) const;
240  int chooseBestDj(int iBlock, const CoinIndexedVector &infeasibilities,
241  const double *weights) const;
247  int primalColumnDouble(int iBlock, CoinPartitionedVector &updateForTableauRow,
248  CoinPartitionedVector &updateForDjs,
249  const CoinIndexedVector &updateForWeights,
250  CoinPartitionedVector &spareColumn1,
251  double *infeasibilities,
252  double referenceIn, double devex,
253  // Array for exact devex to say what is in reference framework
254  unsigned int *reference,
255  double *weights, double scaleFactor) const;
261  int primalColumnSparseDouble(int iBlock, CoinPartitionedVector &updateForTableauRow,
262  CoinPartitionedVector &updateForDjs,
263  const CoinIndexedVector &updateForWeights,
264  CoinPartitionedVector &spareColumn1,
265  double *infeasibilities,
266  double referenceIn, double devex,
267  // Array for exact devex to say what is in reference framework
268  unsigned int *reference,
269  double *weights, double scaleFactor) const;
275  int primalColumnDouble(CoinPartitionedVector &updateForTableauRow,
276  CoinPartitionedVector &updateForDjs,
277  const CoinIndexedVector &updateForWeights,
278  CoinPartitionedVector &spareColumn1,
279  CoinIndexedVector &infeasible,
280  double referenceIn, double devex,
281  // Array for exact devex to say what is in reference framework
282  unsigned int *reference,
283  double *weights, double scaleFactor) const;
285  void primalColumnSubset(int iBlock, const CoinIndexedVector &update,
286  const CoinPartitionedVector &tableauRow,
287  CoinPartitionedVector &weights) const;
289  void partialPricing(double startFraction, double endFraction,
290  int &bestSequence, int &numberWanted);
294  void subsetTransposeTimes(const CoinIndexedVector &x,
295  CoinIndexedVector &z) const;
297  void transposeTimes(const CoinIndexedVector &x,
298  CoinIndexedVector &z) const;
300 
303  inline CoinPackedMatrix *matrix() const
305  {
306  return matrix_;
307  }
310  inline int minimumObjectsScan() const
311  {
312  return minimumObjectsScan_;
313  }
314  inline void setMinimumObjectsScan(int value)
315  {
316  minimumObjectsScan_ = value;
317  }
319  inline int minimumGoodReducedCosts() const
320  {
322  }
323  inline void setMinimumGoodReducedCosts(int value)
324  {
325  minimumGoodReducedCosts_ = value;
326  }
328  inline double startFraction() const
329  {
330  return startFraction_;
331  }
332  inline void setStartFraction(double value)
333  {
334  startFraction_ = value;
335  }
337  inline double endFraction() const
338  {
339  return endFraction_;
340  }
341  inline void setEndFraction(double value)
342  {
343  endFraction_ = value;
344  }
346  inline double savedBestDj() const
347  {
348  return savedBestDj_;
349  }
350  inline void setSavedBestDj(double value)
351  {
352  savedBestDj_ = value;
353  }
355  inline int originalWanted() const
356  {
357  return originalWanted_;
358  }
359  inline void setOriginalWanted(int value)
360  {
361  originalWanted_ = value;
362  }
364  inline int currentWanted() const
365  {
366  return currentWanted_;
367  }
368  inline void setCurrentWanted(int value)
369  {
370  currentWanted_ = value;
371  }
373  inline int savedBestSequence() const
374  {
375  return savedBestSequence_;
376  }
377  inline void setSavedBestSequence(int value)
378  {
379  savedBestSequence_ = value;
380  }
382  inline int *startColumnBlock() const
383  {
384  return startColumnBlock_;
385  }
387  inline const int *blockStart() const
388  {
389  return blockStart_;
390  }
391  inline bool gotRowCopy() const
392  {
393  return rowStart_ != 0;
394  }
396  inline int blockStart(int block) const
397  {
398  return blockStart_[block];
399  }
401  inline int numberColumnBlocks() const
402  {
403  return numberColumnBlocks_;
404  }
406  inline int numberRowBlocks() const
407  {
408  return numberRowBlocks_;
409  }
411 
415  AbcMatrix();
417  ~AbcMatrix();
419 
423  AbcMatrix(const AbcMatrix &);
425  AbcMatrix(const CoinPackedMatrix &);
428  AbcMatrix(const AbcMatrix &wholeModel,
429  int numberRows, const int *whichRows,
430  int numberColumns, const int *whichColumns);
431  AbcMatrix(const CoinPackedMatrix &wholeModel,
432  int numberRows, const int *whichRows,
433  int numberColumns, const int *whichColumns);
434 
435  AbcMatrix &operator=(const AbcMatrix &);
437  void copy(const AbcMatrix *from);
439 private:
440 protected:
444  CoinPackedMatrix *matrix_;
447  mutable AbcSimplex *model_;
448 #if ABC_PARALLEL == 0
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
454 #else
455 #define NUMBER_ROW_BLOCKS 8
456 #define NUMBER_COLUMN_BLOCKS 8
457 #endif
458 
461  CoinBigIndex *rowStart_;
463  double *element_;
465  int *column_;
471  mutable int numberColumnBlocks_;
474  //#define COUNT_COPY
475 #ifdef COUNT_COPY
476 #define MAX_COUNT 13
477  CoinBigIndex countStart_[MAX_COUNT + 1];
480  int countFirst_[MAX_COUNT + 1];
481  // later int countEndUseful_[MAX_COUNT+1];
482  int *countRealColumn_;
483  // later int * countInverseRealColumn_;
484  CoinBigIndex *countStartLarge_;
485  int *countRow_;
486  double *countElement_;
487  int smallestCount_;
488  int largestCount_;
489 #endif
490  //AbcMatrix2 * rowCopy_;
493  //AbcMatrix3 * columnCopy_;
497  double endFraction_;
499  double savedBestDj_;
511 };
512 #ifdef THREAD
513 #include <pthread.h>
514 typedef struct {
515  double acceptablePivot;
516  const AbcSimplex *model;
517  double *spare;
518  int *spareIndex;
519  double *arrayTemp;
520  int *indexTemp;
521  int *numberInPtr;
522  double *bestPossiblePtr;
523  double *upperThetaPtr;
524  int *posFreePtr;
525  double *freePivotPtr;
526  int *numberOutPtr;
527  const unsigned short *count;
528  const double *pi;
529  const CoinBigIndex *rowStart;
530  const double *element;
531  const unsigned short *column;
532  int offset;
533  int numberInRowArray;
534  int numberLook;
535 } dualColumn0Struct;
536 #endif
537 class AbcMatrix2 {
538 
539 public:
545  void transposeTimes(const AbcSimplex *model,
546  const CoinPackedMatrix *rowCopy,
547  const CoinIndexedVector &x,
548  CoinIndexedVector &spareArray,
549  CoinIndexedVector &z) const;
551  inline bool usefulInfo() const
552  {
553  return rowStart_ != NULL;
554  }
556 
560  AbcMatrix2();
562  AbcMatrix2(AbcSimplex *model, const CoinPackedMatrix *rowCopy);
564  ~AbcMatrix2();
566 
570  AbcMatrix2(const AbcMatrix2 &);
571  AbcMatrix2 &operator=(const AbcMatrix2 &);
573 
574 protected:
578  int numberBlocks_;
583  int *offset_;
585  mutable unsigned short *count_;
587  mutable CoinBigIndex *rowStart_;
589  unsigned short *column_;
591  double *work_;
592 #ifdef THREAD
593  pthread_t *threadId_;
594  dualColumn0Struct *info_;
595 #endif
596 
597 };
598 typedef struct {
599  CoinBigIndex startElements_; // point to data
600  int startIndices_; // point to column_
602  int numberPrice_; // at beginning
603  int numberElements_; // number elements per column
604 } blockStruct3;
605 class AbcMatrix3 {
606 
607 public:
613  void transposeTimes(const AbcSimplex *model,
614  const double *pi,
615  CoinIndexedVector &output) const;
617  void transposeTimes2(const AbcSimplex *model,
618  const double *pi, CoinIndexedVector &dj1,
619  const double *piWeight,
620  double referenceIn, double devex,
621  // Array for exact devex to say what is in reference framework
622  unsigned int *reference,
623  double *weights, double scaleFactor);
625 
629  AbcMatrix3();
631  AbcMatrix3(AbcSimplex *model, const CoinPackedMatrix *columnCopy);
633  ~AbcMatrix3();
635 
639  AbcMatrix3(const AbcMatrix3 &);
640  AbcMatrix3 &operator=(const AbcMatrix3 &);
642 
645  void sortBlocks(const AbcSimplex *model);
647  void swapOne(const AbcSimplex *model, const AbcMatrix *matrix,
648  int iColumn);
650 
651 protected:
655  int numberBlocks_;
660  int *column_;
662  CoinBigIndex *start_;
664  int *row_;
666  double *element_;
670 };
671 
672 #endif
673 
674 /* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2
675 */
AbcMatrix::putIntofUseful
void putIntofUseful(int sequence, CoinIndexedVector &spare)
Put into useful.
AbcMatrix::element_
double * element_
Values by row.
Definition: AbcMatrix.hpp:463
AbcMatrix3::start_
CoinBigIndex * start_
Starts for odd/long vectors.
Definition: AbcMatrix.hpp:662
AbcMatrix::add
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.
AbcMatrix::makeAllUseful
void makeAllUseful(CoinIndexedVector &spare)
Make all useful.
AbcMatrix::savedBestSequence_
int savedBestSequence_
Saved best sequence in pricing.
Definition: AbcMatrix.hpp:505
AbcMatrix::getNumRows
int getNumRows() const
Number of rows.
Definition: AbcMatrix.hpp:49
AbcMatrix::transposeTimes
void transposeTimes(const CoinIndexedVector &x, CoinIndexedVector &z) const
Return -x *A in z
AbcMatrix::~AbcMatrix
~AbcMatrix()
Destructor.
AbcMatrix3::~AbcMatrix3
~AbcMatrix3()
Destructor.
AbcMatrix3::block_
blockStruct * block_
Blocks (ordinary start at 0 and go to first block)
Definition: AbcMatrix.hpp:668
AbcMatrix::chooseBestDj
int chooseBestDj(int iBlock, const CoinIndexedVector &infeasibilities, const double *weights) const
Chooses best weighted dj.
AbcMatrix::setStartFraction
void setStartFraction(double value)
Definition: AbcMatrix.hpp:332
AbcMatrix3::transposeTimes2
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.
AbcMatrix::gotRowCopy
bool gotRowCopy() const
Definition: AbcMatrix.hpp:391
AbcMatrix::matrix
CoinPackedMatrix * matrix() const
Returns CoinPackedMatrix (non const)
Definition: AbcMatrix.hpp:304
AbcMatrix::getMutableIndices
int * getMutableIndices() const
A vector containing the minor indices of the elements in the packed matrix.
Definition: AbcMatrix.hpp:72
AbcMatrix::getPackedMatrix
CoinPackedMatrix * getPackedMatrix() const
Return a complete CoinPackedMatrix.
Definition: AbcMatrix.hpp:28
AbcMatrix::getVectorStarts
const CoinBigIndex * getVectorStarts() const
Starts.
Definition: AbcMatrix.hpp:77
AbcMatrix::setSavedBestDj
void setSavedBestDj(double value)
Definition: AbcMatrix.hpp:350
AbcMatrix::pivotColumnDantzig
int pivotColumnDantzig(const CoinIndexedVector &updates, CoinPartitionedVector &spare) const
Get sequenceIn when Dantzig.
AbcMatrix::takeOutOfUseful
void takeOutOfUseful(int sequence, CoinIndexedVector &spare)
Take out of useful.
AbcMatrix::blockStart_
int blockStart_[NUMBER_ROW_BLOCKS+1]
Start of each block (in stored)
Definition: AbcMatrix.hpp:469
AbcMatrix::getMutableElements
double * getMutableElements() const
Mutable elements.
Definition: AbcMatrix.hpp:62
AbcMatrix::isColOrdered
bool isColOrdered() const
Whether the packed matrix is column major ordered or not.
Definition: AbcMatrix.hpp:33
AbcMatrix::startFraction
double startFraction() const
Current start of search space in matrix (as fraction)
Definition: AbcMatrix.hpp:328
AbcMatrix::minimumObjectsScan
int minimumObjectsScan() const
Partial pricing tuning parameter - minimum number of "objects" to scan.
Definition: AbcMatrix.hpp:310
AbcMatrix::setSavedBestSequence
void setSavedBestSequence(int value)
Definition: AbcMatrix.hpp:377
AbcMatrix::currentWanted
int currentWanted() const
Current number of negative reduced costs which we still need.
Definition: AbcMatrix.hpp:364
AbcMatrix::numberRowBlocks
int numberRowBlocks() const
Number of actual row blocks.
Definition: AbcMatrix.hpp:406
AbcMatrix::getNumElements
CoinBigIndex getNumElements() const
Number of entries in the packed matrix.
Definition: AbcMatrix.hpp:38
blockStruct3::numberElements_
int numberElements_
Definition: AbcMatrix.hpp:603
AbcMatrix::sortUseful
void sortUseful(CoinIndexedVector &spare)
Sort into useful.
blockStruct3::numberInBlock_
int numberInBlock_
Definition: AbcMatrix.hpp:601
AbcMatrix::countBasis
CoinBigIndex countBasis(const int *whichColumn, int &numberColumnBasic)
Returns number of elements in column part of basis.
AbcMatrix2::column_
unsigned short * column_
columns within block
Definition: AbcMatrix.hpp:589
AbcMatrix2::work_
double * work_
work arrays
Definition: AbcMatrix.hpp:591
AbcMatrix::setCurrentWanted
void setCurrentWanted(int value)
Definition: AbcMatrix.hpp:368
AbcMatrix::getNumCols
int getNumCols() const
Number of columns.
Definition: AbcMatrix.hpp:43
AbcMatrix::blockStart
int blockStart(int block) const
Start of each block (in stored)
Definition: AbcMatrix.hpp:396
AbcMatrix::dualColumn1Row
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
AbcMatrix::setMinimumObjectsScan
void setMinimumObjectsScan(int value)
Definition: AbcMatrix.hpp:314
AbcMatrix::blockStart
const int * blockStart() const
Start of each block (in stored)
Definition: AbcMatrix.hpp:387
blockStruct3
Definition: AbcMatrix.hpp:598
ClpMatrixBase.hpp
AbcMatrix::copy
void copy(const AbcMatrix *from)
Copy contents - resizing if necessary - otherwise re-use memory.
AbcMatrix3
Definition: AbcMatrix.hpp:605
AbcMatrix::numberColumnBlocks
int numberColumnBlocks() const
Number of actual column blocks.
Definition: AbcMatrix.hpp:401
AbcMatrix::setModel
void setModel(AbcSimplex *model)
Sets model.
AbcMatrix::originalWanted
int originalWanted() const
Initial number of negative reduced costs wanted.
Definition: AbcMatrix.hpp:355
AbcMatrix::originalWanted_
int originalWanted_
Initial number of negative reduced costs wanted.
Definition: AbcMatrix.hpp:501
AbcMatrix2::count_
unsigned short * count_
Counts of elements in each part of row.
Definition: AbcMatrix.hpp:585
AbcMatrix3::AbcMatrix3
AbcMatrix3()
Default constructor.
AbcMatrix::rowStart_
CoinBigIndex * rowStart_
Start of each row (per block) - last lot are useless first all row starts for block 0,...
Definition: AbcMatrix.hpp:461
AbcMatrix2
Definition: AbcMatrix.hpp:537
AbcMatrix::endFraction_
double endFraction_
Current end of search space in matrix (as fraction)
Definition: AbcMatrix.hpp:497
AbcMatrix::setOriginalWanted
void setOriginalWanted(int value)
Definition: AbcMatrix.hpp:359
AbcMatrix::currentWanted_
int currentWanted_
Current number of negative reduced costs which we still need.
Definition: AbcMatrix.hpp:503
AbcMatrix::fillBasis
void fillBasis(const int *whichColumn, int &numberColumnBasic, int *row, int *start, int *rowCount, int *columnCount, CoinSimplexDouble *element)
Fills in column part of basis.
AbcMatrix2::AbcMatrix2
AbcMatrix2()
Default constructor.
AbcMatrix2::usefulInfo
bool usefulInfo() const
Returns true if copy has useful information.
Definition: AbcMatrix.hpp:551
AbcMatrix::transposeTimesAll
void transposeTimesAll(const double *x, double *y) const
Return y - A * x in y.
AbcMatrix::getIndices
const int * getIndices() const
A vector containing the minor indices of the elements in the packed matrix.
Definition: AbcMatrix.hpp:67
AbcMatrix::minimumObjectsScan_
int minimumObjectsScan_
Partial pricing tuning parameter - minimum number of "objects" to scan.
Definition: AbcMatrix.hpp:507
AbcMatrix::setMinimumGoodReducedCosts
void setMinimumGoodReducedCosts(int value)
Definition: AbcMatrix.hpp:323
AbcMatrix3::numberBlocks_
int numberBlocks_
Number of blocks.
Definition: AbcMatrix.hpp:656
AbcMatrix3::sortBlocks
void sortBlocks(const AbcSimplex *model)
Sort blocks.
blockStruct3::startIndices_
int startIndices_
Definition: AbcMatrix.hpp:600
AbcMatrix::createRowCopy
void createRowCopy()
Creates row copy.
AbcMatrix3::numberColumns_
int numberColumns_
Number of columns.
Definition: AbcMatrix.hpp:658
AbcMatrix::model_
AbcSimplex * model_
Model.
Definition: AbcMatrix.hpp:447
AbcMatrix2::~AbcMatrix2
~AbcMatrix2()
Destructor.
AbcMatrix2::transposeTimes
void transposeTimes(const AbcSimplex *model, const CoinPackedMatrix *rowCopy, const CoinIndexedVector &x, CoinIndexedVector &spareArray, CoinIndexedVector &z) const
Return x * -1 * A in z.
AbcMatrix::timesModifyIncludingSlacks
void timesModifyIncludingSlacks(double scalar, const double *x, double *y) const
Return y + A * scalar(+-1) *x in y.
AbcMatrix2::operator=
AbcMatrix2 & operator=(const AbcMatrix2 &)
AbcMatrix::rebalance
void rebalance() const
rebalance for parallel
AbcMatrix::unpack
void unpack(CoinIndexedVector &rowArray, int column) const
Unpacks a column into an CoinIndexedVector.
AbcMatrix::transposeTimesNonBasic
void transposeTimesNonBasic(double scalar, const double *x, double *y) const
Return A * scalar(+-1) *x + y in y.
AbcMatrix::startColumnBlock
int * startColumnBlock() const
Start of each column block.
Definition: AbcMatrix.hpp:382
AbcMatrix
Definition: AbcMatrix.hpp:22
AbcMatrix::AbcMatrix
AbcMatrix()
Default constructor.
AbcMatrix2::rowStart_
CoinBigIndex * rowStart_
Row starts.
Definition: AbcMatrix.hpp:587
AbcMatrix3::swapOne
void swapOne(const AbcSimplex *model, const AbcMatrix *matrix, int iColumn)
Swap one variable.
AbcMatrix2::offset_
int * offset_
Column offset for each block (plus one at end)
Definition: AbcMatrix.hpp:583
AbcMatrix::minimumGoodReducedCosts_
int minimumGoodReducedCosts_
Partial pricing tuning parameter - minimum number of negative reduced costs to get.
Definition: AbcMatrix.hpp:509
AbcMatrix3::row_
int * row_
Rows.
Definition: AbcMatrix.hpp:664
AbcMatrix::reverseOrderedCopy
CoinPackedMatrix * reverseOrderedCopy() const
Returns a new matrix in reverse order without gaps.
AbcSimplex
Definition: AbcSimplex.hpp:62
AbcMatrix::primalColumnRow
int primalColumnRow(int iBlock, bool doByRow, const CoinIndexedVector &update, CoinPartitionedVector &tableauRow) const
gets tableau row - returns number of slacks in block
AbcMatrix::numberRowBlocks_
int numberRowBlocks_
Number of actual row blocks.
Definition: AbcMatrix.hpp:473
AbcMatrix::scale
void scale(int numberRowsAlreadyScaled)
Scales and creates row copy.
AbcMatrix::startColumnBlock_
int startColumnBlock_[NUMBER_COLUMN_BLOCKS+1]
Start of each column block.
Definition: AbcMatrix.hpp:467
AbcMatrix::numberColumnBlocks_
int numberColumnBlocks_
Number of actual column blocks.
Definition: AbcMatrix.hpp:471
AbcMatrix::inOutUseful
void inOutUseful(int sequenceIn, int sequenceOut)
Put in and out for useful.
AbcMatrix::savedBestDj
double savedBestDj() const
Current best reduced cost.
Definition: AbcMatrix.hpp:346
AbcMatrix::rowElements
double * rowElements() const
Row elements.
AbcMatrix2::numberRows_
int numberRows_
Number of rows.
Definition: AbcMatrix.hpp:581
AbcMatrix::timesModifyExcludingSlacks
void timesModifyExcludingSlacks(double scalar, const double *x, double *y) const
Return y + A * scalar *x in y.
AbcMatrix::transposeTimesBasic
void transposeTimesBasic(double scalar, const double *x, double *y) const
Return y + A * scalar(+-1) *x in y.
NUMBER_COLUMN_BLOCKS
#define NUMBER_COLUMN_BLOCKS
Definition: AbcMatrix.hpp:450
AbcMatrix::subsetTransposeTimes
void subsetTransposeTimes(const CoinIndexedVector &x, CoinIndexedVector &z) const
Return x *A in z but just for indices Already in z.
AbcSimplex.hpp
AbcMatrix3::operator=
AbcMatrix3 & operator=(const AbcMatrix3 &)
AbcMatrix3::transposeTimes
void transposeTimes(const AbcSimplex *model, const double *pi, CoinIndexedVector &output) const
Return x * -1 * A in z.
AbcMatrix::minimumGoodReducedCosts
int minimumGoodReducedCosts() const
Partial pricing tuning parameter - minimum number of negative reduced costs to get.
Definition: AbcMatrix.hpp:319
AbcMatrix::rowEnd
CoinBigIndex * rowEnd() const
Row ends.
AbcMatrix::setEndFraction
void setEndFraction(double value)
Definition: AbcMatrix.hpp:341
AbcMatrix::getElements
const double * getElements() const
A vector containing the elements in the packed matrix.
Definition: AbcMatrix.hpp:57
AbcMatrix::getMutableVectorLengths
int * getMutableVectorLengths() const
The lengths of the major-dimension vectors.
Definition: AbcMatrix.hpp:91
CoinSimplexInt
int CoinSimplexInt
Definition: CoinAbcCommon.hpp:22
AbcMatrix::dualColumn1RowFew
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
ClpModel::numberColumns
int numberColumns() const
Definition: ClpModel.hpp:332
AbcMatrix::column_
int * column_
Columns.
Definition: AbcMatrix.hpp:465
CoinAbcHelperFunctions.hpp
AbcMatrix::moveLargestToStart
void moveLargestToStart()
Move largest in column to beginning (not used as doesn't help factorization)
AbcMatrix::operator=
AbcMatrix & operator=(const AbcMatrix &)
NUMBER_ROW_BLOCKS
#define NUMBER_ROW_BLOCKS
Definition: AbcMatrix.hpp:449
AbcMatrix::primalColumnDouble
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 ...
AbcMatrix::endFraction
double endFraction() const
Current end of search space in matrix (as fraction)
Definition: AbcMatrix.hpp:337
AbcMatrix::startFraction_
double startFraction_
Special row copy.
Definition: AbcMatrix.hpp:495
AbcMatrix::partialPricing
void partialPricing(double startFraction, double endFraction, int &bestSequence, int &numberWanted)
Partial pricing.
blockStruct3::numberPrice_
int numberPrice_
Definition: AbcMatrix.hpp:602
AbcMatrix3::column_
int * column_
Column indices and reverse lookup (within block)
Definition: AbcMatrix.hpp:660
AbcMatrix::rowStart
CoinBigIndex * rowStart() const
Row starts.
AbcMatrix::savedBestDj_
double savedBestDj_
Best reduced cost so far.
Definition: AbcMatrix.hpp:499
AbcMatrix::getMutableVectorStarts
CoinBigIndex * getMutableVectorStarts() const
Definition: AbcMatrix.hpp:81
blockStruct
Definition: ClpPackedMatrix.hpp:587
AbcMatrix::dualColumn1Part
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...
AbcMatrix::matrix_
CoinPackedMatrix * matrix_
Data.
Definition: AbcMatrix.hpp:445
AbcMatrix::dualColumn1Row1
double dualColumn1Row1(double upperThetaSlack, int &freeSequence, const CoinIndexedVector &update, CoinPartitionedVector &tableauRow, CoinPartitionedVector &candidateList) const
gets sorted tableau row and a possible value of theta
blockStruct3::startElements_
CoinBigIndex startElements_
Definition: AbcMatrix.hpp:599
AbcMatrix3::element_
double * element_
Elements.
Definition: AbcMatrix.hpp:666
AbcMatrix::primalColumnSubset
void primalColumnSubset(int iBlock, const CoinIndexedVector &update, const CoinPartitionedVector &tableauRow, CoinPartitionedVector &weights) const
gets subset updates
AbcMatrix::dualColumn1
double dualColumn1(const CoinIndexedVector &update, CoinPartitionedVector &tableauRow, CoinPartitionedVector &candidateList) const
gets sorted tableau row and a possible value of theta
CoinSimplexDouble
double CoinSimplexDouble
Definition: CoinAbcCommon.hpp:21
ClpModel::numberRows
int numberRows() const
Number of rows.
Definition: ClpModel.hpp:319
AbcMatrix::getVectorLengths
const int * getVectorLengths() const
The lengths of the major-dimension vectors.
Definition: AbcMatrix.hpp:86
AbcMatrix::savedBestSequence
int savedBestSequence() const
Current best sequence.
Definition: AbcMatrix.hpp:373
AbcMatrix::primalColumnSparseDouble
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 ...
AbcMatrix::rowColumns
CoinSimplexInt * rowColumns() const
Row columns.
AbcMatrix::dualColumn1Row2
double dualColumn1Row2(double upperThetaSlack, int &freeSequence, const CoinIndexedVector &update, CoinPartitionedVector &tableauRow, CoinPartitionedVector &candidateList) const
gets sorted tableau row and a possible value of theta
AbcMatrix2::numberBlocks_
int numberBlocks_
Number of blocks.
Definition: AbcMatrix.hpp:579
AbcMatrix::timesIncludingSlacks
void timesIncludingSlacks(double scalar, const double *x, double *y) const
Return A * scalar(+-1) *x in y.
AbcMatrix::primalColumnRowAndDjs
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