CPPLapack
 All Classes Files Functions Variables Friends Pages
Functions
_zgbmatrix-calc.hpp File Reference

Go to the source code of this file.

Functions

_zgbmatrix t (const _zgbmatrix &mat)
 
_zgematrix i (const _zgbmatrix &mat)
 
_zgbmatrix conj (const _zgbmatrix &mat)
 
_zgbmatrix conjt (const _zgbmatrix &mat)
 

Function Documentation

_zgbmatrix t ( const _zgbmatrix mat)
inline

return its transposed zgbmatrix

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

References _(), _zgbmatrix::destroy(), i(), zgbmatrix::kl, _zgbmatrix::kl, _zgbmatrix::ku, zgbmatrix::ku, zgbmatrix::m, _zgbmatrix::m, _zgbmatrix::n, and zgbmatrix::n.

4 {CPPL_VERBOSE_REPORT;
5  zgbmatrix newmat(mat.n, mat.m, mat.ku, mat.kl);
6  for(CPPL_INT i=0; i<newmat.m; i++){
7  const CPPL_INT jmax =std::min(newmat.n,i+newmat.ku+1);
8  for(CPPL_INT j=std::max(CPPL_INT(0),i-newmat.kl); j<jmax; j++){
9  newmat(i,j) =mat(j,i);
10  }
11  }
12 
13  mat.destroy();
14  return _(newmat);
15 }
CPPL_INT ku
upper band width
Definition: _zgbmatrix.hpp:12
CPPL_INT m
matrix row size
Definition: _zgematrix.hpp:9
CPPL_INT kl
lower band width
Definition: _zgbmatrix.hpp:11
void destroy() const
Complex Double-precision General Band Matrix Class.
Definition: zgbmatrix.hpp:3
CPPL_INT m
matrix row size
Definition: _zgbmatrix.hpp:9
_zgematrix i(const _zgbmatrix &mat)
CPPL_INT n
matrix column size
Definition: _zgbmatrix.hpp:10
_dcovector _(dcovector &vec)
_zgematrix i ( const _zgbmatrix mat)
inline

return its inverse matrix

Definition at line 19 of file _zgbmatrix-calc.hpp.

References _(), zgematrix::identity(), _zgbmatrix::m, zgbmatrix::m, zgbmatrix::n, _zgbmatrix::n, and zgbmatrix::zgbsv().

Referenced by conj(), conjt(), and t().

20 {CPPL_VERBOSE_REPORT;
21 #ifdef CPPL_DEBUG
22  if(mat.m!=mat.n){
23  ERROR_REPORT;
24  std::cerr << "This matrix is not square and has no inverse matrix." << std::endl
25  << "Your input was (" << mat.m << "x" << mat.n << ")." << std::endl;
26  exit(1);
27  }
28 #endif//CPPL_DEBUG
29 
30  zgbmatrix mat_cp(mat);
31  zgematrix mat_inv(mat_cp.m,mat_cp.n);
32  mat_inv.identity();
33  mat_cp.zgbsv(mat_inv);
34 
35  return _(mat_inv);
36 }
Complex Double-precision General Dence Matrix Class.
Definition: zgematrix.hpp:3
Complex Double-precision General Band Matrix Class.
Definition: zgbmatrix.hpp:3
CPPL_INT m
matrix row size
Definition: _zgbmatrix.hpp:9
CPPL_INT n
matrix column size
Definition: _zgbmatrix.hpp:10
_dcovector _(dcovector &vec)
_zgbmatrix conj ( const _zgbmatrix mat)
inline

return its conjugate matrix

Definition at line 44 of file _zgbmatrix-calc.hpp.

References i(), _zgbmatrix::kl, _zgbmatrix::ku, _zgbmatrix::m, and _zgbmatrix::n.

Referenced by conjt().

45 {CPPL_VERBOSE_REPORT;
46  for(CPPL_INT i=0; i<mat.m; i++){
47  const CPPL_INT jmax =std::min(mat.n,i+mat.ku+1);
48  for(CPPL_INT j=std::max(CPPL_INT(0),i-mat.kl); j<jmax; j++){
49  mat(i,j) =std::conj(mat(i,j));
50  }
51  }
52 
53  return mat;
54 }
CPPL_INT ku
upper band width
Definition: _zgbmatrix.hpp:12
CPPL_INT kl
lower band width
Definition: _zgbmatrix.hpp:11
_zgbmatrix conj(const _zgbmatrix &mat)
CPPL_INT m
matrix row size
Definition: _zgbmatrix.hpp:9
_zgematrix i(const _zgbmatrix &mat)
CPPL_INT n
matrix column size
Definition: _zgbmatrix.hpp:10
_zgbmatrix conjt ( const _zgbmatrix mat)
inline

return its conjugate transposed zgbmatrix

Definition at line 58 of file _zgbmatrix-calc.hpp.

References _(), conj(), _zgbmatrix::destroy(), i(), zgbmatrix::kl, _zgbmatrix::kl, _zgbmatrix::ku, zgbmatrix::ku, _zgbmatrix::m, zgbmatrix::m, _zgbmatrix::n, and zgbmatrix::n.

59 {CPPL_VERBOSE_REPORT;
60  zgbmatrix newmat(mat.n, mat.m, mat.ku, mat.kl);
61 
62  for(CPPL_INT i=0; i<newmat.m; i++){
63  const CPPL_INT jmax =std::min(newmat.n,i+newmat.ku+1);
64  for(CPPL_INT j=std::max(CPPL_INT(0),i-newmat.kl); j<jmax; j++){
65  newmat(i,j) =std::conj(mat(j,i));
66  }
67  }
68 
69  mat.destroy();
70  return _(newmat);
71 }
CPPL_INT ku
upper band width
Definition: _zgbmatrix.hpp:12
CPPL_INT m
matrix row size
Definition: _zgematrix.hpp:9
CPPL_INT kl
lower band width
Definition: _zgbmatrix.hpp:11
_zgbmatrix conj(const _zgbmatrix &mat)
void destroy() const
Complex Double-precision General Band Matrix Class.
Definition: zgbmatrix.hpp:3
CPPL_INT m
matrix row size
Definition: _zgbmatrix.hpp:9
_zgematrix i(const _zgbmatrix &mat)
CPPL_INT n
matrix column size
Definition: _zgbmatrix.hpp:10
_dcovector _(dcovector &vec)