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

- File List
- File Members

# /home/coin/SVN-release/Alps-1.2.1/CoinUtils/src/CoinOslFactorization.hpp

Go to the documentation of this file.

    00001 /* $Id: CoinOslFactorization.hpp 1323 2010-11-01 13:06:18Z forrest $ */
    00002 // Copyright (C) 1987, 2009, International Business Machines
    00003 // Corporation and others.  All Rights Reserved.
    00004
    00005 /*
    00006    Authors
    00007
    00008    John Forrest
    00009
    00010  */
    00011 #ifndef CoinOslFactorization_H
    00012 #define CoinOslFactorization_H
    00013 #include <iostream>
    00014 #include <string>
    00015 #include <cassert>
    00016 #include "CoinFinite.hpp"
    00017 #include "CoinIndexedVector.hpp"
    00018 #include "CoinDenseFactorization.hpp"
    00019 class CoinPackedMatrix;
    00027 typedef struct {int suc, pre;} EKKHlink;
    00028 typedef struct _EKKfactinfo {
    00029   double drtpiv;
    00030   double demark;
    00031   double zpivlu;
    00032   double zeroTolerance;
    00033   double areaFactor;
    00034   int *xrsadr;
    00035   int *xcsadr;
    00036   int *xrnadr;
    00037   int *xcnadr;
    00038   int *krpadr;
    00039   int *kcpadr;
    00040   int *mpermu;
    00041   int *bitArray;
    00042   int * back;
    00043   char * nonzero;
    00044   double * trueStart;
    00045   mutable double *kadrpm;
    00046   int *R_etas_index;
    00047   int *R_etas_start;
    00048   double *R_etas_element;
    00049
    00050   int *xecadr;
    00051   int *xeradr;
    00052   double *xeeadr;
    00053   double *xe2adr;
    00054   EKKHlink * kp1adr;
    00055   EKKHlink * kp2adr;
    00056   double * kw1adr;
    00057   double * kw2adr;
    00058   double * kw3adr;
    00059   int * hpivcoR;
    00060   int nrow;
    00061   int nrowmx;
    00062   int firstDoRow;
    00063   int firstLRow;
    00064   int maxinv;
    00065   int nnetas;
    00066   int iterin;
    00067   int iter0;
    00068   int invok;
    00069   int nbfinv;
    00070   int num_resets;
    00071   int nnentl;
    00072   int nnentu;
    00073 #ifdef CLP_REUSE_ETAS
    00074   int save_nnentu;
    00075 #endif
    00076   int ndenuc;
    00077   int npivots; /* use as xpivsq in factorization */
    00078   int kmxeta;
    00079   int xnetal;
    00080   int first_dense;
    00081   int last_dense;
    00082   int iterno;
    00083   int numberSlacks;
    00084   int lastSlack;
    00085   int firstNonSlack;
    00086   int xnetalval;
    00087   int lstart;
    00088   int if_sparse_update;
    00089   mutable int packedMode;
    00090   int switch_off_sparse_update;
    00091   int nuspike;
    00092   bool rows_ok; /* replaces test using mrstrt[1] */
    00093 #ifdef CLP_REUSE_ETAS
    00094   mutable int reintro;
    00095 #endif
    00096   int nR_etas;
    00097   int sortedEta; /* if vector for F-T is sorted */
    00098   int lastEtaCount;
    00099   int ifvsol;
    00100   int eta_size;
    00101   int last_eta_size;
    00102   int maxNNetas;
    00103 } EKKfactinfo;
    00104
    00105 class CoinOslFactorization : public CoinOtherFactorization {
    00106    friend void CoinOslFactorizationUnitTest( const std::string & mpsDir );
    00107
    00108 public:
    00109
    00112
    00113   CoinOslFactorization (  );
    00115   CoinOslFactorization ( const CoinOslFactorization &other);
    00116
    00118   virtual ~CoinOslFactorization (  );
    00120   CoinOslFactorization & operator = ( const CoinOslFactorization & other );
    00122   virtual CoinOtherFactorization * clone() const ;
    00124
    00127
    00128   virtual void getAreas ( int numberRows,
    00129                   int numberColumns,
    00130                   CoinBigIndex maximumL,
    00131                   CoinBigIndex maximumU );
    00132
    00134   virtual void preProcess ( );
    00140   virtual int factor ( );
    00142   virtual void postProcess(const int * sequence, int * pivotVariable);
    00144   virtual void makeNonSingular(int * sequence, int numberColumns);
    00152   int factorize ( const CoinPackedMatrix & matrix,
    00153                   int rowIsBasic[], int columnIsBasic[] ,
    00154                   double areaFactor = 0.0 );
    00156
    00159
    00160   virtual inline int numberElements (  ) const {
    00161     return numberRows_*(numberColumns_+numberPivots_);
    00162   }
    00164   virtual CoinFactorizationDouble * elements() const;
    00166   virtual int * pivotRow() const;
    00168   virtual CoinFactorizationDouble * workArea() const;
    00170   virtual int * intWorkArea() const;
    00172   virtual int * numberInRow() const;
    00174   virtual int * numberInColumn() const;
    00176   virtual CoinBigIndex * starts() const;
    00178   virtual int * permuteBack() const;
    00180   virtual bool wantsTableauColumn() const;
    00185   virtual void setUsefulInformation(const int * info,int whereFrom);
    00187   virtual void maximumPivots (  int value );
    00188
    00190   double maximumCoefficient() const;
    00192   double conditionNumber() const;
    00194   virtual void clearArrays();
    00196
    00199
    00207   virtual int replaceColumn ( CoinIndexedVector * regionSparse,
    00208                       int pivotRow,
    00209                       double pivotCheck ,
    00210                               bool checkBeforeModifying=false,
    00211                               double acceptablePivot=1.0e-8);
    00213
    00223   virtual int updateColumnFT ( CoinIndexedVector * regionSparse,
    00224                                       CoinIndexedVector * regionSparse2,
    00225                                       bool noPermute=false);
    00228   virtual int updateColumn ( CoinIndexedVector * regionSparse,
    00229                      CoinIndexedVector * regionSparse2,
    00230                      bool noPermute=false) const;
    00232     virtual int updateTwoColumnsFT(CoinIndexedVector * regionSparse1,
    00233                            CoinIndexedVector * regionSparse2,
    00234                            CoinIndexedVector * regionSparse3,
    00235                            bool noPermute=false);
    00240   virtual int updateColumnTranspose ( CoinIndexedVector * regionSparse,
    00241                               CoinIndexedVector * regionSparse2) const;
    00243
    00244
    00248
    00249   //inline void clearArrays()
    00250   //{ gutsOfDestructor();}
    00252   virtual int * indices() const;
    00254   virtual inline int * permute() const
    00255   { return NULL;/*pivotRow_*/;}
    00257
    00259   void gutsOfDestructor(bool clearFact=true);
    00261   void gutsOfInitialize(bool zapFact=true);
    00263   void gutsOfCopy(const CoinOslFactorization &other);
    00264
    00266 protected:
    00269   int checkPivot(double saveFromU, double oldPivot) const;
    00271 protected:
    00272
    00275
    00276   EKKfactinfo factInfo_;
    00278 };
    00279 #endif