Go to the documentation of this file.
6 #ifndef AbcSimplexFactorization_H
7 #define AbcSimplexFactorization_H
10 #include "CoinPragma.hpp"
17 #ifndef ABC_USE_COIN_FACTORIZATION
19 class CoinFactorization;
22 #include "CoinFactorization.hpp"
43 #ifdef EARLY_FACTORIZE
46 {
return coinAbcFactorization_->factorize(model,stuff);}
77 #ifdef ABC_LONG_FACTORIZATION
88 #ifdef ABC_LONG_FACTORIZATION
92 CoinIndexedVector * partialUpdate,
94 {
return coinAbcFactorization_->
checkReplacePart1(regionSparse,partialUpdate,pivotRow);}
95 #ifdef MOVE_REPLACE_PART1A
100 inline void checkReplacePart1a ( CoinIndexedVector * regionSparse,
103 inline double checkReplacePart1b (CoinIndexedVector * regionSparse,
112 #ifdef ABC_LONG_FACTORIZATION
116 {
return coinAbcFactorization_->
checkReplacePart2(pivotRow,btranAlpha,ftranAlpha,ftAlpha);}
117 #ifdef ABC_LONG_FACTORIZATION
118 inline void clearHiddenArrays()
120 { coinAbcFactorization_->clearHiddenArrays();}
125 CoinIndexedVector * regionSparse,
126 CoinIndexedVector * tableauColumn,
128 #ifdef ABC_LONG_FACTORIZATION
135 CoinIndexedVector * regionSparse,
136 CoinIndexedVector * tableauColumn,
137 CoinIndexedVector * partialUpdate,
139 #ifdef ABC_LONG_FACTORIZATION
143 #ifdef EARLY_FACTORIZE
144 inline int replaceColumns (
const AbcSimplex * model,
146 CoinIndexedVector & stuff,
147 int firstPivot,
int lastPivot,
bool cleanUp)
148 {
return coinAbcFactorization_->replaceColumns(model,stuff,firstPivot,lastPivot,cleanUp);}
161 CoinIndexedVector * regionSparse2);
165 CoinIndexedVector * regionSparse2)
const;
172 CoinIndexedVector * regionSparse2,
173 CoinIndexedVector * regionSparse3) ;
177 CoinIndexedVector * regionSparse2)
const;
192 CoinIndexedVector & partialUpdate,
194 { coinAbcFactorization_->
updateColumnFT(regionSparseFT,partialUpdate,which);}
197 {
return coinAbcFactorization_->
updateColumn(regionSparse);}
203 CoinIndexedVector & regionSparseOther)
204 {
return coinAbcFactorization_->
updateTwoColumnsFT(regionSparseFT,regionSparseOther);}
210 #ifndef ABC_USE_COIN_FACTORIZATION
217 #ifndef ABC_USE_COIN_FACTORIZATION
230 #ifndef ABC_USE_COIN_FACTORIZATION
255 return coinAbcFactorization_->
pivots() ;
262 coinAbcFactorization_->
setPivots(value) ;
284 return coinAbcFactorization_->
status() ;
288 coinAbcFactorization_->
setStatus(value) ;
291 inline void setParallelMode(
int value)
293 {coinAbcFactorization_->setParallelMode(value);};
300 #if CLP_FACTORIZATION_NEW_TIMING>1
301 void statsRefactor(
char when)
const;
313 {
return numberSlacks_;}
350 return goDenseThreshold_;
354 goDenseThreshold_ = value;
358 return goSmallThreshold_;
362 goSmallThreshold_ = value;
366 return goLongThreshold_;
370 goLongThreshold_ = value;
384 #ifndef ABC_USE_COIN_FACTORIZATION
395 #ifndef ABC_USE_COIN_FACTORIZATION
397 {
return coinAbcFactorization_;}
400 {
return coinAbcFactorization_;}
412 #ifndef ABC_USE_COIN_FACTORIZATION
415 CoinFactorization * coinAbcFactorization_;
417 #ifdef CLP_FACTORIZATION_NEW_TIMING
418 mutable double shortestAverage_;
420 mutable double totalInR_;
421 mutable double totalInIncreasingU_;
422 mutable int endLengthU_;
423 mutable int lastNumberPivots_;
424 mutable int effectiveStartNumberU_;
429 int goDenseThreshold_;
431 int goSmallThreshold_;
433 int goLongThreshold_;
This just implements CoinFactorization when an ClpMatrixBase object is passed.
void areaFactor(double value)
Set whether larger areas needed.
int updateColumnTranspose(CoinIndexedVector ®ionSparse) const
Updates one column (BTRAN)
void replaceColumnPart3(const AbcSimplex *model, CoinIndexedVector *regionSparse, CoinIndexedVector *tableauColumn, CoinIndexedVector *partialUpdate, int pivotRow, double alpha)
Replaces one Column to basis, partial update in vector.
~AbcSimplexFactorization()
Destructor.
bool timeToRefactorize() const
virtual int updateColumnTranspose(CoinIndexedVector ®ionSparse) const =0
Updates one column (BTRAN) from unpacked regionSparse.
int pivots() const
Returns number of pivots since factorization.
Abstract base class which also has some scalars so can be used from Dense or Simp.
int numberSlacks() const
Number of slacks at last factorization.
CoinSimplexInt numberDense() const
Number of dense rows after factorization.
int numberRows() const
Number of Rows after factorization.
int factorize(AbcSimplex *model, int solveType, bool valuesPass)
When part of LP - given by basic variables.
void updateColumnFTPart2(CoinIndexedVector ®ionSparseFT)
virtual void updateFullColumn(CoinIndexedVector ®ionSparse) const =0
This version does FTRAN on array when indices not set up.
virtual void checkMarkArrays() const
double areaFactor() const
Area factor.
int numberElements() const
Total number of elements in factorization.
virtual int updateColumnFT(CoinIndexedVector ®ionSparse)=0
Updates one column (FTRAN) from unpacked regionSparse Tries to do FT update number returned is negati...
bool needToReorder() const
Says whether to redo pivot order.
virtual CoinFactorizationDouble * pivotRegion() const
void saferTolerances(double zeroTolerance, double pivotTolerance)
Set tolerances to safer of existing and given.
void setStatus(int value)
Sets status.
bool usingFT() const
Returns true if doing FT.
int numberRows() const
Number of Rows after factorization.
virtual void clearArrays()
Get rid of all memory.
AbcSimplexFactorization & operator=(const AbcSimplexFactorization &)
int typeOfFactorization() const
Returns type.
double areaFactor() const
Whether larger areas needed.
int updateColumnFT(CoinIndexedVector ®ionSparseFT)
Updates one column (FTRAN) Tries to do FT update number returned is negative if no room.
void updateColumnFT(CoinIndexedVector ®ionSparseFT, CoinIndexedVector &partialUpdate, int which)
Updates one column (FTRAN) Tries to do FT update puts partial update in vector.
void setGoLongThreshold(int value)
Set switch to long/ordered if number rows >= this.
void zeroTolerance(double value)
Set zero tolerance.
void synchronize(const ClpFactorization *otherFactorization, const AbcSimplex *model)
Synchronize stuff.
int status() const
Returns status.
int getDenseThreshold() const
int updateColumnFTPart1(CoinIndexedVector ®ionSparseFT)
double checkReplacePart1(CoinIndexedVector *regionSparse, CoinIndexedVector *partialUpdate, int pivotRow)
Checks if can replace one Column to basis, returns update alpha Fills in region for use later partial...
void updateFullColumn(CoinIndexedVector ®ionSparse) const
Updates one full column (FTRAN)
double pivotTolerance() const
Pivot tolerance.
int updateTwoColumnsFT(CoinIndexedVector ®ionSparseFT, CoinIndexedVector ®ionSparseOther)
Updates one column (FTRAN) from regionFT Tries to do FT update number returned is negative if no room...
void pivotTolerance(double value)
Set pivot tolerance.
int goLongThreshold() const
Get switch to long/ordered if number rows >= this.
virtual void updateFullColumnTranspose(CoinIndexedVector ®ionSparse) const =0
Updates one column (BTRAN) from unpacked regionSparse.
This just implements AbcFactorization when an AbcMatrix object is passed.
int checkReplacePart2(int pivotRow, double btranAlpha, double ftranAlpha, double ftAlpha)
Checks if can replace one Column to basis, returns 0=OK, 1=Probably OK, 2=singular,...
void goSparse()
makes a row copy of L for speed and to allow very sparse problems
virtual int updateTwoColumnsFT(CoinIndexedVector ®ionFT, CoinIndexedVector ®ionOther)=0
does FTRAN on two unpacked columns
virtual int updateColumnFTPart1(CoinIndexedVector ®ionSparse)=0
AbcSimplexFactorization(int numberRows=0)
Default constructor.
void clearArrays()
Get rid of all memory.
double zeroTolerance() const
Zero tolerance.
void forceOtherFactorization(int which)
If nonzero force use of 1,dense 2,small 3,long.
void replaceColumnPart3(const AbcSimplex *model, CoinIndexedVector *regionSparse, CoinIndexedVector *tableauColumn, int pivotRow, double alpha)
Replaces one Column to basis, partial update already in U.
void setModel(AbcSimplex *model)
Sets model.
virtual void updateWeights(CoinIndexedVector ®ionSparse) const =0
Updates one column for dual steepest edge weights (FTRAN)
int pivots() const
Returns number of pivots since factorization.
double minimumPivotTolerance() const
Minimum pivot tolerance.
virtual int checkReplacePart2(int pivotRow, double btranAlpha, double ftranAlpha, double ftAlpha, double acceptablePivot=1.0e-8)=0
Checks if can replace one Column to basis, returns 0=OK, 1=Probably OK, 2=singular,...
virtual bool wantsTableauColumn() const
Returns true if wants tableauColumn in replaceColumn.
void setGoSmallThreshold(int value)
Set switch to small if number rows <= this.
void updateFullColumnTranspose(CoinIndexedVector ®ionSparse) const
Updates one full column (BTRAN)
double pivotTolerance() const
Pivot tolerance.
void checkMarkArrays() const
void maximumPivots(int value)
Set maximum number of pivots between factorizations.
void setFactorization(AbcSimplexFactorization &rhs)
Sets factorization.
void setPivots(int value) const
Sets number of pivots since factorization.
CoinAbcAnyFactorization * factorization() const
Pointer to factorization.
int maximumPivots() const
Maximum number of pivots between factorizations.
double minimumPivotTolerance() const
Minimum pivot tolerance.
int status() const
Returns status.
double zeroTolerance() const
Zero tolerance.
void setGoDenseThreshold(int value)
Set switch to dense if number rows <= this.
virtual void updateColumnFTPart2(CoinIndexedVector ®ionSparse)=0
void updateColumnCpu(CoinIndexedVector ®ionSparse, int whichCpu) const
Updates one column (FTRAN)
virtual void updateColumnTransposeCpu(CoinIndexedVector ®ionSparse, int whichCpu) const
Updates one column (BTRAN)
void updateColumnTransposeCpu(CoinIndexedVector ®ionSparse, int whichCpu) const
Updates one column (BTRAN)
int maximumPivots() const
Maximum number of pivots between factorizations.
void updateWeights(CoinIndexedVector ®ionSparse) const
Updates one column for dual steepest edge weights (FTRAN)
double checkReplacePart1(CoinIndexedVector *regionSparse, int pivotRow)
Checks if can replace one Column to basis, returns update alpha Fills in region for use later partial...
int numberDense() const
Returns number of dense rows.
void setStatus(int value)
Sets status.
void setDenseThreshold(int number)
So we can temporarily switch off dense.
int updateColumn(CoinIndexedVector ®ionSparse) const
Updates one column (FTRAN)
int goSmallThreshold() const
Get switch to small if number rows <= this.
virtual int updateColumn(CoinIndexedVector ®ionSparse) const =0
This version has same effect as above with FTUpdate==false so number returned is always >=0.
void almostDestructor()
Allows change of pivot accuracy check 1.0 == none >1.0 relaxed.
virtual void updateColumnCpu(CoinIndexedVector ®ionSparse, int whichCpu) const
Updates one column (FTRAN)
virtual double checkReplacePart1(CoinIndexedVector *, int)
Checks if can replace one Column to basis, returns update alpha Fills in region for use later partial...
virtual void checkReplacePart1a(CoinIndexedVector *, int)
AbcSimplexFactorization(const AbcSimplexFactorization &, int denseIfSmaller=0)
The copy constructor.
void minimumPivotTolerance(double value)
Set minimum pivot tolerance.
virtual int numberElements() const =0
Total number of elements in factorization.
void goDenseOrSmall(int numberRows)
Go over to dense code.
double * pivotRegion() const
pivot region
void setPivots(int value)
Sets number of pivots since factorization.
virtual double checkReplacePart1b(CoinIndexedVector *, int)
int goDenseThreshold() const
Get switch to dense if number rows <= this.