CPPLapack
 All Classes Files Functions Variables Friends
_zrovector-calc.hpp
Go to the documentation of this file.
00001 //=============================================================================
00002 /*! return a transposed column vector */
00003 inline _zcovector t(const _zrovector& rovec)
00004 {VERBOSE_REPORT;
00005   _zcovector covec;
00006   covec.l =rovec.l;
00007   delete [] covec.array;
00008   covec.array =rovec.array;
00009   
00010   return covec;
00011 }
00012 
00013 //=============================================================================
00014 /*! return its conjugated vector */
00015 inline _zrovector conj(const _zrovector& 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 column vector */
00023 inline _zcovector conjt(const _zrovector& rovec)
00024 {VERBOSE_REPORT;
00025   zcovector covec(rovec.l);
00026   for(long i=0; i<rovec.l; i++){ covec(i) =std::conj(rovec(i)); }
00027   
00028   rovec.destroy();
00029   return _(covec);
00030 }
00031 
00032 ///////////////////////////////////////////////////////////////////////////////
00033 ///////////////////////////////////////////////////////////////////////////////
00034 ///////////////////////////////////////////////////////////////////////////////
00035 
00036 //=============================================================================
00037 /*! return its Euclidean norm */
00038 inline double nrm2(const _zrovector& 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 _zrovector& 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 _zrovector& 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