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

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

#include <zcovector.hpp>

Public Member Functions

 zcovector ()
 
 zcovector (const zcovector &)
 
 zcovector (const _zcovector &)
 
 zcovector (const CPPL_INT &)
 
 zcovector (const char *)
 
 ~zcovector ()
 
comple & operator() (const CPPL_INT &)
 
comple operator() (const CPPL_INT &) const
 
zcovectorset (const CPPL_INT &, const comple &)
 
void write (const char *) const
 
void read (const char *)
 
void clear ()
 
zcovectorzero ()
 
void chsign ()
 
void copy (const zcovector &)
 
void shallow_copy (const _zcovector &)
 
void alias (const zcovector &)
 
void unalias ()
 
void resize (const CPPL_INT &)
 
zcovectoroperator= (const zcovector &)
 
zcovectoroperator= (const _zcovector &)
 
zcovectoroperator+= (const zcovector &)
 
zcovectoroperator+= (const _zcovector &)
 
zcovectoroperator-= (const zcovector &)
 
zcovectoroperator-= (const _zcovector &)
 
zcovectoroperator*= (const double &)
 
zcovectoroperator*= (const comple &)
 
zcovectoroperator/= (const double &)
 
zcovectoroperator/= (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 zcovector &)
 
_zrovector t (const zcovector &)
 
_zcovector conj (const zcovector &)
 
_zrovector conjt (const zcovector &)
 
double nrm2 (const zcovector &)
 
CPPL_INT idamax (const zcovector &)
 
comple damax (const zcovector &)
 
void swap (zcovector &, zcovector &)
 
_zcovector _ (zcovector &)
 
const zcovectoroperator+ (const zcovector &)
 
_zcovector operator- (const zcovector &)
 
_zcovector operator+ (const zcovector &, const zcovector &)
 
_zcovector operator+ (const zcovector &, const _zcovector &)
 
_zcovector operator- (const zcovector &, const zcovector &)
 
_zcovector operator- (const zcovector &, const _zcovector &)
 
_zgematrix operator* (const zcovector &, const zrovector &)
 
_zgematrix operator* (const zcovector &, const _zrovector &)
 
_zcovector operator* (const zcovector &, const double &)
 
_zcovector operator* (const zcovector &, const comple &)
 
_zcovector operator/ (const zcovector &, const double &)
 
_zcovector operator/ (const zcovector &, const comple &)
 
comple operator% (const zcovector &, const zcovector &)
 
comple operator% (const zcovector &, const _zcovector &)
 
_zcovector operator* (const double &, const zcovector &)
 
_zcovector operator* (const comple &, const zcovector &)
 
_zcovector hadamard (const zcovector &, const zcovector &)
 

Detailed Description

Complex Double-precision Column Vector Class.

Definition at line 3 of file zcovector.hpp.

Constructor & Destructor Documentation

zcovector::zcovector ( )
inline

zcovector constructor

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

References array, and l.

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

zcovector copy constructor

Definition at line 12 of file zcovector-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 }
comple * array
1D array to store vector data
Definition: zcovector.hpp:10
CPPL_INT l
vector size
Definition: zcovector.hpp:9
zcovector::zcovector ( const _zcovector vec)
inline

zcovector constructor to cast _zcovector

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

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

26 {CPPL_VERBOSE_REPORT;
27  //////// initialize ////////
28  l =vec.l;
29  array =vec.array;
30 
31  vec.nullify();
32 }
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: _zcovector.hpp:10
void nullify() const
CPPL_INT l
vector size
Definition: _zcovector.hpp:9
zcovector::zcovector ( const CPPL_INT &  _l)
inline

zcovector constructor with size specification

Definition at line 36 of file zcovector-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 }
comple * array
1D array to store vector data
Definition: zcovector.hpp:10
CPPL_INT l
vector size
Definition: zcovector.hpp:9
zcovector::zcovector ( const char *  filename)
inline

zcovector constructor with filename

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

References array, and read().

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

zcovector destructor

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

References array.

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

Member Function Documentation

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

operator() for non-const object

Definition at line 3 of file zcovector-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 }
comple * array
1D array to store vector data
Definition: zcovector.hpp:10
CPPL_INT l
vector size
Definition: zcovector.hpp:9
_dgematrix i(const _dgbmatrix &mat)
comple zcovector::operator() ( const CPPL_INT &  i) const
inline

operator() for const object

Definition at line 19 of file zcovector-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 }
comple * array
1D array to store vector data
Definition: zcovector.hpp:10
CPPL_INT l
vector size
Definition: zcovector.hpp:9
_dgematrix i(const _dgbmatrix &mat)
zcovector & zcovector::set ( const CPPL_INT &  i,
const comple &  v 
)
inline

