Main Page   Packages   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Search  

C:/temp/src/j2k/Deprecated/Complex.old/Complex.old File Reference

#include <j2k/Fred/Math/Complex.hpp>

Go to the source code of this file.

Functions

JComplexoperator+= (JComplex &x, const JComplex &y)
JComplexoperator-= (JComplex &x, const JComplex &y)
JComplex operator+ (const JComplex &left, const JComplex &right)
JComplex operator- (const JComplex &left, const JComplex &right)
JComplexoperator *= (JComplex &x, const JComplex &y)
JComplexoperator/= (JComplex &x, const JComplex &y)
JComplex operator * (const JComplex &left, const JComplex &right)
JComplex operator/ (const JComplex &left, const JComplex &right)
CplxNumber Real (const CplxNumber &x)
CplxNumber Imag (const CplxNumber &y)
CplxNumber Real () const
CplxNumber Imag () const
JComplexoperator= (const CplxNumber &x)
JComplexoperator= (const JComplex &c)
JComplexoperator+= (const CplxNumber &x)
JComplexoperator-= (const CplxNumber &x)
JComplexoperator *= (const CplxNumber &x)
JComplexoperator/= (const CplxNumber &x)
BOOL Compare (const JComplex &l, const JComplex &r)
BOOL operator== (const JComplex &l, const JComplex &r)
BOOL operator!= (const Number &l, const Number &r)
CplxNumber _Infv (CplxNumber)
bool _Isinf (CplxNumber x)
bool _Isnan (CplxNumber x)
CplxNumber _Nanv (CplxNumber)

Variables

CplxNumber Real
CplxNumber Imag


Function Documentation

BOOL Compare const JComplex   l,
const JComplex   r
[static]
 

Definition at line 303 of file Complex.old.

Referenced by operator!=(), JVector2D::operator!=(), Vector4D::operator!=(), Matrix4By4::operator!=(), JArea::operator!=(), JVector3D::operator!=(), operator==(), JVector2D::operator==(), Vector4D::operator==(), and JVector3D::operator==().

00303                                                               {            
00304     return ( (l.Real == r.Real) && (l.Imag == r.Imag) );                   
00305   }                                                                        

CplxNumber Imag   const
 

Definition at line 246 of file Complex.old.

Referenced by Compare(), JComplex::Compare(), CplxNumber(), operator *(), operator *=(), operator+(), JComplex::operator+(), operator+=(), JComplex::operator+=(), operator-(), JComplex::operator-(), operator-=(), JComplex::operator-=(), operator/(), operator/=(), operator=(), and JComplex::operator=().

00246                            {                                               
00247       return (Imag);                                                       
00248    }                                                                       

CplxNumber Imag const CplxNumber   y
 

Definition at line 238 of file Complex.old.

00238                                         {                                  
00239       return (Imag = y);                                                   
00240    }                                                                       

CplxNumber Real   const
 

Definition at line 242 of file Complex.old.

Referenced by Compare(), JComplex::Compare(), CplxNumber(), operator *(), operator *=(), operator+(), JComplex::operator+(), operator+=(), JComplex::operator+=(), operator-(), JComplex::operator-(), operator-=(), JComplex::operator-=(), operator/(), operator/=(), operator=(), and JComplex::operator=().

00242                            {                                               
00243       return (Real);                                                       
00244    }                                                                       

CplxNumber Real const CplxNumber   x
 

Utilities /////////////////////////////////////////////////////////////////////////////.

Definition at line 234 of file Complex.old.

00234                                         {                                  
00235       return (Real = x);                                                   
00236    }                                                                       

CplxNumber _Infv CplxNumber    [static]
 

Definition at line 350 of file Complex.old.

Referenced by CplxNumber().

00350                                        {                                   
00351      return ( _Inf._D );                                                   
00352    }                                                                       

bool _Isinf CplxNumber    x [static]
 

Definition at line 354 of file Complex.old.

Referenced by CplxNumber().

00354                                     {                                      
00355      double temp = (double)x;                                              
00356      return (_Dtest(&temp) == _INFCODE);                                   
00357    }                                                                       

bool _Isnan CplxNumber    x [static]
 

Definition at line 359 of file Complex.old.

Referenced by CplxNumber().

00359                                     {                                      
00360      double temp = (double)x;                                              
00361      return (_Dtest(&temp) == _NANCODE);                                   
00362    }                                                                       

CplxNumber _Nanv CplxNumber    [static]
 

Definition at line 364 of file Complex.old.

Referenced by CplxNumber().

00364                                        {                                   
00365      return (_Nan._D);                                                     
00366    }                                                                       

JComplex operator * const JComplex   left,
const JComplex   right
 

Definition at line 204 of file Complex.old.

00204                                                                 {
00205   return JComplex (
00206    (left.Real * right.Real) - (left.Imag * right.Imag),
00207    (left.Real * right.Imag) + (left.Imag * right.Real)
00208   );
00209 }

JComplex& operator *= const CplxNumber   x
 

Definition at line 285 of file Complex.old.

Referenced by CplxNumber().

00285                                              {                             
00286       Real = Real * x;                                                     
00287       Imag = Imag * x;                                                     
00288       return (*this);                                                      
00289    }                                                                       

JComplex& operator *= JComplex   x,
const JComplex   y
 

