00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 #ifndef TNT_SPARSE_MATRIX_CSR_H
00022 #define TNT_SPARSE_MATRIX_CSR_H
00023 
00024 
00025 namespace TNT
00026 {
00027 
00028 
00046 template <class T>
00047 class Sparse_Matrix_CompRow {
00048 
00049   
00050 public:
00051 
00052         Sparse_Matrix_CompRow(const Sparse_Matrix_CompRow &S);
00053         Sparse_Matrix_CompRow(int M, int N, int nz, const T *val, 
00054                                                 const int *r, const int *c);
00055     
00056 
00057 
00058     inline   const T&      val(int i) const;
00059     inline   const int&         row_ptr(int i) const;
00060     inline   const int&         col_ind(int i) const;
00061 
00062     inline   int    dim1() const ;
00063     inline   int    dim2() const ;
00064        int          NumNonzeros() const ;
00065 
00066 
00067     Sparse_Matrix_CompRow& operator=( const Sparse_Matrix_CompRow &R);
00068 
00069 
00070 
00071 };
00072 
00085 template <class T>
00086 Sparse_Matrix_CompRow<T>::Sparse_Matrix_CompRow(int M, int N, int nz,
00087         const T *val, const int *r, const int *c);
00088 
00089 
00090 }
00091 
00092 
00093 #endif