set value for const object

Definition at line 39 of file zcovector-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 }
comple * array
1D array to store vector data
Definition: zcovector.hpp:10
CPPL_INT l
vector size
Definition: zcovector.hpp:9
_dgematrix i(const _dgbmatrix &mat)
void zcovector::write ( const char *  filename) const
inline

Definition at line 73 of file zcovector-io.hpp.

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

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

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

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

Referenced by zcovector().

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 != "zcovector" && id != "#zcovector" ){
102  ERROR_REPORT;
103  std::cerr << "The type name of the file \"" << filename << "\" is not zcovector." << 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  s.close();
129 }
CPPL_INT l
vector size
Definition: zcovector.hpp:9
_dgematrix i(const _dgbmatrix &mat)
comple & operator()(const CPPL_INT &)
Definition: zcovector-io.hpp:3
void resize(const CPPL_INT &)
void zcovector::clear ( )
inline

clear vector

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

References array, and l.

Referenced by zgematrix::zgels(), and zgematrix::zgelss().

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

make vector into zero vector

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

References array, i(), and l.

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

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

change sign(+/-) of the vector

Definition at line 22 of file zcovector-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 }
comple * array
1D array to store vector data
Definition: zcovector.hpp:10
CPPL_INT l
vector size
Definition: zcovector.hpp:9
_dgematrix i(const _dgbmatrix &mat)
void zcovector::copy ( const zcovector vec)
inline

make a deep copy of the zcovector

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

References array, and l.

Referenced by operator=().

32 {CPPL_VERBOSE_REPORT;
33  l =vec.l;
34  delete [] array;
35  array =new comple[vec.l];
36 
37  CPPL_INT inc =1;
38  zcopy_(&vec.l, vec.array, &inc, array, &inc);
39 }
comple * array
1D array to store vector data
Definition: zcovector.hpp:10
CPPL_INT l
vector size
Definition: zcovector.hpp:9
void zcovector::shallow_copy ( const _zcovector 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 zcovector-misc.hpp.

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

Referenced by operator=().

45 {CPPL_VERBOSE_REPORT;
46  l =vec.l;
47  delete [] array;
48  array =vec.array;
49 
50  vec.nullify();
51 }
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: _zcovector.hpp:10
void nullify() const
CPPL_INT l
vector size
Definition: _zcovector.hpp:9
void zcovector::alias ( const zcovector 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 zcovector-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 }
comple * array
1D array to store vector data
Definition: zcovector.hpp:10
CPPL_INT l
vector size
Definition: zcovector.hpp:9
void zcovector::unalias ( )
inline

unalias the vector

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

References array, and l.

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

resize vector

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

References array, and l.

Referenced by dgematrix::dgeev(), and 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 }
comple * array
1D array to store vector data
Definition: zcovector.hpp:10
CPPL_INT l
vector size
Definition: zcovector.hpp:9
zcovector & zcovector::operator= ( const zcovector vec)
inline

zcovector=zcovector operator

Definition at line 3 of file zcovector-zcovector.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: zcovector.hpp:10
void copy(const zcovector &)
zcovector & zcovector::operator= ( const _zcovector vec)
inline

zcovector=_zcovector operator

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

References shallow_copy().

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

zcovector+=zcovector operator

Definition at line 17 of file zcovector-zcovector.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 }
comple * array
1D array to store vector data
Definition: zcovector.hpp:10
CPPL_INT l
vector size
Definition: zcovector.hpp:9
_dgematrix i(const _dgbmatrix &mat)
zcovector & zcovector::operator+= ( const _zcovector vec)
inline

zcovector+=_zcovector operator

Definition at line 15 of file zcovector-_zcovector.hpp.

References array, _zcovector::array, _zcovector::destroy(), i(), l, and _zcovector::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 }
comple * array
1D array to store vector data
Definition: zcovector.hpp:10
CPPL_INT l
vector size
Definition: zcovector.hpp:9
_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 & zcovector::operator-= ( const zcovector vec)
inline

zcovector operator-=

Definition at line 37 of file zcovector-zcovector.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 }
comple * array
1D array to store vector data
Definition: zcovector.hpp:10
CPPL_INT l
vector size
Definition: zcovector.hpp:9
_dgematrix i(const _dgbmatrix &mat)
zcovector & zcovector::operator-= ( const _zcovector vec)
inline

zcovector operator-=

Definition at line 36 of file zcovector-_zcovector.hpp.

References array, _zcovector::array, _zcovector::destroy(), i(), l, and _zcovector::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 }
comple * array
1D array to store vector data
Definition: zcovector.hpp:10
CPPL_INT l
vector size
Definition: zcovector.hpp:9
_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 & zcovector::operator*= ( const double &  d)
inline

