CPPLapack
 All Classes Files Functions Variables Friends
_zhsmatrix-calc.hpp
Go to the documentation of this file.
00001 //=============================================================================
00002 /*! return its transposed matrix */
00003 inline _zhsmatrix t(const _zhsmatrix& mat)
00004 {VERBOSE_REPORT;
00005   for(std::vector<zcomponent>::iterator it=mat.data.begin(); it!=mat.data.end(); it++){
00006     it->v =std::conj(it->v);
00007   }
00008   return mat;
00009 }
00010 
00011 //=============================================================================
00012 /*! return its conjugate matrix */
00013 inline _zhsmatrix conj(const _zhsmatrix& mat)
00014 {VERBOSE_REPORT;
00015   for(std::vector<zcomponent>::iterator it=mat.data.begin(); it!=mat.data.end(); it++){
00016     it->v =std::conj(it->v);
00017   }
00018   return mat;
00019 }
00020 
00021 //=============================================================================
00022 /*! return its conjugate transposed matrix */
00023 inline _zhsmatrix conjt(const _zhsmatrix& mat)
00024 {VERBOSE_REPORT;
00025   return mat;
00026 }
00027 
00028 ///////////////////////////////////////////////////////////////////////////////
00029 ///////////////////////////////////////////////////////////////////////////////
00030 ///////////////////////////////////////////////////////////////////////////////
00031 
00032 //=============================================================================
00033 /*! search the index of element having the largest absolute value
00034   in 0-based numbering system */
00035 inline void idamax(long& i, long& j, const _zhsmatrix& mat)
00036 {VERBOSE_REPORT;
00037   std::vector<zcomponent>::const_iterator itx(mat.data.begin());
00038   double vmax =0.;
00039   for(std::vector<zcomponent>::const_iterator it=mat.data.begin(); it!=mat.data.end(); it++){
00040     if( vmax < norm(it->v) ){
00041       vmax =norm(it->v);
00042       itx =it;
00043     }
00044   }
00045   i=itx->i;
00046   j=itx->j;
00047   
00048   mat.destroy();
00049 }
00050 
00051 //=============================================================================
00052 /*! return its largest absolute value */
00053 inline comple damax(const _zhsmatrix& mat)
00054 {VERBOSE_REPORT;
00055   std::vector<zcomponent>::const_iterator itx(mat.data.begin());
00056   double vmax =0.;
00057   for(std::vector<zcomponent>::const_iterator it=mat.data.begin(); it!=mat.data.end(); it++){
00058     if( vmax < norm(it->v) ){
00059       vmax =norm(it->v);
00060       itx =it;
00061     }
00062   }
00063   mat.destroy();
00064   return itx->v;
00065 }
 All Classes Files Functions Variables Friends