6 #ifndef AbcSimplexFactorization_H 7 #define AbcSimplexFactorization_H 10 #include "CoinPragma.hpp" 38 #ifdef EARLY_FACTORIZE 41 {
return coinAbcFactorization_->factorize(model,stuff);}
72 #ifdef ABC_LONG_FACTORIZATION 83 #ifdef ABC_LONG_FACTORIZATION 87 CoinIndexedVector * partialUpdate,
89 {
return coinAbcFactorization_->
checkReplacePart1(regionSparse,partialUpdate,pivotRow);}
105 #ifdef ABC_LONG_FACTORIZATION
109 {
return coinAbcFactorization_->
checkReplacePart2(pivotRow,btranAlpha,ftranAlpha,ftAlpha);}
110 #ifdef ABC_LONG_FACTORIZATION 111 inline void clearHiddenArrays()
113 { coinAbcFactorization_->clearHiddenArrays();}
118 CoinIndexedVector * regionSparse,
119 CoinIndexedVector * tableauColumn,
121 #ifdef ABC_LONG_FACTORIZATION
128 CoinIndexedVector * regionSparse,
129 CoinIndexedVector * tableauColumn,
130 CoinIndexedVector * partialUpdate,
132 #ifdef ABC_LONG_FACTORIZATION
136 #ifdef EARLY_FACTORIZE 137 inline int replaceColumns (
const AbcSimplex * model,
139 CoinIndexedVector & stuff,
140 int firstPivot,
int lastPivot,
bool cleanUp)
141 {
return coinAbcFactorization_->replaceColumns(model,stuff,firstPivot,lastPivot,cleanUp);}
154 CoinIndexedVector * regionSparse2);
158 CoinIndexedVector * regionSparse2)
const;
165 CoinIndexedVector * regionSparse2,
166 CoinIndexedVector * regionSparse3) ;
170 CoinIndexedVector * regionSparse2)
const;
185 CoinIndexedVector & partialUpdate,
187 { coinAbcFactorization_->
updateColumnFT(regionSparseFT,partialUpdate,which);}
190 {
return coinAbcFactorization_->
updateColumn(regionSparse);}
196 CoinIndexedVector & regionSparseOther)
197 {
return coinAbcFactorization_->
updateTwoColumnsFT(regionSparseFT,regionSparseOther);}
236 return coinAbcFactorization_->
pivots() ;
240 coinAbcFactorization_->
setPivots(value) ;
262 return coinAbcFactorization_->
status() ;
266 coinAbcFactorization_->
setStatus(value) ;
269 inline void setParallelMode(
int value)
271 {coinAbcFactorization_->setParallelMode(value);};
278 return coinAbcFactorization_->
pivots() > coinAbcFactorization_->
numberRows() / 2.45 + 20;
290 {
return numberSlacks_;}
327 return goDenseThreshold_;
331 goDenseThreshold_ = value;
335 return goSmallThreshold_;
339 goSmallThreshold_ = value;
343 return goLongThreshold_;
347 goLongThreshold_ = value;
368 {
return coinAbcFactorization_;}
383 int goDenseThreshold_;
385 int goSmallThreshold_;
387 int goLongThreshold_;
virtual void updateColumnTransposeCpu(CoinIndexedVector ®ionSparse, int whichCpu) const
Updates one column (BTRAN)
int goDenseThreshold() const
Get switch to dense if number rows <= this.
void setGoLongThreshold(int value)
Set switch to long/ordered if number rows >= this.
void updateColumnFT(CoinIndexedVector ®ionSparseFT, CoinIndexedVector &partialUpdate, int which)
Updates one column (FTRAN) Tries to do FT update puts partial update in vector.
void areaFactor(double value)
Set whether larger areas needed.
This just implements AbcFactorization when an AbcMatrix object is passed.
int updateColumnTranspose(CoinIndexedVector ®ionSparse) const
Updates one column (BTRAN)
virtual double checkReplacePart1(CoinIndexedVector *, int)
Checks if can replace one Column to basis, returns update alpha Fills in region for use later partial...
void synchronize(const ClpFactorization *otherFactorization, const AbcSimplex *model)
Synchronize stuff.
int numberElements() const
Total number of elements in factorization.
Abstract base class which also has some scalars so can be used from Dense or Simp.
bool needToReorder() const
Says whether to redo pivot order.
void updateFullColumn(CoinIndexedVector ®ionSparse) const
Updates one full column (FTRAN)
int typeOfFactorization() const
Returns type.
~AbcSimplexFactorization()
Destructor.
int numberSlacks() const
Number of slacks at last factorization.
virtual void updateFullColumnTranspose(CoinIndexedVector ®ionSparse) const =0
Updates one column (BTRAN) from unpacked regionSparse.
virtual int updateColumnFTPart1(CoinIndexedVector ®ionSparse)=0
void saferTolerances(double zeroTolerance, double pivotTolerance)
Set tolerances to safer of existing and given.
virtual int updateColumnTranspose(CoinIndexedVector ®ionSparse) const =0
Updates one column (BTRAN) from unpacked regionSparse.
bool usingFT() const
Returns true if doing FT.
CoinSimplexInt numberDense() const
Number of dense rows after factorization.
int factorize(AbcSimplex *model, int solveType, bool valuesPass)
When part of LP - given by basic variables.
virtual void updateFullColumn(CoinIndexedVector ®ionSparse) const =0
This version does FTRAN on array when indices not set up.
int numberRows() const
Number of Rows after factorization.
AbcSimplexFactorization & operator=(const AbcSimplexFactorization &)
double checkReplacePart1b(CoinIndexedVector *regionSparse, int pivotRow)
This just implements CoinFactorization when an ClpMatrixBase object is passed.
virtual int updateTwoColumnsFT(CoinIndexedVector ®ionFT, CoinIndexedVector ®ionOther)=0
does FTRAN on two unpacked columns
int updateTwoColumnsFT(CoinIndexedVector ®ionSparseFT, CoinIndexedVector ®ionSparseOther)
Updates one column (FTRAN) from regionFT Tries to do FT update number returned is negative if no room...
int updateColumnFTPart1(CoinIndexedVector ®ionSparseFT)
AbcSimplexFactorization(int numberRows=0)
Default constructor.
void setStatus(int value)
Sets status.
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...
int updateColumnFT(CoinIndexedVector ®ionSparseFT)
Updates one column (FTRAN) Tries to do FT update number returned is negative if no room...
void zeroTolerance(double value)
Set zero tolerance.
double areaFactor() const
Whether larger areas needed.
virtual int updateColumnFT(CoinIndexedVector ®ionSparse)=0
Updates one column (FTRAN) from unpacked regionSparse Tries to do FT update number returned is negati...
void pivotTolerance(double value)
Set pivot tolerance.
int getDenseThreshold() const
int status() const
Returns status.
void checkReplacePart1a(CoinIndexedVector *regionSparse, int pivotRow)
Checks if can replace one Column to basis, returns update alpha Fills in region for use later partial...
double pivotTolerance() const
Pivot tolerance.
void checkMarkArrays() const
double pivotTolerance() const
Pivot tolerance.
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, 3=no room, 5 max pivots.
int goLongThreshold() const
Get switch to long/ordered if number rows >= this.
void clearArrays()
Get rid of all memory.
void setFactorization(AbcSimplexFactorization &rhs)
Sets factorization.
virtual void updateColumnCpu(CoinIndexedVector ®ionSparse, int whichCpu) const
Updates one column (FTRAN)
void maximumPivots(int value)
Set maximum number of pivots between factorizations.
void updateColumnTransposeCpu(CoinIndexedVector ®ionSparse, int whichCpu) const
Updates one column (BTRAN)
void goSparse()
makes a row copy of L for speed and to allow very sparse problems
void setStatus(int value)
Sets status.
void updateWeights(CoinIndexedVector ®ionSparse) const
Updates one column for dual steepest edge weights (FTRAN)
void updateFullColumnTranspose(CoinIndexedVector ®ionSparse) const
Updates one full column (BTRAN)
int status() const
Returns status.
void forceOtherFactorization(int which)
If nonzero force use of 1,dense 2,small 3,long.
virtual int updateColumn(CoinIndexedVector ®ionSparse) const =0
This version has same effect as above with FTUpdate==false so number returned is always >=0...
virtual void checkReplacePart1a(CoinIndexedVector *, int)
virtual int numberElements() const =0
Total number of elements in factorization.
void replaceColumnPart3(const AbcSimplex *model, CoinIndexedVector *regionSparse, CoinIndexedVector *tableauColumn, int pivotRow, double alpha)
Replaces one Column to basis, partial update already in U.
void setPivots(int value)
Sets number of pivots since factorization.
CoinAbcAnyFactorization * factorization() const
Pointer to factorization.
void setGoSmallThreshold(int value)
Set switch to small if number rows <= this.
double zeroTolerance() const
Zero tolerance.
int numberDense() const
Returns number of dense rows.
double minimumPivotTolerance() const
Minimum pivot tolerance.
int goSmallThreshold() const
Get switch to small if number rows <= this.
double minimumPivotTolerance() const
Minimum pivot tolerance.
virtual double checkReplacePart1b(CoinIndexedVector *, int)
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.
void almostDestructor()
Allows change of pivot accuracy check 1.0 == none >1.0 relaxed.
virtual bool wantsTableauColumn() const
Returns true if wants tableauColumn in replaceColumn.
void setPivots(int value) const
Sets number of pivots since factorization.
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, 3=no room, 5 max pivots.
int maximumPivots() const
Maximum number of pivots between factorizations.
double checkReplacePart1(CoinIndexedVector *regionSparse, int pivotRow)
Checks if can replace one Column to basis, returns update alpha Fills in region for use later partial...
void setGoDenseThreshold(int value)
Set switch to dense if number rows <= this.
int numberRows() const
Number of Rows after factorization.
double * pivotRegion() const
pivot region
void setDenseThreshold(int number)
So we can temporarily switch off dense.
double zeroTolerance() const
Zero tolerance.
void updateColumnCpu(CoinIndexedVector ®ionSparse, int whichCpu) const
Updates one column (FTRAN)
int pivots() const
Returns number of pivots since factorization.
virtual void checkMarkArrays() const
void minimumPivotTolerance(double value)
Set minimum pivot tolerance.
void goDenseOrSmall(int numberRows)
Go over to dense code.
virtual void clearArrays()
Get rid of all memory.
double areaFactor() const
Area factor.
int updateColumn(CoinIndexedVector ®ionSparse) const
Updates one column (FTRAN)
int maximumPivots() const
Maximum number of pivots between factorizations.
void updateColumnFTPart2(CoinIndexedVector ®ionSparseFT)
bool timeToRefactorize() const
virtual CoinFactorizationDouble * pivotRegion() const
virtual void updateColumnFTPart2(CoinIndexedVector ®ionSparse)=0