CPPLapack
 All Classes Files Functions Variables Friends Pages
zhematrix-calc.hpp
Go to the documentation of this file.
1 //=============================================================================
2 /*! return transposed zgematrix */
3 inline _zhematrix t(const zhematrix& mat)
4 {CPPL_VERBOSE_REPORT;
5  zhematrix newmat(mat.n);
6 
7  for(CPPL_INT j=0; j<mat.n; j++){
8  for(CPPL_INT i=j; i<mat.n; i++){
9  newmat(i,j) =mat(j,i);
10  }
11  }
12 
13  return _(newmat);
14 }
15 
16 //=============================================================================
17 /*! return its inverse matrix */
18 inline _zgematrix i(const zhematrix& mat)
19 {CPPL_VERBOSE_REPORT;
20  zhematrix mat_cp(mat);
21  zgematrix mat_inv(mat.n,mat.n);
22  mat_inv.identity();
23  mat_cp.zhesv(mat_inv);
24 
25  return _(mat_inv);
26 }
27 
28 ///////////////////////////////////////////////////////////////////////////////
29 ///////////////////////////////////////////////////////////////////////////////
30 ///////////////////////////////////////////////////////////////////////////////
31 
32 //=============================================================================
33 /*! return its conjugate matrix */
34 inline _zhematrix conj(const zhematrix& mat)
35 {CPPL_VERBOSE_REPORT;
36  zhematrix newmat(mat.n);
37 
38  for(CPPL_INT j=0; j<mat.n; j++){
39  for(CPPL_INT i=j; i<mat.n; i++){
40  newmat(i,j) =std::conj(mat(i,j));
41  }
42  }
43 
44  return _(newmat);
45 }
46 
47 //=============================================================================
48 /*! return its conjugate transposed matrix */
49 inline _zhematrix conjt(const zhematrix& mat)
50 {CPPL_VERBOSE_REPORT;
51 #ifdef CPPL_DEBUG
52  WARNING_REPORT;
53  std::cerr << "This function call has no effect since the matrix is Hermitian." << std::endl;
54 #endif//CPPL_DEBUG
55 
56  zhematrix newmat =mat;
57  return _(newmat);
58 }
(DO NOT USE) Smart-temporary Complex Double-precision Hermitian Matrix Class
Definition: _zhematrix.hpp:3
zgematrix & identity()
CPPL_INT zhesv(zgematrix &)
Complex Double-precision General Dence Matrix Class.
Definition: zgematrix.hpp:3
CPPL_INT n
matrix column size
Definition: zhematrix.hpp:11
(DO NOT USE) Smart-temporary Complex Double-precision General Dence Matrix Class
Definition: _zgematrix.hpp:3
_zhematrix conjt(const zhematrix &mat)
Complex Double-precision Hermitian Matrix Class [l-type (UPLO=l) Strage].
Definition: zhematrix.hpp:4
_zgematrix i(const zhematrix &mat)
_dcovector _(dcovector &vec)
_zhematrix conj(const zhematrix &mat)
_zhematrix t(const zhematrix &mat)