Cbc  2.9.9
 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 1910 2013-01-27 02:00:13Z stefan $ */
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  return matrix_;
30  }
32  inline bool isColOrdered() const {
33  return true;
34  }
36  inline CoinBigIndex getNumElements() const {
37  return matrix_->getNumElements();
38  }
40  inline int getNumCols() const {
41  assert(matrix_->getNumCols()==model_->numberColumns());return matrix_->getNumCols();
42  }
44  inline int getNumRows() const {
45  assert(matrix_->getNumRows()==model_->numberRows());return matrix_->getNumRows();
46  }
48  void setModel(AbcSimplex * model);
50  inline const double * getElements() const {
51  return matrix_->getElements();
52  }
54  inline double * getMutableElements() const {
55  return matrix_->getMutableElements();
56  }
58  inline const int * getIndices() const {
59  return matrix_->getIndices();
60  }
62  inline int * getMutableIndices() const {
63  return matrix_->getMutableIndices();
64  }
66  inline const CoinBigIndex * getVectorStarts() const {
67  return matrix_->getVectorStarts();
68  }
71  }
73  inline const int * getVectorLengths() const {
74  return matrix_->getVectorLengths();
75  }
77  inline int * getMutableVectorLengths() const {
79  }
81  CoinBigIndex * rowStart() const;
83  CoinBigIndex * rowEnd() const;
85  double * rowElements() const;
87  CoinSimplexInt * rowColumns() const;
91  CoinBigIndex countBasis(const int * whichColumn,
92  int & numberColumnBasic);
94  void fillBasis(const int * whichColumn,
95  int & numberColumnBasic,
96  int * row, int * start,
97  int * rowCount, int * columnCount,
98  CoinSimplexDouble * element);
100  void fillBasis(const int * whichColumn,
101  int & numberColumnBasic,
102  int * row, int * start,
103  int * rowCount, int * columnCount,
104  long double * element);
107  void scale(int numberRowsAlreadyScaled);
109  void createRowCopy();
111  void takeOutOfUseful(int sequence,CoinIndexedVector & spare);
113  void putIntofUseful(int sequence,CoinIndexedVector & spare);
115  void inOutUseful(int sequenceIn,int sequenceOut);
117  void makeAllUseful(CoinIndexedVector & spare);
119  void sortUseful(CoinIndexedVector & spare);
121  void moveLargestToStart();
122 
125  void unpack(CoinIndexedVector & rowArray,
126  int column) const ;
129  void add(CoinIndexedVector & rowArray, int column, double multiplier) const ;
131 
137  void timesModifyExcludingSlacks(double scalar,
138  const double * x, double * y) const;
142  void timesModifyIncludingSlacks(double scalar,
143  const double * x, double * y) const;
147  void timesIncludingSlacks(double scalar,
148  const double * x, double * y) const;
152  void transposeTimesNonBasic(double scalar,
153  const double * x, double * y) const;
157  void transposeTimesAll(const double * x, double * y) const;
161  void transposeTimesBasic(double scalar,
162  const double * x, double * y) const;
173  int transposeTimesNonBasic(double scalar,
174  const CoinIndexedVector & x,
175  CoinIndexedVector & z) const;
177  double dualColumn1(const CoinIndexedVector & update,
178  CoinPartitionedVector & tableauRow,
179  CoinPartitionedVector & candidateList) const;
181  double dualColumn1Row(int iBlock, double upperThetaSlack, int & freeSequence,
182  const CoinIndexedVector & update,
183  CoinPartitionedVector & tableauRow,
184  CoinPartitionedVector & candidateList) const;
186  double dualColumn1RowFew(int iBlock, double upperThetaSlack, int & freeSequence,
187  const CoinIndexedVector & update,
188  CoinPartitionedVector & tableauRow,
189  CoinPartitionedVector & candidateList) const;
191  double dualColumn1Row2(double upperThetaSlack, int & freeSequence,
192  const CoinIndexedVector & update,
193  CoinPartitionedVector & tableauRow,
194  CoinPartitionedVector & candidateList) const;
196  double dualColumn1Row1(double upperThetaSlack, int & freeSequence,
197  const CoinIndexedVector & update,
198  CoinPartitionedVector & tableauRow,
199  CoinPartitionedVector & candidateList) const;
203  void dualColumn1Part(int iBlock,int & sequenceIn, double & upperTheta,
204  const CoinIndexedVector & update,
205  CoinPartitionedVector & tableauRow,
206  CoinPartitionedVector & candidateList) const;
208  void rebalance() const;
210  int pivotColumnDantzig(const CoinIndexedVector & updates,
211  CoinPartitionedVector & spare) const;
213  int pivotColumnDantzig(int iBlock,bool doByRow,const CoinIndexedVector & updates,
214  CoinPartitionedVector & spare,
215  double & bestValue) const;
217  int primalColumnRow(int iBlock,bool doByRow,const CoinIndexedVector & update,
218  CoinPartitionedVector & tableauRow) const;
220  int primalColumnRowAndDjs(int iBlock,const CoinIndexedVector & updateTableau,
221  const CoinIndexedVector & updateDjs,
222  CoinPartitionedVector & tableauRow) const;
225  int chooseBestDj(int iBlock,const CoinIndexedVector & infeasibilities,
226  const double * weights) const;
232  int primalColumnDouble(int iBlock,CoinPartitionedVector & updateForTableauRow,
233  CoinPartitionedVector & updateForDjs,
234  const CoinIndexedVector & updateForWeights,
235  CoinPartitionedVector & spareColumn1,
236  double * infeasibilities,
237  double referenceIn, double devex,
238  // Array for exact devex to say what is in reference framework
239  unsigned int * reference,
240  double * weights, double scaleFactor) const;
246  int primalColumnSparseDouble(int iBlock,CoinPartitionedVector & updateForTableauRow,
247  CoinPartitionedVector & updateForDjs,
248  const CoinIndexedVector & updateForWeights,
249  CoinPartitionedVector & spareColumn1,
250  double * infeasibilities,
251  double referenceIn, double devex,
252  // Array for exact devex to say what is in reference framework
253  unsigned int * reference,
254  double * weights, double scaleFactor) const;
260  int primalColumnDouble(CoinPartitionedVector & updateForTableauRow,
261  CoinPartitionedVector & updateForDjs,
262  const CoinIndexedVector & updateForWeights,
263  CoinPartitionedVector & spareColumn1,
264  CoinIndexedVector & infeasible,
265  double referenceIn, double devex,
266  // Array for exact devex to say what is in reference framework
267  unsigned int * reference,
268  double * weights, double scaleFactor) const;
270  void primalColumnSubset(int iBlock,const CoinIndexedVector & update,
271  const CoinPartitionedVector & tableauRow,
272  CoinPartitionedVector & weights) const;
274  void partialPricing(double startFraction, double endFraction,
275  int & bestSequence, int & numberWanted);
280  CoinIndexedVector & z) const;
282  void transposeTimes(const CoinIndexedVector & x,
283  CoinIndexedVector & z) const;
285 
288  inline CoinPackedMatrix * matrix() const {
290  return matrix_;
291  }
294  inline int minimumObjectsScan() const {
295  return minimumObjectsScan_;
296  }
297  inline void setMinimumObjectsScan(int value) {
298  minimumObjectsScan_ = value;
299  }
301  inline int minimumGoodReducedCosts() const {
303  }
304  inline void setMinimumGoodReducedCosts(int value) {
305  minimumGoodReducedCosts_ = value;
306  }
308  inline double startFraction() const {
309  return startFraction_;
310  }
311  inline void setStartFraction(double value) {
312  startFraction_ = value;
313  }
315  inline double endFraction() const {
316  return endFraction_;
317  }
318  inline void setEndFraction(double value) {
319  endFraction_ = value;
320  }
322  inline double savedBestDj() const {
323  return savedBestDj_;
324  }
325  inline void setSavedBestDj(double value) {
326  savedBestDj_ = value;
327  }
329  inline int originalWanted() const {
330  return originalWanted_;
331  }
332  inline void setOriginalWanted(int value) {
333  originalWanted_ = value;
334  }
336  inline int currentWanted() const {
337  return currentWanted_;
338  }
339  inline void setCurrentWanted(int value) {
340  currentWanted_ = value;
341  }
343  inline int savedBestSequence() const {
344  return savedBestSequence_;
345  }
346  inline void setSavedBestSequence(int value) {
347  savedBestSequence_ = value;
348  }
350  inline int * startColumnBlock() const
351  {return startColumnBlock_;}
353  inline const int * blockStart() const
354  { return blockStart_;}
355  inline bool gotRowCopy() const
356  { return rowStart_!=0;}
358  inline int blockStart(int block) const
359  { return blockStart_[block];}
361  inline int numberColumnBlocks() const
362  { return numberColumnBlocks_;}
364  inline int numberRowBlocks() const
365  { return numberRowBlocks_;}
367 
368 
372  AbcMatrix();
374  ~AbcMatrix();
376 
380  AbcMatrix(const AbcMatrix&);
382  AbcMatrix(const CoinPackedMatrix&);
385  AbcMatrix (const AbcMatrix & wholeModel,
386  int numberRows, const int * whichRows,
387  int numberColumns, const int * whichColumns);
388  AbcMatrix (const CoinPackedMatrix & wholeModel,
389  int numberRows, const int * whichRows,
390  int numberColumns, const int * whichColumns);
391 
392  AbcMatrix& operator=(const AbcMatrix&);
394  void copy(const AbcMatrix * from);
396 private:
397 
398 protected:
405  mutable AbcSimplex * model_;
406 #if ABC_PARALLEL==0
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
412 #else
413 #define NUMBER_ROW_BLOCKS 8
414 #define NUMBER_COLUMN_BLOCKS 8
415 #endif
416 
421  double * element_;
423  int * column_;
429  mutable int numberColumnBlocks_;
432  //#define COUNT_COPY
433 #ifdef COUNT_COPY
434 #define MAX_COUNT 13
435  CoinBigIndex countStart_[MAX_COUNT+1];
438  int countFirst_[MAX_COUNT+1];
439  // later int countEndUseful_[MAX_COUNT+1];
440  int * countRealColumn_;
441  // later int * countInverseRealColumn_;
442  CoinBigIndex * countStartLarge_;
443  int * countRow_;
444  double * countElement_;
445  int smallestCount_;
446  int largestCount_;
447 #endif
448  //AbcMatrix2 * rowCopy_;
451  //AbcMatrix3 * columnCopy_;
455  double endFraction_;
457  double savedBestDj_;
469 };
470 #ifdef THREAD
471 #include <pthread.h>
472 typedef struct {
473  double acceptablePivot;
474  const AbcSimplex * model;
475  double * spare;
476  int * spareIndex;
477  double * arrayTemp;
478  int * indexTemp;
479  int * numberInPtr;
480  double * bestPossiblePtr;
481  double * upperThetaPtr;
482  int * posFreePtr;
483  double * freePivotPtr;
484  int * numberOutPtr;
485  const unsigned short * count;
486  const double * pi;
487  const CoinBigIndex * rowStart;
488  const double * element;
489  const unsigned short * column;
490  int offset;
491  int numberInRowArray;
492  int numberLook;
493 } dualColumn0Struct;
494 #endif
495 class AbcMatrix2 {
496 
497 public:
503  void transposeTimes(const AbcSimplex * model,
504  const CoinPackedMatrix * rowCopy,
505  const CoinIndexedVector & x,
506  CoinIndexedVector & spareArray,
507  CoinIndexedVector & z) const;
509  inline bool usefulInfo() const {
510  return rowStart_ != NULL;
511  }
513 
514 
518  AbcMatrix2();
520  AbcMatrix2(AbcSimplex * model, const CoinPackedMatrix * rowCopy);
522  ~AbcMatrix2();
524 
528  AbcMatrix2(const AbcMatrix2&);
531 
532 
533 protected:
537  int numberBlocks_;
542  int * offset_;
544  mutable unsigned short * count_;
548  unsigned short * column_;
550  double * work_;
551 #ifdef THREAD
552  pthread_t * threadId_;
553  dualColumn0Struct * info_;
554 #endif
555 
556 };
557 typedef struct {
558  CoinBigIndex startElements_; // point to data
559  int startIndices_; // point to column_
561  int numberPrice_; // at beginning
562  int numberElements_; // number elements per column
563 } blockStruct3;
564 class AbcMatrix3 {
565 
566 public:
572  void transposeTimes(const AbcSimplex * model,
573  const double * pi,
574  CoinIndexedVector & output) const;
576  void transposeTimes2(const AbcSimplex * model,
577  const double * pi, CoinIndexedVector & dj1,
578  const double * piWeight,
579  double referenceIn, double devex,
580  // Array for exact devex to say what is in reference framework
581  unsigned int * reference,
582  double * weights, double scaleFactor);
584 
585 
589  AbcMatrix3();
591  AbcMatrix3(AbcSimplex * model, const CoinPackedMatrix * columnCopy);
593  ~AbcMatrix3();
595 
599  AbcMatrix3(const AbcMatrix3&);
602 
605  void sortBlocks(const AbcSimplex * model);
607  void swapOne(const AbcSimplex * model, const AbcMatrix * matrix,
608  int iColumn);
610 
611 
612 protected:
616  int numberBlocks_;
621  int * column_;
625  int * row_;
627  double * element_;
631 };
632 
633 #endif
CoinBigIndex getNumElements() const
Number of entries in the packed matrix.
Definition: AbcMatrix.hpp:36
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:355
CoinBigIndex getNumElements() const
Number of entries in the packed matrix.
AbcMatrix()
Default constructor.
CoinPackedMatrix * matrix() const
Returns CoinPackedMatrix (non const)
Definition: AbcMatrix.hpp:289
void sortUseful(CoinIndexedVector &spare)
Sort into useful.
void setCurrentWanted(int value)
Definition: AbcMatrix.hpp:339
CoinBigIndex startElements_
Definition: AbcMatrix.hpp:558
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:304
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:311
int * startColumnBlock() const
Start of each column block.
Definition: AbcMatrix.hpp:350
double endFraction() const
Current end of search space in matrix (as fraction)
Definition: AbcMatrix.hpp:315
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:429
void inOutUseful(int sequenceIn, int sequenceOut)
Put in and out for useful.
int getNumRows() const
Number of rows.
Definition: AbcMatrix.hpp:44
const int * getVectorLengths() const
The lengths of the major-dimension vectors.
Definition: AbcMatrix.hpp:73
int blockStart_[NUMBER_ROW_BLOCKS+1]
Start of each block (in stored)
Definition: AbcMatrix.hpp:427
int numberColumnBlocks() const
Number of actual column blocks.
Definition: AbcMatrix.hpp:361
void setSavedBestDj(double value)
Definition: AbcMatrix.hpp:325
double savedBestDj_
Best reduced cost so far.
Definition: AbcMatrix.hpp:457
int * offset_
Column offset for each block (plus one at end)
Definition: AbcMatrix.hpp:542
int currentWanted() const
Current number of negative reduced costs which we still need.
Definition: AbcMatrix.hpp:336
double * element_
Elements.
Definition: AbcMatrix.hpp:627
CoinPackedMatrix * reverseOrderedCopy() const
Returns a new matrix in reverse order without gaps.
void setSavedBestSequence(int value)
Definition: AbcMatrix.hpp:346
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:562
int numberBlocks_
Number of blocks.
Definition: AbcMatrix.hpp:538
int * column_
Column indices and reverse lookup (within block)
Definition: AbcMatrix.hpp:621
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:318
void setOriginalWanted(int value)
Definition: AbcMatrix.hpp:332
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:623
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:546
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:463
CoinPackedMatrix * getPackedMatrix() const
Return a complete CoinPackedMatrix.
Definition: AbcMatrix.hpp:28
int numberColumns() const
Definition: ClpModel.hpp:325
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:294
CoinBigIndex * getMutableVectorStarts() const
Definition: AbcMatrix.hpp:69
double CoinSimplexDouble
const double * getElements() const
A vector containing the elements in the packed matrix.
Definition: AbcMatrix.hpp:50
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:629
int numberRows_
Number of rows.
Definition: AbcMatrix.hpp:540
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:467
CoinBigIndex * rowEnd() const
Row ends.
int currentWanted_
Current number of negative reduced costs which we still need.
Definition: AbcMatrix.hpp:461
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:408
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:407
void makeAllUseful(CoinIndexedVector &spare)
Make all useful.
CoinBigIndex * rowStart() const
Row starts.
AbcSimplex * model_
Model.
Definition: AbcMatrix.hpp:405
void setMinimumObjectsScan(int value)
Definition: AbcMatrix.hpp:297
double * work_
work arrays
Definition: AbcMatrix.hpp:550
int * getMutableIndices() const
A vector containing the minor indices of the elements in the packed matrix.
Definition: AbcMatrix.hpp:62
~AbcMatrix()
Destructor.
int numberRowBlocks_
Number of actual row blocks.
Definition: AbcMatrix.hpp:431
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:301
void createRowCopy()
Creates row copy.
int * getMutableVectorLengths() const
The lengths of the major-dimension vectors.
Definition: AbcMatrix.hpp:77
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:353
int savedBestSequence() const
Current best sequence.
Definition: AbcMatrix.hpp:343
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:358
Sparse Matrix Base Class.
int numberRowBlocks() const
Number of actual row blocks.
Definition: AbcMatrix.hpp:364
double startFraction() const
Current start of search space in matrix (as fraction)
Definition: AbcMatrix.hpp:308
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:619
~AbcMatrix2()
Destructor.
double * getMutableElements() const
Mutable elements.
Definition: AbcMatrix.hpp:54
int CoinBigIndex
const int * getVectorLengths() const
The lengths of the major-dimension vectors.
const CoinBigIndex * getVectorStarts() const
Starts.
Definition: AbcMatrix.hpp:66
bool isColOrdered() const
Whether the packed matrix is column major ordered or not.
Definition: AbcMatrix.hpp:32
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:465
void scale(int numberRowsAlreadyScaled)
Scales and creates row copy.
void setModel(AbcSimplex *model)
Sets model.
double startFraction_
Special row copy.
Definition: AbcMatrix.hpp:453
int getNumCols() const
Number of columns.
Definition: AbcMatrix.hpp:40
int numberBlocks_
Number of blocks.
Definition: AbcMatrix.hpp:617
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:419
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:509
double * rowElements() const
Row elements.
double endFraction_
Current end of search space in matrix (as fraction)
Definition: AbcMatrix.hpp:455
int * row_
Rows.
Definition: AbcMatrix.hpp:625
void swapOne(const AbcSimplex *model, const AbcMatrix *matrix, int iColumn)
Swap one variable.
double savedBestDj() const
Current best reduced cost.
Definition: AbcMatrix.hpp:322
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:548
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:423
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:421
CoinSimplexInt * rowColumns() const
Row columns.
AbcMatrix3()
Default constructor.
int startColumnBlock_[NUMBER_COLUMN_BLOCKS+1]
Start of each column block.
Definition: AbcMatrix.hpp:425
unsigned short * count_
Counts of elements in each part of row.
Definition: AbcMatrix.hpp:544
int originalWanted() const
Initial number of negative reduced costs wanted.
Definition: AbcMatrix.hpp:329
const int * getIndices() const
A vector containing the minor indices of the elements in the packed matrix.
Definition: AbcMatrix.hpp:58
int originalWanted_
Initial number of negative reduced costs wanted.
Definition: AbcMatrix.hpp:459
int numberInBlock_
Definition: AbcMatrix.hpp:560
CoinPackedMatrix * matrix_
Data.
Definition: AbcMatrix.hpp:403