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