Cgl  0.60.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AbcMatrix.hpp
Go to the documentation of this file.
1 /* $Id: AbcMatrix.hpp 2385 2019-01-06 19:43:06Z unxusr $ */
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  }
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  }
82  {
84  }
86  inline const int *getVectorLengths() const
87  {
88  return matrix_->getVectorLengths();
89  }
91  inline int *getMutableVectorLengths() const
92  {
94  }
96  CoinBigIndex *rowStart() const;
98  CoinBigIndex *rowEnd() const;
100  double *rowElements() const;
102  CoinSimplexInt *rowColumns() 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);
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:
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 
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_;
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_;
664  int *row_;
666  double *element_;
670 };
671 
672 #endif
673 
674 /* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2
675 */
CoinBigIndex getNumElements() const
Number of entries in the packed matrix.
Definition: AbcMatrix.hpp:38
void takeOutOfUseful(int sequence, CoinIndexedVector &spare)
Take out of useful.
int pivotColumnDantzig(const CoinIndexedVector &updates, CoinPartitionedVector &spare) const
Get sequenceIn when Dantzig.
bool gotRowCopy() const
Definition: AbcMatrix.hpp:391
CoinBigIndex getNumElements() const
Number of entries in the packed matrix.
AbcMatrix()
Default constructor.
CoinPackedMatrix * matrix() const
Returns CoinPackedMatrix (non const)
Definition: AbcMatrix.hpp:304
void sortUseful(CoinIndexedVector &spare)
Sort into useful.
void setCurrentWanted(int value)
Definition: AbcMatrix.hpp:368
CoinBigIndex startElements_
Definition: AbcMatrix.hpp:599
void primalColumnSubset(int iBlock, const CoinIndexedVector &update, const CoinPartitionedVector &tableauRow, CoinPartitionedVector &weights) const
gets subset updates
AbcMatrix2()
Default constructor.
void setMinimumGoodReducedCosts(int value)
Definition: AbcMatrix.hpp:323
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
void setStartFraction(double value)
Definition: AbcMatrix.hpp:332
int * startColumnBlock() const
Start of each column block.
Definition: AbcMatrix.hpp:382
double endFraction() const
Current end of search space in matrix (as fraction)
Definition: AbcMatrix.hpp:337
CoinBigIndex * getMutableVectorStarts() const
The positions where the major-dimension vectors start in element_ and index_.
int numberColumnBlocks_
Number of actual column blocks.
Definition: AbcMatrix.hpp:471
void inOutUseful(int sequenceIn, int sequenceOut)
Put in and out for useful.
int getNumRows() const
Number of rows.
Definition: AbcMatrix.hpp:49
const int * getVectorLengths() const
The lengths of the major-dimension vectors.
Definition: AbcMatrix.hpp:86
int blockStart_[NUMBER_ROW_BLOCKS+1]
Start of each block (in stored)
Definition: AbcMatrix.hpp:469
int numberColumnBlocks() const
Number of actual column blocks.
Definition: AbcMatrix.hpp:401
void setSavedBestDj(double value)
Definition: AbcMatrix.hpp:350
double savedBestDj_
Best reduced cost so far.
Definition: AbcMatrix.hpp:499
int * offset_
Column offset for each block (plus one at end)
Definition: AbcMatrix.hpp:583
int currentWanted() const
Current number of negative reduced costs which we still need.
Definition: AbcMatrix.hpp:364
double * element_
Elements.
Definition: AbcMatrix.hpp:666
CoinPackedMatrix * reverseOrderedCopy() const
Returns a new matrix in reverse order without gaps.
void setSavedBestSequence(int value)
Definition: AbcMatrix.hpp:377
void transposeTimesBasic(double scalar, const double *x, double *y) const
Return y + A * scalar(+-1) *x in y.
AbcMatrix2 & operator=(const AbcMatrix2 &)
int numberElements_
Definition: AbcMatrix.hpp:603
int numberBlocks_
Number of blocks.
Definition: AbcMatrix.hpp:579
int * column_
Column indices and reverse lookup (within block)
Definition: AbcMatrix.hpp:660
void transposeTimesNonBasic(double scalar, const double *x, double *y) const
Return A * scalar(+-1) *x + y in y.
void setEndFraction(double value)
Definition: AbcMatrix.hpp:341
void setOriginalWanted(int value)
Definition: AbcMatrix.hpp:359
void timesModifyExcludingSlacks(double scalar, const double *x, double *y) const
Return y + A * scalar *x in y.
CoinBigIndex * start_
Starts for odd/long vectors.
Definition: AbcMatrix.hpp:662
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 * rowStart_
Row starts.
Definition: AbcMatrix.hpp:587
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.
int savedBestSequence_
Saved best sequence in pricing.
Definition: AbcMatrix.hpp:505
CoinPackedMatrix * getPackedMatrix() const
Return a complete CoinPackedMatrix.
Definition: AbcMatrix.hpp:28
int numberColumns() const
Definition: ClpModel.hpp:328
void subsetTransposeTimes(const CoinIndexedVector &x, CoinIndexedVector &z) const
Return x *A in z but just for indices Already in z.
void timesIncludingSlacks(double scalar, const double *x, double *y) const
Return A * scalar(+-1) *x in y.
void partialPricing(double startFraction, double endFraction, int &bestSequence, int &numberWanted)
Partial pricing.
int minimumObjectsScan() const
Partial pricing tuning parameter - minimum number of &quot;objects&quot; to scan.
Definition: AbcMatrix.hpp:310
CoinBigIndex * getMutableVectorStarts() const
Definition: AbcMatrix.hpp:81
double CoinSimplexDouble
const double * getElements() const
A vector containing the elements in the packed matrix.
Definition: AbcMatrix.hpp:57
int * getMutableVectorLengths() const
The lengths of the major-dimension vectors.
~AbcMatrix3()
Destructor.
blockStruct * block_
Blocks (ordinary start at 0 and go to first block)
Definition: AbcMatrix.hpp:668
int numberRows_
Number of rows.
Definition: AbcMatrix.hpp:581
int getNumCols() const
Number of columns.
void transposeTimesAll(const double *x, double *y) const
Return y - A * x in y.
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 ...
void transposeTimes(const AbcSimplex *model, const double *pi, CoinIndexedVector &output) const
Return x * -1 * A in z.
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 minimumGoodReducedCosts_
Partial pricing tuning parameter - minimum number of negative reduced costs to get.
Definition: AbcMatrix.hpp:509
CoinBigIndex * rowEnd() const
Row ends.
int currentWanted_
Current number of negative reduced costs which we still need.
Definition: AbcMatrix.hpp:503
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 ...
#define NUMBER_COLUMN_BLOCKS
Definition: AbcMatrix.hpp:450
Indexed Vector.
AbcMatrix3 & operator=(const AbcMatrix3 &)
void timesModifyIncludingSlacks(double scalar, const double *x, double *y) const
Return y + A * scalar(+-1) *x in y.
const CoinBigIndex * getVectorStarts() const
The positions where the major-dimension vectors start in elements and indices.
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
#define NUMBER_ROW_BLOCKS
Definition: AbcMatrix.hpp:449
void makeAllUseful(CoinIndexedVector &spare)
Make all useful.
CoinBigIndex * rowStart() const
Row starts.
AbcSimplex * model_
Model.
Definition: AbcMatrix.hpp:447
void setMinimumObjectsScan(int value)
Definition: AbcMatrix.hpp:314
double * work_
work arrays
Definition: AbcMatrix.hpp:591
int * getMutableIndices() const
A vector containing the minor indices of the elements in the packed matrix.
Definition: AbcMatrix.hpp:72
~AbcMatrix()
Destructor.
int numberRowBlocks_
Number of actual row blocks.
Definition: AbcMatrix.hpp:473
double * getMutableElements() const
A vector containing the elements in the packed matrix.
int minimumGoodReducedCosts() const
Partial pricing tuning parameter - minimum number of negative reduced costs to get.
Definition: AbcMatrix.hpp:319
void createRowCopy()
Creates row copy.
int * getMutableVectorLengths() const
The lengths of the major-dimension vectors.
Definition: AbcMatrix.hpp:91
const double * getElements() const
A vector containing the elements in the packed matrix.
double dualColumn1(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 getNumRows() const
Number of rows.
const int * blockStart() const
Start of each block (in stored)
Definition: AbcMatrix.hpp:387
int savedBestSequence() const
Current best sequence.
Definition: AbcMatrix.hpp:373
void transposeTimes(const CoinIndexedVector &x, CoinIndexedVector &z) const
Return -x *A in z
int blockStart(int block) const
Start of each block (in stored)
Definition: AbcMatrix.hpp:396
Sparse Matrix Base Class.
int numberRowBlocks() const
Number of actual row blocks.
Definition: AbcMatrix.hpp:406
double startFraction() const
Current start of search space in matrix (as fraction)
Definition: AbcMatrix.hpp:328
void moveLargestToStart()
Move largest in column to beginning (not used as doesn&#39;t help factorization)
int numberRows() const
Number of rows.
Definition: ClpModel.hpp:315
AbcMatrix & operator=(const AbcMatrix &)
void sortBlocks(const AbcSimplex *model)
Sort blocks.
int numberColumns_
Number of columns.
Definition: AbcMatrix.hpp:658
~AbcMatrix2()
Destructor.
double * getMutableElements() const
Mutable elements.
Definition: AbcMatrix.hpp:62
int CoinBigIndex
const int * getVectorLengths() const
The lengths of the major-dimension vectors.
const CoinBigIndex * getVectorStarts() const
Starts.
Definition: AbcMatrix.hpp:77
bool isColOrdered() const
Whether the packed matrix is column major ordered or not.
Definition: AbcMatrix.hpp:33
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...
int minimumObjectsScan_
Partial pricing tuning parameter - minimum number of &quot;objects&quot; to scan.
Definition: AbcMatrix.hpp:507
void scale(int numberRowsAlreadyScaled)
Scales and creates row copy.
void setModel(AbcSimplex *model)
Sets model.
double startFraction_
Special row copy.
Definition: AbcMatrix.hpp:495
int getNumCols() const
Number of columns.
Definition: AbcMatrix.hpp:43
int numberBlocks_
Number of blocks.
Definition: AbcMatrix.hpp:656
const int * getIndices() const
A vector containing the minor indices of the elements in the packed matrix.
int * getMutableIndices() const
A vector containing the minor indices of the elements in the packed matrix.
CoinBigIndex * rowStart_
Start of each row (per block) - last lot are useless first all row starts for block 0...
Definition: AbcMatrix.hpp:461
void transposeTimes(const AbcSimplex *model, const CoinPackedMatrix *rowCopy, const CoinIndexedVector &x, CoinIndexedVector &spareArray, CoinIndexedVector &z) const
Return x * -1 * A in z.
bool usefulInfo() const
Returns true if copy has useful information.
Definition: AbcMatrix.hpp:551
double * rowElements() const
Row elements.
double endFraction_
Current end of search space in matrix (as fraction)
Definition: AbcMatrix.hpp:497
int * row_
Rows.
Definition: AbcMatrix.hpp:664
void swapOne(const AbcSimplex *model, const AbcMatrix *matrix, int iColumn)
Swap one variable.
double savedBestDj() const
Current best reduced cost.
Definition: AbcMatrix.hpp:346
int chooseBestDj(int iBlock, const CoinIndexedVector &infeasibilities, const double *weights) const
Chooses best weighted dj.
int CoinSimplexInt
unsigned short * column_
columns within block
Definition: AbcMatrix.hpp:589
void fillBasis(const int *whichColumn, int &numberColumnBasic, int *row, int *start, int *rowCount, int *columnCount, CoinSimplexDouble *element)
Fills in column part of basis.
int * column_
Columns.
Definition: AbcMatrix.hpp:465
void unpack(CoinIndexedVector &rowArray, int column) const
Unpacks a column into an CoinIndexedVector.
void rebalance() const
rebalance for parallel
void putIntofUseful(int sequence, CoinIndexedVector &spare)
Put into useful.
CoinBigIndex countBasis(const int *whichColumn, int &numberColumnBasic)
Returns number of elements in column part of basis.
int primalColumnRow(int iBlock, bool doByRow, const CoinIndexedVector &update, CoinPartitionedVector &tableauRow) const
gets tableau row - returns number of slacks in block
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 copy(const AbcMatrix *from)
Copy contents - resizing if necessary - otherwise re-use memory.
double * element_
Values by row.
Definition: AbcMatrix.hpp:463
CoinSimplexInt * rowColumns() const
Row columns.
AbcMatrix3()
Default constructor.
int startColumnBlock_[NUMBER_COLUMN_BLOCKS+1]
Start of each column block.
Definition: AbcMatrix.hpp:467
unsigned short * count_
Counts of elements in each part of row.
Definition: AbcMatrix.hpp:585
int originalWanted() const
Initial number of negative reduced costs wanted.
Definition: AbcMatrix.hpp:355
const int * getIndices() const
A vector containing the minor indices of the elements in the packed matrix.
Definition: AbcMatrix.hpp:67
int originalWanted_
Initial number of negative reduced costs wanted.
Definition: AbcMatrix.hpp:501
int numberInBlock_
Definition: AbcMatrix.hpp:601
CoinPackedMatrix * matrix_
Data.
Definition: AbcMatrix.hpp:445