CPPLapack
 All Classes Files Functions Variables Friends
dssmatrix-calc.hpp
Go to the documentation of this file.
00001 //=============================================================================
00002 /*! return transposed dssmatrix */
00003 inline _dssmatrix t(const dssmatrix& mat)
00004 {VERBOSE_REPORT;
00005 #ifdef  CPPL_DEBUG
00006   WARNING_REPORT;
00007   std::cerr << "This function call has no effect since the matrix is symmetric." << std::endl;
00008 #endif//CPPL_DEBUG
00009 
00010   dssmatrix newmat(mat);
00011   return _(newmat);
00012 }
00013 
00014 ///////////////////////////////////////////////////////////////////////////////
00015 ///////////////////////////////////////////////////////////////////////////////
00016 ///////////////////////////////////////////////////////////////////////////////
00017 
00018 //=============================================================================
00019 /*! search the index of element having the largest absolute value
00020   in 0-based numbering system */
00021 inline void idamax(long& i, long& j, const dssmatrix& mat)
00022 {VERBOSE_REPORT;
00023   std::vector<dcomponent>::const_iterator itx(mat.data.begin());
00024   double vmax =0.;
00025   for(std::vector<dcomponent>::const_iterator it=mat.data.begin(); it!=mat.data.end(); it++){
00026     if( vmax < fabs(it->v) ){
00027       vmax =fabs(it->v);
00028       itx =it;
00029     }
00030   }
00031   i =itx->i;
00032   j =itx->j;
00033 }
00034 
00035 //=============================================================================
00036 /*! return its largest absolute value */
00037 inline double damax(const dssmatrix& mat)
00038 {VERBOSE_REPORT;
00039   std::vector<dcomponent>::const_iterator itx(mat.data.begin());
00040   double vmax =0.;
00041   for(std::vector<dcomponent>::const_iterator it=mat.data.begin(); it!=mat.data.end(); it++){
00042     if( vmax < fabs(it->v) ){
00043       vmax =fabs(it->v);
00044       itx =it;
00045     }
00046   }
00047   return itx->v;
00048 }
 All Classes Files Functions Variables Friends