CPPLapack
 All Classes Files Functions Variables Friends
zhematrix-calc.hpp
Go to the documentation of this file.
00001 //=============================================================================
00002 /*! return transposed zgematrix */
00003 inline _zhematrix t(const zhematrix& mat)
00004 {VERBOSE_REPORT;
00005   zhematrix newmat(mat.n);
00006   for(long i=0; i<newmat.n; i++){ for(long j=0; j<=i; j++){
00007     newmat(i,j) =mat(j,i);
00008   }}
00009   
00010   return _(newmat);
00011 }
00012 
00013 //=============================================================================
00014 /*! return its inverse matrix */
00015 inline _zgematrix i(const zhematrix& mat)
00016 {VERBOSE_REPORT;
00017   zhematrix mat_cp(mat);
00018   zgematrix mat_inv(mat.n,mat.n);
00019   mat_inv.identity();
00020   mat_cp.zhesv(mat_inv);
00021   
00022   return _(mat_inv);
00023 }
00024 
00025 ///////////////////////////////////////////////////////////////////////////////
00026 ///////////////////////////////////////////////////////////////////////////////
00027 ///////////////////////////////////////////////////////////////////////////////
00028 
00029 //=============================================================================
00030 /*! return its conjugate matrix */
00031 inline _zhematrix conj(const zhematrix& mat)
00032 {VERBOSE_REPORT;
00033   zhematrix newmat(mat.n);
00034   
00035   for(long i=0; i<mat.n; i++){
00036     for(long j=0; j<=i; j++){
00037       newmat(i,j) =std::conj(mat(i,j));
00038     }
00039   }
00040   
00041   return _(newmat);
00042 }
00043 
00044 //=============================================================================
00045 /*! return its conjugate transposed matrix */
00046 inline _zhematrix conjt(const zhematrix& mat)
00047 {VERBOSE_REPORT;
00048 #ifdef  CPPL_DEBUG
00049   WARNING_REPORT;
00050   std::cerr << "This function call has no effect since the matrix is Hermitian." << std::endl;
00051 #endif//CPPL_DEBUG
00052   
00053   zhematrix newmat(mat);
00054   return _(newmat);
00055 }
 All Classes Files Functions Variables Friends