CPPLapack
 All Classes Files Functions Variables Friends
_zcovector-calc.hpp
Go to the documentation of this file.
00001 //=============================================================================
00002 /*! return a transposed row vector */
00003 inline _zrovector t(const _zcovector& covec)
00004 {VERBOSE_REPORT;
00005   _zrovector rovec;
00006   rovec.l =covec.l;
00007   delete [] rovec.array;
00008   rovec.array =covec.array;
00009   
00010   return rovec;
00011 }
00012 
00013 //=============================================================================
00014 /*! return its conjugated vector */
00015 inline _zcovector conj(const _zcovector& vec)
00016 {VERBOSE_REPORT;
00017   for(long i=0; i<vec.l; i++){ vec(i) =std::conj(vec(i)); }
00018   return vec;
00019 }
00020 
00021 //=============================================================================
00022 /*! return a conjugate transposed row vector */
00023 inline _zrovector conjt(const _zcovector& covec)
00024 {VERBOSE_REPORT;
00025   zrovector rovec(covec.l);
00026   for(long i=0; i<covec.l; i++){ rovec(i) =std::conj(covec(i)); }
00027   
00028   covec.destroy();
00029   return _(rovec);
00030 }
00031 
00032 ///////////////////////////////////////////////////////////////////////////////
00033 ///////////////////////////////////////////////////////////////////////////////
00034 ///////////////////////////////////////////////////////////////////////////////
00035 
00036 //=============================================================================
00037 /*! return its Euclidean norm */
00038 inline double nrm2(const _zcovector& vec)
00039 {VERBOSE_REPORT;
00040   double val( dznrm2_(vec.l, vec.array, 1) );
00041   vec.destroy();
00042   return val;
00043 }
00044 
00045 //=============================================================================
00046 /*! return the index of element having the largest absolute value
00047  in 0-based numbering system */
00048 inline long idamax(const _zcovector& vec)
00049 {VERBOSE_REPORT;
00050   long i( izamax_(vec.l, vec.array, 1) -1 );
00051   vec.destroy();
00052   return i;
00053 }
00054 
00055 //=============================================================================
00056 /*! return its largest absolute value */
00057 inline comple damax(const _zcovector& vec)
00058 {VERBOSE_REPORT;
00059   comple val( vec.array[izamax_(vec.l, vec.array, 1)-1] );
00060   vec.destroy();
00061   return val;
00062 }
 All Classes Files Functions Variables Friends