CPPLapack
 All Classes Files Functions Variables Friends Pages
Public Member Functions | Public Attributes | Friends | List of all members
zhsmatrix Class Reference

Complex Double-precision Hermitian Sparse Matrix Class. More...

#include <zhsmatrix.hpp>

Public Member Functions

 zhsmatrix ()
 
 zhsmatrix (const zhsmatrix &)
 
 zhsmatrix (const _zhsmatrix &)
 
 zhsmatrix (const CPPL_INT &, const CPPL_INT=0)
 
 zhsmatrix (const char *)
 
 zhsmatrix (const zgematrix &)
 
 ~zhsmatrix ()
 
_zgematrix to_zgematrix () const
 
_zhematrix to_zhematrix () const
 
_zgsmatrix to_zgsmatrix () const
 
comple operator() (const CPPL_INT &, const CPPL_INT &) const
 
zhecomplex operator() (const CPPL_INT &, const CPPL_INT &)
 
zhsmatrixput (const CPPL_INT &, const CPPL_INT &, const comple &)
 
zhsmatrixdel (const CPPL_INT, const CPPL_INT)
 
zhsmatrixdel (const CPPL_INT)
 
void write (const char *) const
 
void read (const char *)
 
void clear ()
 
zhsmatrixzero ()
 
zhsmatrixidentity ()
 
void chsign ()
 
void copy (const zhsmatrix &)
 
void shallow_copy (const _zhsmatrix &)
 
zhsmatrixresize (const CPPL_INT &, const CPPL_INT=0, const CPPL_INT=0)
 
void stretch (const CPPL_INT &)
 
void expand (const CPPL_INT &)
 
bool isListed (const CPPL_INT &, const CPPL_INT &) const
 
CPPL_INT number (const CPPL_INT &, const CPPL_INT &) const
 
void checkup ()
 
_zrovector row (const CPPL_INT &) const
 
_zcovector col (const CPPL_INT &) const
 
void diet (const double=DBL_MIN)
 
zhsmatrixoperator= (const zhsmatrix &)
 
zhsmatrixoperator= (const _zhsmatrix &)
 
zhsmatrixoperator+= (const zhsmatrix &)
 
zhsmatrixoperator+= (const _zhsmatrix &)
 
zhsmatrixoperator-= (const zhsmatrix &)
 
zhsmatrixoperator-= (const _zhsmatrix &)
 
zhsmatrixoperator*= (const double &)
 
zhsmatrixoperator/= (const double &)
 

Public Attributes

CPPL_INT const & m
 matrix row size More...
 
CPPL_INT n
 matrix column size More...
 
std::vector< zcomponentdata
 matrix data More...
 
std::vector< std::vector
< CPPL_INT > > 
line
 vector of vector to store the entry information of component for each row and column More...
 

Friends

std::ostream & operator<< (std::ostream &, const zhsmatrix &)
 
void swap (zhsmatrix &, zhsmatrix &)
 
_zhsmatrix _ (zhsmatrix &)
 
_zhsmatrix t (const zhsmatrix &)
 
void idamax (CPPL_INT &, CPPL_INT &, const zhsmatrix &)
 
comple damax (const zhsmatrix &)
 
const zhsmatrixoperator+ (const zhsmatrix &)
 
_zhsmatrix operator- (const zhsmatrix &)
 
_zgematrix operator+ (const zhsmatrix &, const zgematrix &)
 
_zgematrix operator+ (const zhsmatrix &, const _zgematrix &)
 
_zgematrix operator+ (const zhsmatrix &, const zhematrix &)
 
_zgematrix operator+ (const zhsmatrix &, const _zhematrix &)
 
_zgematrix operator+ (const zhsmatrix &, const zgbmatrix &)
 
_zgematrix operator+ (const zhsmatrix &, const _zgbmatrix &)
 
_zgsmatrix operator+ (const zhsmatrix &, const zgsmatrix &)
 
_zgsmatrix operator+ (const zhsmatrix &, const _zgsmatrix &)
 
_zhsmatrix operator+ (const zhsmatrix &, const zhsmatrix &)
 
_zhsmatrix operator+ (const zhsmatrix &, const _zhsmatrix &)
 
_zgematrix operator- (const zhsmatrix &, const zgematrix &)
 
_zgematrix operator- (const zhsmatrix &, const _zgematrix &)
 
_zgematrix operator- (const zhsmatrix &, const zhematrix &)
 
_zgematrix operator- (const zhsmatrix &, const _zhematrix &)
 
_zgematrix operator- (const zhsmatrix &, const zgbmatrix &)
 
_zgematrix operator- (const zhsmatrix &, const _zgbmatrix &)
 
_zgsmatrix operator- (const zhsmatrix &, const zgsmatrix &)
 
_zgsmatrix operator- (const zhsmatrix &, const _zgsmatrix &)
 
_zhsmatrix operator- (const zhsmatrix &, const zhsmatrix &)
 
_zhsmatrix operator- (const zhsmatrix &, const _zhsmatrix &)
 
_zcovector operator* (const zhsmatrix &, const zcovector &)
 
_zcovector operator* (const zhsmatrix &, const _zcovector &)
 
_zgematrix operator* (const zhsmatrix &, const zgematrix &)
 
_zgematrix operator* (const zhsmatrix &, const _zgematrix &)
 
_zgematrix operator* (const zhsmatrix &, const zhematrix &)
 
_zgematrix operator* (const zhsmatrix &, const _zhematrix &)
 
_zgematrix operator* (const zhsmatrix &, const zgbmatrix &)
 
_zgematrix operator* (const zhsmatrix &, const _zgbmatrix &)
 
_zgsmatrix operator* (const zhsmatrix &, const zgsmatrix &)
 
_zgsmatrix operator* (const zhsmatrix &, const _zgsmatrix &)
 
_zgsmatrix operator* (const zhsmatrix &, const zhsmatrix &)
 
_zgsmatrix operator* (const zhsmatrix &, const _zhsmatrix &)
 
_zhsmatrix operator* (const zhsmatrix &, const double &)
 
_zgsmatrix operator* (const zhsmatrix &, const comple &)
 
_zhsmatrix operator/ (const zhsmatrix &, const double &)
 
_zgsmatrix operator/ (const zhsmatrix &, const comple &)
 
_zhsmatrix operator* (const double &, const zhsmatrix &)
 
_zgsmatrix operator* (const comple &, const zhsmatrix &)
 

Detailed Description

Complex Double-precision Hermitian Sparse Matrix Class.

Definition at line 3 of file zhsmatrix.hpp.

Constructor & Destructor Documentation

zhsmatrix::zhsmatrix ( )
inline

zhsmatrix constructor without arguments

Definition at line 3 of file zhsmatrix-constructor.hpp.

References data, line, and n.

4  : m(n)
5 {CPPL_VERBOSE_REPORT;
6  //////// initialize ////////
7  n =0;
8  data.clear();
9  line.clear();
10 }
CPPL_INT n
matrix column size
Definition: zhsmatrix.hpp:10
std::vector< zcomponent > data
matrix data
Definition: zhsmatrix.hpp:11
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
CPPL_INT const & m
matrix row size
Definition: zhsmatrix.hpp:9
zhsmatrix::zhsmatrix ( const zhsmatrix mat)
inline

zhsmatrix copy constructor

Definition at line 18 of file zhsmatrix-constructor.hpp.

References copy(), data, and line.

19  : m(n)
20 {CPPL_VERBOSE_REPORT;
21  data.clear();
22  line.clear();
23  copy(mat);
24 }
void copy(const zhsmatrix &)
CPPL_INT n
matrix column size
Definition: zhsmatrix.hpp:10
std::vector< zcomponent > data
matrix data
Definition: zhsmatrix.hpp:11
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
CPPL_INT const & m
matrix row size
Definition: zhsmatrix.hpp:9
zhsmatrix::zhsmatrix ( const _zhsmatrix mat)
inline

zhsmatrix constructor to cast _zhsmatrix

Definition at line 28 of file zhsmatrix-constructor.hpp.

References data, _zhsmatrix::data, line, _zhsmatrix::line, n, _zhsmatrix::n, and _zhsmatrix::nullify().

29  : m(n)
30 {CPPL_VERBOSE_REPORT;
31  n =mat.n;
32  data.clear();
33  line.clear();
34 
35  data.swap(mat.data);
36  line.swap(mat.line);
37 
38  mat.nullify();
39 }
std::vector< zcomponent > data
matrix data
Definition: _zhsmatrix.hpp:12
CPPL_INT n
matrix column size
Definition: zhsmatrix.hpp:10
void nullify() const
CPPL_INT n
matrix column size
Definition: _zhsmatrix.hpp:11
std::vector< zcomponent > data
matrix data
Definition: zhsmatrix.hpp:11
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
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:13
CPPL_INT const & m
matrix row size
Definition: zhsmatrix.hpp:9
zhsmatrix::zhsmatrix ( const CPPL_INT &  _n,
const CPPL_INT  _c = 0 
)
inline

zhsmatrix constructor with size specification

Definition at line 47 of file zhsmatrix-constructor.hpp.

References data, line, and n.

