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