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

Go to the source code of this file.

Functions

_zcovector operator+ (const zcovector &vecA, const _zcovector &vecB)
 
_zcovector operator- (const zcovector &vecA, const _zcovector &vecB)
 
comple operator% (const zcovector &vecA, const _zcovector &vecB)
 

Function Documentation

_zcovector operator+ ( const zcovector vecA,
const _zcovector vecB 
)
inline

zcovector+zcovector operator

Definition at line 61 of file zcovector-_zcovector.hpp.

References _zcovector::array, zcovector::array, i(), zcovector::l, and _zcovector::l.

62 {CPPL_VERBOSE_REPORT;
63 #ifdef CPPL_DEBUG
64  if(vecA.l!=vecB.l){
65  ERROR_REPORT;
66  std::cerr << "These two vectors can not make a sumation." << std::endl
67  << "Your input was (" << vecA.l << ") + (" << vecB.l << ")." << std::endl;
68  exit(1);
69  }
70 #endif//CPPL_DEBUG
71 
72  for(CPPL_INT i=0; i<vecA.l; i++){
73  vecB.array[i] += vecA.array[i];
74  }
75 
76  return vecB;
77 }
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)
comple * array
1D array to store vector data
Definition: _zcovector.hpp:10
CPPL_INT l
vector size
Definition: _zcovector.hpp:9
_zcovector operator- ( const zcovector vecA,
const _zcovector vecB 
)
inline

zcovector-zcovector operator

Definition at line 81 of file zcovector-_zcovector.hpp.

References _zcovector::array, zcovector::array, i(), zcovector::l, and _zcovector::l.

82 {CPPL_VERBOSE_REPORT;
83 #ifdef CPPL_DEBUG
84  if(vecA.l!=vecB.l){
85  ERROR_REPORT;
86  std::cerr << "These two vectors can not make a subtraction." << std::endl
87  << "Your input was (" << vecA.l << ") - (" << vecB.l << ")." << std::endl;
88  exit(1);
89  }
90 #endif//CPPL_DEBUG
91 
92  for(CPPL_INT i=0; i<vecA.l; i++){
93  vecB.array[i] =vecA.array[i]-vecB.array[i];
94  }
95 
96  return vecB;
97 }
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)
comple * array
1D array to store vector data
Definition: _zcovector.hpp:10
CPPL_INT l
vector size
Definition: _zcovector.hpp:9
comple operator% ( const zcovector vecA,
const _zcovector vecB 
)
inline

zcovector^T*zcovector operator (inner product)

Definition at line 101 of file zcovector-_zcovector.hpp.

References zcovector::array, _zcovector::array, _zcovector::destroy(), zcovector::l, and _zcovector::l.

102 {CPPL_VERBOSE_REPORT;
103 #ifdef CPPL_DEBUG
104  if(vecA.l!=vecB.l){
105  ERROR_REPORT;
106  std::cerr << "These two vectors can not make a dot product." << std::endl
107  << "Your input was (" << vecA.l << ") % (" << vecB.l << ")." << std::endl;
108  exit(1);
109  }
110 #endif//CPPL_DEBUG
111 
112  CPPL_INT inc =1;
113  comple val =zdotu_( &vecA.l, vecA.array, &inc, vecB.array, &inc );
114 
115  vecB.destroy();
116  return val;
117 }
comple * array
1D array to store vector data
Definition: zcovector.hpp:10
CPPL_INT l
vector size
Definition: zcovector.hpp:9
void destroy() const
comple * array
1D array to store vector data
Definition: _zcovector.hpp:10
CPPL_INT l
vector size
Definition: _zcovector.hpp:9