48  : m(n)
49 {CPPL_VERBOSE_REPORT;
50 #ifdef CPPL_DEBUG
51  if( _n<0 || _c<0 ){
52  ERROR_REPORT;
53  std::cerr << "Matrix sizes and the length of arrays must be positive integers. " << std::endl
54  << "Your input was (" << _n << "," << _c << ")." << std::endl;
55  exit(1);
56  }
57 #endif//CPPL_DEBUG
58 
59  //////// initialize ////////
60  n =_n;
61  data.resize(0);
62  data.reserve(_c);
63  line.resize(n);
64 }
CPPL_INT n
matrix column size
Definition: zhsmatrix.hpp:10
std::vector< zcomponent > data
matrix data
Definition: zhsmatrix.hpp:11
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
CPPL_INT const & m
matrix row size
Definition: zhsmatrix.hpp:9
zhsmatrix::zhsmatrix ( const char *  filename)
inline

zhsmatrix constructor with filename

Definition at line 68 of file zhsmatrix-constructor.hpp.

References data, line, and read().

69  : m(n)
70 {CPPL_VERBOSE_REPORT;
71  data.clear();
72  line.clear();
73 
74  //// read ////
75  read(filename);
76 }
CPPL_INT n
matrix column size
Definition: zhsmatrix.hpp:10
void read(const char *)
std::vector< zcomponent > data
matrix data
Definition: zhsmatrix.hpp:11
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
CPPL_INT const & m
matrix row size
Definition: zhsmatrix.hpp:9
zhsmatrix::zhsmatrix ( const zgematrix )
inline
zhsmatrix::~zhsmatrix ( )
inline

zhsmatrix destructor

Definition at line 84 of file zhsmatrix-constructor.hpp.

References data, and line.

85 {CPPL_VERBOSE_REPORT;
86  data.clear();
87  line.clear();
88 }
std::vector< zcomponent > data
matrix data
Definition: zhsmatrix.hpp:11
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

Member Function Documentation

_zgematrix zhsmatrix::to_zgematrix ( ) const
inline

convert to _zgematrix

Definition at line 3 of file zhsmatrix-cast.hpp.

References _, conj(), data, m, n, and zero().

4 {CPPL_VERBOSE_REPORT;
5  zgematrix newmat( zgematrix(m,n).zero() );
6 
7  const std::vector<zcomponent>::const_iterator data_end =data.end();
8  for(std::vector<zcomponent>::const_iterator it=data.begin(); it!=data_end; it++){
9  newmat(it->i, it->j) =it->v;
10  newmat(it->j, it->i) =std::conj(it->v);
11  }
12 
13  return _(newmat);
14 }
friend _zhsmatrix _(zhsmatrix &)
CPPL_INT n
matrix column size
Definition: zhsmatrix.hpp:10
_zcovector conj(const _zcovector &vec)
Complex Double-precision General Dence Matrix Class.
Definition: zgematrix.hpp:3
std::vector< zcomponent > data
matrix data
Definition: zhsmatrix.hpp:11
zhsmatrix & zero()
CPPL_INT const & m
matrix row size
Definition: zhsmatrix.hpp:9
_zhematrix zhsmatrix::to_zhematrix ( ) const
inline

convert to _zhematrix

Definition at line 18 of file zhsmatrix-cast.hpp.

References _, data, n, and zhematrix::zero().

19 {CPPL_VERBOSE_REPORT;
20  zhematrix newmat(n);
21  newmat.zero();
22 
23  const std::vector<zcomponent>::const_iterator data_end =data.end();
24  for(std::vector<zcomponent>::const_iterator it=data.begin(); it!=data_end; it++){
25  newmat(it->i, it->j) =it->v;
26  }
27 
28  return _(newmat);
29 }
friend _zhsmatrix _(zhsmatrix &)
CPPL_INT n
matrix column size
Definition: zhsmatrix.hpp:10
std::vector< zcomponent > data
matrix data
Definition: zhsmatrix.hpp:11
Complex Double-precision Hermitian Matrix Class [l-type (UPLO=l) Strage].
Definition: zhematrix.hpp:4
_zgsmatrix zhsmatrix::to_zgsmatrix ( ) const
inline

convert to _zgsmatrix

Definition at line 33 of file zhsmatrix-cast.hpp.

References _, conj(), data, m, n, zgsmatrix::put(), and zgsmatrix::zero().

Referenced by operator*(), and operator/().

34 {CPPL_VERBOSE_REPORT;
35  zgsmatrix newmat(m,n);
36  newmat.zero();
37 
38  const std::vector<zcomponent>::const_iterator data_end =data.end();
39  for(std::vector<zcomponent>::const_iterator it=data.begin(); it!=data_end; it++){
40  newmat.put(it->i, it->j, it->v);
41  if(it->i!=it->j){
42  newmat.put(it->j, it->i, std::conj(it->v));
43  }
44  }
45 
46  return _(newmat);
47 }
Complex Double-precision General Sparse Matrix Class.
Definition: zgsmatrix.hpp:3
friend _zhsmatrix _(zhsmatrix &)
CPPL_INT n
matrix column size
Definition: zhsmatrix.hpp:10
_zcovector conj(const _zcovector &vec)
std::vector< zcomponent > data
matrix data
Definition: zhsmatrix.hpp:11
CPPL_INT const & m
matrix row size
Definition: zhsmatrix.hpp:9
comple zhsmatrix::operator() ( const CPPL_INT &  i,
const CPPL_INT &  j 
) const
inline

operator() for const object

Definition at line 3 of file zhsmatrix-io.hpp.

References conj(), data, line, and n.

4 {CPPL_VERBOSE_REPORT;
5 #ifdef CPPL_DEBUG
6  if( i<0 || j<0 || n<=i || n<=j ){
7  ERROR_REPORT;
8  std::cerr << "The required component is out of the matrix size." << std::endl
9  << "Your input is (" << i << "," << j << "), whereas the matrix size is " << n << "x" << n << "." << std::endl;
10  exit(1);
11  }
12 #endif//CPPL_DEBUG
13 
14  //// search (i,j) component ////
15  const CPPL_INT ii(std::max(i,j)), jj(std::min(i,j));
16 
17  const std::vector<CPPL_INT>::const_iterator line_ii_end =line[ii].end();
18  for(std::vector<CPPL_INT>::const_iterator p=line[ii].begin(); p!=line_ii_end; p++){
19  if(data[*p].i==ii && data[*p].j==jj){
20  if( i>j ){ return data[*p].v; }//ii=i
21  else{ return std::conj(data[*p].v); }//ii=j
22  }
23  }
24 
25  //// (i,j) component was not found ////
26  return comple(0.0,0.0);
27 }
_dgematrix i(const _dgbmatrix &mat)
CPPL_INT n
matrix column size
Definition: zhsmatrix.hpp:10
_zcovector conj(const _zcovector &vec)
std::vector< zcomponent > data
matrix data
Definition: zhsmatrix.hpp:11
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
zhecomplex zhsmatrix::operator() ( const CPPL_INT &  i,
const CPPL_INT &  j 
)
inline

operator()

Definition at line 31 of file zhsmatrix-io.hpp.

References data, i(), line, and n.

32 {CPPL_VERBOSE_REPORT;
33 #ifdef CPPL_DEBUG
34  if( i<0 || j<0 || n<=i || n<=j ){
35  ERROR_REPORT;
36  std::cerr << "The required component is out of the matrix size." << std::endl
37  << "Your input is (" << i << "," << j << "), whereas the matrix size is " << n << "x" << n << "." << std::endl;
38  exit(1);
39  }
40 #endif//CPPL_DEBUG
41 
42  //////// search (i,j) component ////////
43  const CPPL_INT ii(std::max(i,j)), jj(std::min(i,j));
44 
45  const std::vector<CPPL_INT>::const_iterator line_ii_end =line[ii].end();
46  for(std::vector<CPPL_INT>::const_iterator p=line[ii].begin(); p!=line_ii_end; p++){
47  if(data[*p].i==ii && data[*p].j==jj){
48  return zhecomplex(i,j, data[*p].v);
49  }
50  }
51 
52  //////// (i,j) component not found ////////
53  if(i>j){
54  line[i].push_back(CPPL_INT(data.size()));
55  line[j].push_back(CPPL_INT(data.size()));
56  data.push_back(zcomponent(i,j,comple(0.,0.)));
57  }
58  else if(i<j){
59  line[i].push_back(CPPL_INT(data.size()));
60  line[j].push_back(CPPL_INT(data.size()));
61  data.push_back(zcomponent(j,i,comple(0.,0.)));
62  }
63  else{//i==j
64  line[i].push_back(CPPL_INT(data.size()));
65  data.push_back(zcomponent(i,i,comple(0.,0.)));
66  }
67 
68  return zhecomplex(i,j, data.back().v);
69 }
_dgematrix i(const _dgbmatrix &mat)
CPPL_INT n
matrix column size
Definition: zhsmatrix.hpp:10
std::vector< zcomponent > data
matrix data
Definition: zhsmatrix.hpp:11
Component Class for Complex Double-precision Sparse Matrix Classes.
Definition: zcomponent.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
(DO NOT USE) Complex-double Class for Hermitian matrices
Definition: zhecomplex.hpp:3
zhsmatrix & zhsmatrix::put ( const CPPL_INT &  i,
const CPPL_INT &  j,
const comple &  v 
)
inline

