CPPLapack
 All Classes Files Functions Variables Friends Pages
zgsmatrix.hpp
Go to the documentation of this file.
1 //=============================================================================
2 //! Complex Double-precision General Sparse Matrix Class
3 class zgsmatrix
4 {
5 public:
6  ///////////////////////////////////////////////
7  /////////////////// objects ///////////////////
8  ///////////////////////////////////////////////
9  CPPL_INT m; //!< matrix row size
10  CPPL_INT n; //!< matrix column size
11  std::vector<zcomponent> data; //!< matrix data
12  std::vector< std::vector<CPPL_INT> > rows; //!< array of vector to store the entry information of component for each row
13  std::vector< std::vector<CPPL_INT> > cols; //!< array of vector to store the entry information of component for each column
14 
15  ///////////////////////////////////////////////
16  ///////////////// constructors ////////////////
17  ///////////////////////////////////////////////
18  inline zgsmatrix();
19  inline zgsmatrix(const zgsmatrix&);
20  inline zgsmatrix(const _zgsmatrix&);
21  inline zgsmatrix(const CPPL_INT&, const CPPL_INT&, const CPPL_INT=0);
22  inline zgsmatrix(const char*);
23  inline ~zgsmatrix(); //destructor
24 
25  ///////////////////////////////////////////////
26  ////////////////// functions //////////////////
27  ///////////////////////////////////////////////
28  //////// cast ////////
29  inline _zgematrix to_zgematrix() const;
30 
31  //////// io ////////
32  inline comple operator()(const CPPL_INT&, const CPPL_INT&) const;
33  inline comple& operator()(const CPPL_INT&, const CPPL_INT&);
34  inline zgsmatrix& put(const CPPL_INT&, const CPPL_INT&, const comple&);
35  inline zgsmatrix& del(const CPPL_INT, const CPPL_INT); //<-- NOT (const CPPL_INT&)
36  inline zgsmatrix& del(const CPPL_INT); //<-- NOT (const CPPL_INT&)
37  inline friend std::ostream& operator<<(std::ostream&, const zgsmatrix&);
38  inline void write(const char*) const;
39  inline void read(const char*);
40 
41  //////// misc ////////
42  inline void clear();
43  inline zgsmatrix& zero();
44  inline zgsmatrix& identity();
45  inline void chsign();
46  inline void copy(const zgsmatrix&);
47  inline void shallow_copy(const _zgsmatrix&);
48  inline zgsmatrix& resize(const CPPL_INT&, const CPPL_INT&, const CPPL_INT=0, const CPPL_INT=0);
49  inline void stretch(const CPPL_INT&, const CPPL_INT&);
50  inline void expand(const CPPL_INT&);
51  inline bool isListed(const CPPL_INT&, const CPPL_INT&);
52  inline CPPL_INT number(const CPPL_INT&, const CPPL_INT&);
53  inline void checkup();
54  inline void diet(const double=DBL_MIN);
55  inline _zrovector row(const CPPL_INT&) const;
56  inline _zcovector col(const CPPL_INT&) const;
57  inline friend void swap(zgsmatrix&, zgsmatrix&);
58  inline friend _zgsmatrix _(zgsmatrix&);
59 
60  //////// calc ////////
61  inline friend _zgsmatrix t(const zgsmatrix&);
62  ////inline friend _zgematrix i(const zgsmatrix&);
63  inline friend _zgsmatrix conj(const zgsmatrix&);
64  inline friend _zgsmatrix conjt(const zgsmatrix&);
65  inline friend void idamax(CPPL_INT&, CPPL_INT&, const zgsmatrix&);
66  inline friend comple damax(const zgsmatrix&);
67 
68  ///////////////////////////////////////////////
69  ///////////// numerical operators /////////////
70  ///////////////////////////////////////////////
71  //////// = ////////
72  inline zgsmatrix& operator=(const zgsmatrix&);
73  inline zgsmatrix& operator=(const _zgsmatrix&);
74 
75  //////// += ////////
76  inline zgsmatrix& operator+=(const zgsmatrix&);
77  inline zgsmatrix& operator+=(const _zgsmatrix&);
78 
79  //////// -= ////////
80  inline zgsmatrix& operator-=(const zgsmatrix&);
81  inline zgsmatrix& operator-=(const _zgsmatrix&);
82 
83  //////// *= ////////
84  inline zgsmatrix& operator*=(const zgsmatrix&);
85  inline zgsmatrix& operator*=(const _zgsmatrix&);
86  inline zgsmatrix& operator*=(const double&);
87  inline zgsmatrix& operator*=(const comple&);
88 
89  //////// /= ////////
90  inline zgsmatrix& operator/=(const double&);
91  inline zgsmatrix& operator/=(const comple&);
92 
93  //////// unary ////////
94  inline friend const zgsmatrix& operator+(const zgsmatrix&);
95  inline friend _zgsmatrix operator-(const zgsmatrix&);
96 
97  //////// + ////////
98  inline friend _zgematrix operator+(const zgsmatrix&, const zgematrix&);
99  inline friend _zgematrix operator+(const zgsmatrix&, const _zgematrix&);
100  inline friend _zgematrix operator+(const zgsmatrix&, const zhematrix&);
101  inline friend _zgematrix operator+(const zgsmatrix&, const _zhematrix&);
102  inline friend _zgematrix operator+(const zgsmatrix&, const zgbmatrix&);
103  inline friend _zgematrix operator+(const zgsmatrix&, const _zgbmatrix&);
104  inline friend _zgsmatrix operator+(const zgsmatrix&, const zgsmatrix&);
105  inline friend _zgsmatrix operator+(const zgsmatrix&, const _zgsmatrix&);
106  inline friend _zgsmatrix operator+(const zgsmatrix&, const zhsmatrix&);
107  inline friend _zgsmatrix operator+(const zgsmatrix&, const _zhsmatrix&);
108 
109  //////// - ////////
110  inline friend _zgematrix operator-(const zgsmatrix&, const zgematrix&);
111  inline friend _zgematrix operator-(const zgsmatrix&, const _zgematrix&);
112  inline friend _zgematrix operator-(const zgsmatrix&, const zhematrix&);
113  inline friend _zgematrix operator-(const zgsmatrix&, const _zhematrix&);
114  inline friend _zgematrix operator-(const zgsmatrix&, const zgbmatrix&);
115  inline friend _zgematrix operator-(const zgsmatrix&, const _zgbmatrix&);
116  inline friend _zgsmatrix operator-(const zgsmatrix&, const zgsmatrix&);
117  inline friend _zgsmatrix operator-(const zgsmatrix&, const _zgsmatrix&);
118  inline friend _zgsmatrix operator-(const zgsmatrix&, const zhsmatrix&);
119  inline friend _zgsmatrix operator-(const zgsmatrix&, const _zhsmatrix&);
120 
121  //////// * ////////
122  inline friend _zcovector operator*(const zgsmatrix&, const zcovector&);
123  inline friend _zcovector operator*(const zgsmatrix&, const _zcovector&);
124  inline friend _zgematrix operator*(const zgsmatrix&, const zgematrix&);
125  inline friend _zgematrix operator*(const zgsmatrix&, const _zgematrix&);
126  inline friend _zgematrix operator*(const zgsmatrix&, const zhematrix&);
127  inline friend _zgematrix operator*(const zgsmatrix&, const _zhematrix&);
128  inline friend _zgematrix operator*(const zgsmatrix&, const zgbmatrix&);
129  inline friend _zgematrix operator*(const zgsmatrix&, const _zgbmatrix&);
130  inline friend _zgsmatrix operator*(const zgsmatrix&, const zgsmatrix&);
131  inline friend _zgsmatrix operator*(const zgsmatrix&, const _zgsmatrix&);
132  inline friend _zgsmatrix operator*(const zgsmatrix&, const zhsmatrix&);
133  inline friend _zgsmatrix operator*(const zgsmatrix&, const _zhsmatrix&);
134  inline friend _zgsmatrix operator*(const zgsmatrix&, const double&);
135  inline friend _zgsmatrix operator*(const zgsmatrix&, const comple&);
136 
137  //////// / ////////
138  inline friend _zgsmatrix operator/(const zgsmatrix&, const double&);
139  inline friend _zgsmatrix operator/(const zgsmatrix&, const comple&);
140 
141  //////// double, comple ////////
142  inline friend _zgsmatrix operator*(const double&, const zgsmatrix&);
143  inline friend _zgsmatrix operator*(const comple&, const zgsmatrix&);
144 };
friend std::ostream & operator<<(std::ostream &, const zgsmatrix &)
void clear()
(DO NOT USE) Smart-temporary Complex Double-precision Hermitian Matrix Class
Definition: _zhematrix.hpp:3
Complex Double-precision General Sparse Matrix Class.
Definition: zgsmatrix.hpp:3
friend _zgsmatrix _(zgsmatrix &)
zgsmatrix & operator/=(const double &)
zgsmatrix & del(const CPPL_INT, const CPPL_INT)
void read(const char *)
bool isListed(const CPPL_INT &, const CPPL_INT &)
zgsmatrix & operator=(const zgsmatrix &)
_zcovector col(const CPPL_INT &) const
zgsmatrix & resize(const CPPL_INT &, const CPPL_INT &, const CPPL_INT=0, const CPPL_INT=0)
void stretch(const CPPL_INT &, const CPPL_INT &)
zgsmatrix & operator+=(const zgsmatrix &)
(DO NOT USE) Smart-temporary Real Double-precision General Sparse Matrix Class
Definition: _zgsmatrix.hpp:3
zgsmatrix & put(const CPPL_INT &, const CPPL_INT &, const comple &)
void copy(const zgsmatrix &)
void shallow_copy(const _zgsmatrix &)
zgsmatrix & operator-=(const zgsmatrix &)
_zrovector row(const CPPL_INT &) const
Complex Double-precision General Dence Matrix Class.
Definition: zgematrix.hpp:3
std::vector< std::vector< CPPL_INT > > rows
array of vector to store the entry information of component for each row
Definition: zgsmatrix.hpp:12
std::vector< zcomponent > data
matrix data
Definition: zgsmatrix.hpp:11
void expand(const CPPL_INT &)
(DO NOT USE) Smart-temporary Complex Double-precision Row Vector Class
Definition: _zrovector.hpp:3
(DO NOT USE) Smart-temporary Complex Double-precision General Dence Matrix Class
Definition: _zgematrix.hpp:3
friend _zgsmatrix conjt(const zgsmatrix &)
friend _zgsmatrix t(const zgsmatrix &)
friend _zgsmatrix conj(const zgsmatrix &)
friend void swap(zgsmatrix &, zgsmatrix &)
_zgematrix to_zgematrix() const
friend void idamax(CPPL_INT &, CPPL_INT &, const zgsmatrix &)
zgsmatrix & identity()
Complex Double-precision Hermitian Sparse Matrix Class.
Definition: zhsmatrix.hpp:3
void write(const char *) const
void diet(const double=DBL_MIN)
Complex Double-precision General Band Matrix Class.
Definition: zgbmatrix.hpp:3
friend _zgsmatrix operator-(const zgsmatrix &)
zgsmatrix & operator*=(const zgsmatrix &)
(DO NOT USE) Smart-temporary Complex Double-precision General Band Matrix Class
Definition: _zgbmatrix.hpp:3
CPPL_INT number(const CPPL_INT &, const CPPL_INT &)
Complex Double-precision Hermitian Matrix Class [l-type (UPLO=l) Strage].
Definition: zhematrix.hpp:4
std::vector< std::vector< CPPL_INT > > cols
array of vector to store the entry information of component for each column
Definition: zgsmatrix.hpp:13
CPPL_INT m
matrix row size
Definition: zgsmatrix.hpp:9
zgsmatrix & zero()
Complex Double-precision Column Vector Class.
Definition: zcovector.hpp:3
(DO NOT USE) Smart-temporary Complex Double-precision Column Vector Class
Definition: _zcovector.hpp:3
CPPL_INT n
matrix column size
Definition: zgsmatrix.hpp:10
friend const zgsmatrix & operator+(const zgsmatrix &)
comple operator()(const CPPL_INT &, const CPPL_INT &) const
Definition: zgsmatrix-io.hpp:3
(DO NOT USE) Smart-temporary Complex Double-precision Hermitian Sparse Matrix Class ...
Definition: _zhsmatrix.hpp:3
friend _zgsmatrix operator/(const zgsmatrix &, const double &)
friend comple damax(const zgsmatrix &)
friend _zcovector operator*(const zgsmatrix &, const zcovector &)