CPPLapack
 All Classes Files Functions Variables Friends Pages
drovector_small-constructors.hpp
Go to the documentation of this file.
1 //=============================================================================
2 /*! drovector_small constructor */
3 template<CPPL_INT l>
5 {CPPL_VERBOSE_REPORT;
6  ;
7 }
8 
9 //=============================================================================
10 /*! drovector_small constructor */
11 template<CPPL_INT l>
13 {CPPL_VERBOSE_REPORT;
14 #ifdef CPPL_DEBUG
15  if( l!=vec.l ){
16  ERROR_REPORT;
17  std::cerr << "Vector sizes must be the same." << std::endl
18  << "Your input was " << l << " and " << vec.l << "." << std::endl;
19  exit(1);
20  }
21 #endif//CPPL_DEBUG
22 
23  for(CPPL_INT k=0; k<l; k++){
24  array[k] =vec.array[k];
25  }
26 }
27 
28 //=============================================================================
29 /*! drovector_small constructor */
30 template<CPPL_INT l>
31 inline drovector_small<l>::drovector_small(const double& x, const double& y)
32 {CPPL_VERBOSE_REPORT;
33 #ifdef CPPL_DEBUG
34  if( l!=2 ){
35  ERROR_REPORT;
36  std::cerr << "The vector size must be 2." << std::endl
37  << "The vector size you set was " << l << "." << std::endl;
38  exit(1);
39  }
40 #endif//CPPL_DEBUG]
41 
42  array[0] =x;
43  array[1] =y;
44 }
45 
46 //=============================================================================
47 /*! drovector_small constructor */
48 template<CPPL_INT l>
49 inline drovector_small<l>::drovector_small(const double& x, const double& y, const double& z)
50 {CPPL_VERBOSE_REPORT;
51 #ifdef CPPL_DEBUG
52  if( l!=3 ){
53  ERROR_REPORT;
54  std::cerr << "The vector size must be 3." << std::endl
55  << "The vector size you set was " << l << "." << std::endl;
56  exit(1);
57  }
58 #endif//CPPL_DEBUG
59 
60  array[0] =x;
61  array[1] =y;
62  array[2] =z;
63 }
64 
65 //=============================================================================
66 /*! drovector_small constructor */
67 template<CPPL_INT l>
68 inline drovector_small<l>::drovector_small(const double& x, const double& y, const double& z, const double& r)
69 {CPPL_VERBOSE_REPORT;
70 #ifdef CPPL_DEBUG
71  if( l!=4 ){
72  ERROR_REPORT;
73  std::cerr << "The vector size must be 4." << std::endl
74  << "The vector size you set was " << l << "." << std::endl;
75  exit(1);
76  }
77 #endif//CPPL_DEBUG
78 
79  array[0] =x;
80  array[1] =y;
81  array[2] =z;
82  array[3] =r;
83 }
84 
85 ///////////////////////////////////////////////////////////////////////////////
86 ///////////////////////////////////////////////////////////////////////////////
87 ///////////////////////////////////////////////////////////////////////////////
88 
89 //=============================================================================
90 /*! drovector_small destructor */
91 template<CPPL_INT l>
93 {CPPL_VERBOSE_REPORT;
94  ;
95 }
double * array
1D array to store vector data
Definition: drovector.hpp:11
CPPL_INT l
vector size
Definition: drovector.hpp:9
Real Double-precision Row Vector Class.
Definition: drovector.hpp:3