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