zcovector*=double operator

Definition at line 3 of file zcovector-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 }
comple * array
1D array to store vector data
Definition: zcovector.hpp:10
CPPL_INT l
vector size
Definition: zcovector.hpp:9
zcovector & zcovector::operator*= ( const comple &  d)
inline

zcovector*=comple operator

Definition at line 3 of file zcovector-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 }
comple * array
1D array to store vector data
Definition: zcovector.hpp:10
CPPL_INT l
vector size
Definition: zcovector.hpp:9
zcovector & zcovector::operator/= ( const double &  d)
inline

zcovector/=double operator

Definition at line 12 of file zcovector-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 }
comple * array
1D array to store vector data
Definition: zcovector.hpp:10
CPPL_INT l
vector size
Definition: zcovector.hpp:9
zcovector & zcovector::operator/= ( const comple &  d)
inline

zcovector/=comple operator

Definition at line 12 of file zcovector-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 }
comple * array
1D array to store vector data
Definition: zcovector.hpp:10
CPPL_INT l
vector size
Definition: zcovector.hpp:9

Friends And Related Function Documentation

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

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

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

return a transposed row vector

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

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

return its conjugated vector

Definition at line 14 of file zcovector-calc.hpp.

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

return a conjugate transposed row vector

Definition at line 27 of file zcovector-calc.hpp.

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

return its Euclidean norm

Definition at line 44 of file zcovector-calc.hpp.

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

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

Definition at line 53 of file zcovector-calc.hpp.

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

return its largest absolute value

Definition at line 61 of file zcovector-calc.hpp.

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

swap two vectors

Definition at line 93 of file zcovector-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 }
comple * array
1D array to store vector data
Definition: zcovector.hpp:10
CPPL_INT l
vector size
Definition: zcovector.hpp:9
_zcovector _ ( zcovector vec)
friend

convert user object to smart-temporary object

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

104 {CPPL_VERBOSE_REPORT;
105  _zcovector 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 }
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: _zcovector.hpp:10
(DO NOT USE) Smart-temporary Complex Double-precision Column Vector Class
Definition: _zcovector.hpp:3
CPPL_INT l
vector size
Definition: _zcovector.hpp:9
const zcovector& operator+ ( const zcovector vec)
friend

+zcovector operator

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

4 {CPPL_VERBOSE_REPORT;
5  return vec;
6 }
_zcovector operator- ( const zcovector vec)
friend

-zcovector operator

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

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

zcovector+zcovector operator

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

zcovector+zcovector operator

Definition at line 61 of file zcovector-_zcovector.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 #endif//CPPL_DEBUG
71 
72  for(CPPL_INT i=0; i<vecA.l; i++){
73  vecB.array[i] += vecA.array[i];
74  }
75 
76  return vecB;
77 }
comple * array
1D array to store vector data
Definition: zcovector.hpp:10
CPPL_INT l
vector size
Definition: zcovector.hpp:9
_dgematrix i(const _dgbmatrix &mat)
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 
)
friend

zcovector-zcovector operator

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

zcovector-zcovector operator

Definition at line 81 of file zcovector-_zcovector.hpp.

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

zcovector*zrovector operator

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

4 {CPPL_VERBOSE_REPORT;
5  zgematrix newmat(covec.l, rovec.l);
6  for(CPPL_INT i=0; i<newmat.m; i++){
7  for(CPPL_INT j=0; j<newmat.n; j++){
8  newmat(i,j) =covec(i)*rovec(j);
9  }
10  }
11 
12  return _(newmat);
13 }
CPPL_INT l
vector size
Definition: zrovector.hpp:9
CPPL_INT l
vector size
Definition: zcovector.hpp:9
_dgematrix i(const _dgbmatrix &mat)
Complex Double-precision General Dence Matrix Class.
Definition: zgematrix.hpp:3
CPPL_INT m
matrix row size
Definition: _dgematrix.hpp:9
friend _zcovector _(zcovector &)
_zgematrix operator* ( const zcovector covec,
const _zrovector rovec 
)
friend

zcovector*_zrovector operator

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

4 {CPPL_VERBOSE_REPORT;
5  zgematrix newmat(covec.l, rovec.l);
6  for(CPPL_INT i=0; i<newmat.m; i++){
7  for(CPPL_INT j=0; j<newmat.n; j++){
8  newmat(i,j) =covec(i)*rovec(j);
9  }
10  }
11 
12  rovec.destroy();
13  return _(newmat);
14 }
CPPL_INT l
vector size
Definition: zcovector.hpp:9
void destroy() const
_dgematrix i(const _dgbmatrix &mat)
CPPL_INT l
vector size
Definition: _zrovector.hpp:9
Complex Double-precision General Dence Matrix Class.
Definition: zgematrix.hpp:3
CPPL_INT m
matrix row size
Definition: _dgematrix.hpp:9
friend _zcovector _(zcovector &)
_zcovector operator* ( const zcovector vec,
const double &  d 
)
friend

