Go to the documentation of this file.
12 #ifndef CoinAbcDenseFactorization_H
13 #define CoinAbcDenseFactorization_H
18 #include "CoinTypes.hpp"
20 #include "CoinIndexedVector.hpp"
21 class CoinPackedMatrix;
60 inline void setParallelMode(
int value)
63 parallelMode_ = value;
150 virtual CoinFactorizationDouble *
elements()
const;
154 virtual CoinFactorizationDouble *
workArea()
const;
162 virtual CoinBigIndex *
starts()
const;
200 virtual int *
indices()
const = 0;
203 virtual int *
permute()
const = 0;
214 CoinBigIndex maximumL,
215 CoinBigIndex maximumU)
226 #ifdef EARLY_FACTORIZE
227 virtual int factorize(
AbcSimplex * , CoinIndexedVector & )
233 virtual void postProcess(
const int *sequence,
int *pivotVariable) = 0;
246 virtual int checkReplace ( CoinIndexedVector * ,
255 virtual int replaceColumn ( CoinIndexedVector * regionSparse,
258 bool skipBtranU=
false,
259 double acceptablePivot=1.0e-8)=0;
261 #ifdef EARLY_FACTORIZE
262 virtual int replaceColumns(
const AbcSimplex * ,
264 CoinIndexedVector & ,
270 #ifdef ABC_LONG_FACTORIZATION
271 virtual void clearHiddenArrays() {}
279 #ifdef ABC_LONG_FACTORIZATION
289 #ifdef ABC_LONG_FACTORIZATION
294 CoinIndexedVector * ,
313 #ifdef ABC_LONG_FACTORIZATION
317 double acceptablePivot = 1.0e-8)
322 CoinIndexedVector *regionSparse,
323 CoinIndexedVector *tableauColumn,
325 #ifdef ABC_LONG_FACTORIZATION
333 CoinIndexedVector *regionSparse,
334 CoinIndexedVector *tableauColumn,
335 CoinIndexedVector *partialUpdate,
337 #ifdef ABC_LONG_FACTORIZATION
355 CoinIndexedVector &partialUpdate,
360 virtual int updateColumn(CoinIndexedVector ®ionSparse)
const = 0;
363 CoinIndexedVector ®ionOther)
374 virtual void updateWeights(CoinIndexedVector ®ionSparse)
const = 0;
376 virtual void updateColumnCpu(CoinIndexedVector ®ionSparse,
int whichCpu)
const;
394 #define slackValue2_ 1.0
416 #if ABC_PARALLEL == 2
466 CoinBigIndex maximumL,
467 CoinBigIndex maximumU);
478 virtual void postProcess(
const int *sequence,
int *pivotVariable);
504 bool skipBtranU =
false,
505 double acceptablePivot = 1.0e-8);
511 #ifdef ABC_LONG_FACTORIZATION
515 double acceptablePivot = 1.0e-8);
519 CoinIndexedVector *regionSparse,
520 CoinIndexedVector *tableauColumn,
522 #ifdef ABC_LONG_FACTORIZATION
529 CoinIndexedVector *regionSparse,
530 CoinIndexedVector *tableauColumn,
531 CoinIndexedVector * ,
533 #ifdef ABC_LONG_FACTORIZATION
560 virtual void updateColumnFT(CoinIndexedVector ®ionSparseFT, CoinIndexedVector & ,
int )
566 virtual int updateColumn(CoinIndexedVector ®ionSparse)
const;
569 CoinIndexedVector ®ionOther);
585 virtual void updateWeights(CoinIndexedVector ®ionSparse)
const;
621 int checkPivot(
double saveFromU,
double oldPivot)
const;
CoinAbcAnyFactorization()
Default constructor.
virtual CoinBigIndex * starts() const
Returns array to put basis starts in.
virtual int * permute() const =0
Returns permute in.
virtual int updateColumnFT(CoinIndexedVector ®ionSparse)
Updates one column (FTRAN) from unpacked regionSparse Tries to do FT update number returned is negati...
void gutsOfCopy(const CoinAbcDenseFactorization &other)
The real work of copy.
int numberPivots_
Number pivots since last factorization.
virtual int updateColumnTranspose(CoinIndexedVector ®ionSparse) const =0
Updates one column (BTRAN) from unpacked regionSparse.
Abstract base class which also has some scalars so can be used from Dense or Simp.
CoinSimplexInt numberDense() const
Number of dense rows after factorization.
int numberRows() const
Number of Rows after factorization.
int status_
Status of factorization.
double minimumPivotTolerance_
Minimum pivot tolerance.
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.
virtual int updateColumnFT(CoinIndexedVector ®ionSparse)=0
Updates one column (FTRAN) from unpacked regionSparse Tries to do FT update number returned is negati...
double maximumCoefficient() const
Returns maximum absolute value in factorization.
virtual CoinFactorizationDouble * pivotRegion() const
This deals with Factorization and Updates This is a simple dense version so other people can write a ...
virtual void makeNonSingular(int *sequence)
Makes a non-singular basis by replacing variables.
virtual void clearArrays()
Get rid of all memory.
virtual CoinFactorizationDouble * elements() const
Returns array to put basis elements in.
void setNumberSlacks(int value)
Sets number of slacks.
virtual int factor(AbcSimplex *model)=0
Does most of factorization returning status 0 - OK -99 - needs more memory -1 - singular - use number...
CoinBigIndex factorElements_
Number of elements after factorization.
virtual void makeNonSingular(int *sequence)=0
Makes a non-singular basis by replacing variables.
virtual CoinAbcAnyFactorization * clone() const
Clone.
virtual void replaceColumnPart3(const AbcSimplex *model, CoinIndexedVector *regionSparse, CoinIndexedVector *tableauColumn, int pivotRow, double alpha)=0
Replaces one Column to basis, partial update already in U.
double getAccuracyCheck() const
virtual CoinAbcAnyFactorization * clone() const =0
Clone.
int status() const
Returns status.
virtual CoinFactorizationDouble * workArea() const
Returns work area.
virtual int * numberInColumn() const
Number of entries in each column.
CoinFactorizationDouble * workArea_
Work area of numberRows_.
virtual int replaceColumn(CoinIndexedVector *regionSparse, int pivotRow, double pivotCheck, bool skipBtranU=false, double acceptablePivot=1.0e-8)
Replaces one Column to basis, returns 0=OK, 1=Probably OK, 2=singular, 3=no room If skipBtranU is fal...
CoinAbcDenseFactorization()
Default constructor.
virtual void postProcess(const int *sequence, int *pivotVariable)
Does post processing on valid factorization - putting variables on correct rows.
int maximumPivots_
Maximum number of pivots before factorization.
CoinFactorizationDouble * elements_
Elements of factorization and updates length is maxR*maxR+maxSpace will always be long enough so can ...
virtual int * numberInRow() const
Number of entries in each row.
virtual ~CoinAbcAnyFactorization()
Destructor.
virtual void setUsefulInformation(const int *info, int whereFrom)
Useful information for factorization 0 - iteration number whereFrom is 0 for factorize and 1 for repl...
virtual void updateColumnFT(CoinIndexedVector ®ionSparseFT, CoinIndexedVector &, int)
virtual double checkReplacePart1(CoinIndexedVector *, CoinIndexedVector *, int)
virtual void updateFullColumnTranspose(CoinIndexedVector ®ionSparse) const =0
Updates one column (BTRAN) from unpacked regionSparse.
virtual void updateFullColumnTranspose(CoinIndexedVector ®ionSparse) const
Updates one column (BTRAN) from unpacked regionSparse.
CoinAbcAnyFactorization & operator=(const CoinAbcAnyFactorization &other)
= copy
virtual void updateFullColumn(CoinIndexedVector ®ionSparse) const
This version does FTRAN on array when indices not set up.
int numberSlacks() const
Returns number of slacks.
double relaxCheck_
Relax check on accuracy in replaceColumn.
CoinBigIndex maximumSpace_
Maximum length of iterating area.
virtual int * indices() const
Returns array to put basis indices in.
virtual void updateColumnFTPart2(CoinIndexedVector &)
virtual int factor(AbcSimplex *model)
Does most of factorization returning status 0 - OK -99 - needs more memory -1 - singular - use number...
int numberSlacks_
Number slacks.
virtual int updateTwoColumnsFT(CoinIndexedVector ®ionFT, CoinIndexedVector ®ionOther)=0
does FTRAN on two unpacked columns
virtual int updateColumnFTPart1(CoinIndexedVector ®ionSparse)=0
int numberDense_
Number of dense rows in factorization.
virtual int updateColumn(CoinIndexedVector ®ionSparse) const
This version has same effect as above with FTUpdate==false so number returned is always >=0.
int maximumRows_
Maximum rows ever (i.e. use to copy arrays etc)
int solveMode() const
Get solve mode e.g.
double zeroTolerance() const
Zero tolerance.
virtual void preProcess()
PreProcesses column ordered copy of basis.
virtual void postProcess(const int *sequence, int *pivotVariable)=0
Does post processing on valid factorization - putting variables on correct rows.
void gutsOfDestructor()
The real work of desstructor.
virtual void updateWeights(CoinIndexedVector ®ionSparse) const
Updates one column for dual steepest edge weights (FTRAN)
void clearArrays()
Get rid of all memory.
CoinAbcDenseFactorization & operator=(const CoinAbcDenseFactorization &other)
= copy
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.
virtual void preProcess()=0
PreProcesses column ordered copy of basis.
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,...
double pivotTolerance_
Pivot tolerance.
CoinSimplexInt maximumRowsAdjusted_
Use for array size to get multiple of 8.
virtual bool wantsTableauColumn() const
Returns true if wants tableauColumn in replaceColumn.
void gutsOfInitialize()
The real work of constructor.
double pivotTolerance() const
Pivot tolerance.
void relaxAccuracyCheck(double value)
Allows change of pivot accuracy check 1.0 == none >1.0 relaxed.
virtual int * permuteBack() const
Returns permute back.
int numberGoodU_
Number factorized in U (not row singletons)
double areaFactor_
Area factor.
void setSolveMode(int value)
Set solve mode e.g.
int checkPivot(double saveFromU, double oldPivot) const
Returns accuracy status of replaceColumn returns 0=OK, 1=Probably OK, 2=singular.
virtual int updateColumnFTPart1(CoinIndexedVector ®ionSparse)
virtual int * permute() const
Returns permute in.
virtual int updateColumnTranspose(CoinIndexedVector ®ionSparse) const
Updates one column (BTRAN) from unpacked regionSparse.
virtual int * pivotColumn() const
Returns pivotColumn or permute.
virtual void replaceColumnPart3(const AbcSimplex *model, CoinIndexedVector *regionSparse, CoinIndexedVector *tableauColumn, int pivotRow, double alpha)
Replaces one Column to basis, partial update already in U.
virtual void updateColumnFTPart2(CoinIndexedVector ®ionSparse)=0
virtual int * intWorkArea() const
Returns int work area.
virtual void goSparse()
Sees whether to go sparse.
double zeroTolerance_
Zero tolerance.
virtual void updateColumnTransposeCpu(CoinIndexedVector ®ionSparse, int whichCpu) const
Updates one column (BTRAN)
int solveMode_
Solve mode e.g.
int * pivotRow_
Pivot row.
int maximumPivots() const
Maximum number of pivots between factorizations.
void setNumberRows(int value)
Set number of Rows after factorization.
virtual int * indices() const =0
Returns array to put basis indices in.
void setStatus(int value)
Sets status.
virtual int updateColumn(CoinIndexedVector ®ionSparse) const =0
This version has same effect as above with FTUpdate==false so number returned is always >=0.
virtual int checkReplacePart2(int pivotRow, double btranAlpha, double ftranAlpha, double ftAlpha, double acceptablePivot=1.0e-8)
Checks if can replace one Column to basis, returns 0=OK, 1=Probably OK, 2=singular,...
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)
virtual void replaceColumnPart3(const AbcSimplex *model, CoinIndexedVector *regionSparse, CoinIndexedVector *tableauColumn, CoinIndexedVector *, int pivotRow, double alpha)
Replaces one Column to basis, partial update in vector.
int numberRows_
Number of Rows in factorization.
int numberGoodColumns() const
Number of good columns in factorization.
virtual int updateTwoColumnsFT(CoinIndexedVector ®ionFT, CoinIndexedVector ®ionOther)
does FTRAN on two unpacked columns
void areaFactor(CoinSimplexDouble value)
virtual int numberElements() const =0
Total number of elements in factorization.
virtual int numberElements() const
Total number of elements in factorization.
virtual void getAreas(int numberRows, int numberColumns, CoinBigIndex maximumL, CoinBigIndex maximumU)=0
Gets space for a factorization.
virtual ~CoinAbcDenseFactorization()
Destructor.
void setPivots(int value)
Sets number of pivots since factorization.
virtual double checkReplacePart1b(CoinIndexedVector *, int)
friend void CoinAbcDenseFactorizationUnitTest(const std::string &mpsDir)
virtual int * pivotRow() const
Returns pivot row.
virtual void getAreas(int numberRows, int numberColumns, CoinBigIndex maximumL, CoinBigIndex maximumU)
Gets space for a factorization.