CPPLapack
 All Classes Files Functions Variables Friends Pages
zrovector-calc.hpp
Go to the documentation of this file.
1 //=============================================================================
2 /*! return a transposed column vector */
3 inline _zcovector t(const zrovector& rovec)
4 {CPPL_VERBOSE_REPORT;
5  zcovector covec(rovec.l);
6  CPPL_INT inc =1;
7 
8  zcopy_(&rovec.l, rovec.array, &inc, covec.array, &inc);
9 
10  return _(covec);
11 }
12 
13 //=============================================================================
14 /*! return its conjugated vector */
15 inline _zrovector conj(const zrovector& vec)
16 {CPPL_VERBOSE_REPORT;
17  zrovector newvec(vec.l);
18 
19  for(CPPL_INT i=0; i<vec.l; i++){
20  newvec(i) =std::conj(vec(i));
21  }
22 
23  return _(newvec);
24 }
25 
26 //=============================================================================
27 /*! return a conjugate transposed column vector */
28 inline _zcovector conjt(const zrovector& rovec)
29 {CPPL_VERBOSE_REPORT;
30  zcovector covec(rovec.l);
31 
32  for(CPPL_INT i=0; i<rovec.l; i++){
33  covec(i) =std::conj(rovec(i));
34  }
35 
36  return _(covec);
37 }
38 
39 ///////////////////////////////////////////////////////////////////////////////
40 ///////////////////////////////////////////////////////////////////////////////
41 ///////////////////////////////////////////////////////////////////////////////
42 
43 //=============================================================================
44 /*! return its Euclidean norm */
45 inline double nrm2(const zrovector& vec)
46 {CPPL_VERBOSE_REPORT;
47  CPPL_INT inc =1;
48  return dznrm2_(&vec.l, vec.array, &inc);
49 }
50 
51 //=============================================================================
52 /*! return the index of element having the largest absolute value
53  in 0-based numbering system */
54 inline CPPL_INT idamax(const zrovector& vec)
55 {CPPL_VERBOSE_REPORT;
56  CPPL_INT inc =1;
57  return izamax_(&vec.l, vec.array, &inc) -1;
58 }
59 
60 //=============================================================================
61 /*! return its largest absolute value */
62 inline comple damax(const zrovector& vec)
63 {CPPL_VERBOSE_REPORT;
64  CPPL_INT inc =1;
65  return vec.array[izamax_(&vec.l, vec.array, &inc) -1];
66 }
comple * array
1D array to store vector data
Definition: zcovector.hpp:10
CPPL_INT l
vector size
Definition: zrovector.hpp:9
double nrm2(const zrovector &vec)
_dgematrix i(const _dgbmatrix &mat)
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
_zrovector conj(const zrovector &vec)
CPPL_INT idamax(const zrovector &vec)
_zcovector conjt(const zrovector &rovec)
comple damax(const zrovector &vec)
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
_zcovector t(const zrovector &rovec)
_dcovector _(dcovector &vec)
comple * array
1D array to store vector data
Definition: zrovector.hpp:10