CPPLapack
 All Classes Files Functions Variables Friends Pages
Functions
zrovector-_zrovector.hpp File Reference

Go to the source code of this file.

Functions

_zrovector operator+ (const zrovector &vecA, const _zrovector &vecB)
 
_zrovector operator- (const zrovector &vecA, const _zrovector &vecB)
 
comple operator% (const zrovector &vecA, const _zrovector &vecB)
 

Function Documentation

_zrovector operator+ ( const zrovector vecA,
const _zrovector vecB 
)
inline

zrovector+zrovector operator

Definition at line 61 of file zrovector-_zrovector.hpp.

References _zrovector::array, zrovector::array, i(), zrovector::l, and _zrovector::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 
71 #endif//CPPL_DEBUG
72 
73  for(CPPL_INT i=0; i<vecA.l; i++){
74  vecB.array[i] += vecA.array[i];
75  }
76 
77  return vecB;
78 }
CPPL_INT l
vector size
Definition: zrovector.hpp:9
_dgematrix i(const _dgbmatrix &mat)
CPPL_INT l
vector size
Definition: _zrovector.hpp:9
comple * array
1D array to store vector data
Definition: _zrovector.hpp:10
comple * array
1D array to store vector data
Definition: zrovector.hpp:10
_zrovector operator- ( const zrovector vecA,
const _zrovector vecB 
)
inline

zrovector-zrovector operator

Definition at line 82 of file zrovector-_zrovector.hpp.

References _zrovector::array, zrovector::array, i(), zrovector::l, and _zrovector::l.

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

zrovector^T*zrovector operator (inner product)

Definition at line 102 of file zrovector-_zrovector.hpp.

References zrovector::array, _zrovector::array, _zrovector::destroy(), zrovector::l, and _zrovector::l.

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