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