put value with volume cheack without isListed check

Definition at line 77 of file zhsmatrix-io.hpp.

References conj(), data, i(), isListed(), line, and n.

Referenced by identity(), read(), _dssmatrix::to_zhsmatrix(), and dssmatrix::to_zhsmatrix().

78 {CPPL_VERBOSE_REPORT;
79 #ifdef CPPL_DEBUG
80  if( i<0 || j<0 || n<=i || n<=j ){
81  ERROR_REPORT;
82  std::cerr << "The required component is out of the matrix size." << std::endl
83  << "Your input is (" << i << "," << j << "), whereas the matrix size is " << n << "x" << n << "." << std::endl;
84  exit(1);
85  }
86 
87  if( isListed(i,j) ){
88  ERROR_REPORT;
89  std::cerr << "The required component is already listed." << std::endl
90  << "Your input was (" << i << "," << j << ")." << std::endl;
91  exit(1);
92  }
93 #endif//CPPL_DEBUG
94 
95  //// push ////
96  if(i==j){
97  line[i].push_back(CPPL_INT(data.size()));
98  data.push_back(zcomponent(i,j,v));
99  }
100  else if(i>j){
101  line[i].push_back(CPPL_INT(data.size()));
102  line[j].push_back(CPPL_INT(data.size()));
103  data.push_back(zcomponent(i,j,v));
104  }
105  else{//i<j
106  line[i].push_back(CPPL_INT(data.size()));
107  line[j].push_back(CPPL_INT(data.size()));
108  data.push_back(zcomponent(j,i,conj(v)));
109  }
110 
111  return *this;
112 }
bool isListed(const CPPL_INT &, const CPPL_INT &) const
_dgematrix i(const _dgbmatrix &mat)
CPPL_INT n
matrix column size
Definition: zhsmatrix.hpp:10
_zcovector conj(const _zcovector &vec)
std::vector< zcomponent > data
matrix data
Definition: zhsmatrix.hpp:11
Component Class for Complex Double-precision Sparse Matrix Classes.
Definition: zcomponent.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
zhsmatrix & zhsmatrix::del ( const CPPL_INT  i,
const CPPL_INT  j 
)
inline

delete the entry of a component

Definition at line 120 of file zhsmatrix-io.hpp.

References data, line, and n.

Referenced by diet(), and stretch().

121 {CPPL_VERBOSE_REPORT;
122 #ifdef CPPL_DEBUG
123  if( i<0 || j<0 || n<=i || n<=j ){
124  ERROR_REPORT;
125  std::cerr << "The required component is out of the matrix size." << std::endl
126  << "Your input was (" << i << "," << j << ")." << std::endl;
127  exit(1);
128  }
129 #endif//CPPL_DEBUG
130 
131  const CPPL_INT ii(std::max(i,j)), jj(std::min(i,j));
132 
133  //////// search (i,j) component ////////
134  const std::vector<CPPL_INT>::iterator line_ii_end =line[ii].end();
135  for(std::vector<CPPL_INT>::iterator p=line[ii].begin(); p!=line_ii_end; p++){
136  if( data[*p].i==ii && data[*p].j==jj ){//exists
137  //// save position ////
138  CPPL_INT c =*p;
139  CPPL_INT C =CPPL_INT(data.size()-1);
140 
141  //// data translation ////
142  data[c]=data.back();
143  data.pop_back();
144 
145  //// remove from List ////
146  line[ii].erase(p);
147  if(i!=j){//off-diagonal
148  const std::vector<CPPL_INT>::iterator line_jj_end =line[jj].end();
149  for(std::vector<CPPL_INT>::iterator pj=line[jj].begin(); pj!=line_jj_end; pj++){
150  if(*pj==c){ line[jj].erase(pj); break; }
151  }
152  }
153 
154  //// modify the entry of translated component ////
155  CPPL_INT I(data[c].i), J(data[c].j);
156  const std::vector<CPPL_INT>::iterator line_I_end =line[I].end();
157  for(std::vector<CPPL_INT>::iterator q=line[I].begin(); q!=line_I_end; q++){
158  if(*q==C){ *q=c; break; }
159  }
160  if(I!=J){//off-diagonal
161  const std::vector<CPPL_INT>::iterator line_J_end =line[J].end();
162  for(std::vector<CPPL_INT>::iterator q=line[J].begin(); q!=line_J_end; q++){
163  if(*q==C){ *q=c; break; }
164  }
165  }
166  return *this;
167  }
168  }
169 
170 #ifdef CPPL_DEBUG
171  std::cerr << "# [NOTE]@zhsmatrix::del(CPPL_INT&, CPPL_INT&): The required component was not listed. Your input was (" << i << "," << j << ")." << std::endl;
172 #endif//CPPL_DEBUG
173 
174  return *this;
175 }
_dgematrix i(const _dgbmatrix &mat)
CPPL_INT n
matrix column size
Definition: zhsmatrix.hpp:10
std::vector< zcomponent > data
matrix data
Definition: zhsmatrix.hpp:11
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
zhsmatrix & zhsmatrix::del ( const CPPL_INT  c)
inline

delete the entry of an element

Definition at line 179 of file zhsmatrix-io.hpp.

References data, i(), and line.

180 {CPPL_VERBOSE_REPORT;
181 #ifdef CPPL_DEBUG
182  if( c<0 || c>=CPPL_INT(data.size()) ){
183  ERROR_REPORT;
184  std::cerr << "The required element is out of the matrix volume." << std::endl
185  << "Your input was (" << c << ")." << std::endl;
186  exit(1);
187  }
188 #endif//CPPL_DEBUG
189 
190  if( c==CPPL_INT(data.size()-1) ){//if c is the last element
191  CPPL_INT i(data[c].i), j(data[c].j);
192  const std::vector<CPPL_INT>::iterator line_i_end =line[i].end();
193  for(std::vector<CPPL_INT>::iterator q=line[i].begin(); q!=line_i_end; q++){
194  if( *q==c ){ line[i].erase(q); break; }
195  }
196  if(i!=j){//off-diagonal
197  const std::vector<CPPL_INT>::iterator line_j_end =line[j].end();
198  for(std::vector<CPPL_INT>::iterator q=line[j].begin(); q!=line_j_end; q++){
199  if( *q==c ){ line[j].erase(q); break; }
200  }
201  }
202  data.pop_back();
203  }
204 
205  else{//c is NOT the last element
206  //// data translation ////
207  CPPL_INT C =CPPL_INT(data.size()-1);
208  CPPL_INT i(data[c].i), j(data[c].j), I(data.back().i), J(data.back().j);
209  data[c]=data.back();
210  //std::cerr << "c=" << c << " i=" << i << " j=" << j << " C=" << vol << " I=" << I << " J=" << J << std::endl;
211  //// remove entry of component ////
212  const std::vector<CPPL_INT>::iterator line_i_end =line[i].end();
213  for(std::vector<CPPL_INT>::iterator q=line[i].begin(); q!=line_i_end; q++){
214  if( *q==c ){ line[i].erase(q); break; }
215  }
216  if(i!=j){//off-diagonal
217  const std::vector<CPPL_INT>::iterator line_j_end =line[j].end();
218  for(std::vector<CPPL_INT>::iterator q=line[j].begin(); q!=line_j_end; q++){
219  if( *q==c ){ line[j].erase(q); break; }
220  }
221  }
222  //// modify the entry of translated component ////
223  const std::vector<CPPL_INT>::iterator line_I_end =line[I].end();
224  for(std::vector<CPPL_INT>::iterator q=line[I].begin(); q!=line_I_end; q++){
225  if(*q==C){ *q=c; break; }
226  }
227  if(I!=J){//off-diagonal
228  const std::vector<CPPL_INT>::iterator line_J_end =line[J].end();
229  for(std::vector<CPPL_INT>::iterator q=line[J].begin(); q!=line_J_end; q++){
230  if(*q==C){ *q=c; break; }
231  }
232  }
233  //// pop_back ////
234  data.pop_back();
235  }
236 
237  return *this;
238 }
_dgematrix i(const _dgbmatrix &mat)
std::vector< zcomponent > data
matrix data
Definition: zhsmatrix.hpp:11
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
void zhsmatrix::write ( const char *  filename) const
inline

Definition at line 277 of file zhsmatrix-io.hpp.

References data, and n.

278 {CPPL_VERBOSE_REPORT;
279  std::ofstream ofs(filename, std::ios::trunc);
280  ofs.setf(std::cout.flags());
281  ofs.precision(std::cout.precision());
282  ofs.width(std::cout.width());
283  ofs.fill(std::cout.fill());
284 
285  ofs << "#zhsmatrix " << n << " " << data.size() << std::endl;
286 
287  const std::vector<zcomponent>::const_iterator data_end =data.end();
288  for(std::vector<zcomponent>::const_iterator it=data.begin(); it!=data_end; it++){
289  ofs << it->i << " " << it->j << " " << it->v << std::endl;
290  }
291 
292  ofs.close();
293 }
CPPL_INT n
matrix column size
Definition: zhsmatrix.hpp:10
std::vector< zcomponent > data
matrix data
Definition: zhsmatrix.hpp:11
void zhsmatrix::read ( const char *  filename)
inline

