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

Go to the source code of this file.

Functions

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

Function Documentation

_zgematrix operator+ ( const zgematrix matA,
const _zhematrix matB 
)
inline

zgematrix+_zhematrix operator

Definition at line 79 of file zgematrix-_zhematrix.hpp.

References _(), _zhematrix::destroy(), i(), zgematrix::m, zgematrix::n, and _zhematrix::n.

80 {CPPL_VERBOSE_REPORT;
81 #ifdef CPPL_DEBUG
82  if(matA.n!=matB.n || matA.m!=matB.n){
83  ERROR_REPORT;
84  std::cerr << "These two matrises can not make a summation." << std::endl
85  << "Your input was (" << matA.m << "x" << matA.n << ") + (" << matB.n << "x" << matB.n << ")." << std::endl;
86  exit(1);
87  }
88 #endif//CPPL_DEBUG
89 
90  zgematrix newmat =matA;
91 
92  for(CPPL_INT i=0; i<matA.m; i++){
93  for(CPPL_INT j=0; j<matA.n; j++){
94  newmat(i,j) +=matB(i,j);
95  }
96  }
97 
98  matB.destroy();
99  return _(newmat);
100 }
CPPL_INT n
matrix column size
Definition: _zhematrix.hpp:11
_dgematrix i(const _dgbmatrix &mat)
CPPL_INT n
matrix column size
Definition: zgematrix.hpp:10
Complex Double-precision General Dence Matrix Class.
Definition: zgematrix.hpp:3
void destroy() const
CPPL_INT m
matrix row size
Definition: zgematrix.hpp:9
_dcovector _(dcovector &vec)
_zgematrix operator- ( const zgematrix matA,
const _zhematrix matB 
)
inline

zgematrix-_zhematrix operator

Definition at line 104 of file zgematrix-_zhematrix.hpp.

References _(), _zhematrix::destroy(), i(), zgematrix::m, zgematrix::n, and _zhematrix::n.

105 {CPPL_VERBOSE_REPORT;
106 #ifdef CPPL_DEBUG
107  if(matA.n!=matB.n || matA.m!=matB.n){
108  ERROR_REPORT;
109  std::cerr << "These two matrises can not make a subtraction." << std::endl
110  << "Your input was (" << matA.m << "x" << matA.n << ") - (" << matB.n << "x" << matB.n << ")." << std::endl;
111  exit(1);
112  }
113 #endif//CPPL_DEBUG
114 
115  zgematrix newmat =matA;
116 
117  for(CPPL_INT i=0; i<matA.m; i++){
118  for(CPPL_INT j=0; j<matA.n; j++){
119  newmat(i,j) -=matB(i,j);
120  }
121  }
122 
123  matB.destroy();
124  return _(newmat);
125 }
CPPL_INT n
matrix column size
Definition: _zhematrix.hpp:11
_dgematrix i(const _dgbmatrix &mat)
CPPL_INT n
matrix column size
Definition: zgematrix.hpp:10
Complex Double-precision General Dence Matrix Class.
Definition: zgematrix.hpp:3
void destroy() const
CPPL_INT m
matrix row size
Definition: zgematrix.hpp:9
_dcovector _(dcovector &vec)
_zgematrix operator* ( const zgematrix matA,
const _zhematrix matB 
)
inline

zgematrix*_zhematrix operator

Definition at line 129 of file zgematrix-_zhematrix.hpp.

References _(), zgematrix::array, _zhematrix::array, _zhematrix::destroy(), zgematrix::m, zgematrix::n, and _zhematrix::n.

130 {CPPL_VERBOSE_REPORT;
131 #ifdef CPPL_DEBUG
132  if(matA.n!=matB.n){
133  ERROR_REPORT;
134  std::cerr << "These two matrises can not make a product." << std::endl
135  << "Your input was (" << matA.m << "x" << matA.n << ") * (" << matB.n << "x" << matB.n << ")." << std::endl;
136  exit(1);
137  }
138 #endif//CPPL_DEBUG
139 
140  zgematrix newmat( matA.n, matB.n );
141  char side ='R';
142  char uplo ='l';
143  comple alpha =comple(1.,0.);
144  comple beta =comple(0.,0.);
145 
146  zhemm_( &side, &uplo, &newmat.m, &newmat.n, &alpha, matB.array, &matB.n, matA.array, &matA.m, &beta, newmat.array, &newmat.m );
147 
148  matB.destroy();
149  return _(newmat);
150 }
CPPL_INT n
matrix column size
Definition: _zhematrix.hpp:11
CPPL_INT n
matrix column size
Definition: zgematrix.hpp:10
Complex Double-precision General Dence Matrix Class.
Definition: zgematrix.hpp:3
comple * array
1D array to store matrix data
Definition: zgematrix.hpp:11
comple * array
1D array to store matrix data
Definition: _zhematrix.hpp:12
void destroy() const
CPPL_INT m
matrix row size
Definition: zgematrix.hpp:9
_dcovector _(dcovector &vec)