• Main Page
  • Related Pages
  • Modules
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

/build/buildd/coinutils-2.6.4/CoinUtils/src/CoinOslFactorization.hpp

Go to the documentation of this file.
00001 /* $Id: CoinOslFactorization.hpp 1191 2009-07-25 08:38:12Z 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   int ndenuc;
00074   int npivots; /* use as xpivsq in factorization */
00075   int kmxeta;
00076   int xnetal;
00077   int first_dense;
00078   int last_dense;
00079   int iterno;
00080   int numberSlacks;
00081   int lastSlack;
00082   int firstNonSlack;
00083   int xnetalval;
00084   int lstart;
00085   int if_sparse_update;
00086   mutable int packedMode;
00087   int switch_off_sparse_update;
00088   int nuspike;
00089   bool rows_ok; /* replaces test using mrstrt[1] */
00090 
00091   int nR_etas;
00092   int sortedEta; /* if vector for F-T is sorted */
00093   int lastEtaCount;
00094   int ifvsol;
00095   int eta_size;
00096   int last_eta_size;
00097   int maxNNetas;
00098 } EKKfactinfo;
00099 
00100 class CoinOslFactorization : public CoinOtherFactorization {
00101    friend void CoinOslFactorizationUnitTest( const std::string & mpsDir );
00102 
00103 public:
00104 
00107 
00108   CoinOslFactorization (  );
00110   CoinOslFactorization ( const CoinOslFactorization &other);
00111   
00113   virtual ~CoinOslFactorization (  );
00115   CoinOslFactorization & operator = ( const CoinOslFactorization & other );
00117   virtual CoinOtherFactorization * clone() const ;
00119 
00122 
00123   virtual void getAreas ( int numberRows,
00124                   int numberColumns,
00125                   CoinBigIndex maximumL,
00126                   CoinBigIndex maximumU );
00127   
00129   virtual void preProcess ( );
00135   virtual int factor ( );
00137   virtual void postProcess(const int * sequence, int * pivotVariable);
00139   virtual void makeNonSingular(int * sequence, int numberColumns);
00147   int factorize ( const CoinPackedMatrix & matrix, 
00148                   int rowIsBasic[], int columnIsBasic[] , 
00149                   double areaFactor = 0.0 );
00151 
00154 
00155   virtual inline int numberElements (  ) const {
00156     return numberRows_*(numberColumns_+numberPivots_);
00157   }
00159   virtual CoinFactorizationDouble * elements() const;
00161   virtual int * pivotRow() const;
00163   virtual CoinFactorizationDouble * workArea() const;
00165   virtual int * intWorkArea() const;
00167   virtual int * numberInRow() const;
00169   virtual int * numberInColumn() const;
00171   virtual CoinBigIndex * starts() const;
00173   virtual int * permuteBack() const;
00175   virtual bool wantsTableauColumn() const;
00180   virtual void setUsefulInformation(const int * info,int whereFrom);
00182   virtual void maximumPivots (  int value );
00183 
00185   double maximumCoefficient() const;
00187   double conditionNumber() const;
00189   virtual void clearArrays();
00191 
00194 
00202   virtual int replaceColumn ( CoinIndexedVector * regionSparse,
00203                       int pivotRow,
00204                       double pivotCheck ,
00205                               bool checkBeforeModifying=false,
00206                               double acceptablePivot=1.0e-8);
00208 
00218   virtual int updateColumnFT ( CoinIndexedVector * regionSparse,
00219                                       CoinIndexedVector * regionSparse2,
00220                                       bool noPermute=false);
00223   virtual int updateColumn ( CoinIndexedVector * regionSparse,
00224                      CoinIndexedVector * regionSparse2,
00225                      bool noPermute=false) const;
00227     virtual int updateTwoColumnsFT(CoinIndexedVector * regionSparse1,
00228                            CoinIndexedVector * regionSparse2,
00229                            CoinIndexedVector * regionSparse3,
00230                            bool noPermute=false);
00235   virtual int updateColumnTranspose ( CoinIndexedVector * regionSparse,
00236                               CoinIndexedVector * regionSparse2) const;
00238 
00239 
00243 
00244   //inline void clearArrays()
00245   //{ gutsOfDestructor();}
00247   virtual int * indices() const;
00249   virtual inline int * permute() const
00250   { return NULL;/*pivotRow_*/;}
00252 
00254   void gutsOfDestructor(bool clearFact=true);
00256   void gutsOfInitialize(bool zapFact=true);
00258   void gutsOfCopy(const CoinOslFactorization &other);
00259 
00261 protected:
00264   int checkPivot(double saveFromU, double oldPivot) const;
00266 protected:
00267 
00270 
00271   EKKfactinfo factInfo_;
00273 };
00274 #endif

Generated on Fri Oct 15 2010 18:21:02 by  doxygen 1.7.1