Definition at line 296 of file zhsmatrix-io.hpp.

References data, i(), n, put(), and resize().

Referenced by zhsmatrix().

297 {CPPL_VERBOSE_REPORT;
298  std::ifstream s( filename );
299  if(!s){
300  ERROR_REPORT;
301  std::cerr << "The file \"" << filename << "\" can not be opened." << std::endl;
302  exit(1);
303  }
304 
305  std::string id;
306  s >> id;
307  if( id != "zhsmatrix" && id != "#zhsmatrix" ){
308  ERROR_REPORT;
309  std::cerr << "The type name of the file \"" << filename << "\" is not zhsmatrix." << std::endl
310  << "Its type name was " << id << " ." << std::endl;
311  exit(1);
312  }
313 
314  //////// n, size ////////
315  size_t size;
316  s >> n >> size;
317  resize(n);
318  data.reserve(size);
319 
320  //////// i, j, v ////////
321  CPPL_INT i, j;
322  comple v;
323  for(size_t k=0; k<size; k++){
324  s >> i >> j >> v;
325  put(i,j, v);
326  }
327 
328  //////// check ////////
329  s >> i;
330  if(!s.eof()){
331  ERROR_REPORT;
332  std::cerr << "There is something is wrong with the file \"" << filename << " ." << std::endl
333  << "Most likely, there are too many data components over the context." << std::endl;
334  exit(1);
335  }
336  s.close();
337 }
zhsmatrix & put(const CPPL_INT &, const CPPL_INT &, const comple &)
_dgematrix i(const _dgbmatrix &mat)
CPPL_INT n
matrix column size
Definition: zhsmatrix.hpp:10
std::vector< zcomponent > data
matrix data
Definition: zhsmatrix.hpp:11
zhsmatrix & resize(const CPPL_INT &, const CPPL_INT=0, const CPPL_INT=0)
void zhsmatrix::clear ( )
inline

clear all the matrix data and set the sizes 0

Definition at line 3 of file zhsmatrix-misc.hpp.

References data, line, and n.

4 {CPPL_VERBOSE_REPORT;
5  n =0;
6  data.clear();
7  line.clear();
8 }
CPPL_INT n
matrix column size
Definition: zhsmatrix.hpp:10
std::vector< zcomponent > data
matrix data
Definition: zhsmatrix.hpp:11
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
zhsmatrix & zhsmatrix::zero ( )
inline

change the matrix into a zero matrix

Definition at line 12 of file zhsmatrix-misc.hpp.

References data, i(), line, and n.

Referenced by col(), identity(), row(), and to_zgematrix().

13 {CPPL_VERBOSE_REPORT;
14  data.resize(0);
15  for(CPPL_INT i=0; i<n; i++){ line[i].resize(0); }
16  return *this;
17 }
_dgematrix i(const _dgbmatrix &mat)
CPPL_INT n
matrix column size
Definition: zhsmatrix.hpp:10
std::vector< zcomponent > data
matrix data
Definition: zhsmatrix.hpp:11
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
zhsmatrix & zhsmatrix::identity ( )
inline

change the matrix into an identity matrix

Definition at line 21 of file zhsmatrix-misc.hpp.

References i(), n, put(), and zero().

22 {CPPL_VERBOSE_REPORT;
23  zero();
24  for(CPPL_INT i=0; i<n; i++){
25  put(i,i, comple(1.,0.));
26  }
27  return *this;
28 }
zhsmatrix & put(const CPPL_INT &, const CPPL_INT &, const comple &)
_dgematrix i(const _dgbmatrix &mat)
CPPL_INT n
matrix column size
Definition: zhsmatrix.hpp:10
zhsmatrix & zero()
void zhsmatrix::chsign ( )
inline

change sign(+/-) of the matrix

Definition at line 32 of file zhsmatrix-misc.hpp.

References data.

33 {CPPL_VERBOSE_REPORT;
34  const std::vector<zcomponent>::iterator data_end =data.end();
35  for(std::vector<zcomponent>::iterator it=data.begin(); it!=data_end; it++){
36  it->v =-it->v;
37  }
38 }
std::vector< zcomponent > data
matrix data
Definition: zhsmatrix.hpp:11
void zhsmatrix::copy ( const zhsmatrix mat)
inline

make a deep copy of the matrix

Definition at line 42 of file zhsmatrix-misc.hpp.

References data, line, and n.

Referenced by operator=(), and zhsmatrix().

43 {CPPL_VERBOSE_REPORT;
44  n =mat.n;
45  data =mat.data;
46  line =mat.line;
47 }
CPPL_INT n
matrix column size
Definition: zhsmatrix.hpp:10
std::vector< zcomponent > data
matrix data
Definition: zhsmatrix.hpp:11
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
void zhsmatrix::shallow_copy ( const _zhsmatrix mat)
inline

make a shallow copy of the matrix
This function is not designed to be used in project codes.

Definition at line 52 of file zhsmatrix-misc.hpp.

References data, _zhsmatrix::data, line, _zhsmatrix::line, n, _zhsmatrix::n, and _zhsmatrix::nullify().

Referenced by operator=().

53 {CPPL_VERBOSE_REPORT;
54  data.clear();
55  line.clear();
56 
57  n =mat.n;
58  data.swap(mat.data);
59  line.swap(mat.line);
60 
61  mat.nullify();
62 }
std::vector< zcomponent > data
matrix data
Definition: _zhsmatrix.hpp:12
CPPL_INT n
matrix column size
Definition: zhsmatrix.hpp:10
void nullify() const
CPPL_INT n
matrix column size
Definition: _zhsmatrix.hpp:11
std::vector< zcomponent > data
matrix data
Definition: zhsmatrix.hpp:11
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
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:13
zhsmatrix & zhsmatrix::resize ( const CPPL_INT &  _n,
const CPPL_INT  _c = 0,
const CPPL_INT  _l = 0 
)
inline

resize the matrix

Definition at line 66 of file zhsmatrix-misc.hpp.

References data, i(), line, and n.

Referenced by read().

67 {CPPL_VERBOSE_REPORT;
68 #ifdef CPPL_DEBUG
69  if( _n<0 || _c<0 || _l<0 ){
70  ERROR_REPORT;
71  std::cerr << "Matrix sizes and the length of arrays must be positive integers. " << std::endl
72  << "Your input was (" << _n << "," << _c << "," << _l << ")." << std::endl;
73  exit(1);
74  }
75 #endif//CPPL_DEBUG
76 
77  n =_n;
78  data.resize(0);
79  data.reserve(_c);
80  line.resize(n);
81  for(CPPL_INT i=0; i<n; i++){
82  line[i].resize(0);
83  line[i].reserve(_l);
84  }
85 
86  return *this;
87 }
_dgematrix i(const _dgbmatrix &mat)
CPPL_INT n
matrix column size
Definition: zhsmatrix.hpp:10
std::vector< zcomponent > data
matrix data
Definition: zhsmatrix.hpp:11
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
void zhsmatrix::stretch ( const CPPL_INT &  dn)
inline

stretch the matrix size

Definition at line 91 of file zhsmatrix-misc.hpp.

References data, del(), i(), line, and n.

92 {CPPL_VERBOSE_REPORT;
93  if(dn==0){ return; }
94 
95 #ifdef CPPL_DEBUG
96  if( n+dn<0 ){
97  ERROR_REPORT;
98  std::cerr << "The new matrix size must be larger than zero." << std::endl
99  << "Your input was (" << dn << ")." << std::endl;
100  exit(1);
101  }
102 #endif//CPPL_DEBUG
103 
104  n +=dn;
105 
106  if(dn<0){
107  //// delete components over the new size ////
108  const std::vector<zcomponent>::reverse_iterator data_rend =data.rend();
109  for(std::vector<zcomponent>::reverse_iterator it=data.rbegin(); it!=data_rend; it++){
110  if( it->i>=n ){ del( CPPL_INT(data_rend-it-1) ); }
111  }
112  //// shrink line ////
113  for(CPPL_INT i=0; i<-dn; i++){
114  line.pop_back();
115  }
116  }
117  else{//dn>0
118  //// expand line ////
119  for(CPPL_INT i=0; i<dn; i++){
120  line.push_back( std::vector<CPPL_INT>(0) );
121  }
122  }
123 }
_dgematrix i(const _dgbmatrix &mat)
CPPL_INT n
matrix column size
Definition: zhsmatrix.hpp:10
std::vector< zcomponent > data
matrix data
Definition: zhsmatrix.hpp:11
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
zhsmatrix & del(const CPPL_INT, const CPPL_INT)
void zhsmatrix::expand ( const CPPL_INT &  )
inline
bool zhsmatrix::isListed ( const CPPL_INT &  i,
const CPPL_INT &  j 
) const
inline

check if the component is listed

Definition at line 127 of file zhsmatrix-misc.hpp.

References data, line, and n.

Referenced by put().

