VERB_code_2.3
zcovector-constructor.hpp
1 //============================================================================
4  : l(L), array(Array)
5 {
6 #ifdef CPPL_VERBOSE
7  std::cerr << "# [MARK] zcovector::zcovector()"
8  << std::endl;
9 #endif//CPPL_VERBOSE
10 
12  L =0;
13  Array =NULL;
14 
15 #ifdef CPPL_DEBUG
16  std::cerr << "# [NOTE] zcovector::zcovector() "
17  << "A new 0x0 vector at " << Array
18  << " has been made." << std::endl;
19 #endif//CPPL_DEBUG
20 }
21 
22 //============================================================================
24 inline zcovector::zcovector(const zcovector& vec)
25  : l(L), array(Array)
26 {
27 #ifdef CPPL_VERBOSE
28  std::cerr << "# [MARK] zcovector::zcovector(const zcovector&)"
29  << std::endl;
30 #endif//CPPL_VERBOSE
31 
33  L =vec.L;
34  Array =new std::complex<double>[L];
35 
37  zcopy_(L, vec.Array, 1, Array, 1);
38 
39 #ifdef CPPL_DEBUG
40  std::cerr << "# [NOTE] zcovector::zcovector(const zcovector&) "
41  << "A new vector at " << Array << " has been made." << std::endl;
42 #endif//CPPL_DEBUG
43 }
44 
45 //============================================================================
47 inline zcovector::zcovector(const _zcovector& vec)
48  : l(L), array(Array)
49 {
50 #ifdef CPPL_VERBOSE
51  std::cerr << "# [MARK] zcovector::zcovector(const _zcovector&)"
52  << std::endl;
53 #endif//CPPL_VERBOSE
54 
56  L =vec.L;
57  Array =vec.Array;
58 
59 #ifdef CPPL_DEBUG
60  std::cerr << "# [NOTE] zcovector::zcovector(const _zcovector&) "
61  << "A new vector pointing at " << Array << " has been made."
62  << std::endl;
63 #endif//CPPL_DEBUG
64 }
65 
66 //============================================================================
68 inline zcovector::zcovector(const long& _l)
69  : l(L), array(Array)
70 {
71 #ifdef CPPL_VERBOSE
72  std::cerr << "# [MARK] zcovector::zcovector(const long&)"
73  << std::endl;
74 #endif//CPPL_VERBOSE
75 
76 #ifdef CPPL_DEBUG
77  if( _l<0 ){
78  std::cerr << "[ERROR] zcovector::zcovector(const long&)" << std::endl
79  << "Vector size must be positive integers. " << std::endl
80  << "Your input was (" << _l << ")." << std::endl;
81  exit(1);
82  }
83 #endif//CPPL_DEBUG
84 
86  L =_l;
87  Array =new std::complex<double>[L];
88 
89 #ifdef CPPL_DEBUG
90  std::cerr << "# [NOTE] zcovector::zcovector(const long&) "
91  << "A new vector at " << Array << " has been made." << std::endl;
92 #endif//CPPL_DEBUG
93 }
94 
95 //============================================================================
97 inline zcovector::zcovector(const char* filename)
98  : l(L), array(Array)
99 {
100 #ifdef CPPL_VERBOSE
101  std::cerr << "# [MARK] zcovector::zcovector(const char*)"
102  << std::endl;
103 #endif//CPPL_VERBOSE
104 
105  Array =NULL;
106 
108  read(filename);
109 
110 #ifdef CPPL_DEBUG
111  std::cerr << "# [NOTE] zcovector::zcovector(const char*) "
112  << "A new vector at " << Array << " has been made." << std::endl;
113 #endif//CPPL_DEBUG
114 }
115 
119 
120 //============================================================================
123 {
124 #ifdef CPPL_VERBOSE
125  std::cerr << "# [MARK] zcovector::~zcovector()"
126  << std::endl;
127 #endif//CPPL_VERBOSE
128 
129 #ifdef CPPL_DEBUG
130  std::cerr << "# [NOTE] zcovector::~zcovector "
131  << "A vector at " << Array
132  << " is going to be deleted." << std::endl;
133 #endif//CPPL_DEBUG
134 
136  delete [] Array;
137 }
zcovector()
Definition: zcovector-constructor.hpp:3
std::complex< double > * Array
1D Array to store vector data
Definition: _zcovector.hpp:8
~zcovector()
Definition: zcovector-constructor.hpp:122
long L
vector size
Definition: _drovector.hpp:7
double * Array
1D Array to store vector data
Definition: _drovector.hpp:8
Complex Double-precision Column Vector Class.
Definition: zcovector.hpp:3
(DO NOT USE) Smart-temporary Complex Double-precision Column Vector Class
Definition: _zcovector.hpp:3
long L
vector size
Definition: _zcovector.hpp:7