DyLP  1.10.4
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"
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;
51  double *R_etas_element;
52 
53  int *xecadr;
54  int *xeradr;
55  double *xeeadr;
56  double *xe2adr;
59  double *kw1adr;
60  double *kw2adr;
61  double *kw3adr;
62  int *hpivcoR;
63  int nrow;
64  int nrowmx;
66  int firstLRow;
67  int maxinv;
68  int nnetas;
69  int iterin;
70  int iter0;
71  int invok;
72  int nbfinv;
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;
85  int iterno;
87  int lastSlack;
89  int xnetalval;
90  int lstart;
92  mutable int packedMode;
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 */
102  int ifvsol;
103  int eta_size;
106 } EKKfactinfo;
107 
109  friend void CoinOslFactorizationUnitTest(const std::string &mpsDir);
110 
111 public:
118 
120  virtual ~CoinOslFactorization();
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 */
virtual int * permute() const
Returns permute in.
Abstract base class which also has some scalars so can be used from Dense or Simp.
CoinPackedMatrix & operator=(const CoinPackedMatrix &rhs)
Assignment operator.
double CoinFactorizationDouble
Definition: CoinTypes.hpp:57
Indexed Vector.
void gutsOfDestructor()
Sparse Matrix Base Class.
struct _EKKfactinfo EKKfactinfo