simplematrix.h

Go to the documentation of this file.
00001 #ifndef  __SimpleMatrix_h
00002 #define  __SimpleMatrix_h
00003 
00004 #include  "matrixinterface.h"
00005 #include  "columndiagstencil.h"
00006 #include  "sparsestructureadaptor.h"
00007 #include  "compvector.h"
00008 
00009 
00010 namespace Gascoigne
00011 {
00012 
00017 
00021 
00022 class SimpleMatrix : virtual public MatrixInterface
00023 {
00024 protected:
00025 
00026   ColumnDiagStencil  ST;
00027   DoubleVector value; 
00028   DoubleVector _diag;
00029 
00030 public:
00031 
00032 //
00034 //
00035     SimpleMatrix() : MatrixInterface() {}
00036     ~SimpleMatrix() {}
00037 
00038     std::string GetName() const {return "SimpleMatrix";}
00039 
00040     std::ostream& Write(std::ostream& os) const;
00041 
00042     const StencilInterface* GetStencil() const { return &ST;}
00043     double& GetValue(int pos) {return value[pos];}
00044     const double& GetValue(int pos) const {return value[pos];}
00045     const double& GetValue(int i, int j) const {return value[ST.Find(i,j)];}
00046 
00047     void zero() {value.zero();}
00048     void ReInit(const SparseStructureInterface* S);
00049     void ReInit(int n, int nentries);
00050     void entry(niiterator start, niiterator stop, const EntryMatrix& M, double s=1.);
00051     void vmult(DoubleVector& y, const DoubleVector& x, double d=1.) const;
00052     void vmult_transpose(DoubleVector& y, const DoubleVector& x, double d=1.) const;
00053     void vmult_comp(int c, int d, GlobalVector& y, const GlobalVector& x, double s=1.) const;
00054     void vmult_comp_trans(int c, int d, GlobalVector& y, const GlobalVector& x, double s=1.) const;
00055     void vmult_time(GlobalVector& y, const GlobalVector& x, const TimePattern& TP, double s=1.) const;
00056     void dirichlet(const IntVector& indices);
00057     void dirichlet_only_row(const IntVector& indices);
00058 
00059     void transpose();
00060     void entry_diag(int i, const nmatrix<double>& M);
00061     
00062     void PrepareJacobi(double s=1.);
00063     void JacobiVector(GlobalVector &y) const;
00064     void JacobiVectorInv(GlobalVector &y) const;
00065     void vmult_time_Jacobi(GlobalVector& y, const GlobalVector& x, const TimePattern& TP, double s=1.) const;
00066 
00067 };
00068 }
00069 
00070 #endif

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