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

Go to the source code of this file.

Functions

_zhematrix operator+ (const zhematrix &matA, const zhematrix &matB)
 
_zhematrix operator- (const zhematrix &matA, const zhematrix &matB)
 
_zgematrix operator* (const zhematrix &matA, const zhematrix &matB)
 

Function Documentation

_zhematrix operator+ ( const zhematrix matA,
const zhematrix matB 
)
inline

zhematrix+zhematrix operator

Definition at line 61 of file zhematrix-zhematrix.hpp.

References _(), zhematrix::darray, i(), and zhematrix::n.

62 {CPPL_VERBOSE_REPORT;
63 #ifdef CPPL_DEBUG
64  if(matA.n!=matB.n){
65  ERROR_REPORT;
66  std::cerr << "These two matrises can not make a summation." << std::endl
67  << "Your input was (" << matA.n << "x" << matA.n << ") + (" << matB.n << "x" << matB.n << ")." << std::endl;
68  exit(1);
69  }
70 #endif//CPPL_DEBUG
71 
72  zhematrix newmat(matA.n);
73 
74  for(CPPL_INT j=0; j<matA.n; j++){
75  for(CPPL_INT i=j; i<matA.n; i++){
76  newmat.darray[j][i] =matA.darray[j][i] +matB.darray[j][i];
77  }
78  }
79 
80  return _(newmat);
81 }
_dgematrix i(const _dgbmatrix &mat)
CPPL_INT n
matrix column size
Definition: zhematrix.hpp:11
Complex Double-precision Hermitian Matrix Class [l-type (UPLO=l) Strage].
Definition: zhematrix.hpp:4
comple ** darray
array of pointers of column head addresses
Definition: zhematrix.hpp:13
_dcovector _(dcovector &vec)
_zhematrix operator- ( const zhematrix matA,
const zhematrix matB 
)
inline

zhematrix-zhematrix operator

Definition at line 85 of file zhematrix-zhematrix.hpp.

References _(), zhematrix::darray, i(), and zhematrix::n.

86 {CPPL_VERBOSE_REPORT;
87 #ifdef CPPL_DEBUG
88  if(matA.n!=matB.n){
89  ERROR_REPORT;
90  std::cerr << "These two matrises can not make a subtraction." << std::endl
91  << "Your input was (" << matA.n << "x" << matA.n << ") - (" << matB.n << "x" << matB.n << ")." << std::endl;
92  exit(1);
93  }
94 #endif//CPPL_DEBUG
95 
96  zhematrix newmat(matA.n);
97 
98  for(CPPL_INT j=0; j<matA.n; j++){
99  for(CPPL_INT i=j; i<matA.n; i++){
100  newmat.darray[j][i] =matA.darray[j][i] -matB.darray[j][i];
101  }
102  }
103 
104  return _(newmat);
105 }
_dgematrix i(const _dgbmatrix &mat)
CPPL_INT n
matrix column size
Definition: zhematrix.hpp:11
Complex Double-precision Hermitian Matrix Class [l-type (UPLO=l) Strage].
Definition: zhematrix.hpp:4
comple ** darray
array of pointers of column head addresses
Definition: zhematrix.hpp:13
_dcovector _(dcovector &vec)
_zgematrix operator* ( const zhematrix matA,
const zhematrix matB 
)
inline

zhematrix*zhematrix operator

Definition at line 109 of file zhematrix-zhematrix.hpp.

References _(), zgematrix::array, zhematrix::array, zhematrix::complete(), zgematrix::m, and zhematrix::n.

110 {CPPL_VERBOSE_REPORT;
111 #ifdef CPPL_DEBUG
112  if(matA.n!=matB.n){
113  ERROR_REPORT;
114  std::cerr << "These two matrises can not make a product." << std::endl
115  << "Your input was (" << matA.n << "x" << matA.n << ") * (" << matB.n << "x" << matB.n << ")." << std::endl;
116  exit(1);
117  }
118 #endif//CPPL_DEBUG
119 
120  matB.complete();
121 
122  zgematrix newmat( matA.n, matB.n );
123  char side ='l';
124  char uplo ='l';
125  comple alpha =comple(1.,0.);
126  comple beta =comple(0.,0.);
127 
128  zhemm_( &side, &uplo, &matA.n, &matB.n, &alpha, matA.array, &matA.n, matB.array, &matB.n, &beta, newmat.array, &newmat.m );
129 
130  return _(newmat);
131 }
void complete() const
Complex Double-precision General Dence Matrix Class.
Definition: zgematrix.hpp:3
CPPL_INT n
matrix column size
Definition: zhematrix.hpp:11
comple * array
1D array to store matrix data
Definition: zhematrix.hpp:12
_dcovector _(dcovector &vec)