CPPLapack
 All Classes Files Functions Variables Friends Pages
Public Member Functions | Public Attributes | Friends | List of all members
zrovector Class Reference

Complex Double-precision Row Vector Class. More...

#include <zrovector.hpp>

Public Member Functions

 zrovector ()
 
 zrovector (const zrovector &)
 
 zrovector (const _zrovector &)
 
 zrovector (const CPPL_INT &)
 
 zrovector (const char *)
 
 ~zrovector ()
 
comple & operator() (const CPPL_INT &)
 
comple operator() (const CPPL_INT &) const
 
zrovectorset (const CPPL_INT &, const comple &)
 
void write (const char *) const
 
void read (const char *)
 
void clear ()
 
zrovectorzero ()
 
void chsign ()
 
void copy (const zrovector &)
 
void shallow_copy (const _zrovector &)
 
void alias (const zrovector &)
 
void unalias ()
 
void resize (const CPPL_INT &)
 
zrovectoroperator= (const zrovector &)
 
zrovectoroperator= (const _zrovector &)
 
zrovectoroperator+= (const zrovector &)
 
zrovectoroperator+= (const _zrovector &)
 
zrovectoroperator-= (const zrovector &)
 
zrovectoroperator-= (const _zrovector &)
 
zrovectoroperator*= (const double &)
 
zrovectoroperator*= (const comple &)
 
zrovectoroperator/= (const double &)
 
zrovectoroperator/= (const comple &)
 

Public Attributes

CPPL_INT l
 vector size More...
 
comple * array
 1D array to store vector data More...
 

Friends

std::ostream & operator<< (std::ostream &, const zrovector &)
 
_zcovector t (const zrovector &)
 
_zrovector conj (const zrovector &)
 
_zcovector conjt (const zrovector &)
 
double nrm2 (const zrovector &)
 
CPPL_INT idamax (const zrovector &)
 
comple damax (const zrovector &)
 
void swap (zrovector &, zrovector &)
 
_zrovector _ (zrovector &)
 
const zrovectoroperator+ (const zrovector &)
 
_zrovector operator- (const zrovector &)
 
_zrovector operator+ (const zrovector &, const zrovector &)
 
_zrovector operator+ (const zrovector &, const _zrovector &)
 
_zrovector operator- (const zrovector &, const zrovector &)
 
_zrovector operator- (const zrovector &, const _zrovector &)
 
comple operator* (const zrovector &, const zcovector &)
 
comple operator* (const zrovector &, const _zcovector &)
 
_zrovector operator* (const zrovector &, const zgematrix &)
 
_zrovector operator* (const zrovector &, const _zgematrix &)
 
_zrovector operator* (const zrovector &, const zhematrix &)
 
_zrovector operator* (const zrovector &, const _zhematrix &)
 
_zrovector operator* (const zrovector &, const zgbmatrix &)
 
_zrovector operator* (const zrovector &, const _zgbmatrix &)
 
_zrovector operator* (const zrovector &, const zgsmatrix &)
 
_zrovector operator* (const zrovector &, const _zgsmatrix &)
 
_zrovector operator* (const zrovector &, const zhsmatrix &)
 
_zrovector operator* (const zrovector &, const _zhsmatrix &)
 
_zrovector operator* (const zrovector &, const double &)
 
_zrovector operator* (const zrovector &, const comple &)
 
_zrovector operator/ (const zrovector &, const double &)
 
_zrovector operator/ (const zrovector &, const comple &)
 
comple operator% (const zrovector &, const zrovector &)
 
comple operator% (const zrovector &, const _zrovector &)
 
_zrovector operator* (const double &, const zrovector &)
 
_zrovector operator* (const comple &, const zrovector &)
 
_zrovector hadamard (const zrovector &, const zrovector &)
 

Detailed Description

Complex Double-precision Row Vector Class.

Definition at line 3 of file zrovector.hpp.

Constructor & Destructor Documentation

zrovector::zrovector ( )
inline

zrovector constructor

Definition at line 3 of file zrovector-constructor.hpp.

References array, and l.

4 {CPPL_VERBOSE_REPORT;
5  //////// initialize ////////
6  l =0;
7  array =NULL;
8 }
CPPL_INT l
vector size
Definition: zrovector.hpp:9
comple * array
1D array to store vector data
Definition: zrovector.hpp:10
zrovector::zrovector ( const zrovector vec)
inline

zrovector copy constructor

Definition at line 12 of file zrovector-constructor.hpp.

References array, and l.

13 {CPPL_VERBOSE_REPORT;
14  //////// initialize ////////
15  l =vec.l;
16  array =new comple[l];
17 
18  //////// copy ////////
19  CPPL_INT inc =1;
20  zcopy_(&l, vec.array, &inc, array, &inc);
21 }
CPPL_INT l
vector size
Definition: zrovector.hpp:9
comple * array
1D array to store vector data
Definition: zrovector.hpp:10
zrovector::zrovector ( const _zrovector vec)
inline

zrovector constructor to cast _zrovector

Definition at line 25 of file zrovector-constructor.hpp.

References array, _zrovector::array, _zrovector::l, l, and _zrovector::nullify().

26 {CPPL_VERBOSE_REPORT;
27  //////// initialize ////////
28  l =vec.l;
29  array =vec.array;
30 
31  vec.nullify();
32 }
CPPL_INT l
vector size
Definition: zrovector.hpp:9
CPPL_INT l
vector size
Definition: _zrovector.hpp:9
comple * array
1D array to store vector data
Definition: _zrovector.hpp:10
void nullify() const
comple * array
1D array to store vector data
Definition: zrovector.hpp:10
zrovector::zrovector ( const CPPL_INT &  _l)
inline

zrovector constructor with size specification

Definition at line 36 of file zrovector-constructor.hpp.

References array, and l.

37 {CPPL_VERBOSE_REPORT;
38 #ifdef CPPL_DEBUG
39  if( _l<0 ){
40  ERROR_REPORT;
41  std::cerr << "Vector size must be positive integers. " << std::endl
42  << "Your input was (" << _l << ")." << std::endl;
43  exit(1);
44  }
45 #endif//CPPL_DEBUG
46 
47  //////// initialize ////////
48  l =_l;
49  array =new comple[l];
50 }
CPPL_INT l
vector size
Definition: zrovector.hpp:9
comple * array
1D array to store vector data
Definition: zrovector.hpp:10
zrovector::zrovector ( const char *  filename)
inline

zrovector constructor with filename

Definition at line 54 of file zrovector-constructor.hpp.

References array, and read().

