6#ifndef AbcSimplexFactorization_H
7#define AbcSimplexFactorization_H
9#include "CoinPragma.hpp"
16#ifndef ABC_USE_COIN_FACTORIZATION
18class CoinFactorization;
21#include "CoinFactorization.hpp"
76#ifdef ABC_LONG_FACTORIZATION
90#ifdef ABC_LONG_FACTORIZATION
95 CoinIndexedVector *partialUpdate,
100#ifdef MOVE_REPLACE_PART1A
105 inline void checkReplacePart1a(CoinIndexedVector *regionSparse,
110 inline double checkReplacePart1b(CoinIndexedVector *regionSparse,
121#ifdef ABC_LONG_FACTORIZATION
128#ifdef ABC_LONG_FACTORIZATION
130 inline void clearHiddenArrays()
138 CoinIndexedVector *regionSparse,
139 CoinIndexedVector *tableauColumn,
141#ifdef ABC_LONG_FACTORIZATION
148 CoinIndexedVector *regionSparse,
149 CoinIndexedVector *tableauColumn,
150 CoinIndexedVector *partialUpdate,
152#ifdef ABC_LONG_FACTORIZATION
156#ifdef EARLY_FACTORIZE
158 inline int replaceColumns(
const AbcSimplex *model,
159 CoinIndexedVector &stuff,
160 int firstPivot,
int lastPivot,
bool cleanUp)
176 CoinIndexedVector * regionSparse2);
180 CoinIndexedVector * regionSparse2)
const;
187 CoinIndexedVector * regionSparse2,
188 CoinIndexedVector * regionSparse3) ;
192 CoinIndexedVector * regionSparse2)
const;
213 CoinIndexedVector &partialUpdate,
228 CoinIndexedVector ®ionSparseOther)
239#ifndef ABC_USE_COIN_FACTORIZATION
250#ifndef ABC_USE_COIN_FACTORIZATION
271#ifndef ABC_USE_COIN_FACTORIZATION
352 inline void setParallelMode(
int value)
363#if CLP_FACTORIZATION_NEW_TIMING > 1
364 void statsRefactor(
char when)
const;
466#ifndef ABC_USE_COIN_FACTORIZATION
484#ifndef ABC_USE_COIN_FACTORIZATION
504#ifndef ABC_USE_COIN_FACTORIZATION
509#ifdef CLP_FACTORIZATION_NEW_TIMING
511 mutable double shortestAverage_;
512 mutable double totalInR_;
513 mutable double totalInIncreasingU_;
514 mutable int endLengthU_;
515 mutable int lastNumberPivots_;
516 mutable int effectiveStartNumberU_;
This just implements AbcFactorization when an AbcMatrix object is passed.
void checkMarkArrays() const
int updateTwoColumnsFT(CoinIndexedVector ®ionSparseFT, CoinIndexedVector ®ionSparseOther)
Updates one column (FTRAN) from regionFT Tries to do FT update number returned is negative if no room...
AbcSimplexFactorization(const AbcSimplexFactorization &, int denseIfSmaller=0)
The copy constructor.
int factorize(AbcSimplex *model, int solveType, bool valuesPass)
When part of LP - given by basic variables.
void zeroTolerance(double value)
Set zero tolerance.
int goSmallThreshold_
Switch to small if number rows <= this.
int goDenseThreshold() const
Get switch to dense if number rows <= this.
void almostDestructor()
Allows change of pivot accuracy check 1.0 == none >1.0 relaxed.
void pivotTolerance(double value)
Set pivot tolerance.
int numberElements() const
Total number of elements in factorization.
bool needToReorder() const
Says whether to redo pivot order.
int goLongThreshold_
Switch to long/ordered if number rows >= this.
void updateFullColumn(CoinIndexedVector ®ionSparse) const
Updates one full column (FTRAN)
AbcSimplex * model_
Pointer to model.
int numberSlacks() const
Number of slacks at last factorization.
double * pivotRegion() const
pivot region
int pivots() const
Returns number of pivots since factorization.
void updateColumnFT(CoinIndexedVector ®ionSparseFT, CoinIndexedVector &partialUpdate, int which)
Updates one column (FTRAN) Tries to do FT update puts partial update in vector.
int typeOfFactorization() const
Returns type.
CoinAbcAnyFactorization * coinAbcFactorization_
Pointer to factorization.
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...
bool timeToRefactorize() const
void goSparse()
makes a row copy of L for speed and to allow very sparse problems
double minimumPivotTolerance() const
Minimum pivot tolerance.
void synchronize(const ClpFactorization *otherFactorization, const AbcSimplex *model)
Synchronize stuff.
int getDenseThreshold() const
int numberRows() const
Number of Rows after factorization.
void saferTolerances(double zeroTolerance, double pivotTolerance)
Set tolerances to safer of existing and given.
int updateColumnFTPart1(CoinIndexedVector ®ionSparseFT)
CoinAbcAnyFactorization * factorization() const
Pointer to factorization.
void replaceColumnPart3(const AbcSimplex *model, CoinIndexedVector *regionSparse, CoinIndexedVector *tableauColumn, int pivotRow, double alpha)
Replaces one Column to basis, partial update already in U.
int goDenseThreshold_
Switch to dense if number rows <= this.
AbcSimplexFactorization(int numberRows=0)
Default constructor.
double pivotTolerance() const
Pivot tolerance.
void setDenseThreshold(int number)
So we can temporarily switch off dense.
void setPivots(int value) const
Sets number of pivots since factorization.
int maximumPivots() const
Maximum number of pivots between factorizations.
int forceB_
If nonzero force use of 1,dense 2,small 3,long.
void clearArrays()
Get rid of all memory.
void updateFullColumnTranspose(CoinIndexedVector ®ionSparse) const
Updates one full column (BTRAN)
void setGoSmallThreshold(int value)
Set switch to small if number rows <= this.
int numberSlacks_
Number of slacks at last factorization.
void areaFactor(double value)
Set whether larger areas needed.
int updateColumnTranspose(CoinIndexedVector ®ionSparse) const
Updates one column (BTRAN)
~AbcSimplexFactorization()
Destructor.
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.
int goSmallThreshold() const
Get switch to small if number rows <= this.
void updateColumnTransposeCpu(CoinIndexedVector ®ionSparse, int whichCpu) const
Updates one column (BTRAN)
void goDenseOrSmall(int numberRows)
Go over to dense code.
void setGoLongThreshold(int value)
Set switch to long/ordered if number rows >= this.
void forceOtherFactorization(int which)
If nonzero force use of 1,dense 2,small 3,long.
double zeroTolerance() const
Zero tolerance.
void setGoDenseThreshold(int value)
Set switch to dense if number rows <= this.
AbcSimplexFactorization & operator=(const AbcSimplexFactorization &)
void setFactorization(AbcSimplexFactorization &rhs)
Sets factorization.
void replaceColumnPart3(const AbcSimplex *model, CoinIndexedVector *regionSparse, CoinIndexedVector *tableauColumn, CoinIndexedVector *partialUpdate, int pivotRow, double alpha)
Replaces one Column to basis, partial update in vector.
int goLongThreshold() const
Get switch to long/ordered if number rows >= this.
void setModel(AbcSimplex *model)
Sets model.
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 setStatus(int value)
Sets status.
bool usingFT() const
Returns true if doing FT.
int status() const
Returns status.
void updateColumnCpu(CoinIndexedVector ®ionSparse, int whichCpu) const
Updates one column (FTRAN)
void updateWeights(CoinIndexedVector ®ionSparse) const
Updates one column for dual steepest edge weights (FTRAN)
void maximumPivots(int value)
Set maximum number of pivots between factorizations.
int numberDense() const
Returns number of dense rows.
void updateColumnFTPart2(CoinIndexedVector ®ionSparseFT)
void minimumPivotTolerance(double value)
Set minimum pivot tolerance.
int updateColumn(CoinIndexedVector ®ionSparse) const
Updates one column (FTRAN)
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,...
This just implements CoinFactorization when an ClpMatrixBase object is passed.
Abstract base class which also has some scalars so can be used from Dense or Simp.
void setStatus(int value)
Sets status.
virtual int numberElements() const =0
Total number of elements in factorization.
virtual int updateTwoColumnsFT(CoinIndexedVector ®ionFT, CoinIndexedVector ®ionOther)=0
does FTRAN on two unpacked columns
virtual void updateFullColumnTranspose(CoinIndexedVector ®ionSparse) const =0
Updates one column (BTRAN) from unpacked regionSparse.
double zeroTolerance() const
Zero tolerance.
double pivotTolerance() const
Pivot tolerance.
int pivots() const
Returns number of pivots since factorization.
virtual double checkReplacePart1b(CoinIndexedVector *, int)
int maximumPivots() const
Maximum number of pivots between factorizations.
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 void updateWeights(CoinIndexedVector ®ionSparse) const =0
Updates one column for dual steepest edge weights (FTRAN)
virtual CoinFactorizationDouble * pivotRegion() const
virtual void clearArrays()
Get rid of all memory.
void setPivots(int value)
Sets number of pivots since factorization.
virtual void updateColumnFTPart2(CoinIndexedVector ®ionSparse)=0
virtual int updateColumnFTPart1(CoinIndexedVector ®ionSparse)=0
virtual int updateColumn(CoinIndexedVector ®ionSparse) const =0
This version has same effect as above with FTUpdate==false so number returned is always >=0.
virtual bool wantsTableauColumn() const
Returns true if wants tableauColumn in replaceColumn.
virtual int updateColumnFT(CoinIndexedVector ®ionSparse)=0
Updates one column (FTRAN) from unpacked regionSparse Tries to do FT update number returned is negati...
virtual void checkReplacePart1a(CoinIndexedVector *, int)
double areaFactor() const
Area factor.
virtual int updateColumnTranspose(CoinIndexedVector ®ionSparse) const =0
Updates one column (BTRAN) from unpacked regionSparse.
int numberRows() const
Number of Rows after factorization.
int status() const
Returns status.
virtual void updateFullColumn(CoinIndexedVector ®ionSparse) const =0
This version does FTRAN on array when indices not set up.
virtual void updateColumnTransposeCpu(CoinIndexedVector ®ionSparse, int whichCpu) 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...
CoinSimplexInt numberDense() const
Number of dense rows after factorization.
double minimumPivotTolerance() const
Minimum pivot tolerance.
virtual void updateColumnCpu(CoinIndexedVector ®ionSparse, int whichCpu) const
Updates one column (FTRAN)
virtual void checkMarkArrays() const