CoinUtils  2.10.13
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"
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;
49  double *R_etas_element;
50 
51  int *xecadr;
52  int *xeradr;
53  double *xeeadr;
54  double *xe2adr;
57  double * kw1adr;
58  double * kw2adr;
59  double * kw3adr;
60  int * hpivcoR;
61  int nrow;
62  int nrowmx;
64  int firstLRow;
65  int maxinv;
66  int nnetas;
67  int iterin;
68  int iter0;
69  int invok;
70  int nbfinv;
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;
83  int iterno;
85  int lastSlack;
87  int xnetalval;
88  int lstart;
90  mutable int packedMode;
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 */
100  int ifvsol;
101  int eta_size;
104 } EKKfactinfo;
105 
107  friend void CoinOslFactorizationUnitTest( const std::string & mpsDir );
108 
109 public:
110 
117 
119  virtual ~CoinOslFactorization ( );
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
Abstract base class which also has some scalars so can be used from Dense or Simp.
virtual int * permute() const
Returns permute in.
CoinPackedMatrix & operator=(const CoinPackedMatrix &rhs)
Assignment operator.
double CoinFactorizationDouble
Definition: CoinTypes.hpp:57
Indexed Vector.
void gutsOfDestructor()
Sparse Matrix Base Class.
int CoinBigIndex
struct _EKKfactinfo EKKfactinfo