55 {CPPL_VERBOSE_REPORT;
56  array =NULL;
57 
58  //// read ////
59  read(filename);
60 }
void read(const char *)
comple * array
1D array to store vector data
Definition: zrovector.hpp:10
zrovector::~zrovector ( )
inline

zrovector destructor

Definition at line 68 of file zrovector-constructor.hpp.

References array.

69 {CPPL_VERBOSE_REPORT;
70  //////// delete array ////////
71  delete [] array;
72 }
comple * array
1D array to store vector data
Definition: zrovector.hpp:10

Member Function Documentation

comple & zrovector::operator() ( const CPPL_INT &  i)
inline

operator() for non-const object

Definition at line 3 of file zrovector-io.hpp.

References array, i(), and l.

Referenced by read(), and write().

4 {CPPL_VERBOSE_REPORT;
5 #ifdef CPPL_DEBUG
6  if( i<0 || l<=i ){
7  ERROR_REPORT;
8  std::cerr << "The required component is out of the vector size." << std::endl
9  << "Your input is (" << i << "), whereas the vector size is " << l << "." << std::endl;
10  exit(1);
11  }
12 #endif//CPPL_DEBUG
13 
14  return array[i];
15 }
CPPL_INT l
vector size
Definition: zrovector.hpp:9
_dgematrix i(const _dgbmatrix &mat)
comple * array
1D array to store vector data
Definition: zrovector.hpp:10
comple zrovector::operator() ( const CPPL_INT &  i) const
inline

operator() for const object

Definition at line 19 of file zrovector-io.hpp.

References array, i(), and l.

20 {CPPL_VERBOSE_REPORT;
21 #ifdef CPPL_DEBUG
22  if( i<0 || l<=i ){
23  ERROR_REPORT;
24  std::cerr << "The required component is out of the vector size." << std::endl
25  << "Your input is (" << i << "), whereas the vector size is " << l << "." << std::endl;
26  exit(1);
27  }
28 #endif//CPPL_DEBUG
29 
30  return array[i];
31 }
CPPL_INT l
vector size
Definition: zrovector.hpp:9
_dgematrix i(const _dgbmatrix &mat)
comple * array
1D array to store vector data
Definition: zrovector.hpp:10
zrovector & zrovector::set ( const CPPL_INT &  i,
const comple &  v 
)
inline

set value for const object

Definition at line 39 of file zrovector-io.hpp.

References array, i(), and l.

40 {CPPL_VERBOSE_REPORT;
41 #ifdef CPPL_DEBUG
42  if( i<0 || l<=i ){
43  ERROR_REPORT;
44  std::cerr << "The required component is out of the vector size." << std::endl
45  << "Your input is (" << i << "), whereas the vector size is " << l << "." << std::endl;
46  exit(1);
47  }
48 #endif//CPPL_DEBUG
49 
50  array[i] =v;
51  return *this;
52 }
CPPL_INT l
vector size
Definition: zrovector.hpp:9
_dgematrix i(const _dgbmatrix &mat)
comple * array
1D array to store vector data
Definition: zrovector.hpp:10
void zrovector::write ( const char *  filename) const
inline

Definition at line 72 of file zrovector-io.hpp.

References i(), l, and operator()().

73 {CPPL_VERBOSE_REPORT;
74  std::ofstream ofs(filename, std::ios::trunc);
75  ofs.setf(std::cout.flags());
76  ofs.precision(std::cout.precision());
77  ofs.width(std::cout.width());
78  ofs.fill(std::cout.fill());
79 
80  ofs << "#zrovector" << " " << l << std::endl;
81  for(CPPL_INT i=0; i<l; i++){
82  ofs << operator()(i) << " ";
83  }
84  ofs << std::endl;
85 
86  ofs.close();
87 }
CPPL_INT l
vector size
Definition: zrovector.hpp:9
_dgematrix i(const _dgbmatrix &mat)
comple & operator()(const CPPL_INT &)
Definition: zrovector-io.hpp:3
void zrovector::read ( const char *  filename)
inline

Definition at line 90 of file zrovector-io.hpp.

References i(), l, operator()(), and resize().

Referenced by zrovector().

91 {CPPL_VERBOSE_REPORT;
92  std::ifstream s( filename );
93  if(!s){
94  ERROR_REPORT;
95  std::cerr << "The file \"" << filename << "\" can not be opened." << std::endl;
96  exit(1);
97  }
98 
99  std::string id;
100  s >> id;
101  if( id != "zrovector" && id != "#zrovector" ){
102  ERROR_REPORT;
103  std::cerr << "The type name of the file \"" << filename << "\" is not zrovector." << std::endl
104  << "Its type name was " << id << " ." << std::endl;
105  exit(1);
106  }
107 
108  s >> l;
109  resize(l);
110  for(CPPL_INT i=0; i<l; i++){
111  s >> operator()(i);
112  }
113  if(s.eof()){
114  ERROR_REPORT;
115  std::cerr << "There is something is wrong with the file \"" << filename << "\"." << std::endl
116  << "Most likely, there is not enough data components, or a linefeed code or space code is missing at the end of the last line." << std::endl;
117  exit(1);
118  }
119 
120  s >> id;
121  if(!s.eof()){
122  ERROR_REPORT;
123  std::cerr << "There is something is wrong with the file \"" << filename << "\"." << std::endl
124  << "Most likely, there are extra data components." << std::endl;
125  exit(1);
126  }
127 
128 
129  s.close();
130 }
CPPL_INT l
vector size
Definition: zrovector.hpp:9
void resize(const CPPL_INT &)
_dgematrix i(const _dgbmatrix &mat)
comple & operator()(const CPPL_INT &)
Definition: zrovector-io.hpp:3
void zrovector::clear ( )
inline

clear vector

Definition at line 3 of file zrovector-misc.hpp.

References array, and l.

4 {CPPL_VERBOSE_REPORT;
5  l =0;
6  delete [] array;
7  array =NULL;
8 }
CPPL_INT l
vector size
Definition: zrovector.hpp:9
comple * array
1D array to store vector data
Definition: zrovector.hpp:10
zrovector & zrovector::zero ( )
inline

make vector into zero vector

Definition at line 12 of file zrovector-misc.hpp.

References array, i(), and l.

Referenced by operator*(), and zgbmatrix::row().

13 {CPPL_VERBOSE_REPORT;
14  for(CPPL_INT i=0; i<l; i++){
15  array[i] =comple(0.,0.);
16  }
17  return *this;
18 }
CPPL_INT l
vector size
Definition: zrovector.hpp:9
_dgematrix i(const _dgbmatrix &mat)
comple * array
1D array to store vector data
Definition: zrovector.hpp:10
void zrovector::chsign ( )
inline

