Menu

[r187]: / trunk / include / dgrmatrix- / dgrmatrix.hpp  Maximize  Restore  History

Download this file

76 lines (65 with data), 3.0 kB

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