128 {CPPL_VERBOSE_REPORT;
129 #ifdef CPPL_DEBUG
130  if( i<0 || j<0 || n<=i || n<=j ){
131  ERROR_REPORT;
132  std::cerr << "The required component is out of the matrix size." << std::endl
133  << "Your input is (" << i << "," << j << "), whereas the matrix size is " << n << "x" << n << "." << std::endl;
134  exit(1);
135  }
136 #endif//CPPL_DEBUG
137 
138  const CPPL_INT ii(std::max(i,j)), jj(std::min(i,j));
139 
140  const std::vector<CPPL_INT>::const_iterator line_ii_end =line[ii].end();
141  for(std::vector<CPPL_INT>::const_iterator p=line[ii].begin(); p!=line_ii_end; p++){
142  if(data[*p].j==jj){ return 1; }
143  }
144 
145  return 0;
146 }
_dgematrix i(const _dgbmatrix &mat)
CPPL_INT n
matrix column size
Definition: zhsmatrix.hpp:10
std::vector< zcomponent > data
matrix data
Definition: zhsmatrix.hpp:11
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
CPPL_INT zhsmatrix::number ( const CPPL_INT &  i,
const CPPL_INT &  j 
) const
inline

return the element number of the component

Definition at line 150 of file zhsmatrix-misc.hpp.

References data, line, and n.

Referenced by operator<<().

151 {CPPL_VERBOSE_REPORT;
152 #ifdef CPPL_DEBUG
153  if( i<0 || j<0 || n<=i || n<=j ){
154  ERROR_REPORT;
155  std::cerr << "The required component is out of the matrix size." << std::endl
156  << "Your input is (" << i << "," << j << "), whereas the matrix size is " << n << "x" << n << "." << std::endl;
157  exit(1);
158  }
159 #endif//CPPL_DEBUG
160 
161  const CPPL_INT ii(std::max(i,j)), jj(std::min(i,j));
162 
163  const std::vector<CPPL_INT>::const_iterator line_ii_end =line[ii].end();
164  for(std::vector<CPPL_INT>::const_iterator p=line[ii].begin(); p!=line_ii_end; p++){
165  if(data[*p].i==ii && data[*p].j==jj){
166  return *p;
167  }
168  }
169 
170  return -1;
171 }
_dgematrix i(const _dgbmatrix &mat)
CPPL_INT n
matrix column size
Definition: zhsmatrix.hpp:10
std::vector< zcomponent > data
matrix data
Definition: zhsmatrix.hpp:11
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
void zhsmatrix::checkup ( )
inline

health checkup

Definition at line 278 of file zhsmatrix-misc.hpp.

References i(), imag(), and m.

279 {CPPL_VERBOSE_REPORT;
280  //////// complex diagonal ////////
281  for(CPPL_INT i=0; i<m; i++){
282  if( std::fabs((*this)(i,i).imag()) > DBL_MIN ){
283  ERROR_REPORT;
284  std::cerr << "Diagonal components of a Hermitian matrix have to be real numbers." << std::endl
285  << "(*this)(" << i << "," << i << ") was a complex number, " << (*this)(i,i) << "." << std::endl;
286  exit(1);
287  }
288  }
289 
290  //////// NOTE ////////
291  std::cerr << "# [NOTE]@zhsmatrix::checkup(): This symmetric sparse matrix is fine." << std::endl;
292 }
_dgematrix i(const _dgbmatrix &mat)
dcovec3 imag(const dquater &q)
CPPL_INT const & m
matrix row size
Definition: zhsmatrix.hpp:9
_zrovector zhsmatrix::row ( const CPPL_INT &  _m) const
inline

get row of the matrix

Definition at line 179 of file zhsmatrix-misc.hpp.

References _, conj(), data, i(), line, m, n, and zero().

180 {CPPL_VERBOSE_REPORT;
181 #ifdef CPPL_DEBUG
182  if( _m<0 || _m>m ){
183  ERROR_REPORT;
184  std::cerr << "Input row number must be between 0 and " << m << "." << std::endl
185  << "Your input was " << _m << "." << std::endl;
186  exit(1);
187  }
188 #endif//CPPL_DEBUG
189 
190  zrovector vec( zrovector(n).zero() );
191 
192  const std::vector<CPPL_INT>::const_iterator line__m_end =line[_m].end();
193  for(std::vector<CPPL_INT>::const_iterator p=line[_m].begin(); p!=line__m_end; p++){
194  if( data[*p].i==_m ){//i>=j
195  vec(data[*p].j) =data[*p].v;
196  }
197  else{//i<j
198  vec(data[*p].i) =std::conj(data[*p].v);
199  }
200  }
201 
202  return _(vec);
203 }
friend _zhsmatrix _(zhsmatrix &)
_dgematrix i(const _dgbmatrix &mat)
CPPL_INT n
matrix column size
Definition: zhsmatrix.hpp:10
_zcovector conj(const _zcovector &vec)
std::vector< zcomponent > data
matrix data
Definition: zhsmatrix.hpp:11
Complex Double-precision Row Vector Class.
Definition: zrovector.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
zhsmatrix & zero()
CPPL_INT const & m
matrix row size
Definition: zhsmatrix.hpp:9
_zcovector zhsmatrix::col ( const CPPL_INT &  _n) const
inline

get column of the matrix

Definition at line 207 of file zhsmatrix-misc.hpp.

References _, conj(), data, i(), line, m, n, and zero().

208 {CPPL_VERBOSE_REPORT;
209 #ifdef CPPL_DEBUG
210  if( _n<0 || _n>n ){
211  ERROR_REPORT;
212  std::cerr << "Input row number must be between 0 and " << n << "." << std::endl
213  << "Your input was " << _n << "." << std::endl;
214  exit(1);
215  }
216 #endif//CPPL_DEBUG
217 
218  zcovector vec( zcovector(m).zero() );
219 
220  const std::vector<CPPL_INT>::const_iterator line__n_end =line[_n].end();
221  for(std::vector<CPPL_INT>::const_iterator p=line[_n].begin(); p!=line__n_end; p++){
222  if( data[*p].i==_n ){//i<j
223  vec(data[*p].j) =std::conj(data[*p].v);
224  }
225  else{//i>=j
226  vec(data[*p].i) =data[*p].v;
227  }
228  }
229 
230  return _(vec);
231 }
friend _zhsmatrix _(zhsmatrix &)
_dgematrix i(const _dgbmatrix &mat)
CPPL_INT n
matrix column size
Definition: zhsmatrix.hpp:10
_zcovector conj(const _zcovector &vec)
std::vector< zcomponent > data
matrix data
Definition: zhsmatrix.hpp:11
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
zhsmatrix & zero()
Complex Double-precision Column Vector Class.
Definition: zcovector.hpp:3
CPPL_INT const & m
matrix row size
Definition: zhsmatrix.hpp:9
void zhsmatrix::diet ( const double  eps = DBL_MIN)
inline

erase components less than DBL_MIN

Definition at line 235 of file zhsmatrix-misc.hpp.

References data, and del().

236 {CPPL_VERBOSE_REPORT;
237  const std::vector<zcomponent>::reverse_iterator data_rend =data.rend();
238  for(std::vector<zcomponent>::reverse_iterator it=data.rbegin(); it!=data_rend; it++){
239  if( fabs(it->v.real())<eps && fabs(it->v.imag())<eps ){
240  del( CPPL_INT(data_rend-it-1) );
241  }
242  }
243 }
std::vector< zcomponent > data
matrix data
Definition: zhsmatrix.hpp:11
zhsmatrix & del(const CPPL_INT, const CPPL_INT)
zhsmatrix & zhsmatrix::operator= ( const zhsmatrix mat)
inline

zhsmatrix=zhsmatrix operator

Definition at line 3 of file zhsmatrix-zhsmatrix.hpp.

References copy(), and data.

4 {CPPL_VERBOSE_REPORT;
5  if(&data!=&mat.data){ // if it is NOT self substitution
6  copy(mat);
7  }
8  return *this;
9 }
void copy(const zhsmatrix &)
std::vector< zcomponent > data
matrix data
Definition: zhsmatrix.hpp:11
zhsmatrix & zhsmatrix::operator= ( const _zhsmatrix mat)
inline

zhsmatrix=_zhsmatrix operator

Definition at line 3 of file zhsmatrix-_zhsmatrix.hpp.

References shallow_copy().

4 {CPPL_VERBOSE_REPORT;
5  shallow_copy(mat);
6  return *this;
7 }
void shallow_copy(const _zhsmatrix &)
zhsmatrix & zhsmatrix::operator+= ( const zhsmatrix mat)
inline

zhsmatrix+=zhsmatrix operator

Definition at line 17 of file zhsmatrix-zhsmatrix.hpp.

References data, and n.

18 {CPPL_VERBOSE_REPORT;
19 #ifdef CPPL_DEBUG
20  if(n!=mat.n){
21  ERROR_REPORT;
22  std::cerr << "These two matrises can not make a summation." << std::endl
23  << "Your input was (" << n << "x" << n << ") += (" << mat.n << "x" << mat.n << ")." << std::endl;
24  exit(1);
25  }
26 #endif//CPPL_DEBUG
27 
28  const std::vector<zcomponent>::const_iterator mat_data_end =mat.data.end();
29  for(std::vector<zcomponent>::const_iterator it=mat.data.begin(); it!=mat_data_end; it++){
30  (*this)(it->i,it->j) +=it->v;
31  }
32 
33  return *this;
34 }
CPPL_INT n
matrix column size
Definition: zhsmatrix.hpp:10
std::vector< zcomponent > data
matrix data
Definition: zhsmatrix.hpp:11
zhsmatrix & zhsmatrix::operator+= ( const _zhsmatrix mat)
inline

