CPPLapack
 All Classes Files Functions Variables Friends Pages
_zcovector-zcovector.hpp
Go to the documentation of this file.
1 //=============================================================================
2 /*! _zcovector+zcovector operator */
3 inline _zcovector operator+(const _zcovector& vecA, const zcovector& vecB)
4 {CPPL_VERBOSE_REPORT;
5 #ifdef CPPL_DEBUG
6  if(vecA.l!=vecB.l){
7  ERROR_REPORT;
8  std::cerr << "These two vectors can not make a sumation." << std::endl
9  << "Your input was (" << vecA.l << ") + (" << vecB.l << ")." << std::endl;
10  exit(1);
11  }
12 
13 #endif//CPPL_DEBUG
14 
15  for(CPPL_INT i=0; i<vecA.l; i++){
16  vecA.array[i] += vecB.array[i];
17  }
18 
19  return vecA;
20 }
21 
22 //=============================================================================
23 /*! zcovector-zcovector operator */
24 inline _zcovector operator-(const _zcovector& vecA, const zcovector& vecB)
25 {CPPL_VERBOSE_REPORT;
26 #ifdef CPPL_DEBUG
27  if(vecA.l!=vecB.l){
28  ERROR_REPORT;
29  std::cerr << "These two vectors can not make a subtraction." << std::endl
30  << "Your input was (" << vecA.l << ") - (" << vecB.l << ")." << std::endl;
31  exit(1);
32  }
33 #endif//CPPL_DEBUG
34 
35  for(CPPL_INT i=0; i<vecA.l; i++){
36  vecA.array[i] -= vecB.array[i];
37  }
38 
39  return vecA;
40 }
41 
42 //=============================================================================
43 /*! zcovector^T*zcovector operator (inner product) */
44 inline comple operator%(const _zcovector& vecA, const zcovector& vecB)
45 {CPPL_VERBOSE_REPORT;
46 #ifdef CPPL_DEBUG
47  if(vecA.l!=vecB.l){
48  ERROR_REPORT;
49  std::cerr << "These two vectors can not make a dot product." << std::endl
50  << "Your input was (" << vecA.l << ") % (" << vecB.l << ")." << std::endl;
51  exit(1);
52  }
53 #endif//CPPL_DEBUG
54 
55  CPPL_INT inc =1;
56  comple val =zdotu_( &vecA.l, vecA.array, &inc, vecB.array, &inc );
57 
58  vecA.destroy();
59  return val;
60 }
comple * array
1D array to store vector data
Definition: zcovector.hpp:10
CPPL_INT l
vector size
Definition: zcovector.hpp:9
_dgematrix i(const _dgbmatrix &mat)
void destroy() const
comple * array
1D array to store vector data
Definition: _zcovector.hpp:10
comple operator%(const _zcovector &vecA, const zcovector &vecB)
Complex Double-precision Column Vector Class.
Definition: zcovector.hpp:3
(DO NOT USE) Smart-temporary Complex Double-precision Column Vector Class
Definition: _zcovector.hpp:3
CPPL_INT l
vector size
Definition: _zcovector.hpp:9
_zcovector operator+(const _zcovector &vecA, const zcovector &vecB)
_zcovector operator-(const _zcovector &vecA, const zcovector &vecB)