change sign(+/-) of the vector

Definition at line 22 of file zrovector-misc.hpp.

References array, i(), and l.

23 {CPPL_VERBOSE_REPORT;
24  for(CPPL_INT i=0; i<l; i++){
25  array[i] =-array[i];
26  }
27 }
CPPL_INT l
vector size
Definition: zrovector.hpp:9
_dgematrix i(const _dgbmatrix &mat)
comple * array
1D array to store vector data
Definition: zrovector.hpp:10
void zrovector::copy ( const zrovector vec)
inline

make a deep copy of the zrovector

Definition at line 31 of file zrovector-misc.hpp.

References array, and l.

Referenced by operator=().

32 {CPPL_VERBOSE_REPORT;
33  delete [] array;
34  l =vec.l;
35  array =new comple[vec.l];
36  CPPL_INT inc =1;
37 
38  zcopy_(&vec.l, vec.array, &inc, array, &inc);
39 }
CPPL_INT l
vector size
Definition: zrovector.hpp:9
comple * array
1D array to store vector data
Definition: zrovector.hpp:10
void zrovector::shallow_copy ( const _zrovector vec)
inline

make a shallow copy of the vector
This function is not desinged to be used in project codes.

Definition at line 44 of file zrovector-misc.hpp.

References array, _zrovector::array, _zrovector::l, l, and _zrovector::nullify().

Referenced by operator=().

45 {CPPL_VERBOSE_REPORT;
46  l =vec.l;
47  delete [] array;
48  array =vec.array;
49 
50  vec.nullify();
51 }
CPPL_INT l
vector size
Definition: zrovector.hpp:9
CPPL_INT l
vector size
Definition: _zrovector.hpp:9
comple * array
1D array to store vector data
Definition: _zrovector.hpp:10
void nullify() const
comple * array
1D array to store vector data
Definition: zrovector.hpp:10
void zrovector::alias ( const zrovector vec)
inline

make an alias of the vector
Be carefull to use this function not to cause double free.

Definition at line 56 of file zrovector-misc.hpp.

References array, and l.

57 {CPPL_VERBOSE_REPORT;
58  l =vec.l;
59  //cap =vec.cap;
60  delete [] array;
61  array =vec.array;
62 }
CPPL_INT l
vector size
Definition: zrovector.hpp:9
comple * array
1D array to store vector data
Definition: zrovector.hpp:10
void zrovector::unalias ( )
inline

unalias the vector

Definition at line 66 of file zrovector-misc.hpp.

References array, and l.

67 {CPPL_VERBOSE_REPORT;
68  l =0;
69  //cap =0;
70  array =NULL;
71 }
CPPL_INT l
vector size
Definition: zrovector.hpp:9
comple * array
1D array to store vector data
Definition: zrovector.hpp:10
void zrovector::resize ( const CPPL_INT &  _l)
inline

resize vector

Definition at line 75 of file zrovector-misc.hpp.

References array, and l.

Referenced by read().

76 {CPPL_VERBOSE_REPORT;
77 #ifdef CPPL_DEBUG
78  if( _l<0 ){
79  ERROR_REPORT;
80  std::cerr << "Vector size must be positive integers." << std::endl
81  << "Your input was (" << _l << ")." << std::endl;
82  exit(1);
83  }
84 #endif//CPPL_DEBUG
85 
86  l =_l;
87  delete [] array;
88  array =new comple[_l];
89 }
CPPL_INT l
vector size
Definition: zrovector.hpp:9
comple * array
1D array to store vector data
Definition: zrovector.hpp:10
zrovector & zrovector::operator= ( const zrovector vec)
inline

zrovector=zrovector operator

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

References array, and copy().

4 {CPPL_VERBOSE_REPORT;
5  if(array!=vec.array){ // if it is NOT self substitution
6  copy(vec);
7  }
8  return *this;
9 }
comple * array
1D array to store vector data
Definition: zrovector.hpp:10
void copy(const zrovector &)
zrovector & zrovector::operator= ( const _zrovector vec)
inline

zrovector=_zrovector operator

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

References shallow_copy().

4 {CPPL_VERBOSE_REPORT;
5  shallow_copy(vec);
6  return *this;
7 }
void shallow_copy(const _zrovector &)
zrovector & zrovector::operator+= ( const zrovector vec)
inline

zrovector+=zrovector operator

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

References array, i(), and l.

18 {CPPL_VERBOSE_REPORT;
19 #ifdef CPPL_DEBUG
20  if( l!=vec.l ){
21  ERROR_REPORT;
22  std::cerr << "These two vectors can not make a sumation." << std::endl
23  << "Your input was (" << l << ") += (" << vec.l << ")." << std::endl;
24  exit(1);
25  }
26 #endif//CPPL_DEBUG
27 
28  for(CPPL_INT i=0; i<l; i++){
29  array[i] += vec.array[i];
30  }
31 
32  return *this;
33 }
CPPL_INT l
vector size
Definition: zrovector.hpp:9
_dgematrix i(const _dgbmatrix &mat)
comple * array
1D array to store vector data
Definition: zrovector.hpp:10
zrovector & zrovector::operator+= ( const _zrovector vec)
inline

zrovector+=_zrovector operator

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

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

16 {CPPL_VERBOSE_REPORT;
17 #ifdef CPPL_DEBUG
18  if( l!=vec.l ){
19  ERROR_REPORT;
20  std::cerr << "These two vectors can not make a sumation." << std::endl
21  << "Your input was (" << l << ") += (" << vec.l << ")." << std::endl;
22  exit(1);
23  }
24 #endif//CPPL_DEBUG
25 
26  for(CPPL_INT i=0; i<l; i++){
27  array[i] += vec.array[i];
28  }
29 
30  vec.destroy();
31  return *this;
32 }
CPPL_INT l
vector size
Definition: zrovector.hpp:9
void destroy() const
_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 & zrovector::operator-= ( const zrovector vec)
inline

zrovector operator-=

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

References array, i(), and l.

38 {CPPL_VERBOSE_REPORT;
39 #ifdef CPPL_DEBUG
40  if( l!=vec.l ){
41  ERROR_REPORT;
42  std::cerr << "These two vectors can not make a subtraction." << std::endl
43  << "Your input was (" << l << ") -= (" << vec.l << ")." << std::endl;
44  exit(1);
45  }
46 #endif//CPPL_DEBUG
47 
48  for(CPPL_INT i=0; i<l; i++){
49  array[i] -= vec.array[i];
50  }
51 
52  return *this;
53 }
CPPL_INT l
vector size
Definition: zrovector.hpp:9
_dgematrix i(const _dgbmatrix &mat)
comple * array
1D array to store vector data
Definition: zrovector.hpp:10
zrovector & zrovector::operator-= ( const _zrovector vec)
inline

