My Project
zrovector-complex.hpp
1 //=============================================================================
3 inline zrovector& zrovector::operator*=(const std::complex<double>& d)
4 {
5 #ifdef CPPL_VERBOSE
6  std::cerr << "# [MARK] zrovector::operator*=(const std::complex<double>&)"
7  << std::endl;
8 #endif//CPPL_VERBOSE
9 
10  zscal_(L, d, Array, 1);
11  return *this;
12 }
13 
14 //=============================================================================
16 inline zrovector& zrovector::operator/=(const std::complex<double>& d)
17 {
18 #ifdef CPPL_VERBOSE
19  std::cerr << "# [MARK] zrovector::operator/=(const std::complex<double>&)"
20  << std::endl;
21 #endif//CPPL_VERBOSE
22 
23  zscal_(L, 1./d, Array, 1);
24  return *this;
25 }
26 
30 
31 //=============================================================================
33 inline _zrovector operator*(const zrovector& vec, const std::complex<double>& d)
34 {
35 #ifdef CPPL_VERBOSE
36  std::cerr << "# [MARK] operator*(const zrovector&, const std::complex<double>&)"
37  << std::endl;
38 #endif//CPPL_VERBOSE
39 
40  zrovector newvec(vec.L);
41  for(long i=0; i<vec.L; i++){ newvec.array[i] =vec.Array[i]*d; }
42 
43  return _(newvec);
44 }
45 
46 //=============================================================================
48 inline _zrovector operator/(const zrovector& vec, const std::complex<double>& d)
49 {
50 #ifdef CPPL_VERBOSE
51  std::cerr << "# [MARK] operator/(const zrovector&, const std::complex<double>&)"
52  << std::endl;
53 #endif//CPPL_VERBOSE
54 
55  std::complex<double> inv_d(1./d);
56  zrovector newvec(vec.L);
57  for(long i=0; i<vec.L; i++){ newvec.array[i] =vec.Array[i]*inv_d; }
58 
59  return _(newvec);
60 }
long L
vector size
Definition: _zrovector.hpp:7
friend _zrovector operator/(const zrovector &, const double &)
Definition: zrovector-double.hpp:48
Complex Double-precision Row Vector Class.
Definition: zrovector.hpp:3
(DO NOT USE) Smart-temporary Complex Double-precision Row Vector Class
Definition: _zrovector.hpp:3
zrovector & operator*=(const double &)
Definition: zrovector-double.hpp:3
friend _zrovector operator*(const zrovector &, const zgematrix &)
Definition: zrovector-zgematrix.hpp:3
zrovector & operator/=(const double &)
Definition: zrovector-double.hpp:16
std::complex< double > * Array
1D Array to store vector data
Definition: _zrovector.hpp:8