zhsmatrix+=_zhsmatrix operator

Definition at line 15 of file zhsmatrix-_zhsmatrix.hpp.

References _zhsmatrix::data, _zhsmatrix::destroy(), n, and _zhsmatrix::n.

16 {CPPL_VERBOSE_REPORT;
17 #ifdef CPPL_DEBUG
18  if(n!=mat.n){
19  ERROR_REPORT;
20  std::cerr << "These two matrises can not make a summation." << std::endl
21  << "Your input was (" << n << "x" << n << ") += (" << mat.n << "x" << mat.n << ")." << std::endl;
22  exit(1);
23  }
24 #endif//CPPL_DEBUG
25 
26  const std::vector<zcomponent>::const_iterator mat_data_end =mat.data.end();
27  for(std::vector<zcomponent>::const_iterator it=mat.data.begin(); it!=mat_data_end; it++){
28  (*this)(it->i,it->j) +=it->v;
29  }
30 
31  mat.destroy();
32  return *this;
33 }
std::vector< zcomponent > data
matrix data
Definition: _zhsmatrix.hpp:12
void destroy() const
CPPL_INT n
matrix column size
Definition: zhsmatrix.hpp:10
CPPL_INT n
matrix column size
Definition: _zhsmatrix.hpp:11
zhsmatrix & zhsmatrix::operator-= ( const zhsmatrix mat)
inline

zhsmatrix-=zhsmatrix operator

Definition at line 38 of file zhsmatrix-zhsmatrix.hpp.

References data, and n.

39 {CPPL_VERBOSE_REPORT;
40 #ifdef CPPL_DEBUG
41  if(n!=mat.n){
42  ERROR_REPORT;
43  std::cerr << "These two matrises can not make a sutraction." << std::endl
44  << "Your input was (" << n << "x" << n << ") -= (" << mat.n << "x" << mat.n << ")." << std::endl;
45  exit(1);
46  }
47 #endif//CPPL_DEBUG
48 
49  const std::vector<zcomponent>::const_iterator mat_data_end =mat.data.end();
50  for(std::vector<zcomponent>::const_iterator it=mat.data.begin(); it!=mat_data_end; it++){
51  (*this)(it->i,it->j) -=it->v;
52  }
53 
54  return *this;
55 }
CPPL_INT n
matrix column size
Definition: zhsmatrix.hpp:10
std::vector< zcomponent > data
matrix data
Definition: zhsmatrix.hpp:11
zhsmatrix & zhsmatrix::operator-= ( const _zhsmatrix mat)
inline

zhsmatrix-=_zhsmatrix operator

Definition at line 37 of file zhsmatrix-_zhsmatrix.hpp.

References _zhsmatrix::data, _zhsmatrix::destroy(), n, and _zhsmatrix::n.

38 {CPPL_VERBOSE_REPORT;
39 #ifdef CPPL_DEBUG
40  if(n!=mat.n){
41  ERROR_REPORT;
42  std::cerr << "These two matrises can not make a sutraction." << std::endl
43  << "Your input was (" << n << "x" << n << ") -= (" << mat.n << "x" << mat.n << ")." << std::endl;
44  exit(1);
45  }
46 #endif//CPPL_DEBUG
47 
48  const std::vector<zcomponent>::const_iterator mat_data_end =mat.data.end();
49  for(std::vector<zcomponent>::const_iterator it=mat.data.begin(); it!=mat_data_end; it++){
50  (*this)(it->i,it->j) -=it->v;
51  }
52 
53  mat.destroy();
54  return *this;
55 }
std::vector< zcomponent > data
matrix data
Definition: _zhsmatrix.hpp:12
void destroy() const
CPPL_INT n
matrix column size
Definition: zhsmatrix.hpp:10
CPPL_INT n
matrix column size
Definition: _zhsmatrix.hpp:11
zhsmatrix & zhsmatrix::operator*= ( const double &  d)
inline

zhsmatrix*=double operator

Definition at line 3 of file zhsmatrix-double.hpp.

References data.

4 {CPPL_VERBOSE_REPORT;
5  const std::vector<zcomponent>::iterator data_end =data.end();
6  for(std::vector<zcomponent>::iterator it=data.begin(); it!=data_end; it++){
7  it->v *=d;
8  }
9 
10  return *this;
11 }
std::vector< zcomponent > data
matrix data
Definition: zhsmatrix.hpp:11
zhsmatrix & zhsmatrix::operator/= ( const double &  d)
inline

zhsmatrix/=double operator

Definition at line 15 of file zhsmatrix-double.hpp.

References data.

16 {CPPL_VERBOSE_REPORT;
17  const std::vector<zcomponent>::iterator data_end =data.end();
18  for(std::vector<zcomponent>::iterator it=data.begin(); it!=data_end; it++){
19  it->v /=d;
20  }
21 
22  return *this;
23 }
std::vector< zcomponent > data
matrix data
Definition: zhsmatrix.hpp:11

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  s,
const zhsmatrix mat 
)
friend

Definition at line 245 of file zhsmatrix-io.hpp.

246 {CPPL_VERBOSE_REPORT;
247  for(CPPL_INT i=0; i<mat.n; i++){
248  for(CPPL_INT j=0; j<=i; j++){
249  CPPL_INT c =mat.number(i,j);
250  if(c<0){
251  s << " x ";
252  }
253  else{
254  s << " " << mat.data[c].v << " ";
255  }
256  }
257  for(CPPL_INT j=i+1; j<mat.n; j++){
258  CPPL_INT c =mat.number(i,j);
259  if(c<0){
260  s << "{x}";
261  }
262  else{
263  s << "{" << std::conj(mat.data[c].v) << "}";
264  }
265  }
266  s << std::endl;
267  }
268 
269  return s;
270 }
_dgematrix i(const _dgbmatrix &mat)
CPPL_INT number(const CPPL_INT &, const CPPL_INT &) const
CPPL_INT n
matrix column size
Definition: zhsmatrix.hpp:10
_zcovector conj(const _zcovector &vec)
std::vector< zcomponent > data
matrix data
Definition: zhsmatrix.hpp:11
void swap ( zhsmatrix A,
zhsmatrix B 
)
friend

swap two matrices

Definition at line 251 of file zhsmatrix-misc.hpp.

252 {CPPL_VERBOSE_REPORT;
253  std::swap(A.n,B.n);
254  std::swap(A.data,B.data);
255  std::swap(A.line,B.line);
256 }
CPPL_INT n
matrix column size
Definition: zhsmatrix.hpp:10
std::vector< zcomponent > data
matrix data
Definition: zhsmatrix.hpp:11
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
void swap(zhsmatrix &A, zhsmatrix &B)
_zhsmatrix _ ( zhsmatrix mat)
friend

convert user object to smart-temporary object

Definition at line 260 of file zhsmatrix-misc.hpp.

Referenced by col(), row(), to_zgematrix(), to_zgsmatrix(), and to_zhematrix().

261 {CPPL_VERBOSE_REPORT;
262  _zhsmatrix newmat;
263  //////// shallow copy ////////
264  newmat.n =mat.n;
265  std::swap(newmat.data, mat.data);
266  std::swap(newmat.line, mat.line);
267  //////// nullify ////////
268  mat.n =0;
269  return newmat;
270 }
std::vector< zcomponent > data
matrix data
Definition: _zhsmatrix.hpp:12
CPPL_INT n
matrix column size
Definition: zhsmatrix.hpp:10
CPPL_INT n
matrix column size
Definition: _zhsmatrix.hpp:11
std::vector< zcomponent > data
matrix data
Definition: zhsmatrix.hpp:11
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
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:13
void swap(zhsmatrix &A, zhsmatrix &B)
(DO NOT USE) Smart-temporary Complex Double-precision Hermitian Sparse Matrix Class ...
Definition: _zhsmatrix.hpp:3
_zhsmatrix t ( const zhsmatrix mat)
friend

return transposed zhsmatrix

Definition at line 3 of file zhsmatrix-calc.hpp.

4 {CPPL_VERBOSE_REPORT;
5  zhsmatrix newmat(mat);
6 
7  const std::vector<zcomponent>::iterator newmat_data_end =newmat.data.end();
8  for(std::vector<zcomponent>::iterator it=newmat.data.begin(); it!=newmat_data_end; it++){
9  it->v =std::conj(it->v);
10  }
11 
12  return _(newmat);
13 }
friend _zhsmatrix _(zhsmatrix &)
_zhsmatrix conj(const zhsmatrix &mat)
Complex Double-precision Hermitian Sparse Matrix Class.
Definition: zhsmatrix.hpp:3
void idamax ( CPPL_INT &  i,
CPPL_INT &  j,
const zhsmatrix mat 
)
friend

