Go to the documentation of this file.
6 #ifndef ClpFactorization_H
7 #define ClpFactorization_H
16 #ifndef CLP_MULTIPLE_FACTORIZATIONS
17 #define CLP_MULTIPLE_FACTORIZATIONS 4
19 #ifdef CLP_MULTIPLE_FACTORIZATIONS
23 #ifndef COIN_FAST_CODE
24 #define COIN_FAST_CODE
26 #ifndef CLP_FACTORIZATION_NEW_TIMING
27 #define CLP_FACTORIZATION_NEW_TIMING 1
71 #ifdef CLP_MULTIPLE_FACTORIZATIONS
94 bool checkBeforeModifying =
false,
95 double acceptablePivot = 1.0e-8);
96 #if ABOCA_LITE_FACTORIZATION
119 bool noPermute =
false)
const;
128 bool noPermuteRegion3 =
false);
132 bool noPermute =
false)
const;
145 #ifdef CLP_MULTIPLE_FACTORIZATIONS
151 if (coinFactorizationA_)
159 if (coinFactorizationA_)
160 return coinFactorizationA_->
permute();
162 return coinFactorizationB_->
permute();
167 if (coinFactorizationA_)
170 return coinFactorizationB_->
permute();
175 if (coinFactorizationA_)
183 if (coinFactorizationA_)
191 if (coinFactorizationA_)
192 return coinFactorizationA_->
pivots();
194 return coinFactorizationB_->
pivots();
199 if (coinFactorizationA_)
207 if (coinFactorizationA_)
213 if (coinFactorizationA_)
221 if (coinFactorizationA_)
231 if (coinFactorizationA_)
239 if (coinFactorizationA_)
245 if (coinFactorizationA_)
246 return coinFactorizationA_->
status();
248 return coinFactorizationB_->
status();
253 if (coinFactorizationA_)
261 if (coinFactorizationA_)
270 if (coinFactorizationA_)
278 if (coinFactorizationA_)
286 if (coinFactorizationA_)
293 #if CLP_FACTORIZATION_NEW_TIMING > 1
294 void statsRefactor(
char when)
const;
299 if (coinFactorizationA_)
307 if (coinFactorizationA_)
313 if (coinFactorizationA_)
315 else if (coinFactorizationB_)
321 if (coinFactorizationA_)
329 if (coinFactorizationA_)
337 if (coinFactorizationA_)
343 if (coinFactorizationA_)
345 else if (coinFactorizationB_)
352 if (coinFactorizationA_)
354 else if (coinFactorizationB_)
360 if (coinFactorizationA_)
370 if (coinFactorizationA_)
377 if (coinFactorizationA_)
383 if (coinFactorizationA_)
385 else if (coinFactorizationB_)
391 if (coinFactorizationA_)
398 if (coinFactorizationA_)
404 if (coinFactorizationA_)
410 if (coinFactorizationA_) {
412 #ifndef COIN_FAST_CODE
423 return goOslThreshold_;
428 goOslThreshold_ = value;
433 return goDenseThreshold_;
438 goDenseThreshold_ = value;
443 return goSmallThreshold_;
448 goSmallThreshold_ = value;
457 return coinFactorizationB_ ? 1 : 0;
462 return coinFactorizationA_;
473 #ifndef COIN_FAST_CODE
479 inline void goDense() {}
494 doStatistics_ = trueFalse;
500 return (networkBasis_ != NULL);
521 #ifdef CLP_MULTIPLE_FACTORIZATIONS
526 #ifdef CLP_REUSE_ETAS
535 int goSmallThreshold_;
537 int goDenseThreshold_;
539 #ifdef CLP_FACTORIZATION_NEW_TIMING
540 mutable double shortestAverage_;
542 mutable double totalInR_;
543 mutable double totalInIncreasingU_;
544 mutable int endLengthU_;
545 mutable int lastNumberPivots_;
546 mutable int effectiveStartNumberU_;
548 mutable bool doStatistics_;
int factorize(ClpSimplex *model, int solveType, bool valuesPass)
When part of LP - given by basic variables.
This solves LPs using the simplex method.
int messageLevel() const
Level of detail of messages.
This just implements CoinFactorization when an ClpMatrixBase object is passed.
void relaxAccuracyCheck(double value)
virtual int numberElements() const=0
void forceOtherFactorization(int which)
If nonzero force use of 1,dense 2,small 3,osl.
void setFactorization(ClpFactorization &factorization)
Sets factorization.
int goSmallThreshold() const
Get switch to small if number rows <= this.
void setForrestTomlin(bool value)
true if Forrest Tomlin update, false if PFI
double pivotTolerance() const
double adjustedAreaFactor() const
int maximumPivots() const
void setDenseThreshold(int value)
CoinBigIndex numberElementsR() const
Returns number in R area.
void setDefaultValues()
Sets default values.
int updateTwoColumnsFT(CoinIndexedVector *regionSparse1, CoinIndexedVector *regionSparse2, CoinIndexedVector *regionSparse3, bool noPermuteRegion3=false)
Updates one column (FTRAN) from region2 Tries to do FT update number returned is negative if no room.
void setDenseThreshold(int value)
Sets dense threshold.
void maximumPivots(int value)
Set maximum number of pivots between factorizations.
int goDenseThreshold() const
Get switch to dense if number rows <= this.
int maximumPivots() const
void almostDestructor()
Delete all stuff (leaves as after CoinFactorization())
virtual void clearArrays()
int sparseThreshold() const
void setBiasLU(int value)
int numberDense() const
Returns number of dense rows.
void setPersistenceFlag(int value)
double zeroTolerance() const
void relaxAccuracyCheck(double value)
Allows change of pivot accuracy check 1.0 == none >1.0 relaxed.
void saferTolerances(double zeroTolerance, double pivotTolerance)
Set tolerances to safer of existing and given.
int goOslThreshold() const
Get switch to osl if number rows <= this.
int numberElementsR() const
void getWeights(int *weights) const
Fills weighted row list.
int numberElementsL() const
void zeroTolerance(double value)
Set zero tolerance.
void setGoDenseThreshold(int value)
Set switch to dense if number rows <= this.
void setForrestTomlin(bool value)
void setStatus(int value)
CoinBigIndex numberElementsL() const
Returns number in L area.
void goDenseOrSmall(int numberRows)
Go over to dense or small code if small enough.
void setStatus(int value)
double areaFactor() const
int pivots() const
Returns number of pivots since factorization.
double pivotTolerance() const
~ClpFactorization()
Destructor.
bool networkBasis() const
Says if a network basis.
This deals with Factorization and Updates for network structures.
void cleanUp()
Cleans up i.e. gets rid of network basis.
bool needToReorder() const
Says whether to redo pivot order.
CoinBigIndex numberElementsU() const
Returns number in U area.
void messageLevel(int value)
Set level of detail of messages.
double zeroTolerance() const
CoinFactorization * coinFactorization() const
Return coinFactorizationA_.
Abstract base class for Clp Matrices.
int replaceColumn(const ClpSimplex *model, CoinIndexedVector *regionSparse, CoinIndexedVector *tableauColumn, int pivotRow, double pivotCheck, bool checkBeforeModifying=false, double acceptablePivot=1.0e-8)
Replaces one Column to basis, returns 0=OK, 1=Probably OK, 2=singular, 3=no room If checkBeforeModify...
void doStatistics(bool trueFalse) const
To switch statistics on or off.
int maximumPivots() const
Maximum number of pivots between factorizations.
double adjustedAreaFactor() const
Returns areaFactor but adjusted for dense.
int numberRows() const
Number of Rows after factorization.
double areaFactor() const
Whether larger areas needed.
int updateColumnForDebug(CoinIndexedVector *regionSparse, CoinIndexedVector *regionSparse2, bool noPermute=false) const
For debug (no statistics update)
ClpFactorization & operator=(const ClpFactorization &)
int * pivotColumn() const
Returns address of pivotColumn region (also used for permuting)
int numberElementsU() const
void setPersistenceFlag(int value)
int updateColumnTranspose(CoinIndexedVector *regionSparse, CoinIndexedVector *regionSparse2) const
Updates one column (BTRAN) from region2 region1 starts as zero and is zero at end.
void setBiasLU(int value)
int status() const
Returns status.
int numberElements() const
Total number of elements in factorization.
virtual int * permute() const=0
#define CLP_MULTIPLE_FACTORIZATIONS
void updateTwoColumnsTranspose(CoinIndexedVector *regionSparse, CoinIndexedVector *regionSparse2, CoinIndexedVector *regionSparse3) const
Updates two columns (BTRAN) from regionSparse2 and 3 regionSparse starts as zero and is zero at end N...
void clearArrays()
Get rid of all memory.
ClpFactorization()
Default constructor.
int * pivotColumn() const
void setGoOslThreshold(int value)
Set switch to osl if number rows <= this.
int numberElements() const
void setGoSmallThreshold(int value)
Set switch to small if number rows <= this.
void areaFactor(double value)
Set whether larger areas needed.
int denseThreshold() const
Gets dense threshold.
void setStatus(int value)
Sets status.
void goSparse()
makes a row copy of L for speed and to allow very sparse problems
int persistenceFlag() const
int sparseThreshold() const
get sparse threshold
bool timeToRefactorize() const
double slackValue() const
int updateColumn(CoinIndexedVector *regionSparse, CoinIndexedVector *regionSparse2, bool noPermute=false) const
Updates one column (FTRAN) from region2 region1 starts as zero and is zero at end.
int isDenseOrSmall() const
Return 1 if dense code.
int persistenceFlag() const
Array persistence flag If 0 then as now (delete/new) 1 then only do arrays if bigger needed 2 as 1 bu...
int updateColumnFT(CoinIndexedVector *regionSparse, CoinIndexedVector *regionSparse2)
Updates one column (FTRAN) from region2 Tries to do FT update number returned is negative if no room ...
double zeroTolerance() const
Zero tolerance.
void sparseThreshold(int value)
Set sparse threshold.
int * permute() const
Returns address of permute region.
void pivotTolerance(double value)
Set pivot tolerance.
double pivotTolerance() const
Pivot tolerance.
int denseThreshold() const