zrovector operator-=

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

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

37 {CPPL_VERBOSE_REPORT;
38 #ifdef CPPL_DEBUG
39  if( l!=vec.l ){
40  ERROR_REPORT;
41  std::cerr << "These two vectors can not make a subtraction." << std::endl
42  << "Your input was (" << l << ") -= (" << vec.l << ")." << std::endl;
43  exit(1);
44  }
45 #endif//CPPL_DEBUG
46 
47  for(CPPL_INT i=0; i<l; i++){
48  array[i] -= vec.array[i];
49  }
50 
51  vec.destroy();
52  return *this;
53 }
CPPL_INT l
vector size
Definition: zrovector.hpp:9
void destroy() const
_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 & zrovector::operator*= ( const double &  d)
inline

zrovector*=double operator

Definition at line 3 of file zrovector-double.hpp.

References array, and l.

4 {CPPL_VERBOSE_REPORT;
5  CPPL_INT inc =1;
6  zdscal_(&l, &d, array, &inc);
7  return *this;
8 }
CPPL_INT l
vector size
Definition: zrovector.hpp:9
comple * array
1D array to store vector data
Definition: zrovector.hpp:10
zrovector & zrovector::operator*= ( const comple &  d)
inline

zrovector*=comple operator

Definition at line 3 of file zrovector-complex.hpp.

References array, and l.

4 {CPPL_VERBOSE_REPORT;
5  CPPL_INT inc =1;
6  zscal_(&l, &d, array, &inc);
7  return *this;
8 }
CPPL_INT l
vector size
Definition: zrovector.hpp:9
comple * array
1D array to store vector data
Definition: zrovector.hpp:10
zrovector & zrovector::operator/= ( const double &  d)
inline

zrovector/=double operator

Definition at line 12 of file zrovector-double.hpp.

References array, and l.

13 {CPPL_VERBOSE_REPORT;
14  double dinv =1./d;
15  CPPL_INT inc =1;
16  zdscal_(&l, &dinv, array, &inc);
17  return *this;
18 }
CPPL_INT l
vector size
Definition: zrovector.hpp:9
comple * array
1D array to store vector data
Definition: zrovector.hpp:10
zrovector & zrovector::operator/= ( const comple &  d)
inline

zrovector/=comple operator

Definition at line 12 of file zrovector-complex.hpp.

References array, and l.

13 {CPPL_VERBOSE_REPORT;
14  comple dinv =1./d;
15  CPPL_INT inc =1;
16  zscal_(&l, &dinv, array, &inc);
17  return *this;
18 }
CPPL_INT l
vector size
Definition: zrovector.hpp:9
comple * array
1D array to store vector data
Definition: zrovector.hpp:10

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  s,
const zrovector vec 
)
friend

Definition at line 59 of file zrovector-io.hpp.

60 {CPPL_VERBOSE_REPORT;
61  for(CPPL_INT i=0; i<vec.l; i++){ s << " " << vec.array[i]; }
62  s << std::endl;
63 
64  return s;
65 }
CPPL_INT l
vector size
Definition: zrovector.hpp:9
_dgematrix i(const _dgbmatrix &mat)
comple * array
1D array to store vector data
Definition: zrovector.hpp:10
_zcovector t ( const zrovector rovec)
friend

return a transposed column vector

Definition at line 3 of file zrovector-calc.hpp.

4 {CPPL_VERBOSE_REPORT;
5  zcovector covec(rovec.l);
6  CPPL_INT inc =1;
7 
8  zcopy_(&rovec.l, rovec.array, &inc, covec.array, &inc);
9 
10  return _(covec);
11 }
friend _zrovector _(zrovector &)
CPPL_INT l
vector size
Definition: zrovector.hpp:9
Complex Double-precision Column Vector Class.
Definition: zcovector.hpp:3
comple * array
1D array to store vector data
Definition: zrovector.hpp:10
_zrovector conj ( const zrovector vec)
friend

return its conjugated vector

Definition at line 15 of file zrovector-calc.hpp.

16 {CPPL_VERBOSE_REPORT;
17  zrovector newvec(vec.l);
18 
19  for(CPPL_INT i=0; i<vec.l; i++){
20  newvec(i) =std::conj(vec(i));
21  }
22 
23  return _(newvec);
24 }
friend _zrovector _(zrovector &)
CPPL_INT l
vector size
Definition: zrovector.hpp:9
_dgematrix i(const _dgbmatrix &mat)
Complex Double-precision Row Vector Class.
Definition: zrovector.hpp:3
_zrovector conj(const zrovector &vec)
_zcovector conjt ( const zrovector rovec)
friend

return a conjugate transposed column vector

Definition at line 28 of file zrovector-calc.hpp.

29 {CPPL_VERBOSE_REPORT;
30  zcovector covec(rovec.l);
31 
32  for(CPPL_INT i=0; i<rovec.l; i++){
33  covec(i) =std::conj(rovec(i));
34  }
35 
36  return _(covec);
37 }
friend _zrovector _(zrovector &)
CPPL_INT l
vector size
Definition: zrovector.hpp:9
_dgematrix i(const _dgbmatrix &mat)
_zrovector conj(const zrovector &vec)
Complex Double-precision Column Vector Class.
Definition: zcovector.hpp:3
double nrm2 ( const zrovector vec)
friend

return its Euclidean norm

Definition at line 45 of file zrovector-calc.hpp.

46 {CPPL_VERBOSE_REPORT;
47  CPPL_INT inc =1;
48  return dznrm2_(&vec.l, vec.array, &inc);
49 }
CPPL_INT l
vector size
Definition: zrovector.hpp:9
comple * array
1D array to store vector data
Definition: zrovector.hpp:10
CPPL_INT idamax ( const zrovector vec)
friend

return the index of element having the largest absolute value in 0-based numbering system

Definition at line 54 of file zrovector-calc.hpp.

55 {CPPL_VERBOSE_REPORT;
56  CPPL_INT inc =1;
57  return izamax_(&vec.l, vec.array, &inc) -1;
58 }
CPPL_INT l
vector size
Definition: zrovector.hpp:9
comple * array
1D array to store vector data
Definition: zrovector.hpp:10
comple damax ( const zrovector vec)
friend

return its largest absolute value

Definition at line 62 of file zrovector-calc.hpp.

