fei_CSVec.hpp

00001 #ifndef _fei_CSVec_hpp_
00002 #define _fei_CSVec_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_FillableVec.hpp>
00014 #include <vector>
00015 
00016 namespace fei {
00017 
00024 class CSVec {
00025  public:
00026   CSVec(const FillableVec& invec);
00027   CSVec(unsigned sz=0);
00028   virtual ~CSVec();
00029 
00030   CSVec& operator=(const CSVec& invec);
00031 
00032   CSVec& operator=(const FillableVec& invec);
00033 
00034   std::vector<int>& indices() {return indices_;}
00035   const std::vector<int>& indices() const {return indices_;}
00036   std::vector<double>& coefs() {return coefs_;}
00037   const std::vector<double>& coefs() const {return coefs_;}
00038 
00039   size_t size() const {return indices_.size();}
00040 
00041   void clear() { indices_.clear(); coefs_.clear(); }
00042 
00043  private:
00044   std::vector<int> indices_;
00045   std::vector<double> coefs_;
00046 };//class CSVec
00047 
00048 void add_entry(CSVec& vec, int eqn, double coef);
00049 
00050 void put_entry(CSVec& vec, int eqn, double coef);
00051 
00052 void remove_entry(CSVec& vec, int eqn);
00053 
00054 void set_values(CSVec& vec, double scalar);
00055 
00058 void add_CSVec_CSVec(const CSVec& u, CSVec& v);
00059 
00060 }//namespace fei
00061 
00062 #endif
00063 

Generated on Wed May 12 21:30:41 2010 for FEI by  doxygen 1.4.7