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 76 of file zgematrix-zhematrix.hpp.

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

77 {CPPL_VERBOSE_REPORT;
78 #ifdef CPPL_DEBUG
79  if(matA.n!=matB.n || matA.m!=matB.n){
80  ERROR_REPORT;
81  std::cerr << "These two matrises can not make a summation." << std::endl
82  << "Your input was (" << matA.m << "x" << matA.n << ") + (" << matB.n << "x" << matB.n << ")." << std::endl;
83  exit(1);
84  }
85 #endif//CPPL_DEBUG
86 
87  zgematrix newmat =matA;
88 
89  for(CPPL_INT i=0; i<matA.m; i++){
90  for(CPPL_INT j=0; j<matA.n; j++){
91  newmat(i,j) += matB(i,j);
92  }
93  }
94 
95  return _(newmat);
96 }
_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
CPPL_INT n
matrix column size
Definition: zhematrix.hpp:11
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 100 of file zgematrix-zhematrix.hpp.

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

101 {CPPL_VERBOSE_REPORT;
102 #ifdef CPPL_DEBUG
103  if(matA.n!=matB.n || matA.m!=matB.n){
104  ERROR_REPORT;
105  std::cerr << "These two matrises can not make a subtraction." << std::endl
106  << "Your input was (" << matA.m << "x" << matA.n << ") - (" << matB.n << "x" << matB.n << ")." << std::endl;
107  exit(1);
108  }
109 #endif//CPPL_DEBUG
110 
111  zgematrix newmat =matA;
112 
113  for(CPPL_INT i=0; i<matA.m; i++){
114  for(CPPL_INT j=0; j<matA.n; j++){
115  newmat(i,j) -= matB(i,j);
116  }
117  }
118 
119  return _(newmat);
120 }
_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
CPPL_INT n
matrix column size
Definition: zhematrix.hpp:11
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 124 of file zgematrix-zhematrix.hpp.

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

125 {CPPL_VERBOSE_REPORT;
126 #ifdef CPPL_DEBUG
127  if(matA.n!=matB.n){
128  ERROR_REPORT;
129  std::cerr << "These two matrises can not make a product." << std::endl
130  << "Your input was (" << matA.m << "x" << matA.n << ") * (" << matB.n << "x" << matB.n << ")." << std::endl;
131  exit(1);
132  }
133 #endif//CPPL_DEBUG
134 
135  zgematrix newmat( matA.m, matA.n );
136  char side ='R';
137  char uplo ='l';
138  comple alpha =comple(1.,0.);
139  comple beta =comple(0.,0.);
140 
141  zhemm_( &side, &uplo, &newmat.m, &newmat.n, &alpha, matB.array, &matB.n, matA.array, &matA.m, &beta, newmat.array, &newmat.m );
142 
143  return _(newmat);
144 }
CPPL_INT n
matrix column size
Definition: zgematrix.hpp:10
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: zgematrix.hpp:11
comple * array
1D array to store matrix data
Definition: zhematrix.hpp:12
CPPL_INT m
matrix row size
Definition: zgematrix.hpp:9
_dcovector _(dcovector &vec)