rowcolumnstencil.h

Go to the documentation of this file.
00001 #ifndef  __RowColumnStencil_h
00002 #define  __RowColumnStencil_h
00003 
00004 #include  "columnstencil.h"
00005 
00006 
00007 namespace Gascoigne
00008 {
00009 
00014 
00018 
00019 class RowColumnStencil : virtual public StencilInterface, public ColumnStencil
00020 {
00021 private:
00022 
00023 
00024 protected:
00025 
00026   nvector<int>   srow;
00027 
00028 public:
00029 
00030 
00031 //
00033 //
00034 
00035   RowColumnStencil() : ColumnStencil() {}
00036   ~RowColumnStencil() {}
00037 
00038   const nvector<int>&  row()    const { return srow; }
00039         nvector<int>&  row()          { return srow; }
00040         int&  row(int i)           { return srow[i]; } 
00041   const int&  row(int i)     const { return srow[i]; } 
00042   void memory(int n, int nt);
00043   void memory(const SparseStructureInterface*);
00044   
00045   virtual int Find(int i, int j) const
00046     {
00047       for(int ii=0;ii<n();ii++)
00048         {
00049           if(row(ii)==i)
00050             {
00051               return ColumnStencil::Find(ii,j);
00052             }
00053         }
00054       std::cerr << "ColumnStencil::Find()";
00055       std::cerr << "no such coupling: "<<i <<" "<<j<<std::endl;
00056       abort();
00057       return -1;
00058     }
00059 
00060   std::ostream& Write(std::ostream& os) const
00061   {
00062     os << n() << "\t" << nentries()<<std::endl<<std::endl;
00063     os << sstart<<std::endl<<std::endl;
00064     for(int i=0;i<n();i++)
00065       {
00066         for(int pos=start(i);pos<stop(i);pos++)
00067           {
00068             os << row(i) << ":" << col(pos)  << " ";
00069           }
00070         os << std::endl;
00071       }
00072     return os;
00073   }
00074 };
00075 }
00076 
00077 #endif

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