63 {CPPL_VERBOSE_REPORT;
64  CPPL_INT inc =1;
65  return vec.array[izamax_(&vec.l, vec.array, &inc) -1];
66 }
CPPL_INT l
vector size
Definition: zrovector.hpp:9
comple * array
1D array to store vector data
Definition: zrovector.hpp:10
void swap ( zrovector u,
zrovector v 
)
friend

swap two vectors

Definition at line 93 of file zrovector-misc.hpp.

94 {CPPL_VERBOSE_REPORT;
95  CPPL_INT u_L =u.l;
96  comple* u_Array =u.array;
97  u.l=v.l; u.array=v.array;
98  v.l=u_L; v.array=u_Array;
99 }
CPPL_INT l
vector size
Definition: zrovector.hpp:9
comple * array
1D array to store vector data
Definition: zrovector.hpp:10
_zrovector _ ( zrovector vec)
friend

convert user object to smart-temporary object

Definition at line 103 of file zrovector-misc.hpp.

104 {CPPL_VERBOSE_REPORT;
105  _zrovector newvec;
106 
107  //////// shallow copy ////////
108  newvec.l =vec.l;
109  newvec.array =vec.array;
110 
111  //////// nullify ////////
112  vec.l =0;
113  vec.array =NULL;
114 
115  return newvec;
116 }
CPPL_INT l
vector size
Definition: zrovector.hpp:9
CPPL_INT l
vector size
Definition: _zrovector.hpp:9
(DO NOT USE) Smart-temporary Complex Double-precision Row Vector Class
Definition: _zrovector.hpp:3
comple * array
1D array to store vector data
Definition: _zrovector.hpp:10
comple * array
1D array to store vector data
Definition: zrovector.hpp:10
const zrovector& operator+ ( const zrovector vec)
friend

+zrovector operator

Definition at line 3 of file zrovector-unary.hpp.

4 {CPPL_VERBOSE_REPORT;
5  return vec;
6 }
_zrovector operator- ( const zrovector vec)
friend

-zrovector operator

Definition at line 10 of file zrovector-unary.hpp.

11 {CPPL_VERBOSE_REPORT;
12  zrovector newvec(vec.l);
13  for(CPPL_INT i=0; i<newvec.l; i++){ newvec.array[i]=-vec.array[i]; }
14 
15  return _(newvec);
16 }
friend _zrovector _(zrovector &)
CPPL_INT l
vector size
Definition: zrovector.hpp:9
_dgematrix i(const _dgbmatrix &mat)
Complex Double-precision Row Vector Class.
Definition: zrovector.hpp:3
comple * array
1D array to store vector data
Definition: zrovector.hpp:10
_zrovector operator+ ( const zrovector vecA,
const zrovector vecB 
)
friend

zrovector+zrovector operator

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

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 }
friend _zrovector _(zrovector &)
CPPL_INT l
vector size
Definition: zrovector.hpp:9
_dgematrix i(const _dgbmatrix &mat)
Complex Double-precision Row Vector Class.
Definition: zrovector.hpp:3
comple * array
1D array to store vector data
Definition: zrovector.hpp:10
_zrovector operator+ ( const zrovector vecA,
const _zrovector vecB 
)
friend

zrovector+zrovector operator

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

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 
)
friend

zrovector-zrovector operator

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

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 }
friend _zrovector _(zrovector &)
CPPL_INT l
vector size
Definition: zrovector.hpp:9
_dgematrix i(const _dgbmatrix &mat)
Complex Double-precision Row Vector Class.
Definition: zrovector.hpp:3
comple * array
1D array to store vector data
Definition: zrovector.hpp:10
_zrovector operator- ( const zrovector vecA,
const _zrovector vecB 
)
friend

zrovector-zrovector operator

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

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 rovec,
const zcovector covec 
)
friend

zrovector*zcovector operator

Definition at line 3 of file zrovector-zcovector.hpp.

4 {CPPL_VERBOSE_REPORT;
5 #ifdef CPPL_DEBUG
6  if(rovec.l!=covec.l){
7  ERROR_REPORT;
8  std::cerr << "These two vectors can not make a product." << std::endl
9  << "Your input was (" << rovec.l << ") * (" << covec.l << ")." << std::endl;
10  exit(1);
11  }
12 #endif//CPPL_DEBUG
13 
14  CPPL_INT inc =1;
15 
16  comple val =zdotu_( &rovec.l, rovec.array, &inc, covec.array, &inc );
17 
18  return val;
19 }
comple * array
1D array to store vector data
Definition: zcovector.hpp:10
CPPL_INT l
vector size
Definition: zrovector.hpp:9
CPPL_INT l
vector size
Definition: zcovector.hpp:9
comple * array
1D array to store vector data
Definition: zrovector.hpp:10
comple operator* ( const zrovector rovec,
const _zcovector covec 
)
friend

zrovector*_zcovector operator

Definition at line 3 of file zrovector-_zcovector.hpp.

4 {CPPL_VERBOSE_REPORT;
5 #ifdef CPPL_DEBUG
6  if(rovec.l!=covec.l){
7  ERROR_REPORT;
8  std::cerr << "These two vectors can not make a product." << std::endl
9  << "Your input was (" << rovec.l << ") * (" << covec.l << ")." << std::endl;
10  exit(1);
11  }
12 #endif//CPPL_DEBUG
13 
14  CPPL_INT inc =1;
15 
16  comple val =zdotu_( &rovec.l, rovec.array, &inc, covec.array, &inc );
17 
18  covec.destroy();
19  return val;
20 }
CPPL_INT l
vector size
Definition: zrovector.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
comple * array
1D array to store vector data
Definition: zrovector.hpp:10
_zrovector operator* ( const zrovector vec,
const zgematrix mat 
)
friend

zrovector*zgematrix operator

Definition at line 3 of file zrovector-zgematrix.hpp.

4 {CPPL_VERBOSE_REPORT;
5 #ifdef CPPL_DEBUG
6  if(vec.l!=mat.m){
7  ERROR_REPORT;
8  std::cerr << "These vector and matrix can not make a product." << std::endl
9  << "Your input was (" << vec.l << ") * (" << mat.m << "x" << mat.n << ")." << std::endl;
10  exit(1);
11  }
12 #endif//CPPL_DEBUG
13 
14  zrovector newvec(mat.n);
15  char trans ='T';
16  comple alpha =comple(1.,0.);
17  CPPL_INT inc =1;
18  comple beta =comple(0.,0.);
19 
20  zgemv_( &trans, &mat.m, &mat.n, &alpha, mat.array, &mat.m, vec.array, &inc, &beta, newvec.array, &inc );
21 
22  return _(newvec);
23 }
friend _zrovector _(zrovector &)
CPPL_INT l
vector size
Definition: zrovector.hpp:9
CPPL_INT n
matrix column size
Definition: zgematrix.hpp:10
comple * array
1D array to store matrix data
Definition: zgematrix.hpp:11
Complex Double-precision Row Vector Class.
Definition: zrovector.hpp:3
CPPL_INT m
matrix row size
Definition: zgematrix.hpp:9
comple * array
1D array to store vector data
Definition: zrovector.hpp:10
_zrovector operator* ( const zrovector vec,
const _zgematrix mat 
)
friend

