Osi 0.107.7

- 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 1416 2011-04-17 09:57:29Z stefan $ */
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 {int suc, pre;} EKKHlink;
29 typedef struct _EKKfactinfo {
30 double drtpiv;
31 double demark;
32 double zpivlu;
33 double zeroTolerance;
34 double areaFactor;
35 int *xrsadr;
36 int *xcsadr;
37 int *xrnadr;
38 int *xcnadr;
39 int *krpadr;
40 int *kcpadr;
41 int *mpermu;
42 int *bitArray;
43 int * back;
44 char * nonzero;
45 double * trueStart;
46 mutable double *kadrpm;
47 int *R_etas_index;
48 int *R_etas_start;
49 double *R_etas_element;
50
51 int *xecadr;
52 int *xeradr;
53 double *xeeadr;
54 double *xe2adr;
55 EKKHlink * kp1adr;
56 EKKHlink * kp2adr;
57 double * kw1adr;
58 double * kw2adr;
59 double * kw3adr;
60 int * hpivcoR;
61 int nrow;
62 int nrowmx;
63 int firstDoRow;
64 int firstLRow;
65 int maxinv;
66 int nnetas;
67 int iterin;
68 int iter0;
69 int invok;
70 int nbfinv;
71 int num_resets;
72 int nnentl;
73 int nnentu;
74 #ifdef CLP_REUSE_ETAS
75 int save_nnentu;
76 #endif
77 int ndenuc;
78 int npivots; /* use as xpivsq in factorization */
79 int kmxeta;
80 int xnetal;
81 int first_dense;
82 int last_dense;
83 int iterno;
84 int numberSlacks;
85 int lastSlack;
86 int firstNonSlack;
87 int xnetalval;
88 int lstart;
89 int if_sparse_update;
90 mutable int packedMode;
91 int switch_off_sparse_update;
92 int nuspike;
93 bool rows_ok; /* replaces test using mrstrt[1] */
94 #ifdef CLP_REUSE_ETAS
95 mutable int reintro;
96 #endif
97 int nR_etas;
98 int sortedEta; /* if vector for F-T is sorted */
99 int lastEtaCount;
100 int ifvsol;
101 int eta_size;
102 int last_eta_size;
103 int maxNNetas;
104 } EKKfactinfo;
105
106 class CoinOslFactorization : public CoinOtherFactorization {
107 friend void CoinOslFactorizationUnitTest( const std::string & mpsDir );
108
109 public:
110
113 CoinOslFactorization ( );
116 CoinOslFactorization ( const CoinOslFactorization &other);
117
119 virtual ~CoinOslFactorization ( );
121 CoinOslFactorization & operator = ( const CoinOslFactorization & other );
123 virtual CoinOtherFactorization * clone() const ;
125
128 virtual void getAreas ( int numberRows,
130 int numberColumns,
131 CoinBigIndex maximumL,
132 CoinBigIndex maximumU );
133
135 virtual void preProcess ( );
141 virtual int factor ( );
143 virtual void postProcess(const int * sequence, int * pivotVariable);
145 virtual void makeNonSingular(int * sequence, int numberColumns);
153 int factorize ( const CoinPackedMatrix & matrix,
154 int rowIsBasic[], int columnIsBasic[] ,
155 double areaFactor = 0.0 );
157
160 virtual inline int numberElements ( ) const {
162 return numberRows_*(numberColumns_+numberPivots_);
163 }
165 virtual CoinFactorizationDouble * elements() const;
167 virtual int * pivotRow() const;
169 virtual CoinFactorizationDouble * workArea() const;
171 virtual int * intWorkArea() const;
173 virtual int * numberInRow() const;
175 virtual int * numberInColumn() const;
177 virtual CoinBigIndex * starts() const;
179 virtual int * permuteBack() const;
181 virtual bool wantsTableauColumn() const;
186 virtual void setUsefulInformation(const int * info,int whereFrom);
188 virtual void maximumPivots ( int value );
189
191 double maximumCoefficient() const;
193 double conditionNumber() const;
195 virtual void clearArrays();
197
200
208 virtual int replaceColumn ( CoinIndexedVector * regionSparse,
209 int pivotRow,
210 double pivotCheck ,
211 bool checkBeforeModifying=false,
212 double acceptablePivot=1.0e-8);
214
224 virtual int updateColumnFT ( CoinIndexedVector * regionSparse,
225 CoinIndexedVector * regionSparse2,
226 bool noPermute=false);
229 virtual int updateColumn ( CoinIndexedVector * regionSparse,
230 CoinIndexedVector * regionSparse2,
231 bool noPermute=false) const;
233 virtual int updateTwoColumnsFT(CoinIndexedVector * regionSparse1,
234 CoinIndexedVector * regionSparse2,
235 CoinIndexedVector * regionSparse3,
236 bool noPermute=false);
241 virtual int updateColumnTranspose ( CoinIndexedVector * regionSparse,
242 CoinIndexedVector * regionSparse2) const;
244
249 //inline void clearArrays()
251 //{ gutsOfDestructor();}
253 virtual int * indices() const;
255 virtual inline int * permute() const
256 { return NULL;/*pivotRow_*/;}
258
260 void gutsOfDestructor(bool clearFact=true);
262 void gutsOfInitialize(bool zapFact=true);
264 void gutsOfCopy(const CoinOslFactorization &other);
265
267 protected:
270 int checkPivot(double saveFromU, double oldPivot) const;
272 protected:
273
276 EKKfactinfo factInfo_;
279 };
280 #endif
_EKKfactinfo::trueStart
double * trueStart
Definition: CoinOslFactorization.hpp:45
_EKKfactinfo::xe2adr
double * xe2adr
Definition: CoinOslFactorization.hpp:54
_EKKfactinfo::R_etas_start
int * R_etas_start
Definition: CoinOslFactorization.hpp:48
_EKKfactinfo::kmxeta
int kmxeta
Definition: CoinOslFactorization.hpp:79
_EKKfactinfo::maxinv
int maxinv
Definition: CoinOslFactorization.hpp:65
_EKKfactinfo::ifvsol
int ifvsol
Definition: CoinOslFactorization.hpp:100
_EKKfactinfo::switch_off_sparse_update
int switch_off_sparse_update
Definition: CoinOslFactorization.hpp:91
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:59
CoinOslFactorization::wantsTableauColumn
virtual bool wantsTableauColumn() const
Returns true if wants tableauColumn in replaceColumn.
_EKKfactinfo::iterno
int iterno
Definition: CoinOslFactorization.hpp:83
_EKKfactinfo::xcnadr
int * xcnadr
Definition: CoinOslFactorization.hpp:38
_EKKfactinfo::npivots
int npivots
Definition: CoinOslFactorization.hpp:78
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:27
CoinOtherFactorization::numberPivots_
int numberPivots_
Number pivots since last factorization.
Definition: CoinDenseFactorization.hpp:253
_EKKfactinfo::numberSlacks
int numberSlacks
Definition: CoinOslFactorization.hpp:84
_EKKfactinfo::nnentl
int nnentl
Definition: CoinOslFactorization.hpp:72
CoinOslFactorization::permute
virtual int * permute() const
Returns permute in.
Definition: CoinOslFactorization.hpp:255
_EKKfactinfo::R_etas_element
double * R_etas_element
Definition: CoinOslFactorization.hpp:49
CoinOtherFactorization::numberRows_
int numberRows_
Number of Rows in factorization.
Definition: CoinDenseFactorization.hpp:245
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:64
CoinOtherFactorization::numberRows
int numberRows() const
Number of Rows after factorization.
Definition: CoinDenseFactorization.hpp:67
CoinOslFactorization::indices
virtual int * indices() const
Get rid of all memory.
_EKKfactinfo
Definition: CoinOslFactorization.hpp:29
_EKKfactinfo::sortedEta
int sortedEta
Definition: CoinOslFactorization.hpp:98
_EKKfactinfo::kp2adr
EKKHlink * kp2adr
Definition: CoinOslFactorization.hpp:56
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:47
_EKKfactinfo::nrow
int nrow
Definition: CoinOslFactorization.hpp:61
CoinOslFactorization::numberInColumn
virtual int * numberInColumn() const
Number of entries in each column.
_EKKfactinfo::lastSlack
int lastSlack
Definition: CoinOslFactorization.hpp:85
CoinOslFactorization::makeNonSingular
virtual void makeNonSingular(int *sequence, int numberColumns)
Makes a non-singular basis by replacing variables.
_EKKfactinfo::lstart
int lstart
Definition: CoinOslFactorization.hpp:88
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:103
_EKKfactinfo::nnetas
int nnetas
Definition: CoinOslFactorization.hpp:66
CoinOtherFactorization::maximumPivots
int maximumPivots() const
Maximum number of pivots between factorizations.
Definition: CoinDenseFactorization.hpp:84
_EKKfactinfo::demark
double demark
Definition: CoinOslFactorization.hpp:31
CoinFactorizationDouble
double CoinFactorizationDouble
Definition: CoinTypes.hpp:57
CoinOtherFactorization::numberColumns
int numberColumns() const
Total number of columns in factorization.
Definition: CoinDenseFactorization.hpp:71
CoinOslFactorization::gutsOfInitialize
void gutsOfInitialize(bool zapFact=true)
The real work of constructor.
_EKKfactinfo::eta_size
int eta_size
Definition: CoinOslFactorization.hpp:101
CoinOslFactorization::permuteBack
virtual int * permuteBack() const
Returns permute back.
_EKKfactinfo::packedMode
int packedMode
Definition: CoinOslFactorization.hpp:90
_EKKfactinfo::kw2adr
double * kw2adr
Definition: CoinOslFactorization.hpp:58
_EKKfactinfo::last_dense
int last_dense
Definition: CoinOslFactorization.hpp:82
_EKKfactinfo::xeeadr
double * xeeadr
Definition: CoinOslFactorization.hpp:53
CoinIndexedVector
Indexed Vector.
Definition: CoinIndexedVector.hpp:104
CoinOslFactorization::factInfo_
EKKfactinfo factInfo_
Osl factorization data.
Definition: CoinOslFactorization.hpp:277
_EKKfactinfo::mpermu
int * mpermu
Definition: CoinOslFactorization.hpp:41
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:34
_EKKfactinfo::xrnadr
int * xrnadr
Definition: CoinOslFactorization.hpp:37
_EKKfactinfo::hpivcoR
int * hpivcoR
Definition: CoinOslFactorization.hpp:60
_EKKfactinfo::iter0
int iter0
Definition: CoinOslFactorization.hpp:68
_EKKfactinfo::kcpadr
int * kcpadr
Definition: CoinOslFactorization.hpp:40
_EKKfactinfo::zpivlu
double zpivlu
Definition: CoinOslFactorization.hpp:32
_EKKfactinfo::xnetal
int xnetal
Definition: CoinOslFactorization.hpp:80
_EKKfactinfo::nR_etas
int nR_etas
Definition: CoinOslFactorization.hpp:97
_EKKfactinfo::firstNonSlack
int firstNonSlack
Definition: CoinOslFactorization.hpp:86
CoinOslFactorization::pivotRow
virtual int * pivotRow() const
Returns pivot row.
_EKKfactinfo::invok
int invok
Definition: CoinOslFactorization.hpp:69
_EKKfactinfo::xrsadr
int * xrsadr
Definition: CoinOslFactorization.hpp:35
CoinOslFactorization::conditionNumber
double conditionNumber() const
Condition number - product of pivots after factorization.
CoinOslFactorization::starts
virtual CoinBigIndex * starts() const
Returns array to put basis starts in.
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:55
CoinOslFactorization
Definition: CoinOslFactorization.hpp:106
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:99
_EKKfactinfo::bitArray
int * bitArray
Definition: CoinOslFactorization.hpp:42
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:73
CoinOslFactorization::workArea
virtual CoinFactorizationDouble * workArea() const
Returns work area.
CoinBigIndex
int CoinBigIndex
Definition: Coin_C_defines.h:105
_EKKfactinfo::num_resets
int num_resets
Definition: CoinOslFactorization.hpp:71
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:28
_EKKfactinfo::xecadr
int * xecadr
Definition: CoinOslFactorization.hpp:51
CoinOslFactorization::clearArrays
virtual void clearArrays()
Get rid of all memory.
_EKKfactinfo::krpadr
int * krpadr
Definition: CoinOslFactorization.hpp:39
CoinOslFactorization::elements
virtual CoinFactorizationDouble * elements() const
Returns array to put basis elements in.
CoinOslFactorization::getAreas
virtual void getAreas(int numberRows, int numberColumns, CoinBigIndex maximumL, CoinBigIndex maximumU)
Gets space for a factorization.
CoinOslFactorization::clone
virtual CoinOtherFactorization * clone() const
Clone.
_EKKfactinfo::nrowmx
int nrowmx
Definition: CoinOslFactorization.hpp:62
_EKKfactinfo::nbfinv
int nbfinv
Definition: CoinOslFactorization.hpp:70
_EKKfactinfo::xnetalval
int xnetalval
Definition: CoinOslFactorization.hpp:87
CoinIndexedVector.hpp
CoinOslFactorization::CoinOslFactorization
CoinOslFactorization()
Default constructor.
_EKKfactinfo::drtpiv
double drtpiv
Definition: CoinOslFactorization.hpp:30
_EKKfactinfo::xcsadr
int * xcsadr
Definition: CoinOslFactorization.hpp:36
_EKKfactinfo::last_eta_size
int last_eta_size
Definition: CoinOslFactorization.hpp:102
CoinOslFactorization::numberElements
virtual int numberElements() const
Total number of elements in factorization.
Definition: CoinOslFactorization.hpp:161
_EKKfactinfo::iterin
int iterin
Definition: CoinOslFactorization.hpp:67
_EKKfactinfo::xeradr
int * xeradr
Definition: CoinOslFactorization.hpp:52
CoinOslFactorization::operator=
CoinOslFactorization & operator=(const CoinOslFactorization &other)
= copy
_EKKfactinfo::kadrpm
double * kadrpm
Definition: CoinOslFactorization.hpp:46
CoinOslFactorization::gutsOfCopy
void gutsOfCopy(const CoinOslFactorization &other)
The real work of copy.
CoinOtherFactorization::numberColumns_
int numberColumns_
Number of Columns in factorization.
Definition: CoinDenseFactorization.hpp:247
_EKKfactinfo::zeroTolerance
double zeroTolerance
Definition: CoinOslFactorization.hpp:33
EKKfactinfo
struct _EKKfactinfo EKKfactinfo
_EKKfactinfo::if_sparse_update
int if_sparse_update
Definition: CoinOslFactorization.hpp:89
_EKKfactinfo::kw1adr
double * kw1adr
Definition: CoinOslFactorization.hpp:57
_EKKfactinfo::nonzero
char * nonzero
Definition: CoinOslFactorization.hpp:44
_EKKfactinfo::ndenuc
int ndenuc
Definition: CoinOslFactorization.hpp:77
_EKKfactinfo::firstDoRow
int firstDoRow
Definition: CoinOslFactorization.hpp:63
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:92
CoinDenseFactorization.hpp
_EKKfactinfo::rows_ok
bool rows_ok
Definition: CoinOslFactorization.hpp:93
_EKKfactinfo::back
int * back
Definition: CoinOslFactorization.hpp:43
_EKKfactinfo::first_dense
int first_dense
Definition: CoinOslFactorization.hpp:81