/home/coin/SVN-release/CoinAll-1.1.0/Clp/src/ClpCholeskyBase.hpp

Go to the documentation of this file.
00001 // Copyright (C) 2003, International Business Machines
00002 // Corporation and others.  All Rights Reserved.
00003 #ifndef ClpCholeskyBase_H
00004 #define ClpCholeskyBase_H
00005 
00006 #include "CoinPragma.hpp"
00007 #include "CoinFinite.hpp"
00008 #define CLP_LONG_CHOLESKY 0
00009 #if CLP_LONG_CHOLESKY>1
00010 typedef long double longDouble;
00011 typedef long double longWork;
00012 #elif CLP_LONG_CHOLESKY==1
00013 typedef double longDouble;
00014 typedef long double longWork;
00015 #else
00016 typedef double longDouble;
00017 typedef double longWork;
00018 #endif
00019 class ClpInterior;
00020 class ClpCholeskyDense;
00021 class ClpMatrixBase;
00022 
00029 class ClpCholeskyBase  {
00030   
00031 public:
00040   virtual int order(ClpInterior * model);
00045   virtual int symbolic();
00048   virtual int factorize(const double * diagonal, int * rowsDropped) ;
00050   virtual void solve (double * region) ;
00053   virtual void solveKKT (double * region1, double * region2, const double * diagonal,
00054                          double diagonalScaleFactor);
00056 
00059 
00060   inline int status() const 
00061   {return status_;}
00063   inline int numberRowsDropped() const 
00064   {return numberRowsDropped_;}
00066   void resetRowsDropped();
00068   inline char * rowsDropped() const 
00069   {return rowsDropped_;}
00071   inline double choleskyCondition() const 
00072   {return choleskyCondition_;}
00074   inline double goDense() const 
00075   {return goDense_;}
00077   inline void setGoDense(double value)
00078   {goDense_=value;}
00080   inline int rank() const 
00081   {return numberRows_-numberRowsDropped_;}
00083   inline int numberRows() const 
00084   {return numberRows_;}
00086   inline CoinBigIndex size() const
00087   { return sizeFactor_;}
00089   inline longDouble * sparseFactor() const
00090   { return sparseFactor_;}
00092   inline longDouble * diagonal() const
00093   { return diagonal_;}
00095   inline longDouble * workDouble() const
00096   { return workDouble_;}
00098   inline bool kkt() const
00099   { return doKKT_;}
00101   inline void setKKT(bool yesNo)
00102   { doKKT_ = yesNo;}
00104   inline void setIntegerParameter(int i,int value)
00105   { integerParameters_[i]=value;}
00107   inline int getIntegerParameter(int i)
00108   { return integerParameters_[i];}
00110   inline void setDoubleParameter(int i,double value)
00111   { doubleParameters_[i]=value;}
00113   inline double getDoubleParameter(int i)
00114   { return doubleParameters_[i];}
00116   
00117   
00118 public:
00119 
00125   ClpCholeskyBase(int denseThreshold=-1);
00127    virtual ~ClpCholeskyBase();
00129    ClpCholeskyBase(const ClpCholeskyBase&);
00131    ClpCholeskyBase& operator=(const ClpCholeskyBase&);
00133 
00134 
00135 
00136   virtual ClpCholeskyBase * clone() const;
00137  
00139   inline int type() const
00140   { if (doKKT_) return 100; else return type_;}
00141 protected:
00143   void setType(int type) {type_=type;}
00145    
00152   int symbolic1(const CoinBigIndex * Astart, const int * Arow);
00156   void symbolic2(const CoinBigIndex * Astart, const int * Arow);
00160   void factorizePart2(int * rowsDropped) ;
00164   void solve(double * region, int type);
00165   void solveLong(longDouble * region, int type);
00167   int preOrder(bool lowerTriangular, bool includeDiagonal, bool doKKT);
00169   void updateDense(longDouble * d, longDouble * work, int * first);
00171     
00172 protected:
00176 
00177   int type_;
00179   bool doKKT_;
00181   double goDense_;
00183   double choleskyCondition_;
00185   ClpInterior * model_;
00187   int numberTrials_;
00189   int numberRows_;
00191   int status_;
00193   char * rowsDropped_;
00195   int * permuteInverse_;
00197   int * permute_;
00199   int numberRowsDropped_;
00201   longDouble * sparseFactor_;
00203   CoinBigIndex * choleskyStart_;
00205   int * choleskyRow_;
00207   CoinBigIndex * indexStart_;
00209   longDouble * diagonal_;
00211   longDouble * workDouble_;
00213   int * link_;
00214   // Integer work array
00215   CoinBigIndex * workInteger_;
00216   // Clique information
00217   int * clique_;
00219   CoinBigIndex sizeFactor_;
00221   CoinBigIndex sizeIndex_;
00223   int firstDense_;
00225   int integerParameters_[64];
00227   double doubleParameters_[64];
00229   ClpMatrixBase * rowCopy_;
00231   char * whichDense_;
00233   longDouble * denseColumn_;
00235   ClpCholeskyDense * dense_;
00237   int denseThreshold_;
00239 };
00240 
00241 #endif

Generated on Sun Nov 14 14:06:31 2010 for Coin-All by  doxygen 1.4.7