00001 #ifndef __J2K__JComplex_Tools_CPP__
00002 #define __J2K__JComplex_Tools_CPP__
00003
00004
00005
00006
00007 inline CplxDouble JComplex::Real() const {
00008 return Real;
00009 }
00010
00011 inline CplxDouble JComplex::Imag() const {
00012 return Imag;
00013 }
00014
00015 inline JComplex& JComplex::Get() const {
00016 return this;
00017 }
00018
00019 inline CplxDouble JComplex::Real( CplxDouble x ) {
00020 return (Real = x);
00021 }
00022
00023 inline CplxDouble JComplex::Imag( CplxDouble y ) {
00024 return (Imag = y);
00025 }
00026
00027 inline JComplex& JComplex::Set( JComplex& c ) {
00028 Real = c.Real;
00029 Imag = c.Imag;
00030 return (*this);
00031 }
00032
00033 inline CplxDouble JComplex::Modulus() const {
00034 return ((Real * Real) + (Imag * Imag));
00035 }
00036
00037 inline JComplex JComplex::getConjugate() const {
00038 return JComplex( Real, 0.0 - Imag );
00039 }
00040
00041 inline void JComplex::Conjugate() {
00042
00043 Imag = 0.0 - Imag;
00044 }
00045
00046
00047
00048
00049 CplxDouble _Infv(CplxDouble) {
00050 return ( _Inf._D );
00051 }
00052
00053 bool _Isinf(CplxDouble x) {
00054 double temp = (double)x;
00055 return (_Dtest(&temp) == _INFCODE);
00056 }
00057
00058 bool _Isnan(CplxDouble x) {
00059 double temp = (double)x;
00060 return (_Dtest(&temp) == _NANCODE);
00061 }
00062
00063 CplxDouble _Nanv(CplxDouble) {
00064 return (_Nan._D);
00065 }
00066
00067 #endif