CPPLapack
 All Classes Files Functions Variables Friends
zhsmatrix-cast.hpp
Go to the documentation of this file.
00001 //=============================================================================
00002 /*! convert to _zgematrix */
00003 inline _zgematrix zhsmatrix::to_zgematrix() const
00004 {VERBOSE_REPORT;
00005   zgematrix newmat( zgematrix(m,n).zero() );
00006   
00007   for(std::vector<zcomponent>::const_iterator it=data.begin(); it!=data.end(); it++){
00008     newmat(it->i, it->j) =it->v;
00009     newmat(it->j, it->i) =std::conj(it->v);
00010   }
00011   
00012   return _(newmat);
00013 }
00014 
00015 //=============================================================================
00016 /*! convert to _zhematrix */
00017 inline _zhematrix zhsmatrix::to_zhematrix() const
00018 {VERBOSE_REPORT;
00019   zhematrix newmat(n);
00020   newmat.zero();
00021   
00022   for(std::vector<zcomponent>::const_iterator it=data.begin(); it!=data.end(); it++){
00023     newmat(it->i, it->j) =it->v;
00024   }
00025   
00026   return _(newmat);
00027 }
00028 
00029 //=============================================================================
00030 /*! convert to _zgsmatrix */
00031 inline _zgsmatrix zhsmatrix::to_zgsmatrix() const
00032 {VERBOSE_REPORT;
00033   zgsmatrix newmat(m,n);
00034   newmat.zero();
00035   
00036   for(std::vector<zcomponent>::const_iterator it=data.begin(); it!=data.end(); it++){
00037     newmat.put(it->i, it->j, it->v);
00038     if(it->i!=it->j){
00039       newmat.put(it->j, it->i, std::conj(it->v));
00040     }
00041   }
00042   
00043   return _(newmat);
00044 }
 All Classes Files Functions Variables Friends