zrovector*_zgematrix operator

Definition at line 3 of file zrovector-_zgematrix.hpp.

4 {CPPL_VERBOSE_REPORT;
5 #ifdef CPPL_DEBUG
6  if(vec.l!=mat.m){
7  ERROR_REPORT;
8  std::cerr << "These vector and matrix can not make a product." << std::endl
9  << "Your input was (" << vec.l << ") * (" << mat.m << "x" << mat.n << ")." << std::endl;
10  exit(1);
11  }
12 #endif//CPPL_DEBUG
13 
14  zrovector newvec(mat.n);
15  char trans ='T';
16  comple alpha =comple(1.,0.);
17  CPPL_INT inc =1;
18  comple beta =comple(0.,0.);
19 
20  zgemv_( &trans, &mat.m, &mat.n, &alpha, mat.array, &mat.m, vec.array, &inc, &beta, newvec.array, &inc );
21 
22  mat.destroy();
23  return _(newvec);
24 }
friend _zrovector _(zrovector &)
CPPL_INT m
matrix row size
Definition: _zgematrix.hpp:9
CPPL_INT l
vector size
Definition: zrovector.hpp:9
Complex Double-precision Row Vector Class.
Definition: zrovector.hpp:3
void destroy() const
comple * array
1D array to store matrix data
Definition: _zgematrix.hpp:11
comple * array
1D array to store vector data
Definition: zrovector.hpp:10
CPPL_INT n
matrix column size
Definition: _zgematrix.hpp:10
_zrovector operator* ( const zrovector vec,
const zhematrix mat 
)
friend

zrovector*zhematrix operator

Definition at line 3 of file zrovector-zhematrix.hpp.

4 {CPPL_VERBOSE_REPORT;
5 #ifdef CPPL_DEBUG
6  if(vec.l!=mat.n){
7  ERROR_REPORT;
8  std::cerr << "These vector and matrix can not make a product." << std::endl
9  << "Your input was (" << vec.l << ") * (" << mat.n << "x" << mat.n << ")." << std::endl;
10  exit(1);
11  }
12 #endif//CPPL_DEBUG
13 
14  zrovector newvec(mat.n);
15  char uplo ='l';
16  comple alpha =comple(1.,0.);
17  CPPL_INT inc =1;
18  comple beta =comple(0.,0.);
19 
20  zhemv_( &uplo, &mat.n, &alpha, mat.array, &mat.n, vec.array, &inc, &beta, newvec.array, &inc );
21 
22  return _(newvec);
23 }
friend _zrovector _(zrovector &)
CPPL_INT l
vector size
Definition: zrovector.hpp:9
CPPL_INT n
matrix column size
Definition: zhematrix.hpp:11
Complex Double-precision Row Vector Class.
Definition: zrovector.hpp:3
comple * array
1D array to store matrix data
Definition: zhematrix.hpp:12
comple * array
1D array to store vector data
Definition: zrovector.hpp:10
_zrovector operator* ( const zrovector vec,
const _zhematrix mat 
)
friend

zrovector*_zhematrix operator

Definition at line 3 of file zrovector-_zhematrix.hpp.

4 {CPPL_VERBOSE_REPORT;
5 #ifdef CPPL_DEBUG
6  if(vec.l!=mat.n){
7  ERROR_REPORT;
8  std::cerr << "These vector and matrix can not make a product." << std::endl
9  << "Your input was (" << vec.l << ") * (" << mat.n << "x" << mat.n << ")." << std::endl;
10  exit(1);
11  }
12 #endif//CPPL_DEBUG
13 
14  zrovector newvec(mat.n);
15  char uplo ='l';
16  comple alpha =comple(1.,0.);
17  CPPL_INT inc =1;
18  comple beta =comple(0.,0.);
19 
20  zhemv_( &uplo, &mat.n, &alpha, mat.array, &mat.n, vec.array, &inc, &beta, newvec.array, &inc );
21 
22  mat.destroy();
23  return _(newvec);
24 }
friend _zrovector _(zrovector &)
CPPL_INT l
vector size
Definition: zrovector.hpp:9
CPPL_INT n
matrix column size
Definition: _zhematrix.hpp:11
Complex Double-precision Row Vector Class.
Definition: zrovector.hpp:3
comple * array
1D array to store matrix data
Definition: _zhematrix.hpp:12
void destroy() const
comple * array
1D array to store vector data
Definition: zrovector.hpp:10
_zrovector operator* ( const zrovector vec,
const zgbmatrix mat 
)
friend

zrovector*zgbmatrix operator

Definition at line 3 of file zrovector-zgbmatrix.hpp.

4 {CPPL_VERBOSE_REPORT;
5 #ifdef CPPL_DEBUG
6  if(vec.l!=mat.m){
7  ERROR_REPORT;
8  std::cerr << "These vector and matrix can not make a product." << std::endl
9  << "Your input was (" << vec.l << ") * (" << mat.m << "x" << mat.n << ")." << std::endl;
10  exit(1);
11  }
12 #endif//CPPL_DEBUG
13 
14  zrovector newvec(mat.n);
15  char trans ='T';
16  comple alpha =comple(1.,0.);
17  CPPL_INT lda =mat.kl+mat.ku+1;
18  CPPL_INT inc =1;
19  comple beta =comple(0.,0.);
20 
21  zgbmv_( &trans, &mat.m, &mat.n, &mat.kl, &mat.ku, &alpha, mat.array, &lda, vec.array, &inc, &beta, newvec.array, &inc );
22 
23  return _(newvec);
24 }
friend _zrovector _(zrovector &)
CPPL_INT l
vector size
Definition: zrovector.hpp:9
CPPL_INT n
matrix column size
Definition: zgbmatrix.hpp:10
CPPL_INT ku
upper band width
Definition: zgbmatrix.hpp:12
Complex Double-precision Row Vector Class.
Definition: zrovector.hpp:3
CPPL_INT m
matrix row size
Definition: zgbmatrix.hpp:9
CPPL_INT kl
lower band width
Definition: zgbmatrix.hpp:11
comple * array
1D array to store vector data
Definition: zrovector.hpp:10
comple * array
1D array to store matrix data
Definition: zgbmatrix.hpp:13
_zrovector operator* ( const zrovector vec,
const _zgbmatrix mat 
)
friend

