Cgl 0.60.2

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CoinOslFactorization.hpp
Go to the documentation of this file.
1 /* $Id: CoinOslFactorization.hpp 2084 2019-01-09 14:17:08Z forrest $ */
2 // Copyright (C) 1987, 2009, International Business Machines
3 // Corporation and others. All Rights Reserved.
4 // This code is licensed under the terms of the Eclipse Public License (EPL).
5
6 /*
7 Authors
8
9 John Forrest
10
11 */
12 #ifndef CoinOslFactorization_H
13 #define CoinOslFactorization_H
14 #include <iostream>
15 #include <string>
16 #include <cassert>
17 #include "CoinTypes.hpp"
18 #include "CoinIndexedVector.hpp"
19 #include "CoinDenseFactorization.hpp"
20 class CoinPackedMatrix;
28 typedef struct {
29 int suc, pre;
30 } EKKHlink;
31 typedef struct _EKKfactinfo {
32 double drtpiv;
33 double demark;
34 double zpivlu;
35 double zeroTolerance;
36 double areaFactor;
37 int *xrsadr;
38 int *xcsadr;
39 int *xrnadr;
40 int *xcnadr;
41 int *krpadr;
42 int *kcpadr;
43 int *mpermu;
44 int *bitArray;
45 int *back;
46 char *nonzero;
47 double *trueStart;
48 mutable double *kadrpm;
49 int *R_etas_index;
50 int *R_etas_start;
51 double *R_etas_element;
52
53 int *xecadr;
54 int *xeradr;
55 double *xeeadr;
56 double *xe2adr;
57 EKKHlink *kp1adr;
58 EKKHlink *kp2adr;
59 double *kw1adr;
60 double *kw2adr;
61 double *kw3adr;
62 int *hpivcoR;
63 int nrow;
64 int nrowmx;
65 int firstDoRow;
66 int firstLRow;
67 int maxinv;
68 int nnetas;
69 int iterin;
70 int iter0;
71 int invok;
72 int nbfinv;
73 int num_resets;
74 int nnentl;
75 int nnentu;
76 #ifdef CLP_REUSE_ETAS
77 int save_nnentu;
78 #endif
79 int ndenuc;
80 int npivots; /* use as xpivsq in factorization */
81 int kmxeta;
82 int xnetal;
83 int first_dense;
84 int last_dense;
85 int iterno;
86 int numberSlacks;
87 int lastSlack;
88 int firstNonSlack;
89 int xnetalval;
90 int lstart;
91 int if_sparse_update;
92 mutable int packedMode;
93 int switch_off_sparse_update;
94 int nuspike;
95 bool rows_ok; /* replaces test using mrstrt[1] */
96 #ifdef CLP_REUSE_ETAS
97 mutable int reintro;
98 #endif
99 int nR_etas;
100 int sortedEta; /* if vector for F-T is sorted */
101 int lastEtaCount;
102 int ifvsol;
103 int eta_size;
104 int last_eta_size;
105 int maxNNetas;
106 } EKKfactinfo;
107
108 class CoinOslFactorization : public CoinOtherFactorization {
109 friend void CoinOslFactorizationUnitTest(const std::string &mpsDir);
110
111 public:
114 CoinOslFactorization();
117 CoinOslFactorization(const CoinOslFactorization &other);
118
120 virtual ~CoinOslFactorization();
122 CoinOslFactorization &operator=(const CoinOslFactorization &other);
124 virtual CoinOtherFactorization *clone() const;
126
129 virtual void getAreas(int numberRows,
131 int numberColumns,
132 int maximumL,
133 int maximumU);
134
136 virtual void preProcess();
142 virtual int factor();
144 virtual void postProcess(const int *sequence, int *pivotVariable);
146 virtual void makeNonSingular(int *sequence, int numberColumns);
154 int factorize(const CoinPackedMatrix &matrix,
155 int rowIsBasic[], int columnIsBasic[],
156 double areaFactor = 0.0);
158
161 virtual inline int numberElements() const
163 {
164 return numberRows_ * (numberColumns_ + numberPivots_);
165 }
167 virtual CoinFactorizationDouble *elements() const;
169 virtual int *pivotRow() const;
171 virtual CoinFactorizationDouble *workArea() const;
173 virtual int *intWorkArea() const;
175 virtual int *numberInRow() const;
177 virtual int *numberInColumn() const;
179 virtual int *starts() const;
181 virtual int *permuteBack() const;
183 virtual bool wantsTableauColumn() const;
188 virtual void setUsefulInformation(const int *info, int whereFrom);
190 virtual void maximumPivots(int value);
191
193 double maximumCoefficient() const;
195 double conditionNumber() const;
197 virtual void clearArrays();
199
202
210 virtual int replaceColumn(CoinIndexedVector *regionSparse,
211 int pivotRow,
212 double pivotCheck,
213 bool checkBeforeModifying = false,
214 double acceptablePivot = 1.0e-8);
216
226 virtual int updateColumnFT(CoinIndexedVector *regionSparse,
227 CoinIndexedVector *regionSparse2,
228 bool noPermute = false);
231 virtual int updateColumn(CoinIndexedVector *regionSparse,
232 CoinIndexedVector *regionSparse2,
233 bool noPermute = false) const;
235 virtual int updateTwoColumnsFT(CoinIndexedVector *regionSparse1,
236 CoinIndexedVector *regionSparse2,
237 CoinIndexedVector *regionSparse3,
238 bool noPermute = false);
243 virtual int updateColumnTranspose(CoinIndexedVector *regionSparse,
244 CoinIndexedVector *regionSparse2) const;
246
251 //inline void clearArrays()
253 //{ gutsOfDestructor();}
255 virtual int *indices() const;
257 virtual inline int *permute() const
258 {
259 return NULL; /*pivotRow_*/
260 ;
261 }
263
265 void gutsOfDestructor(bool clearFact = true);
267 void gutsOfInitialize(bool zapFact = true);
269 void gutsOfCopy(const CoinOslFactorization &other);
270
272 protected:
275 int checkPivot(double saveFromU, double oldPivot) const;
277 protected:
280 EKKfactinfo factInfo_;
283 };
284 #endif
285
286 /* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2
287 */
_EKKfactinfo::trueStart
double * trueStart
Definition: CoinOslFactorization.hpp:47
_EKKfactinfo::xe2adr
double * xe2adr
Definition: CoinOslFactorization.hpp:56
_EKKfactinfo::R_etas_start
int * R_etas_start
Definition: CoinOslFactorization.hpp:50
_EKKfactinfo::kmxeta
int kmxeta
Definition: CoinOslFactorization.hpp:81
_EKKfactinfo::maxinv
int maxinv
Definition: CoinOslFactorization.hpp:67
_EKKfactinfo::ifvsol
int ifvsol
Definition: CoinOslFactorization.hpp:102
_EKKfactinfo::switch_off_sparse_update
int switch_off_sparse_update
Definition: CoinOslFactorization.hpp:93
CoinOslFactorization::updateColumnFT
virtual int updateColumnFT(CoinIndexedVector *regionSparse, CoinIndexedVector *regionSparse2, bool noPermute=false)
Updates one column (FTRAN) from regionSparse2 Tries to do FT update number returned is negative if no...
_EKKfactinfo::kw3adr
double * kw3adr
Definition: CoinOslFactorization.hpp:61
CoinOslFactorization::wantsTableauColumn
virtual bool wantsTableauColumn() const
Returns true if wants tableauColumn in replaceColumn.
_EKKfactinfo::iterno
int iterno
Definition: CoinOslFactorization.hpp:85
_EKKfactinfo::xcnadr
int * xcnadr
Definition: CoinOslFactorization.hpp:40
_EKKfactinfo::npivots
int npivots
Definition: CoinOslFactorization.hpp:80
CoinTypes.hpp
CoinOslFactorization::maximumCoefficient
double maximumCoefficient() const
Returns maximum absolute value in factorization.
CoinOtherFactorization
Abstract base class which also has some scalars so can be used from Dense or Simp.
Definition: CoinDenseFactorization.hpp:26
CoinOtherFactorization::numberPivots_
int numberPivots_
Number pivots since last factorization.
Definition: CoinDenseFactorization.hpp:277
_EKKfactinfo::numberSlacks
int numberSlacks
Definition: CoinOslFactorization.hpp:86
_EKKfactinfo::nnentl
int nnentl
Definition: CoinOslFactorization.hpp:74
CoinOslFactorization::permute
virtual int * permute() const
Returns permute in.
Definition: CoinOslFactorization.hpp:257
_EKKfactinfo::R_etas_element
double * R_etas_element
Definition: CoinOslFactorization.hpp:51
CoinOtherFactorization::numberRows_
int numberRows_
Number of Rows in factorization.
Definition: CoinDenseFactorization.hpp:269
CoinOslFactorization::updateTwoColumnsFT
virtual int updateTwoColumnsFT(CoinIndexedVector *regionSparse1, CoinIndexedVector *regionSparse2, CoinIndexedVector *regionSparse3, bool noPermute=false)
does FTRAN on two columns
CoinOslFactorization::CoinOslFactorizationUnitTest
friend void CoinOslFactorizationUnitTest(const std::string &mpsDir)
CoinOslFactorization::~CoinOslFactorization
virtual ~CoinOslFactorization()
Destructor.
_EKKfactinfo::firstLRow
int firstLRow
Definition: CoinOslFactorization.hpp:66
CoinOtherFactorization::numberRows
int numberRows() const
Number of Rows after factorization.
Definition: CoinDenseFactorization.hpp:73
CoinOslFactorization::indices
virtual int * indices() const
Get rid of all memory.
CoinOslFactorization::starts
virtual int * starts() const
Returns array to put basis starts in.
_EKKfactinfo
Definition: CoinOslFactorization.hpp:31
CoinOslFactorization::getAreas
virtual void getAreas(int numberRows, int numberColumns, int maximumL, int maximumU)
Gets space for a factorization.
_EKKfactinfo::sortedEta
int sortedEta
Definition: CoinOslFactorization.hpp:100
_EKKfactinfo::kp2adr
EKKHlink * kp2adr
Definition: CoinOslFactorization.hpp:58
CoinOslFactorization::postProcess
virtual void postProcess(const int *sequence, int *pivotVariable)
Does post processing on valid factorization - putting variables on correct rows.
_EKKfactinfo::R_etas_index
int * R_etas_index
Definition: CoinOslFactorization.hpp:49
_EKKfactinfo::nrow
int nrow
Definition: CoinOslFactorization.hpp:63
CoinOslFactorization::numberInColumn
virtual int * numberInColumn() const
Number of entries in each column.
_EKKfactinfo::lastSlack
int lastSlack
Definition: CoinOslFactorization.hpp:87
CoinOslFactorization::makeNonSingular
virtual void makeNonSingular(int *sequence, int numberColumns)
Makes a non-singular basis by replacing variables.
_EKKfactinfo::lstart
int lstart
Definition: CoinOslFactorization.hpp:90
CoinOslFactorization::updateColumn
virtual int updateColumn(CoinIndexedVector *regionSparse, CoinIndexedVector *regionSparse2, bool noPermute=false) const
This version has same effect as above with FTUpdate==false so number returned is always &gt;=0...
_EKKfactinfo::maxNNetas
int maxNNetas
Definition: CoinOslFactorization.hpp:105
_EKKfactinfo::nnetas
int nnetas
Definition: CoinOslFactorization.hpp:68
CoinOtherFactorization::maximumPivots
int maximumPivots() const
Maximum number of pivots between factorizations.
Definition: CoinDenseFactorization.hpp:97
_EKKfactinfo::demark
double demark
Definition: CoinOslFactorization.hpp:33
CoinFactorizationDouble
double CoinFactorizationDouble
Definition: CoinTypes.hpp:57
CoinOtherFactorization::numberColumns
int numberColumns() const
Total number of columns in factorization.
Definition: CoinDenseFactorization.hpp:78
CoinOslFactorization::gutsOfInitialize
void gutsOfInitialize(bool zapFact=true)
The real work of constructor.
_EKKfactinfo::eta_size
int eta_size
Definition: CoinOslFactorization.hpp:103
CoinOslFactorization::permuteBack
virtual int * permuteBack() const
Returns permute back.
_EKKfactinfo::packedMode
int packedMode
Definition: CoinOslFactorization.hpp:92
_EKKfactinfo::kw2adr
double * kw2adr
Definition: CoinOslFactorization.hpp:60
_EKKfactinfo::last_dense
int last_dense
Definition: CoinOslFactorization.hpp:84
_EKKfactinfo::xeeadr
double * xeeadr
Definition: CoinOslFactorization.hpp:55
CoinIndexedVector
Indexed Vector.
Definition: CoinIndexedVector.hpp:104
CoinOslFactorization::factInfo_
EKKfactinfo factInfo_
Osl factorization data.
Definition: CoinOslFactorization.hpp:281
_EKKfactinfo::mpermu
int * mpermu
Definition: CoinOslFactorization.hpp:43
CoinOslFactorization::updateColumnTranspose
virtual int updateColumnTranspose(CoinIndexedVector *regionSparse, CoinIndexedVector *regionSparse2) const
Updates one column (BTRAN) from regionSparse2 regionSparse starts as zero and is zero at end Note - i...
_EKKfactinfo::areaFactor
double areaFactor
Definition: CoinOslFactorization.hpp:36
_EKKfactinfo::xrnadr
int * xrnadr
Definition: CoinOslFactorization.hpp:39
_EKKfactinfo::hpivcoR
int * hpivcoR
Definition: CoinOslFactorization.hpp:62
_EKKfactinfo::iter0
int iter0
Definition: CoinOslFactorization.hpp:70
_EKKfactinfo::kcpadr
int * kcpadr
Definition: CoinOslFactorization.hpp:42
_EKKfactinfo::zpivlu
double zpivlu
Definition: CoinOslFactorization.hpp:34
_EKKfactinfo::xnetal
int xnetal
Definition: CoinOslFactorization.hpp:82
_EKKfactinfo::nR_etas
int nR_etas
Definition: CoinOslFactorization.hpp:99
_EKKfactinfo::firstNonSlack
int firstNonSlack
Definition: CoinOslFactorization.hpp:88
CoinOslFactorization::pivotRow
virtual int * pivotRow() const
Returns pivot row.
_EKKfactinfo::invok
int invok
Definition: CoinOslFactorization.hpp:71
_EKKfactinfo::xrsadr
int * xrsadr
Definition: CoinOslFactorization.hpp:37
CoinOslFactorization::conditionNumber
double conditionNumber() const
Condition number - product of pivots after factorization.
CoinOslFactorization::gutsOfDestructor
void gutsOfDestructor(bool clearFact=true)
The real work of desstructor.
CoinPackedMatrix
Sparse Matrix Base Class.
Definition: CoinPackedMatrix.hpp:79
CoinOslFactorization::factor
virtual int factor()
Does most of factorization returning status 0 - OK -99 - needs more memory -1 - singular - use number...
_EKKfactinfo::kp1adr
EKKHlink * kp1adr
Definition: CoinOslFactorization.hpp:57
CoinOslFactorization
Definition: CoinOslFactorization.hpp:108
CoinOslFactorization::setUsefulInformation
virtual void setUsefulInformation(const int *info, int whereFrom)
Useful information for factorization 0 - iteration number whereFrom is 0 for factorize and 1 for repl...
_EKKfactinfo::lastEtaCount
int lastEtaCount
Definition: CoinOslFactorization.hpp:101
_EKKfactinfo::bitArray
int * bitArray
Definition: CoinOslFactorization.hpp:44
CoinOslFactorization::numberInRow
virtual int * numberInRow() const
Number of entries in each row.
EKKHlink
This deals with Factorization and Updates This is ripped off from OSL!!!!!!!!!
Definition: CoinOslFactorization.hpp:28
_EKKfactinfo::nnentu
int nnentu
Definition: CoinOslFactorization.hpp:75
CoinOslFactorization::workArea
virtual CoinFactorizationDouble * workArea() const
Returns work area.
_EKKfactinfo::num_resets
int num_resets
Definition: CoinOslFactorization.hpp:73
CoinOslFactorization::factorize
int factorize(const CoinPackedMatrix &matrix, int rowIsBasic[], int columnIsBasic[], double areaFactor=0.0)
When part of LP - given by basic variables.
CoinOslFactorization::intWorkArea
virtual int * intWorkArea() const
Returns int work area.
CoinOslFactorization::preProcess
virtual void preProcess()
PreProcesses column ordered copy of basis.
CoinOslFactorization::replaceColumn
virtual int replaceColumn(CoinIndexedVector *regionSparse, 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...
EKKHlink::suc
int suc
Definition: CoinOslFactorization.hpp:29
_EKKfactinfo::xecadr
int * xecadr
Definition: CoinOslFactorization.hpp:53
CoinOslFactorization::clearArrays
virtual void clearArrays()
Get rid of all memory.
_EKKfactinfo::krpadr
int * krpadr
Definition: CoinOslFactorization.hpp:41
CoinOslFactorization::elements
virtual CoinFactorizationDouble * elements() const
Returns array to put basis elements in.
CoinOslFactorization::clone
virtual CoinOtherFactorization * clone() const
Clone.
_EKKfactinfo::nrowmx
int nrowmx
Definition: CoinOslFactorization.hpp:64
_EKKfactinfo::nbfinv
int nbfinv
Definition: CoinOslFactorization.hpp:72
_EKKfactinfo::xnetalval
int xnetalval
Definition: CoinOslFactorization.hpp:89
CoinIndexedVector.hpp
CoinOslFactorization::CoinOslFactorization
CoinOslFactorization()
Default constructor.
_EKKfactinfo::drtpiv
double drtpiv
Definition: CoinOslFactorization.hpp:32
_EKKfactinfo::xcsadr
int * xcsadr
Definition: CoinOslFactorization.hpp:38
_EKKfactinfo::last_eta_size
int last_eta_size
Definition: CoinOslFactorization.hpp:104
CoinOslFactorization::numberElements
virtual int numberElements() const
Total number of elements in factorization.
Definition: CoinOslFactorization.hpp:162
_EKKfactinfo::iterin
int iterin
Definition: CoinOslFactorization.hpp:69
_EKKfactinfo::xeradr
int * xeradr
Definition: CoinOslFactorization.hpp:54
CoinOslFactorization::operator=
CoinOslFactorization & operator=(const CoinOslFactorization &other)
= copy
_EKKfactinfo::kadrpm
double * kadrpm
Definition: CoinOslFactorization.hpp:48
CoinOslFactorization::gutsOfCopy
void gutsOfCopy(const CoinOslFactorization &other)
The real work of copy.
CoinOtherFactorization::numberColumns_
int numberColumns_
Number of Columns in factorization.
Definition: CoinDenseFactorization.hpp:271
_EKKfactinfo::zeroTolerance
double zeroTolerance
Definition: CoinOslFactorization.hpp:35
EKKfactinfo
struct _EKKfactinfo EKKfactinfo
_EKKfactinfo::if_sparse_update
int if_sparse_update
Definition: CoinOslFactorization.hpp:91
_EKKfactinfo::kw1adr
double * kw1adr
Definition: CoinOslFactorization.hpp:59
_EKKfactinfo::nonzero
char * nonzero
Definition: CoinOslFactorization.hpp:46
_EKKfactinfo::ndenuc
int ndenuc
Definition: CoinOslFactorization.hpp:79
_EKKfactinfo::firstDoRow
int firstDoRow
Definition: CoinOslFactorization.hpp:65
CoinOslFactorization::checkPivot
int checkPivot(double saveFromU, double oldPivot) const
Returns accuracy status of replaceColumn returns 0=OK, 1=Probably OK, 2=singular. ...
_EKKfactinfo::nuspike
int nuspike
Definition: CoinOslFactorization.hpp:94
CoinDenseFactorization.hpp
_EKKfactinfo::rows_ok
bool rows_ok
Definition: CoinOslFactorization.hpp:95
_EKKfactinfo::back
int * back
Definition: CoinOslFactorization.hpp:45
_EKKfactinfo::first_dense
int first_dense
Definition: CoinOslFactorization.hpp:83