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 3 of file _zcovector-zcovector.hpp.

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

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 }
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 24 of file _zcovector-zcovector.hpp.

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

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 }
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 44 of file _zcovector-zcovector.hpp.

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

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
void destroy() const
comple * array
1D array to store vector data
Definition: _zcovector.hpp:10
CPPL_INT l
vector size
Definition: _zcovector.hpp:9