FEI Package Browser (Single Doxygen Collection) Version of the Day
Loading...
Searching...
No Matches
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
18namespace fei {
19
21 public:
23 FillableMat(EqnBuffer& eqnbuf);
24 virtual ~FillableMat();
25
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
69void print(std::ostream& os, const FillableMat& mat);
70
72int count_nnz(const FillableMat& mat);
73
75void get_row_numbers(const FillableMat& mat, std::vector<int>& rows);
76
77}//namespace fei
78
79#endif
80
void putCoef(int row, int col, double coef)
unsigned getNumRows() const
const_iterator end() const
const CSVec * getRow(int row) const
bool hasRow(int row) const
void putRow(int row, const int *cols, const double *coefs, unsigned len)
CSVec * create_or_getRow(int row)
FillableMat & operator=(const FillableMat &src)
void createPosition(int row, int col)
feipoolmat::const_iterator const_iterator
void sumInCoef(int row, int col, double coef)
const_iterator begin() const
bool operator!=(const FillableMat &rhs) const
void setValues(double value)
fei_Pool_alloc< CSVec > vecpool_
feipoolmat::iterator iterator
bool operator==(const FillableMat &rhs) const
std::map< int, CSVec *, std::less< int >, fei_Pool_alloc< std::pair< const int, CSVec * > > > feipoolmat
void sumInRow(int row, const int *cols, const double *coefs, unsigned len)
int count_nnz(const FillableMat &mat)
void print(std::ostream &os, const FillableMat &mat)
void get_row_numbers(const FillableMat &mat, std::vector< int > &rows)