fei_CSRMat.hpp

00001 #ifndef _fei_CSRMat_hpp_
00002 #define _fei_CSRMat_hpp_
00003 
00004 /*--------------------------------------------------------------------*/
00005 /*    Copyright 2005 Sandia Corporation.                              */
00006 /*    Under the terms of Contract DE-AC04-94AL85000, there is a       */
00007 /*    non-exclusive license for use of this work by or on behalf      */
00008 /*    of the U.S. Government.  Export of this program may require     */
00009 /*    a license from the United States Government.                    */
00010 /*--------------------------------------------------------------------*/
00011 
00012 #include "fei_macros.hpp"
00013 #include "fei_FillableMat.hpp"
00014 #include "fei_SparseRowGraph.hpp"
00015 #include "fei_CSVec.hpp"
00016 
00017 namespace fei {
00018 
00021 class CSRMat {
00022  public:
00023   CSRMat();
00024   CSRMat(const FillableMat& fmat);
00025   virtual ~CSRMat();
00026 
00027   SparseRowGraph& getGraph() {return srg_;}
00028   const SparseRowGraph& getGraph() const {return srg_;}
00029  
00030   std::vector<double>& getPackedCoefs() {return packedcoefs_;}
00031   const std::vector<double>& getPackedCoefs() const {return packedcoefs_;}
00032 
00033   unsigned getNumRows() const {return srg_.rowNumbers.size();}
00034 
00035   CSRMat& operator=(const FillableMat& src);
00036 
00037   CSRMat& operator+=(const CSRMat& src);
00038 
00039   bool operator==(const CSRMat& rhs) const;
00040 
00041   bool operator!=(const CSRMat& rhs) const;
00042 
00043  private:
00044   SparseRowGraph srg_;
00045   std::vector<double> packedcoefs_;
00046 };//class CSRMat
00047 
00049 void multiply_CSRMat_CSVec(const CSRMat& A, const CSVec& x, CSVec& y);
00050 
00052 void multiply_trans_CSRMat_CSVec(const CSRMat& A, const CSVec& x, CSVec& y);
00053 
00055 void multiply_CSRMat_CSRMat(const CSRMat& A, const CSRMat& B, CSRMat& C,
00056                             bool storeResultZeros=false);
00057 
00059 void multiply_trans_CSRMat_CSRMat(const CSRMat& A, const CSRMat& B, CSRMat& C,
00060                                   bool storeResultZeros=false);
00061 
00062 void add_CSRMat_to_FillableMat(const CSRMat& csrm, FillableMat& fm);
00063 
00064 }//namespace fei
00065 
00066 #endif
00067 

Generated on Tue Jul 13 09:27:44 2010 for FEI by  doxygen 1.4.7