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::destroy(), i(), 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 #endif//CPPL_DEBUG
13 
14  for(CPPL_INT i=0; i<vecA.l; i++){
15  vecA.array[i] += vecB.array[i];
16  }
17 
18  vecB.destroy();
19  return vecA;
20 }
_dgematrix i(const _dgbmatrix &mat)
void destroy() const
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::destroy(), i(), 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  vecB.destroy();
40  return vecA;
41 }
_dgematrix i(const _dgbmatrix &mat)
void destroy() const
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 45 of file _zcovector-_zcovector.hpp.

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

46 {CPPL_VERBOSE_REPORT;
47 #ifdef CPPL_DEBUG
48  if(vecA.l!=vecB.l){
49  ERROR_REPORT;
50  std::cerr << "These two vectors can not make a dot product." << std::endl
51  << "Your input was (" << vecA.l << ") % (" << vecB.l << ")." << std::endl;
52  exit(1);
53  }
54 #endif//CPPL_DEBUG
55 
56  CPPL_INT inc =1;
57  comple val =zdotu_( &vecA.l, vecA.array, &inc, vecB.array, &inc );
58 
59  vecA.destroy();
60  vecB.destroy();
61  return val;
62 }
void destroy() const
comple * array
1D array to store vector data
Definition: _zcovector.hpp:10
CPPL_INT l
vector size
Definition: _zcovector.hpp:9