zrovector*_zgbmatrix operator

Definition at line 3 of file zrovector-_zgbmatrix.hpp.

4 {CPPL_VERBOSE_REPORT;
5 #ifdef CPPL_DEBUG
6  if(vec.l!=mat.m){
7  ERROR_REPORT;
8  std::cerr << "These vector and matrix can not make a product." << std::endl
9  << "Your input was (" << vec.l << ") * (" << mat.m << "x" << mat.n << ")." << std::endl;
10  exit(1);
11  }
12 #endif//CPPL_DEBUG
13 
14  zrovector newvec(mat.n);
15  char trans ='T';
16  comple alpha =comple(1.,0.);
17  CPPL_INT lda =mat.kl+mat.ku+1;
18  CPPL_INT inc =1;
19  comple beta =comple(0.,0.);
20 
21  zgbmv_( &trans, &mat.m, &mat.n, &mat.kl, &mat.ku, &alpha, mat.array, &lda, vec.array, &inc, &beta, newvec.array, &inc );
22 
23  mat.destroy();
24  return _(newvec);
25 }
friend _zrovector _(zrovector &)
CPPL_INT ku
upper band width
Definition: _zgbmatrix.hpp:12
CPPL_INT l
vector size
Definition: zrovector.hpp:9
CPPL_INT kl
lower band width
Definition: _zgbmatrix.hpp:11
void destroy() const
Complex Double-precision Row Vector Class.
Definition: zrovector.hpp:3
CPPL_INT m
matrix row size
Definition: _zgbmatrix.hpp:9
comple * array
1D array to store matrix data
Definition: _zgbmatrix.hpp:13
CPPL_INT n
matrix column size
Definition: _zgbmatrix.hpp:10
comple * array
1D array to store vector data
Definition: zrovector.hpp:10
_zrovector operator* ( const zrovector vec,
const zgsmatrix mat 
)
friend

zrovector*zgsmatrix operator

Definition at line 3 of file zrovector-zgsmatrix.hpp.

4 {CPPL_VERBOSE_REPORT;
5 #ifdef CPPL_DEBUG
6  if(vec.l!=mat.m){
7  ERROR_REPORT;
8  std::cerr << "These vector and matrix can not make a product." << std::endl
9  << "Your input was (" << vec.l << ") * (" << mat.m << "x" << mat.n << ")." << std::endl;
10  exit(1);
11  }
12 #endif//CPPL_DEBUG
13 
14  zrovector newvec(mat.n);
15  newvec.zero();
16 
17  const std::vector<zcomponent>::const_iterator mat_data_end =mat.data.end();
18  for(std::vector<zcomponent>::const_iterator it=mat.data.begin(); it!=mat_data_end; it++){
19  newvec(it->j) += vec(it->i)*it->v;
20  }
21 
22  return _(newvec);
23 }
friend _zrovector _(zrovector &)
CPPL_INT l
vector size
Definition: zrovector.hpp:9
std::vector< zcomponent > data
matrix data
Definition: zgsmatrix.hpp:11
Complex Double-precision Row Vector Class.
Definition: zrovector.hpp:3
CPPL_INT m
matrix row size
Definition: zgsmatrix.hpp:9
CPPL_INT n
matrix column size
Definition: zgsmatrix.hpp:10
_zrovector operator* ( const zrovector vec,
const _zgsmatrix mat 
)
friend

zrovector*_zgsmatrix operator

Definition at line 3 of file zrovector-_zgsmatrix.hpp.

4 {CPPL_VERBOSE_REPORT;
5 #ifdef CPPL_DEBUG
6  if(vec.l!=mat.m){
7  ERROR_REPORT;
8  std::cerr << "These vector and matrix can not make a product." << std::endl
9  << "Your input was (" << vec.l << ") * (" << mat.m << "x" << mat.n << ")." << std::endl;
10  exit(1);
11  }
12 #endif//CPPL_DEBUG
13 
14  zrovector newvec(mat.n);
15  newvec.zero();
16 
17  const std::vector<zcomponent>::const_iterator mat_data_end =mat.data.end();
18  for(std::vector<zcomponent>::const_iterator it=mat.data.begin(); it!=mat_data_end; it++){
19  newvec(it->j) += vec(it->i)*it->v;
20  }
21 
22  mat.destroy();
23  return _(newvec);
24 }
friend _zrovector _(zrovector &)
CPPL_INT l
vector size
Definition: zrovector.hpp:9
CPPL_INT n
matrix column size
Definition: _zgsmatrix.hpp:10
Complex Double-precision Row Vector Class.
Definition: zrovector.hpp:3
CPPL_INT m
matrix row size
Definition: _zgsmatrix.hpp:9
void destroy() const
std::vector< zcomponent > data
matrix data
Definition: _zgsmatrix.hpp:11
_zrovector operator* ( const zrovector vec,
const zhsmatrix mat 
)
friend

zrovector*zhsmatrix operator

Definition at line 3 of file zrovector-zhsmatrix.hpp.

4 {CPPL_VERBOSE_REPORT;
5 #ifdef CPPL_DEBUG
6  if(vec.l!=mat.m){
7  ERROR_REPORT;
8  std::cerr << "These vector and matrix can not make a product." << std::endl
9  << "Your input was (" << vec.l << ") * (" << mat.m << "x" << mat.n << ")." << std::endl;
10  exit(1);
11  }
12 #endif//CPPL_DEBUG
13 
14  zrovector newvec(mat.n);
15  newvec.zero();
16 
17  const std::vector<zcomponent>::const_iterator mat_data_end =mat.data.end();
18  for(std::vector<zcomponent>::const_iterator it=mat.data.begin(); it!=mat_data_end; it++){
19  newvec(it->j) +=vec(it->i)*it->v;
20  if(it->i!=it->j){
21  newvec(it->i) +=vec(it->j)*std::conj(it->v);
22  }
23  }
24 
25  return _(newvec);
26 }
friend _zrovector _(zrovector &)
CPPL_INT l
vector size
Definition: zrovector.hpp:9
CPPL_INT n
matrix column size
Definition: zhsmatrix.hpp:10
_zcovector conj(const _zcovector &vec)
std::vector< zcomponent > data
matrix data
Definition: zhsmatrix.hpp:11
Complex Double-precision Row Vector Class.
Definition: zrovector.hpp:3
CPPL_INT const & m
matrix row size
Definition: zhsmatrix.hpp:9
_zrovector operator* ( const zrovector vec,
const _zhsmatrix mat 
)
friend

