CPPLapack
 All Classes Files Functions Variables Friends Pages
dgrmatrix.hpp
Go to the documentation of this file.
1 //=============================================================================
2 //! Real Double-precision General Compressed Sparse Row (CSR) Matrix Class
3 class dgrmatrix
4 {
5 public:
6  ///////////////////////////////////////////////
7  /////////////////// objects ///////////////////
8  ///////////////////////////////////////////////
9  CPPL_INT m; //!< matrix row size
10  CPPL_INT n; //!< matrix column size
11  std::vector<double> a; //!< matrix component values
12  std::vector<CPPL_INT> ia; //!< rowIndex (NOT zero-based BUT one-based indexing)
13  std::vector<CPPL_INT> ja; //!< columns (NOT zero-based BUT one-based indexing)
14 
15  ///////////////////////////////////////////////
16  ///////////////// constructors ////////////////
17  ///////////////////////////////////////////////
18  inline dgrmatrix();
19  inline dgrmatrix(const CPPL_INT&, const CPPL_INT&);
20  inline dgrmatrix(const dgrmatrix&);
21  inline dgrmatrix(const char*);
22  inline ~dgrmatrix(); //destructor
23 
24  ///////////////////////////////////////////////
25  ////////////////// functions //////////////////
26  ///////////////////////////////////////////////
27  //////// cast ////////
28  //inline _zgsmatrix to_zgsmatrix() const;
29  inline _dgematrix to_dgematrix() const;
30 
31  //////// io ////////
32  inline double operator()(const CPPL_INT&, const CPPL_INT&) const;
33  inline double& operator()(const CPPL_INT&, const CPPL_INT&);
34  inline friend std::ostream& operator<<(std::ostream&, const dgrmatrix&);
35  inline void write(const char*) const;
36  inline void read(const char*);
37 
38  //////// misc ////////
39  inline void clear();
40  inline dgrmatrix& zero();
41  inline void copy(const dgrmatrix&);
42  inline bool isListed(const CPPL_INT&, const CPPL_INT&) const;
43  inline void checkup();
44  //inline _drovector row(const CPPL_INT&) const;
45  //inline _dcovector col(const CPPL_INT&) const;
46  inline friend void swap(dgrmatrix&, dgrmatrix&);
47 
48  //////// calc ////////
49  //inline friend void idamax(CPPL_INT&, CPPL_INT&, const dgrmatrix&);
50  inline friend double damax(const dgrmatrix&);
51 
52  //////// MKL ////////
53  inline CPPL_INT pardiso(dcovector&) const;
54  inline CPPL_INT dfgmres(dcovector&, const double) const;
55  inline CPPL_INT ilut_dfgmres(dcovector&, const int, const double) const;
56 
57  ///////////////////////////////////////////////
58  ///////////// numerical operators /////////////
59  ///////////////////////////////////////////////
60  //////// = ////////
61  inline dgrmatrix& operator=(const dgrmatrix&);
62 
63  //////// ?= ////////
64  inline dgrmatrix& operator*=(const double&);
65  inline dgrmatrix& operator/=(const double&);
66 
67  //////// * ////////
68  inline friend dgrmatrix operator*(const dgrmatrix&, const double&);
69  inline friend dgrmatrix operator*(const double&, const dgrmatrix&);
70  inline friend _dcovector operator*(const dgrmatrix&, const dcovector&);
71  inline friend _dcovector operator*(const dgrmatrix&, const _dcovector&);
72 
73  //////// / ////////
74  inline friend dgrmatrix operator/(const dgrmatrix&, const double&);
75 };
void read(const char *)
_dgematrix to_dgematrix() const
void copy(const dgrmatrix &)
dgrmatrix & zero()
std::vector< double > a
matrix component values
Definition: dgrmatrix.hpp:11
void write(const char *) const
friend void swap(dgrmatrix &, dgrmatrix &)
std::vector< CPPL_INT > ia
rowIndex (NOT zero-based BUT one-based indexing)
Definition: dgrmatrix.hpp:12
friend dgrmatrix operator/(const dgrmatrix &, const double &)
CPPL_INT n
matrix column size
Definition: dgrmatrix.hpp:10
friend dgrmatrix operator*(const dgrmatrix &, const double &)
friend std::ostream & operator<<(std::ostream &, const dgrmatrix &)
void clear()
void checkup()
(DO NOT USE) Smart-temporary Real Double-precision General Dence Matrix Class
Definition: _dgematrix.hpp:3
dgrmatrix & operator*=(const double &)
dgrmatrix & operator=(const dgrmatrix &)
bool isListed(const CPPL_INT &, const CPPL_INT &) const
CPPL_INT pardiso(dcovector &) const
Real Double-precision Column Vector Class.
Definition: dcovector.hpp:3
CPPL_INT m
matrix row size
Definition: dgrmatrix.hpp:9
double operator()(const CPPL_INT &, const CPPL_INT &) const
Definition: dgrmatrix-io.hpp:3
CPPL_INT dfgmres(dcovector &, const double) const
std::vector< CPPL_INT > ja
columns (NOT zero-based BUT one-based indexing)
Definition: dgrmatrix.hpp:13
dgrmatrix & operator/=(const double &)
(DO NOT USE) Smart-temporary Real Double-precision Column Vector Class
Definition: _dcovector.hpp:3
CPPL_INT ilut_dfgmres(dcovector &, const int, const double) const
Real Double-precision General Compressed Sparse Row (CSR) Matrix Class.
Definition: dgrmatrix.hpp:3
friend double damax(const dgrmatrix &)