CPPLapack
 All Classes Files Functions Variables Friends Pages
_zhsmatrix-cast.hpp
Go to the documentation of this file.
1 //=============================================================================
2 /*! convert to _zgematrix */
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  destroy();
14  return _(newmat);
15 }
16 
17 //=============================================================================
18 /*! convert to _zhematrix */
20 {CPPL_VERBOSE_REPORT;
21  zhematrix newmat(n);
22  newmat.zero();
23 
24  const std::vector<zcomponent>::const_iterator data_end =data.end();
25  for(std::vector<zcomponent>::const_iterator it=data.begin(); it!=data_end; it++){
26  newmat(it->i, it->j) =it->v;
27  }
28 
29  destroy();
30  return _(newmat);
31 }
32 
33 //=============================================================================
34 /*! convert to _zgsmatrix */
36 {CPPL_VERBOSE_REPORT;
37  zgsmatrix newmat(m,n);
38  newmat.zero();
39 
40  const std::vector<zcomponent>::const_iterator data_end =data.end();
41  for(std::vector<zcomponent>::const_iterator it=data.begin(); it!=data_end; it++){
42  newmat.put(it->i, it->j, it->v);
43  if(it->i!=it->j){
44  newmat.put(it->j, it->i, std::conj(it->v));
45  }
46  }
47 
48  destroy();
49  return _(newmat);
50 }
(DO NOT USE) Smart-temporary Complex Double-precision Hermitian Matrix Class
Definition: _zhematrix.hpp:3
std::vector< zcomponent > data
matrix data
Definition: _zhsmatrix.hpp:12
_zgsmatrix to_zgsmatrix() const
Complex Double-precision General Sparse Matrix Class.
Definition: zgsmatrix.hpp:3
zhematrix & zero()
CPPL_INT const & m
matrix row size
Definition: _zhsmatrix.hpp:10
void destroy() const
(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 &)
_zcovector conj(const _zcovector &vec)
CPPL_INT n
matrix column size
Definition: _zhsmatrix.hpp:11
Complex Double-precision General Dence Matrix Class.
Definition: zgematrix.hpp:3
(DO NOT USE) Smart-temporary Complex Double-precision General Dence Matrix Class
Definition: _zgematrix.hpp:3
_zgematrix to_zgematrix() const
Complex Double-precision Hermitian Matrix Class [l-type (UPLO=l) Strage].
Definition: zhematrix.hpp:4
zgsmatrix & zero()
_zhematrix to_zhematrix() const
_dcovector _(dcovector &vec)