CPPLapack
 All Classes Files Functions Variables Friends
zhecomplex.hpp
Go to the documentation of this file.
00001 //=============================================================================
00002 //! (DO NOT USE) Complex-double Class for Hermitian matrices
00003 class zhecomplex : public comple
00004 {
00005 public:
00006   ///////////////////////////////////////////////
00007   /////////////////// objects ///////////////////
00008   ///////////////////////////////////////////////
00009   long i, j;
00010   comple& v;
00011   
00012   ///////////////////////////////////////////////
00013   ///////////////// constructors ////////////////
00014   ///////////////////////////////////////////////
00015   inline zhecomplex(const long&, const long&, comple&);
00016   
00017   ///////////////////////////////////////////////
00018   ////////////////// functions //////////////////
00019   ///////////////////////////////////////////////
00020   inline zhecomplex& operator=(const comple&);
00021 };
00022 
00023 ///////////////////////////////////////////////////////////////////////////////
00024 ///////////////////////////////////////////////////////////////////////////////
00025 ///////////////////////////////////////////////////////////////////////////////
00026 
00027 //=============================================================================
00028 /*! constructor */
00029 inline zhecomplex::zhecomplex(const long& _i, const long& _j, comple& _v)
00030   : comple( _i < _j ? std::conj( _v ) : _v ), 
00031     v( _v )
00032 {VERBOSE_REPORT;
00033   i = _i;
00034   j = _j;
00035 }
00036 
00037 ///////////////////////////////////////////////////////////////////////////////
00038 ///////////////////////////////////////////////////////////////////////////////
00039 ///////////////////////////////////////////////////////////////////////////////
00040 
00041 //=============================================================================
00042 /*! operator= */
00043 inline zhecomplex& zhecomplex::operator=(const comple& _v)
00044 {VERBOSE_REPORT;
00045 #ifdef  CPPL_DEBUG
00046   if( i==j && std::fabs(_v.imag()) > DBL_MIN ){
00047     WARNING_REPORT;
00048     std::cerr << "Diagonal components of a hermitian matrix have to be real numbers." << std::endl
00049               << "Your input to the (" << i << "," << j << ") element was a complex number, " << _v << "." << std::endl;
00050   }
00051 #endif//CPPL_DEBUG
00052   
00053   comple::operator=( _v );
00054   v = ( i < j ? std::conj( _v ) : _v );
00055   return *this;
00056 }
 All Classes Files Functions Variables Friends