zrovector*_zhsmatrix operator

Definition at line 3 of file zrovector-_zhsmatrix.hpp.

4 {CPPL_VERBOSE_REPORT;
5 #ifdef CPPL_DEBUG
6  if(vec.l!=mat.m){
7  ERROR_REPORT;
8  std::cerr << "These vector and matrix can not make a product." << std::endl
9  << "Your input was (" << vec.l << ") * (" << mat.m << "x" << mat.n << ")." << std::endl;
10  exit(1);
11  }
12 #endif//CPPL_DEBUG
13 
14  zrovector newvec(mat.n);
15  newvec.zero();
16 
17  const std::vector<zcomponent>::const_iterator mat_data_end =mat.data.end();
18  for(std::vector<zcomponent>::const_iterator it=mat.data.begin(); it!=mat_data_end; it++){
19  newvec(it->j) +=vec(it->i)*it->v;
20  if(it->i!=it->j){
21  newvec(it->i) +=vec(it->j)*std::conj(it->v);
22  }
23  }
24 
25  mat.destroy();
26  return _(newvec);
27 }
friend _zrovector _(zrovector &)
std::vector< zcomponent > data
matrix data
Definition: _zhsmatrix.hpp:12
CPPL_INT l
vector size
Definition: zrovector.hpp:9
CPPL_INT const & m
matrix row size
Definition: _zhsmatrix.hpp:10
void destroy() const
_zcovector conj(const _zcovector &vec)
CPPL_INT n
matrix column size
Definition: _zhsmatrix.hpp:11
Complex Double-precision Row Vector Class.
Definition: zrovector.hpp:3
_zrovector operator* ( const zrovector vec,
const double &  d 
)
friend

zrovector*double operator

Definition at line 26 of file zrovector-double.hpp.

27 {CPPL_VERBOSE_REPORT;
28  zrovector newvec(vec.l);
29 
30  for(CPPL_INT i=0; i<vec.l; i++){
31  newvec.array[i] =vec.array[i]*d;
32  }
33 
34  return _(newvec);
35 }
friend _zrovector _(zrovector &)
CPPL_INT l
vector size
Definition: zrovector.hpp:9
_dgematrix i(const _dgbmatrix &mat)
Complex Double-precision Row Vector Class.
Definition: zrovector.hpp:3
comple * array
1D array to store vector data
Definition: zrovector.hpp:10
_zrovector operator* ( const zrovector vec,
const comple &  d 
)
friend

zrovector*comple operator

Definition at line 26 of file zrovector-complex.hpp.

27 {CPPL_VERBOSE_REPORT;
28  zrovector newvec(vec.l);
29 
30  for(CPPL_INT i=0; i<vec.l; i++){
31  newvec.array[i] =vec.array[i]*d;
32  }
33 
34  return _(newvec);
35 }
friend _zrovector _(zrovector &)
CPPL_INT l
vector size
Definition: zrovector.hpp:9
_dgematrix i(const _dgbmatrix &mat)
Complex Double-precision Row Vector Class.
Definition: zrovector.hpp:3
comple * array
1D array to store vector data
Definition: zrovector.hpp:10
_zrovector operator/ ( const zrovector vec,
const double &  d 
)
friend

zrovector/double operator

Definition at line 39 of file zrovector-double.hpp.

40 {CPPL_VERBOSE_REPORT;
41  zrovector newvec(vec.l);
42 
43  for(CPPL_INT i=0; i<vec.l; i++){
44  newvec.array[i] =vec.array[i]/d;
45  }
46 
47  return _(newvec);
48 }
friend _zrovector _(zrovector &)
CPPL_INT l
vector size
Definition: zrovector.hpp:9
_dgematrix i(const _dgbmatrix &mat)
Complex Double-precision Row Vector Class.
Definition: zrovector.hpp:3
comple * array
1D array to store vector data
Definition: zrovector.hpp:10
_zrovector operator/ ( const zrovector vec,
const comple &  d 
)
friend

zrovector/comple operator

Definition at line 39 of file zrovector-complex.hpp.

40 {CPPL_VERBOSE_REPORT;
41  zrovector newvec(vec.l);
42 
43  for(CPPL_INT i=0; i<vec.l; i++){
44  newvec.array[i] =vec.array[i]/d;
45  }
46 
47  return _(newvec);
48 }
friend _zrovector _(zrovector &)
CPPL_INT l
vector size
Definition: zrovector.hpp:9
_dgematrix i(const _dgbmatrix &mat)
Complex Double-precision Row Vector Class.
Definition: zrovector.hpp:3
comple * array
1D array to store vector data
Definition: zrovector.hpp:10
comple operator% ( const zrovector vecA,
const zrovector vecB 
)
friend

zrovector^T*zrovector operator (inner product)

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

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
comple operator% ( const zrovector vecA,
const _zrovector vecB 
)
friend

zrovector^T*zrovector operator (inner product)

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

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
_zrovector operator* ( const double &  d,
const zrovector vec 
)
friend

double*zrovector operator

Definition at line 3 of file double-zrovector.hpp.

4 {CPPL_VERBOSE_REPORT;
5  zrovector newvec(vec.l);
6 
7  for(CPPL_INT i=0; i<vec.l; i++){
8  newvec.array[i] =d*vec.array[i];
9  }
10 
11  return _(newvec);
12 }
friend _zrovector _(zrovector &)
CPPL_INT l
vector size
Definition: zrovector.hpp:9
_dgematrix i(const _dgbmatrix &mat)
Complex Double-precision Row Vector Class.
Definition: zrovector.hpp:3
comple * array
1D array to store vector data
Definition: zrovector.hpp:10
_zrovector operator* ( const comple &  d,
const zrovector vec 
)
friend

comple*zrovector operator

Definition at line 3 of file complex-zrovector.hpp.

4 {CPPL_VERBOSE_REPORT;
5  zrovector newvec(vec.l);
6 
7  for(CPPL_INT i=0; i<vec.l; i++){
8  newvec.array[i] =d*vec.array[i];
9  }
10 
11  return _(newvec);
12 }
friend _zrovector _(zrovector &)
CPPL_INT l
vector size
Definition: zrovector.hpp:9
_dgematrix i(const _dgbmatrix &mat)
Complex Double-precision Row Vector Class.
Definition: zrovector.hpp:3
comple * array
1D array to store vector data
Definition: zrovector.hpp:10
_zrovector hadamard ( const zrovector ,
const zrovector  
)
friend

Member Data Documentation

CPPL_INT zrovector::l
comple* zrovector::array

The documentation for this class was generated from the following files: