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