sparseblockilu.h

Go to the documentation of this file.
00001 #ifndef __sparseblockilu_h
00002 #define __sparseblockilu_h
00003 
00004 #include  "sparseblockmatrix.h"
00005 #include  "iluinterface.h"
00006 
00007 /*-------------------------------------------------------------*/
00008 
00009 namespace Gascoigne
00010 {
00011 template<class B>
00012 class SparseBlockIlu: public virtual IluInterface, public SparseBlockMatrix<B>
00013 {
00014 protected:
00015 
00016   nvector<int>          p,q;
00017   GlobalVector*   yp;
00018 
00019   void backward() const;
00020   void forward () const;
00021   virtual void hin(const GlobalVector& x) const;
00022   virtual void her(GlobalVector& x) const;
00023 
00024   int   n()          const { return SparseBlockMatrix<B>::US.n();};
00025   const int&  start(int i) const { return SparseBlockMatrix<B>::US.start(i); }; 
00026   const int&  stop (int i) const { return SparseBlockMatrix<B>::US.stop (i); }; 
00027   const int&  col(int pos) const { return SparseBlockMatrix<B>::US.col(pos); };
00028   const int&  diag(int i)  const { return SparseBlockMatrix<B>::US.diag(i); }; 
00029 
00030   public:
00031 
00032   SparseBlockIlu<B>();
00033   SparseBlockIlu<B>(const SparseBlockIlu<B>& I);
00034   ~SparseBlockIlu();
00035 
00036   string GetName() const {return "SparseBlockIlu";}
00037   
00038   nvector<int>&       GetP() {return p;}
00039   nvector<int>&       GetQ() {return q;}
00040   const nvector<int>& GetP() const {return p;}
00041   const nvector<int>& GetQ() const {return q;}
00042 
00043   void modify(int c, double s);
00044   void zero() { SparseBlockMatrix<B>::zero(); }
00045 
00046   void compute_ilu ();
00047   void ReInit      (const SparseStructureInterface* SI);
00048   void ConstructStructure(const nvector<int>& perm, const MatrixInterface& A);
00049   void copy_entries(const MatrixInterface* A);
00050   void solve       (GlobalVector& x) const;
00051   void solvetrans  (GlobalVector& x) const { assert(0);};
00052   ostream& Write(ostream &s) const;
00053 };
00054 }
00055 
00056 #endif

Generated on Thu Sep 14 10:34:37 2006 for Gascoigne by  doxygen 1.4.7