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;
6  rovec.l =covec.l;
7  delete [] rovec.array;
8  rovec.array =covec.array;
9 
10  return rovec;
11 }
12 
13 //=============================================================================
14 /*! return its conjugated vector */
15 inline _zcovector conj(const _zcovector& vec)
16 {CPPL_VERBOSE_REPORT;
17  for(CPPL_INT i=0; i<vec.l; i++){
18  vec(i) =std::conj(vec(i));
19  }
20  return vec;
21 }
22 
23 //=============================================================================
24 /*! return a conjugate transposed row vector */
25 inline _zrovector conjt(const _zcovector& covec)
26 {CPPL_VERBOSE_REPORT;
27  zrovector rovec(covec.l);
28 
29  for(CPPL_INT i=0; i<covec.l; i++){
30  rovec(i) =std::conj(covec(i));
31  }
32 
33  covec.destroy();
34  return _(rovec);
35 }
36 
37 ///////////////////////////////////////////////////////////////////////////////
38 ///////////////////////////////////////////////////////////////////////////////
39 ///////////////////////////////////////////////////////////////////////////////
40 
41 //=============================================================================
42 /*! return its Euclidean norm */
43 inline double nrm2(const _zcovector& vec)
44 {CPPL_VERBOSE_REPORT;
45  CPPL_INT inc =1;
46  double val =dznrm2_(&vec.l, vec.array, &inc);
47  vec.destroy();
48  return val;
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 _zcovector& vec)
55 {CPPL_VERBOSE_REPORT;
56  CPPL_INT inc =1;
57  CPPL_INT i =izamax_(&vec.l, vec.array, &inc) -1;
58  vec.destroy();
59  return i;
60 }
61 
62 //=============================================================================
63 /*! return its largest absolute value */
64 inline comple damax(const _zcovector& vec)
65 {CPPL_VERBOSE_REPORT;
66  CPPL_INT inc =1;
67  comple val =vec.array[izamax_(&vec.l, vec.array, &inc) -1];
68  vec.destroy();
69  return val;
70 }
double nrm2(const _zcovector &vec)
_dgematrix i(const _dgbmatrix &mat)
_zcovector conj(const _zcovector &vec)
CPPL_INT l
vector size
Definition: _zrovector.hpp:9
void destroy() const
comple damax(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
comple * array
1D array to store vector data
Definition: _zrovector.hpp:10
_zrovector t(const _zcovector &covec)
comple * array
1D array to store vector data
Definition: _zcovector.hpp:10
CPPL_INT idamax(const _zcovector &vec)
_zrovector conjt(const _zcovector &covec)
(DO NOT USE) Smart-temporary Complex Double-precision Column Vector Class
Definition: _zcovector.hpp:3
CPPL_INT l
vector size
Definition: _zcovector.hpp:9
_dcovector _(dcovector &vec)