search the index of element having the largest absolute value in 0-based numbering system

Definition at line 53 of file zhsmatrix-calc.hpp.

54 {CPPL_VERBOSE_REPORT;
55  std::vector<zcomponent>::const_iterator itx(mat.data.begin());
56  double vmax =0.;
57 
58  const std::vector<zcomponent>::const_iterator mat_data_end =mat.data.end();
59  for(std::vector<zcomponent>::const_iterator it=mat.data.begin(); it!=mat_data_end; it++){
60  if( vmax < norm(it->v) ){
61  vmax =norm(it->v);
62  itx =it;
63  }
64  }
65 
66  i =itx->i;
67  j =itx->j;
68 }
_dgematrix i(const _dgbmatrix &mat)
friend _dgematrix i(const _dgematrix &)
std::vector< zcomponent > data
matrix data
Definition: zhsmatrix.hpp:11
comple damax ( const zhsmatrix mat)
friend

return its largest absolute value

Definition at line 72 of file zhsmatrix-calc.hpp.

73 {CPPL_VERBOSE_REPORT;
74  std::vector<zcomponent>::const_iterator itx(mat.data.begin());
75  double vmax =0.;
76 
77  const std::vector<zcomponent>::const_iterator mat_data_end =mat.data.end();
78  for(std::vector<zcomponent>::const_iterator it=mat.data.begin(); it!=mat_data_end; it++){
79  if( vmax < norm(it->v) ){
80  vmax =norm(it->v);
81  itx =it;
82  }
83  }
84 
85  return itx->v;
86 }
std::vector< zcomponent > data
matrix data
Definition: zhsmatrix.hpp:11
const zhsmatrix& operator+ ( const zhsmatrix mat)
friend

+zhsmatrix operator

Definition at line 3 of file zhsmatrix-unary.hpp.

4 {CPPL_VERBOSE_REPORT;
5  return mat;
6 }
_zhsmatrix operator- ( const zhsmatrix mat)
friend

-zhsmatrix operator

Definition at line 10 of file zhsmatrix-unary.hpp.

11 {CPPL_VERBOSE_REPORT;
12  zhsmatrix newmat(mat);
13 
14  const std::vector<zcomponent>::iterator newmat_data_end =newmat.data.end();
15  for(std::vector<zcomponent>::iterator it=newmat.data.begin(); it!=newmat_data_end; it++){
16  it->v =-it->v;
17  }
18 
19  return _(newmat);
20 }
friend _zhsmatrix _(zhsmatrix &)
Complex Double-precision Hermitian Sparse Matrix Class.
Definition: zhsmatrix.hpp:3
_zgematrix operator+ ( const zhsmatrix ,
const zgematrix  
)
friend
_zgematrix operator+ ( const zhsmatrix ,
const _zgematrix  
)
friend
_zgematrix operator+ ( const zhsmatrix ,
const zhematrix  
)
friend
_zgematrix operator+ ( const zhsmatrix ,
const _zhematrix  
)
friend
_zgematrix operator+ ( const zhsmatrix ,
const zgbmatrix  
)
friend
_zgematrix operator+ ( const zhsmatrix ,
const _zgbmatrix  
)
friend
_zgsmatrix operator+ ( const zhsmatrix ,
const zgsmatrix  
)
friend
_zgsmatrix operator+ ( const zhsmatrix ,
const _zgsmatrix  
)
friend
_zhsmatrix operator+ ( const zhsmatrix matA,
const zhsmatrix matB 
)
friend

zhsmatrix+zhsmatrix operator

Definition at line 63 of file zhsmatrix-zhsmatrix.hpp.

64 {CPPL_VERBOSE_REPORT;
65 #ifdef CPPL_DEBUG
66  if(matA.n!=matB.n){
67  ERROR_REPORT;
68  std::cerr << "These two matrises can not make a summation." << std::endl
69  << "Your input was (" << matA.n << "x" << matA.n << ") + (" << matB.n << "x" << matB.n << ")." << std::endl;
70  exit(1);
71  }
72 #endif//CPPL_DEBUG
73 
74  zhsmatrix newmat(matA);
75 
76  const std::vector<zcomponent>::const_iterator matB_data_end =matB.data.end();
77  for(std::vector<zcomponent>::const_iterator it=matB.data.begin(); it!=matB_data_end; it++){
78  newmat(it->i,it->j) +=it->v;
79  }
80 
81  return _(newmat);
82 }
friend _zhsmatrix _(zhsmatrix &)
CPPL_INT n
matrix column size
Definition: zhsmatrix.hpp:10
std::vector< zcomponent > data
matrix data
Definition: zhsmatrix.hpp:11
Complex Double-precision Hermitian Sparse Matrix Class.
Definition: zhsmatrix.hpp:3
_zhsmatrix operator+ ( const zhsmatrix matA,
const _zhsmatrix matB 
)
friend

zhsmatrix+_zhsmatrix operator

Definition at line 63 of file zhsmatrix-_zhsmatrix.hpp.

64 {CPPL_VERBOSE_REPORT;
65 #ifdef CPPL_DEBUG
66  if(matA.n!=matB.n){
67  ERROR_REPORT;
68  std::cerr << "These two matrises can not make a summation." << std::endl
69  << "Your input was (" << matA.n << "x" << matA.n << ") + (" << matB.n << "x" << matB.n << ")." << std::endl;
70  exit(1);
71  }
72 #endif//CPPL_DEBUG
73 
74  zhsmatrix newmat(matB);
75 
76  const std::vector<zcomponent>::const_iterator matA_data_end =matA.data.end();
77  for(std::vector<zcomponent>::const_iterator it=matA.data.begin(); it!=matA_data_end; it++){
78  newmat(it->i,it->j) +=it->v;
79  }
80 
81  return _(newmat);
82 }
friend _zhsmatrix _(zhsmatrix &)
CPPL_INT n
matrix column size
Definition: zhsmatrix.hpp:10
CPPL_INT n
matrix column size
Definition: _zhsmatrix.hpp:11
std::vector< zcomponent > data
matrix data
Definition: zhsmatrix.hpp:11
Complex Double-precision Hermitian Sparse Matrix Class.
Definition: zhsmatrix.hpp:3
_zgematrix operator- ( const zhsmatrix ,
const zgematrix  
)
friend
_zgematrix operator- ( const zhsmatrix ,
const _zgematrix  
)
friend
_zgematrix operator- ( const zhsmatrix ,
const zhematrix  
)
friend
_zgematrix operator- ( const zhsmatrix ,
const _zhematrix  
)
friend
_zgematrix operator- ( const zhsmatrix ,
const zgbmatrix  
)
friend
_zgematrix operator- ( const zhsmatrix ,
const _zgbmatrix  
)
friend
_zgsmatrix operator- ( const zhsmatrix ,
const zgsmatrix  
)
friend
_zgsmatrix operator- ( const zhsmatrix ,
const _zgsmatrix  
)
friend
_zhsmatrix operator- ( const zhsmatrix matA,
const zhsmatrix matB 
)
friend

zhsmatrix-zhsmatrix operator

Definition at line 86 of file zhsmatrix-zhsmatrix.hpp.

87 {CPPL_VERBOSE_REPORT;
88 #ifdef CPPL_DEBUG
89  if(matA.n!=matB.n){
90  ERROR_REPORT;
91  std::cerr << "These two matrises can not make a subtraction." << std::endl
92  << "Your input was (" << matA.n << "x" << matA.n << ") - (" << matB.n << "x" << matB.n << ")." << std::endl;
93  exit(1);
94  }
95 #endif//CPPL_DEBUG
96 
97  zhsmatrix newmat(matA);
98 
99  const std::vector<zcomponent>::const_iterator matB_data_end =matB.data.end();
100  for(std::vector<zcomponent>::const_iterator it=matB.data.begin(); it!=matB_data_end; it++){
101  newmat(it->i,it->j) -= it->v;
102  }
103 
104  return _(newmat);
105 }
friend _zhsmatrix _(zhsmatrix &)
CPPL_INT n
matrix column size
Definition: zhsmatrix.hpp:10
std::vector< zcomponent > data
matrix data
Definition: zhsmatrix.hpp:11
Complex Double-precision Hermitian Sparse Matrix Class.
Definition: zhsmatrix.hpp:3
_zhsmatrix operator- ( const zhsmatrix matA,
const _zhsmatrix matB 
)
friend

zhsmatrix-_zhsmatrix operator

Definition at line 86 of file zhsmatrix-_zhsmatrix.hpp.

87 {CPPL_VERBOSE_REPORT;
88 #ifdef CPPL_DEBUG
89  if(matA.n!=matB.n){
90  ERROR_REPORT;
91  std::cerr << "These two matrises can not make a subtraction." << std::endl
92  << "Your input was (" << matA.n << "x" << matA.n << ") - (" << matB.n << "x" << matB.n << ")." << std::endl;
93  exit(1);
94  }
95 #endif//CPPL_DEBUG
96 
97  zhsmatrix newmat(-matB);
98 
99  const std::vector<zcomponent>::const_iterator matA_data_end =matA.data.end();
100  for(std::vector<zcomponent>::const_iterator it=matA.data.begin(); it!=matA_data_end; it++){
101  newmat(it->i,it->j) +=it->v;
102  }
103 
104  return _(newmat);
105 }
friend _zhsmatrix _(zhsmatrix &)
CPPL_INT n
matrix column size
Definition: zhsmatrix.hpp:10
CPPL_INT n
matrix column size
Definition: _zhsmatrix.hpp:11
std::vector< zcomponent > data
matrix data
Definition: zhsmatrix.hpp:11
Complex Double-precision Hermitian Sparse Matrix Class.
Definition: zhsmatrix.hpp:3
_zcovector operator* ( const zhsmatrix mat,
const zcovector vec 
)
friend

