Main Page Namespace List Compound List File List Namespace Members Compound Members File Members

# tnt_sparse_matrix_csr.h

Go to the documentation of this file.

    00001 /*
    00002 *
    00003 * Template Numerical Toolkit (TNT)
    00004 *
    00005 * Mathematical and Computational Sciences Division
    00006 * National Institute of Technology,
    00007 * Gaithersburg, MD USA
    00008 *
    00009 *
    00010 * This software was developed at the National Institute of Standards and
    00011 * Technology (NIST) by employees of the Federal Government in the course
    00012 * of their official duties. Pursuant to title 17 Section 105 of the
    00013 * United States Code, this software is not subject to copyright protection
    00014 * and is in the public domain. NIST assumes no responsibility whatsoever for
    00015 * its use by other parties, and makes no guarantees, expressed or implied,
    00016 * about its quality, reliability, or any other characteristic.
    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 // namespace TNT
    00092
    00093 #endif