zcovector*double operator

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

27 {CPPL_VERBOSE_REPORT;
28  zcovector 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 }
comple * array
1D array to store vector data
Definition: zcovector.hpp:10
CPPL_INT l
vector size
Definition: zcovector.hpp:9
_dgematrix i(const _dgbmatrix &mat)
friend _zcovector _(zcovector &)
Complex Double-precision Column Vector Class.
Definition: zcovector.hpp:3
_zcovector operator* ( const zcovector vec,
const comple &  d 
)
friend

zcovector*comple operator

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

27 {CPPL_VERBOSE_REPORT;
28  zcovector 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 }
comple * array
1D array to store vector data
Definition: zcovector.hpp:10
CPPL_INT l
vector size
Definition: zcovector.hpp:9
_dgematrix i(const _dgbmatrix &mat)
friend _zcovector _(zcovector &)
Complex Double-precision Column Vector Class.
Definition: zcovector.hpp:3
_zcovector operator/ ( const zcovector vec,
const double &  d 
)
friend

zcovector/double operator

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

40 {CPPL_VERBOSE_REPORT;
41  zcovector 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 }
comple * array
1D array to store vector data
Definition: zcovector.hpp:10
CPPL_INT l
vector size
Definition: zcovector.hpp:9
_dgematrix i(const _dgbmatrix &mat)
friend _zcovector _(zcovector &)
Complex Double-precision Column Vector Class.
Definition: zcovector.hpp:3
_zcovector operator/ ( const zcovector vec,
const comple &  d 
)
friend

zcovector/comple operator

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

40 {CPPL_VERBOSE_REPORT;
41  zcovector 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 }
comple * array
1D array to store vector data
Definition: zcovector.hpp:10
CPPL_INT l
vector size
Definition: zcovector.hpp:9
_dgematrix i(const _dgbmatrix &mat)
friend _zcovector _(zcovector &)
Complex Double-precision Column Vector Class.
Definition: zcovector.hpp:3
comple operator% ( const zcovector vecA,
const zcovector vecB 
)
friend

zcovector^T*zcovector operator (inner product)

Definition at line 106 of file zcovector-zcovector.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 
120  return val;
121 }
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 
)
friend

zcovector^T*zcovector operator (inner product)

Definition at line 101 of file zcovector-_zcovector.hpp.

102 {CPPL_VERBOSE_REPORT;
103 #ifdef CPPL_DEBUG
104  if(vecA.l!=vecB.l){
105  ERROR_REPORT;
106  std::cerr << "These two vectors can not make a dot product." << std::endl
107  << "Your input was (" << vecA.l << ") % (" << vecB.l << ")." << std::endl;
108  exit(1);
109  }
110 #endif//CPPL_DEBUG
111 
112  CPPL_INT inc =1;
113  comple val =zdotu_( &vecA.l, vecA.array, &inc, vecB.array, &inc );
114 
115  vecB.destroy();
116  return val;
117 }
comple * array
1D array to store vector data
Definition: zcovector.hpp:10
CPPL_INT l
vector size
Definition: zcovector.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
_zcovector operator* ( const double &  d,
const zcovector vec 
)
friend

double*zcovector operator

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

4 {CPPL_VERBOSE_REPORT;
5  zcovector 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 }
comple * array
1D array to store vector data
Definition: zcovector.hpp:10
CPPL_INT l
vector size
Definition: zcovector.hpp:9
_dgematrix i(const _dgbmatrix &mat)
friend _zcovector _(zcovector &)
Complex Double-precision Column Vector Class.
Definition: zcovector.hpp:3
_zcovector operator* ( const comple &  d,
const zcovector vec 
)
friend

comple*zcovector operator

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

4 {CPPL_VERBOSE_REPORT;
5  zcovector 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 }
comple * array
1D array to store vector data
Definition: zcovector.hpp:10
CPPL_INT l
vector size
Definition: zcovector.hpp:9
_dgematrix i(const _dgbmatrix &mat)
friend _zcovector _(zcovector &)
Complex Double-precision Column Vector Class.
Definition: zcovector.hpp:3
_zcovector hadamard ( const zcovector ,
const zcovector  
)
friend

Member Data Documentation

CPPL_INT zcovector::l
comple* zcovector::array

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