zhsmatrix*zcovector operator

Definition at line 3 of file zhsmatrix-zcovector.hpp.

4 {CPPL_VERBOSE_REPORT;
5 #ifdef CPPL_DEBUG
6  if(mat.n!=vec.l){
7  ERROR_REPORT;
8  std::cerr << "These matrix and vector can not make a product." << std::endl
9  << "Your input was (" << mat.n << "x" << mat.n << ") * (" << vec.l << ")." << std::endl;
10  exit(1);
11  }
12 #endif//CPPL_DEBUG
13 
14  zcovector newvec(mat.n);
15  newvec.zero();
16 
17  const std::vector<zcomponent>::const_iterator mat_data_end =mat.data.end();
18  for(std::vector<zcomponent>::const_iterator it=mat.data.begin(); it!=mat_data_end; it++){
19  newvec(it->i) +=it->v*vec(it->j);
20  if(it->i!=it->j){
21  newvec(it->j) +=std::conj(it->v)*vec(it->i);
22  }
23  }
24 
25  return _(newvec);
26 }
CPPL_INT l
vector size
Definition: zcovector.hpp:9
friend _zhsmatrix _(zhsmatrix &)
CPPL_INT n
matrix column size
Definition: zhsmatrix.hpp:10
_zcovector conj(const _zcovector &vec)
std::vector< zcomponent > data
matrix data
Definition: zhsmatrix.hpp:11
Complex Double-precision Column Vector Class.
Definition: zcovector.hpp:3
_zcovector operator* ( const zhsmatrix mat,
const _zcovector vec 
)
friend

zhsmatrix*_zcovector operator

Definition at line 3 of file zhsmatrix-_zcovector.hpp.

4 {CPPL_VERBOSE_REPORT;
5 #ifdef CPPL_DEBUG
6  if(mat.n!=vec.l){
7  ERROR_REPORT;
8  std::cerr << "These matrix and vector can not make a product." << std::endl
9  << "Your input was (" << mat.n << "x" << mat.n << ") * (" << vec.l << ")." << std::endl;
10  exit(1);
11  }
12 #endif//CPPL_DEBUG
13 
14  zcovector newvec(mat.n);
15  newvec.zero();
16 
17  const std::vector<zcomponent>::const_iterator mat_data_end =mat.data.end();
18  for(std::vector<zcomponent>::const_iterator it=mat.data.begin(); it!=mat_data_end; it++){
19  newvec(it->i) +=it->v*vec(it->j);
20  if(it->i!=it->j){
21  newvec(it->j) +=std::conj(it->v)*vec(it->i);
22  }
23  }
24 
25  vec.destroy();
26  return _(newvec);
27 }
friend _zhsmatrix _(zhsmatrix &)
CPPL_INT n
matrix column size
Definition: zhsmatrix.hpp:10
_zcovector conj(const _zcovector &vec)
void destroy() const
std::vector< zcomponent > data
matrix data
Definition: zhsmatrix.hpp:11
Complex Double-precision Column Vector Class.
Definition: zcovector.hpp:3
CPPL_INT l
vector size
Definition: _zcovector.hpp:9
_zgematrix operator* ( const zhsmatrix ,
const zgematrix  
)
friend
_zgematrix operator* ( const zhsmatrix ,
const _zgematrix  
)
friend
_zgematrix operator* ( const zhsmatrix ,
const zhematrix  
)
friend
_zgematrix operator* ( const zhsmatrix ,
const _zhematrix  
)
friend
_zgematrix operator* ( const zhsmatrix ,
const zgbmatrix  
)
friend
_zgematrix operator* ( const zhsmatrix ,
const _zgbmatrix  
)
friend
_zgsmatrix operator* ( const zhsmatrix ,
const zgsmatrix  
)
friend
_zgsmatrix operator* ( const zhsmatrix ,
const _zgsmatrix  
)
friend
_zgsmatrix operator* ( const zhsmatrix ,
const zhsmatrix  
)
friend
_zgsmatrix operator* ( const zhsmatrix ,
const _zhsmatrix  
)
friend
_zhsmatrix operator* ( const zhsmatrix mat,
const double &  d 
)
friend

zhsmatrix*double operator

Definition at line 31 of file zhsmatrix-double.hpp.

32 {CPPL_VERBOSE_REPORT;
33  zhsmatrix newmat(mat);
34 
35  const std::vector<zcomponent>::iterator newmat_data_end =newmat.data.end();
36  for(std::vector<zcomponent>::iterator it=newmat.data.begin(); it!=newmat_data_end; it++){
37  it->v *=d;
38  }
39 
40  return _(newmat);
41 }
friend _zhsmatrix _(zhsmatrix &)
Complex Double-precision Hermitian Sparse Matrix Class.
Definition: zhsmatrix.hpp:3
_zgsmatrix operator* ( const zhsmatrix mat,
const comple &  d 
)
friend

zhsmatrix*complex operator

Definition at line 3 of file zhsmatrix-complex.hpp.

4 {CPPL_VERBOSE_REPORT;
5  zgsmatrix newmat( mat.to_zgsmatrix() );
6  return newmat*d;
7 }
Complex Double-precision General Sparse Matrix Class.
Definition: zgsmatrix.hpp:3
_zgsmatrix to_zgsmatrix() const
_zhsmatrix operator/ ( const zhsmatrix mat,
const double &  d 
)
friend

zhsmatrix/double operator

Definition at line 45 of file zhsmatrix-double.hpp.

46 {CPPL_VERBOSE_REPORT;
47  zhsmatrix newmat(mat);
48 
49  const std::vector<zcomponent>::iterator newmat_data_end =newmat.data.end();
50  for(std::vector<zcomponent>::iterator it=newmat.data.begin(); it!=newmat_data_end; it++){
51  it->v /=d;
52  }
53 
54  return _(newmat);
55 }
friend _zhsmatrix _(zhsmatrix &)
Complex Double-precision Hermitian Sparse Matrix Class.
Definition: zhsmatrix.hpp:3
_zgsmatrix operator/ ( const zhsmatrix mat,
const comple &  d 
)
friend

zhsmatrix/complex operator

Definition at line 11 of file zhsmatrix-complex.hpp.

12 {CPPL_VERBOSE_REPORT;
13  zgsmatrix newmat( mat.to_zgsmatrix() );
14  return newmat/d;
15 }
Complex Double-precision General Sparse Matrix Class.
Definition: zgsmatrix.hpp:3
_zgsmatrix to_zgsmatrix() const
_zhsmatrix operator* ( const double &  d,
const zhsmatrix mat 
)
friend

double*zhsmatrix operator

Definition at line 3 of file double-zhsmatrix.hpp.

4 {CPPL_VERBOSE_REPORT;
5  zhsmatrix newmat =mat;
6 
7  const std::vector<zcomponent>::iterator newmat_data_end =newmat.data.end();
8  for(std::vector<zcomponent>::iterator it=newmat.data.begin(); it!=newmat_data_end; it++){
9  it->v *=d;
10  }
11 
12  return _(newmat);
13 }
friend _zhsmatrix _(zhsmatrix &)
std::vector< zcomponent > data
matrix data
Definition: zhsmatrix.hpp:11
Complex Double-precision Hermitian Sparse Matrix Class.
Definition: zhsmatrix.hpp:3
_zgsmatrix operator* ( const comple &  d,
const zhsmatrix mat 
)
friend

complex*zhsmatrix operator

Definition at line 3 of file complex-zhsmatrix.hpp.

4 {CPPL_VERBOSE_REPORT;
5  zgsmatrix newmat =mat.to_zgsmatrix();
6  return d*newmat;
7 }
Complex Double-precision General Sparse Matrix Class.
Definition: zgsmatrix.hpp:3
_zgsmatrix to_zgsmatrix() const

Member Data Documentation

CPPL_INT const& zhsmatrix::m

matrix row size

Definition at line 9 of file zhsmatrix.hpp.

Referenced by checkup(), col(), operator*(), row(), to_zgematrix(), and to_zgsmatrix().

CPPL_INT zhsmatrix::n
std::vector<zcomponent> zhsmatrix::data
std::vector< std::vector<CPPL_INT> > zhsmatrix::line

vector of vector to store the entry information of component for each row and column

Definition at line 12 of file zhsmatrix.hpp.

Referenced by _(), clear(), col(), copy(), del(), isListed(), number(), operator()(), put(), resize(), row(), shallow_copy(), stretch(), swap(), zero(), zhsmatrix(), and ~zhsmatrix().


The documentation for this class was generated from the following files: