CPPLapack
 All Classes Files Functions Variables Friends
_dssmatrix-cast.hpp
Go to the documentation of this file.
00001 //=============================================================================
00002 /*! cast to _zhsmatrix */
00003 inline _zhsmatrix _dssmatrix::to_zhsmatrix() const
00004 {VERBOSE_REPORT;
00005   zhsmatrix newmat(n,data.size());
00006   for(std::vector<dcomponent>::const_iterator it=data.begin(); it!=data.end(); it++){
00007     newmat.put(it->i, it->j, comple(it->v,0.0));
00008   }
00009   
00010   destroy();
00011   return _(newmat);
00012 }
00013 
00014 ///////////////////////////////////////////////////////////////////////////////
00015 ///////////////////////////////////////////////////////////////////////////////
00016 ///////////////////////////////////////////////////////////////////////////////
00017 
00018 //=============================================================================
00019 /*! convert to _dgematrix */
00020 inline _dgematrix _dssmatrix::to_dgematrix() const
00021 {VERBOSE_REPORT;
00022   dgematrix newmat(m,n);
00023   newmat.zero();
00024   
00025   for(std::vector<dcomponent>::const_iterator it=data.begin(); it!=data.end(); it++){
00026     newmat(it->i, it->j) =it->v;
00027     newmat(it->j, it->i) =it->v;
00028   }
00029   
00030   destroy();
00031   return _(newmat);
00032 }
00033 
00034 //=============================================================================
00035 /*! convert to _dsymatrix */
00036 inline _dsymatrix _dssmatrix::to_dsymatrix() const
00037 {VERBOSE_REPORT;
00038   dsymatrix newmat(n);
00039   newmat.zero();
00040   
00041   for(std::vector<dcomponent>::const_iterator it=data.begin(); it!=data.end(); it++){
00042     newmat(it->i, it->j) =it->v;
00043   }
00044   
00045   destroy();
00046   return _(newmat);
00047 }
00048 
00049 //=============================================================================
00050 /*! convert to _dgsmatrix */
00051 inline _dgsmatrix _dssmatrix::to_dgsmatrix() const
00052 {VERBOSE_REPORT;
00053   dgsmatrix newmat(m,n,data.size()*2);
00054   newmat.zero();
00055   
00056   for(std::vector<dcomponent>::const_iterator it=data.begin(); it!=data.end(); it++){
00057     newmat.put(it->i, it->j, it->v);
00058     if(it->i!=it->j){
00059       newmat.put(it->j, it->i, it->v);
00060     }
00061   }
00062   
00063   destroy();
00064   return _(newmat);
00065 }
 All Classes Files Functions Variables Friends