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)
 
_zrovector hadamerd (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, i(), 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  zrovector newvec(vecA.l);
74 
75  for(CPPL_INT i=0; i<newvec.l; i++){
76  newvec.array[i] =vecA.array[i]+vecB.array[i];
77  }
78 
79  return _(newvec);
80 }
CPPL_INT l
vector size
Definition: zrovector.hpp:9
_dgematrix i(const _dgbmatrix &mat)
Complex Double-precision Row Vector Class.
Definition: zrovector.hpp:3
_dcovector _(dcovector &vec)
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 84 of file zrovector-zrovector.hpp.

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

85 {CPPL_VERBOSE_REPORT;
86 #ifdef CPPL_DEBUG
87  if(vecA.l!=vecB.l){
88  ERROR_REPORT;
89  std::cerr << "These two vectors can not make a subtraction." << std::endl
90  << "Your input was (" << vecA.l << ") - (" << vecB.l << ")." << std::endl;
91  exit(1);
92  }
93 #endif//CPPL_DEBUG
94 
95  zrovector newvec(vecA.l);
96 
97  for(CPPL_INT i=0; i<newvec.l; i++){
98  newvec.array[i] =vecA.array[i]-vecB.array[i];
99  }
100 
101  return _(newvec);
102 }
CPPL_INT l
vector size
Definition: zrovector.hpp:9
_dgematrix i(const _dgbmatrix &mat)
Complex Double-precision Row Vector Class.
Definition: zrovector.hpp:3
_dcovector _(dcovector &vec)
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 106 of file zrovector-zrovector.hpp.

References zrovector::array, and zrovector::l.

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

return Hadamerd product

Definition at line 128 of file zrovector-zrovector.hpp.

References _(), i(), and zrovector::l.

129 {CPPL_VERBOSE_REPORT;
130 #ifdef CPPL_DEBUG
131  if( vecA.l!=vecB.l ){
132  ERROR_REPORT;
133  std::cerr << "These two vectors can not make Hadamerd product." << std::endl
134  << "Your input was (" << vecA.l << ") and (" << vecB.l << ")." << std::endl;
135  exit(1);
136  }
137 #endif//CPPL_DEBUG
138 
139  zrovector newvec(vecA.l);
140  for(CPPL_INT i=0; i<newvec.l; i++){
141  newvec(i) =vecA(i)*vecB(i);
142  }
143  return _(newvec);
144 }
CPPL_INT l
vector size
Definition: zrovector.hpp:9
_dgematrix i(const _dgbmatrix &mat)
Complex Double-precision Row Vector Class.
Definition: zrovector.hpp:3
_dcovector _(dcovector &vec)