Multiplication and Division operations /////////////////////////////////////////////////////////////////////////////.

Definition at line 165 of file Complex.old.

00165                                                        {
00166    // Reminder: (a+bj)(c+dj) = (ac + bcj + adj + bdjj)
00167    // Result:   (ac - bd) + ( bc + ad )j
00168    // jj = -1, by definition.
00169 
00170    CplxNumber Temp_Re = (x.Real * y.Real) - (x.Imag * y.Imag);
00171    CplxNumber Temp_Im = (x.Imag * y.Real) + (x.Real * y.Imag);
00172 
00173    x.Real = Temp_Re;
00174    x.Imag = Temp_Im;
00175 
00176    return (x);
00177 }

friend BOOL operator!= const Number &    l,
const Number &    r
[inline]
 

Definition at line 311 of file Complex.old.

00311                                                                     {      
00312     return !Compare( l, r );                                               
00313   }                                                                        

JComplex operator+ const JComplex   left,
const JComplex   right
[inline]
 

Definition at line 141 of file Complex.old.

00141                                                                        {
00142   return JComplex( (left.Real + right.Real), (left.Imag + right.Imag) );
00143 }

JComplex& operator+= const CplxNumber   x
 

Definition at line 263 of file Complex.old.

00263                                               {                            
00264       Real = Real + x;                                                     
00265       return (*this);                                                      
00266    }                                                                       

JComplex& operator+= JComplex   x,
const JComplex   y
[inline]
 

Definition at line 119 of file Complex.old.

00119                                                               {
00120   x.Real = x.Real + y.Real;
00121   x.Imag = x.Imag + y.Imag;
00122   return (x);
00123 }

JComplex operator- const JComplex   left,
const JComplex   right
[inline]
 

Definition at line 145 of file Complex.old.

00145                                                                        {
00146   return JComplex( (left.Real - right.Real), (left.Imag - right.Imag) );
00147 }

JComplex& operator-= const CplxNumber   x
 

Definition at line 274 of file Complex.old.

00274                                              {                             
00275       Real = Real - x;                                                     
00276       return (*this);                                                      
00277    }                                                                       

JComplex& operator-= JComplex   x,
const JComplex   y
[inline]
 

Definition at line 125 of file Complex.old.

00125                                                               {
00126   x.Real = x.Real - y.Real;
00127   x.Imag = x.Imag - y.Imag;
00128   return (x);
00129 }                                                                       

JComplex operator/ const JComplex   left,
const JComplex   right
 

Definition at line 221 of file Complex.old.

00221                                                                 {
00222  const CplxDouble Tmp1 = right.Real / right.Imag;
00223  const CplxDouble Tmp2 = right.Imag + (Tmp1 * right.Real);
00224 
00225  return JComplex(
00226   ( (left.Real * Tmp1 + left.Imag) / Tmp2 ),
00227   ( (left.Imag * Tmp1 - left.Real) / Tmp2 )
00228  );
00229 }

JComplex& operator/= const CplxNumber   x
 

Definition at line 291 of file Complex.old.

Referenced by CplxNumber().

00291                                              {                             
00292       Real = Real / x;                                                     
00293       Imag = Imag / x;                                                     
00294       return (*this);                                                      
00295    }                                                                       

JComplex& operator/= JComplex   x,
const JComplex   y
 

Definition at line 179 of file Complex.old.

00179                                                        {
00180    // Reminder: (a+bj)/(c+dj) = (a+bj)(c-dj) / [ (c+dj)(c-dj) ]
00181    // = (ac + bcj - adj - bdjj) / (cc - ddjj)
00182    // = [ (ac + bd) + ( bc - ad )j ] / [ cc + dd ]
00183    // jj = -1, by definition.
00184 
00185    // Doesn't handle Divide by Zero, but STL does it.
00186 
00187    CplxNumber Temp_delta = (y.Real * y.Real) + (y.Imag * y.Imag);
00188    CplxNumber Temp_Re    = (x.Real * y.Real) + (x.Imag * y.Imag);
00189    CplxNumber Temp_Im    = (x.Imag * y.Real) - (x.Real * y.Imag);
00190 
00191    x.Real = Temp_Re / Temp_delta;
00192    x.Imag = Temp_Im / Temp_delta;
00193 
00194    return (x);
00195 }

JComplex& operator= const JComplex   c
 

Definition at line 257 of file Complex.old.

00257                                             {
00258       Real = c.Real;                                                       
00259       Imag = c.Imag;                                                       
00260       return (*this);                                                      
00261    }                                                                       

JComplex& operator= const CplxNumber   x
 

Definition at line 251 of file Complex.old.

00251                                               {                            
00252       Real = x;                                                            
00253       Imag = 0;                                                            
00254       return (*this);                                                      
00255    }                                                                       

friend BOOL operator== const JComplex   l,
const JComplex   r
[inline]
 

Definition at line 307 of file Complex.old.

00307                                                                         {  
00308     return Compare( l, r );                                                
00309   }                                                                        


Variable Documentation

CplxNumber Imag
 

Definition at line 299 of file Complex.old.

CplxNumber Real
 

Definition at line 298 of file Complex.old.


Generated on Sun Oct 14 18:47:04 2001 for Standard J2K Library by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001