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 65 of file zhematrix-_zhematrix.hpp.

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

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

zhematrix-_zhematrix operator

Definition at line 87 of file zhematrix-_zhematrix.hpp.

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

88 {CPPL_VERBOSE_REPORT;
89 #ifdef CPPL_DEBUG
90  if(matA.n!=matB.n){
91  ERROR_REPORT;
92  std::cerr << "These two matrises can not make a subtraction." << std::endl
93  << "Your input was (" << matA.n << "x" << matA.n << ") - (" << matB.n << "x" << matB.n << ")." << std::endl;
94  exit(1);
95  }
96 #endif//CPPL_DEBUG
97 
98  for(CPPL_INT j=0; j<matA.n; j++){
99  for(CPPL_INT i=j; i<matA.n; i++){
100  matB.darray[j][i] =matA.darray[j][i]-matB.darray[j][i];
101  }
102  }
103 
104  return matB;
105 }
CPPL_INT n
matrix column size
Definition: _zhematrix.hpp:11
_dgematrix i(const _dgbmatrix &mat)
CPPL_INT n
matrix column size
Definition: zhematrix.hpp:11
comple ** darray
array of pointers of column head addresses
Definition: zhematrix.hpp:13
comple ** darray
array of pointers of column head addresses
Definition: _zhematrix.hpp:13
_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::array, _zhematrix::complete(), _zhematrix::destroy(), zgematrix::m, zhematrix::n, 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  matB.destroy();
131  return _(newmat);
132 }
CPPL_INT n
matrix column size
Definition: _zhematrix.hpp:11
Complex Double-precision General Dence Matrix Class.
Definition: zgematrix.hpp:3
CPPL_INT n
matrix column size
Definition: zhematrix.hpp:11
void complete() const
comple * array
1D array to store matrix data
Definition: zhematrix.hpp:12
comple * array
1D array to store matrix data
Definition: _zhematrix.hpp:12
void destroy() const
_dcovector _(dcovector &vec)