FEI Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
fei_FillableMat.hpp
Go to the documentation of this file.
1 /*--------------------------------------------------------------------*/
2 /* Copyright 2005 Sandia Corporation. */
3 /* Under the terms of Contract DE-AC04-94AL85000, there is a */
4 /* non-exclusive license for use of this work by or on behalf */
5 /* of the U.S. Government. Export of this program may require */
6 /* a license from the United States Government. */
7 /*--------------------------------------------------------------------*/
8 
9 #ifndef _fei_FillableMat_hpp_
10 #define _fei_FillableMat_hpp_
11 
12 #include <fei_CSVec.hpp>
13 #include <fei_Pool_alloc.hpp>
14 #include <fei_EqnBuffer.hpp>
15 #include <vector>
16 #include <map>
17 
18 namespace fei {
19 
20 class FillableMat {
21  public:
22  FillableMat();
23  FillableMat(EqnBuffer& eqnbuf);
24  virtual ~FillableMat();
25 
26  FillableMat& operator=(const FillableMat& src);
27 
28  void setValues(double value);
29 
30  void createPosition(int row, int col);
31 
32  void sumInCoef(int row, int col, double coef);
33  void putCoef(int row, int col, double coef);
34 
35  void sumInRow(int row, const int* cols, const double* coefs, unsigned len);
36  void putRow(int row, const int* cols, const double* coefs, unsigned len);
37 
38  unsigned getNumRows() const;
39 
40  bool hasRow(int row) const;
41 
42  const CSVec* getRow(int row) const;
43  CSVec* create_or_getRow(int row);
44 
45  typedef std::map<int, CSVec*, std::less<int>,
47 
48  typedef feipoolmat::iterator iterator;
49  typedef feipoolmat::const_iterator const_iterator;
50 
51  iterator begin() {return matdata_.begin();}
52  iterator end() {return matdata_.end();}
53 
54  const_iterator begin() const {return matdata_.begin();}
55  const_iterator end() const {return matdata_.end();}
56 
57  void clear();
58 
59  bool operator==(const FillableMat& rhs) const;
60 
61  bool operator!=(const FillableMat& rhs) const;
62 
63  private:
66 }; //class FillableMat
67 
69 void print(std::ostream& os, const FillableMat& mat);
70 
72 int count_nnz(const FillableMat& mat);
73 
75 void get_row_numbers(const FillableMat& mat, std::vector<int>& rows);
76 
77 }//namespace fei
78 
79 #endif
80 
feipoolmat::iterator iterator
bool operator==(const FillableMat &rhs) const
CSVec * create_or_getRow(int row)
const_iterator end() const
const CSVec * getRow(int row) const
bool hasRow(int row) const
bool operator!=(const FillableMat &rhs) const
void createPosition(int row, int col)
void get_row_numbers(const FillableMat &mat, std::vector< int > &rows)
FillableMat & operator=(const FillableMat &src)
void putCoef(int row, int col, double coef)
void putRow(int row, const int *cols, const double *coefs, unsigned len)
fei_Pool_alloc< CSVec > vecpool_
feipoolmat::const_iterator const_iterator
void setValues(double value)
void sumInRow(int row, const int *cols, const double *coefs, unsigned len)
void sumInCoef(int row, int col, double coef)
unsigned getNumRows() const
int count_nnz(const FillableMat &mat)
const_iterator begin() const
std::map< int, CSVec *, std::less< int >, fei_Pool_alloc< std::pair< const int, CSVec * > > > feipoolmat
void print(std::ostream &os, const FillableMat &mat)