CPPLapack
 All Classes Files Functions Variables Friends Pages
zrovector-constructor.hpp
Go to the documentation of this file.
1 //=============================================================================
2 /*! zrovector constructor */
4 {CPPL_VERBOSE_REPORT;
5  //////// initialize ////////
6  l =0;
7  array =NULL;
8 }
9 
10 //=============================================================================
11 /*! zrovector copy constructor */
12 inline zrovector::zrovector(const zrovector& vec)
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 }
22 
23 //=============================================================================
24 /*! zrovector constructor to cast _zrovector */
25 inline zrovector::zrovector(const _zrovector& vec)
26 {CPPL_VERBOSE_REPORT;
27  //////// initialize ////////
28  l =vec.l;
29  array =vec.array;
30 
31  vec.nullify();
32 }
33 
34 //=============================================================================
35 /*! zrovector constructor with size specification */
36 inline zrovector::zrovector(const CPPL_INT& _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 }
51 
52 //=============================================================================
53 /*! zrovector constructor with filename */
54 inline zrovector::zrovector(const char* filename)
55 {CPPL_VERBOSE_REPORT;
56  array =NULL;
57 
58  //// read ////
59  read(filename);
60 }
61 
62 ///////////////////////////////////////////////////////////////////////////////
63 ///////////////////////////////////////////////////////////////////////////////
64 ///////////////////////////////////////////////////////////////////////////////
65 
66 //=============================================================================
67 /*! zrovector destructor */
69 {CPPL_VERBOSE_REPORT;
70  //////// delete array ////////
71  delete [] array;
72 }
CPPL_INT l
vector size
Definition: zrovector.hpp:9
void read(const char *)
CPPL_INT l
vector size
Definition: _zrovector.hpp:9
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
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