Cpx Class Template Reference

Class template supports mathematics of complex numbers. More...

#include <Cpx.h>

List of all members.

Public Member Functions

 Cpx (const Cpx< aType > &cm)
 Cpx (double long real, double long imaginary)
 Cpx (double real, double imaginary)
 Cpx (long unsigned real, long unsigned imaginary)
 Cpx (long real, long imaginary)
 Cpx (int unsigned real, int unsigned imaginary)
 Cpx (int real, int imaginary)
 Cpx (short unsigned real, short unsigned imaginary)
 Cpx (short real, short imaginary)
 Cpx (char unsigned real, char unsigned imaginary)
 Cpx (char real, char imaginary)
 Cpx (float real, float imaginary)
 Cpx (const double long *ptr)
 Cpx (const double *ptr)
 Cpx (const long unsigned *ptr)
 Cpx (const long *ptr)
 Cpx (const int unsigned *ptr)
 Cpx (const int *ptr)
 Cpx (const short unsigned *ptr)
 Cpx (const short *ptr)
 Cpx (const char unsigned *ptr)
 Cpx (const char *ptr)
 Cpx (const float *ptr)
 Cpx (double long real)
 Cpx (double real)
 Cpx (long unsigned real)
 Cpx (long real)
 Cpx (int unsigned real)
 Cpx (int real)
 Cpx (short unsigned real)
 Cpx (short real)
 Cpx (char unsigned real)
 Cpx (char real)
 Cpx (float real)
 Cpx (void)
aType magnitude (void) const
aType magnitude2 (void) const
Cpx< aType > operator * (const Cpx< aType > &cm) const
Cpx< aType > operator * (aType scalar) const
const Cpx< aType > operator *= (const Cpx< aType > &cm)
const Cpx< aType > operator *= (aType scalar)
 operator aType * (void)
bool operator!= (aType scalar) const
bool operator!= (const Cpx< aType > &cm) const
Cpx< aType > operator+ (const Cpx< aType > &cm) const
Cpx< aType > operator+ (aType scalar) const
Cpx< aType > operator+ (void) const
const Cpx< aType > operator+= (const Cpx< aType > &cm)
const Cpx< aType > operator+= (aType scalar)
Cpx< aType > operator- (const Cpx< aType > &cm) const
Cpx< aType > operator- (aType scalar) const
Cpx< aType > operator- (void) const
const Cpx< aType > operator-= (const Cpx< aType > &cm)
const Cpx< aType > operator-= (double scalar)
Cpx< aType > operator/ (aType scalar) const
Cpx< aType > operator/ (const Cpx< aType > &cm) const
const Cpx< aType > operator/= (aType scalar)
const Cpx< aType > operator/= (const Cpx< aType > &cm)
bool operator< (const Cpx< aType > &cm) const
bool operator<= (const Cpx< aType > &cm) const
const Cpx< aType > operator= (const Cpx< aType > &cm)
bool operator== (aType scalar) const
bool operator== (const Cpx< aType > &cm) const
bool operator> (const Cpx< aType > &cm) const
bool operator>= (const Cpx< aType > &cm) const
Cpx< aType > operator~ (void) const
std::ostream & stream (std::ostream &ostr) const
 ~Cpx (void)

Public Attributes

aType im
aType re

Static Public Attributes

static const aType LN10 = 2.302585092994045684017991
static const aType PI = 3.141592653589793238462643

Friends

template<class bType>
Cpx< bType > acos (const Cpx< bType > &cm)
template<class bType>
Cpx< bType > acosh (const Cpx< bType > &cm)
template<class bType>
Cpx< bType > asin (const Cpx< bType > &cm)
template<class bType>
Cpx< bType > asinh (const Cpx< bType > &cm)
template<class bType>
Cpx< bType > atan (const Cpx< bType > &cm)
template<class bType>
Cpx< bType > atanh (const Cpx< bType > &cm)
template<class bType>
Cpx< bType > ceil (const Cpx< bType > &cm)
template<class bType>
Cpx< bType > cos (const Cpx< bType > &cm)
template<class bType>
Cpx< bType > cosh (const Cpx< bType > &cm)
template<class bType>
Cpx< bType > exp (const Cpx< bType > &cm)
template<class bType>
bType fabs (const Cpx< bType > &cm)
template<class bType>
Cpx< bType > floor (const Cpx< bType > &cm)
template<class bType>
Cpx< bType > log (const Cpx< bType > &cm)
template<class bType>
Cpx< bType > log10 (const Cpx< bType > &cm)
template<class bType>
Cpx< bType > operator * (bType scalar, const Cpx< bType > &cm)
template<class bType>
bool operator!= (bType scalar, const Cpx< bType > &cm)
template<class bType>
Cpx< bType > operator+ (bType scalar, const Cpx< bType > &cm)
template<class bType>
Cpx< bType > operator- (bType scalar, const Cpx< bType > &cm)
template<class bType>
Cpx< bType > operator/ (bType scalar, const Cpx< bType > &cm)
template<class bType>
std::ostream & operator<< (std::ostream &ostr, const Cpx< bType > &cm)
template<class bType>
bool operator== (bType scalar, const Cpx< bType > &cm)
template<class bType>
Cpx< bType > pow (const Cpx< bType > &cm, const Cpx< bType > &cx)
template<class bType>
Cpx< bType > pow (const Cpx< bType > &cm, bType scalar)
template<class bType>
Cpx< bType > pow (bType scalar, const Cpx< bType > &cx)
template<class bType>
Cpx< bType > sin (const Cpx< bType > &cm)
template<class bType>
Cpx< bType > sinh (const Cpx< bType > &cm)
template<class bType>
Cpx< bType > sqrt (const Cpx< bType > &cm)
template<class bType>
Cpx< bType > tan (const Cpx< bType > &cm)
template<class bType>
Cpx< bType > tanh (const Cpx< bType > &cm)


Detailed Description

template<typename aType>
class calc::Cpx< aType >

Class template supports mathematics of complex numbers.

Value storage with in this complex object uses <aType> variable declarations. All angular phase evaluations of complex values occur within the range of negative Cpx::PI to positive Cpx::PI.

See the cited References to obtain more information on the mathematical theory applied here.

Author
efgeorge
Date
2006/07/18 01:45:34
Revision
1.2
Examples:

example_Cheb.txt, example_Intg.txt, example_Mtx.txt, and example_Ode.txt.


Constructor & Destructor Documentation

Cpx ( void   ) 

Constructor initializes a complex object with zero real and imaginary values.

Cpx ( float  real  ) 

Overloaded constructor initializes a complex object with the specified real value and a zero imaginary value.

Parameters:
real real value of complex number

Cpx ( char  real  ) 

Overloaded constructor initializes a complex object with the specified real value and a zero imaginary value.

Parameters:
real real value of complex number

Cpx ( char unsigned  real  ) 

Overloaded constructor initializes a complex object with the specified real value and a zero imaginary value.

Parameters:
real real value of complex number

Cpx ( short  real  ) 

Overloaded constructor initializes a complex object with the specified real value and a zero imaginary value.

Parameters:
real real value of complex number

Cpx ( short unsigned  real  ) 

Overloaded constructor initializes a complex object with the specified real value and a zero imaginary value.

Parameters:
real real value of complex number

Cpx ( int  real  ) 

Overloaded constructor initializes a complex object with the specified real value and a zero imaginary value.

Parameters:
real real value of complex number

Cpx ( int unsigned  real  ) 

Overloaded constructor initializes a complex object with the specified real value and a zero imaginary value.

Parameters:
real real value of complex number

Cpx ( long  real  ) 

Overloaded constructor initializes a complex object with the specified real value and a zero imaginary value.

Parameters:
real real value of complex number

Cpx ( long unsigned  real  ) 

Overloaded constructor initializes a complex object with the specified real value and a zero imaginary value.

Parameters:
real real value of complex number

Cpx ( double  real  ) 

Overloaded constructor initializes a complex object with the specified real value and a zero imaginary value.

Parameters:
real real value of complex number

Cpx ( double long  real  ) 

Overloaded constructor initializes a complex object with the specified real value and a zero imaginary value.

Parameters:
real real value of complex number

Cpx ( const float *  ptr  ) 

Overloaded constructor initializes a complex object with the specified array of a real value followed by an imaginary value.

Parameters:
ptr pointer to a 2-value array defining a complex number

Cpx ( const char *  ptr  ) 

Overloaded constructor initializes a complex object with the specified array of a real value followed by an imaginary value.

Parameters:
ptr pointer to a 2-value array defining a complex number

Cpx ( const char unsigned *  ptr  ) 

Overloaded constructor initializes a complex object with the specified array of a real value followed by an imaginary value.

Parameters:
ptr pointer to a 2-value array defining a complex number

Cpx ( const short *  ptr  ) 

Overloaded constructor initializes a complex object with the specified array of a real value followed by an imaginary value.

Parameters:
ptr pointer to a 2-value array defining a complex number

Cpx ( const short unsigned *  ptr  ) 

Overloaded constructor initializes a complex object with the specified array of a real value followed by an imaginary value.

Parameters:
ptr pointer to a 2-value array defining a complex number

Cpx ( const int *  ptr  ) 

Overloaded constructor initializes a complex object with the specified array of a real value followed by an imaginary value.

Parameters:
ptr pointer to a 2-value array defining a complex number

Cpx ( const int unsigned *  ptr  ) 

Overloaded constructor initializes a complex object with the specified array of a real value followed by an imaginary value.

Parameters:
ptr pointer to a 2-value array defining a complex number

Cpx ( const long *  ptr  ) 

Overloaded constructor initializes a complex object with the specified array of a real value followed by an imaginary value.

Parameters:
ptr pointer to a 2-value array defining a complex number

Cpx ( const long unsigned *  ptr  ) 

Overloaded constructor initializes a complex object with the specified array of a real value followed by an imaginary value.

Parameters:
ptr pointer to a 2-value array defining a complex number

Cpx ( const double *  ptr  ) 

Overloaded constructor initializes a complex object with the specified array of a real value followed by an imaginary value.

Parameters:
ptr pointer to a 2-value array defining a complex number

Cpx ( const double long *  ptr  ) 

Overloaded constructor initializes a complex object with the specified array of a real value followed by an imaginary value.

Parameters:
ptr pointer to a 2-value array defining a complex number

Cpx ( float  real,
float  imaginary 
)

Overloaded constructor initializes a complex object with the specified real and imaginary values.

Parameters:
real real value of complex number
imaginary imaginary value of complex number

Cpx ( char  real,
char  imaginary 
)

Overloaded constructor initializes a complex object with the specified real and imaginary values.

Parameters:
real real value of complex number
imaginary imaginary value of complex number

Cpx ( char unsigned  real,
char unsigned  imaginary 
)

Overloaded constructor initializes a complex object with the specified real and imaginary values.

Parameters:
real real value of complex number
imaginary imaginary value of complex number

Cpx ( short  real,
short  imaginary 
)

Overloaded constructor initializes a complex object with the specified real and imaginary values.

Parameters:
real real value of complex number
imaginary imaginary value of complex number

Cpx ( short unsigned  real,
short unsigned  imaginary 
)

Overloaded constructor initializes a complex object with the specified real and imaginary values.

Parameters:
real real value of complex number
imaginary imaginary value of complex number

Cpx ( int  real,
int  imaginary 
)

Overloaded constructor initializes a complex object with the specified real and imaginary values.

Parameters:
real real value of complex number
imaginary imaginary value of complex number

Cpx ( int unsigned  real,
int unsigned  imaginary 
)

Overloaded constructor initializes a complex object with the specified real and imaginary values.

Parameters:
real real value of complex number
imaginary imaginary value of complex number

Cpx ( long  real,
long  imaginary 
)

Overloaded constructor initializes a complex object with the specified real and imaginary values.

Parameters:
real real value of complex number
imaginary imaginary value of complex number

Cpx ( long unsigned  real,
long unsigned  imaginary 
)

Overloaded constructor initializes a complex object with the specified real and imaginary values.

Parameters:
real real value of complex number
imaginary imaginary value of complex number

Cpx ( double  real,
double  imaginary 
)

Overloaded constructor initializes a complex object with the specified real and imaginary values.

Parameters:
real real value of complex number
imaginary imaginary value of complex number

Cpx ( double long  real,
double long  imaginary 
)

Overloaded constructor initializes a complex object with the specified real and imaginary values.

Parameters:
real real value of complex number
imaginary imaginary value of complex number

Cpx ( const Cpx< aType > &  cm  ) 

Overloaded copy constructor initializes a complex object from the specified existing complex object.

Parameters:
cm a reference to a complex object

~Cpx ( void   ) 

Destructor is a place holder, no dynamic memory is allocated.


Member Function Documentation

aType magnitude ( void   )  const

Function calculates the magnitude of the complex object.

Returns:
the absolute value of a complex object
Remarks:
The magnitude of a complex number is defined as the square root of a complex number multiplied by its complex conjugate.

aType magnitude2 ( void   )  const

Function calculates the squared magnitude of the complex object.

Returns:
the squared absolute value of a complex object
Remarks:
The squared magnitude of a complex number is defined as the complex number multiplied by its complex conjugate.

Cpx<aType> operator * ( const Cpx< aType > &  cm  )  const

Function overloads the multiplication operator *. The function finds the product of two complex numbers.

Parameters:
cm a complex object to multiply
Returns:
the product of two complex objects

Cpx<aType> operator * ( aType  scalar  )  const

Function overloads the multiplication operator *. The function multiplies a complex number by a scalar.

Parameters:
scalar a value to multiply
Returns:
the product of a complex object and scalar

const Cpx<aType> operator *= ( const Cpx< aType > &  cm  ) 

Function overloads the multiplication assignment operator *=. The function finds the product of two complex numbers, and stores the results into the specified complex object.

Parameters:
cm a complex object to multiply
Returns:
the product of two complex objects

const Cpx<aType> operator *= ( aType  scalar  ) 

Function overloads the multiplication assignment operator *=. The function multiplies a complex number by a scalar, and stores the results into the specified complex object.

Parameters:
scalar a value to multiply
Returns:
the product of a complex object and scalar

operator aType * ( void   ) 

Conversion function returns a pointer to the complex object.

Returns:
a pointer to the complex object
Remarks:
The real value of the complex object directly preceeds the imaginary value in the array.
Note:
For all conversion references of a complex object cm, the object is cast as: aType cm[2];

bool operator!= ( aType  scalar  )  const

Function overloads the inequality operator !=. The function compares the value of a complex number and a scalar number.

Parameters:
scalar a floating point number to compare
Returns:
status flag
  • false (the real numbers are equivalent and the imaginary value is zero)
  • true (the real numbers are not equivalent, and/or the imaginary value is not zero)
Remarks:
For equivalence, the real value of the complex number must be equivalent to the corresponding real number. The imaginary part of the complex number must equal 0.

bool operator!= ( const Cpx< aType > &  cm  )  const

Function overloads the inequality operator !=. The function compares the values of two complex objects.

Parameters:
cm a complex object to compare
Returns:
status flag
  • false (the complex numbers are equivalent)
  • true (the complex numbers are not equivalent)
Remarks:
For inequivalence, the real and/or imaginary values of the two complex numbers must be different.

Cpx<aType> operator+ ( const Cpx< aType > &  cm  )  const

Function overloads the addition operator +. The function finds the sum of two complex numbers.

Parameters:
cm a complex object to be added
Returns:
the sum of two complex objects

Cpx<aType> operator+ ( aType  scalar  )  const

Function overloads the addition operator +. The function finds the sum of a complex number and a scalar.

Parameters:
scalar a value to be added
Returns:
the sum of a complex object and scalar

Cpx<aType> operator+ ( void   )  const

Function overloads the addition operator +. The function returns a copy of the complex number.

Returns:
a copy of a complex object

const Cpx<aType> operator+= ( const Cpx< aType > &  cm  ) 

Function overloads the addition assignment operator +=. The function finds the sum of two complex numbers, and stores the results into the specified complex object.

Parameters:
cm a complex object to be added
Returns:
the sum of two complex objects

const Cpx<aType> operator+= ( aType  scalar  ) 

Function overloads the addition assignment operator +=. The function finds the sum of a complex number and a scalar, and stores the results into the specified complex object.

Parameters:
scalar a value to be added
Returns:
the sum of a complex object and scalar

Cpx<aType> operator- ( const Cpx< aType > &  cm  )  const

Function overloads the subtraction operator -. The function finds the difference between two complex numbers.

Parameters:
cm a complex number object to be subtracted
Returns:
the difference between two complex objects

Cpx<aType> operator- ( aType  scalar  )  const

Function overloads the subtraction operator -. The function finds the difference between a complex number and a scalar.

Parameters:
scalar a value to be subtracted
Returns:
the difference between a complex object and scalar

Cpx<aType> operator- ( void   )  const

Function overloads the subtraction operator -. The function finds the negative of a complex number.

Returns:
the negative of a complex object

const Cpx<aType> operator-= ( const Cpx< aType > &  cm  ) 

Function overloads the subtraction assignment operator -=. The function finds the difference between two complex numbers, and stores the results into the specified complex object.

Parameters:
cm a complex object to be subtracted
Returns:
the difference between two complex objects

const Cpx<aType> operator-= ( double  scalar  ) 

Function overloads the subtraction assignment operator -=. The function finds the difference between a complex number and a scalar, and stores the results into the specified complex object.

Parameters:
scalar a value to be subtracted
Returns:
the difference between a complex object and scalar

Cpx<aType> operator/ ( aType  scalar  )  const

Function overloads the division operator /. The function divides a complex number by a scalar.

Parameters:
scalar a value to divide by
Returns:
the quotient of a complex object divided by a scalar

calc::Cpx< aType > operator/ ( const Cpx< aType > &  cm  )  const

Function overloads the division operator /. The function divides a complex number by a complex number.

Parameters:
cm a complex object to divide by
Returns:
the quotient of a complex object divided by a complex object

const Cpx<aType> operator/= ( aType  scalar  ) 

Function overloads the division assignment operator /=. The function divides a complex number by a scalar, and stores the results into the specified complex object.

Parameters:
scalar a value to divide by
Returns:
the quotient of a complex object divided by a scalar

const calc::Cpx< aType > operator/= ( const Cpx< aType > &  cm  ) 

Function overloads the division assignment operator /. The function divides a complex number by a complex number, and stores the results into the specified complex object.

Parameters:
cm a complex object to divide by
Returns:
the quotient of a complex object divided by a complex object

bool operator< ( const Cpx< aType > &  cm  )  const

Function overloads the less-than operator <. The function compares the values of two complex objects.

Parameters:
cm a complex object to compare
Returns:
status flag
  • false (the complex object is greater than the complex object to compare)
  • true (the complex object is less than the complex object to compare)
Remarks:
To express a single value of a complex object for comparison, the square of the complex magnitude is calculated (see Cpx::fabs()).

bool operator<= ( const Cpx< aType > &  cm  )  const

Function overloads the less-than-or-equal operator <=. The function compares the values of two complex objects.

Parameters:
cm a complex object to compare
Returns:
status flag
  • false (the complex object is greater than the complex object to compare)
  • true (the complex object is less than or equal to the complex object to compare)
Remarks:
To express a single value of a complex object for comparison, the square of the complex magnitude is calculated (see Cpx::fabs()).

const Cpx<aType> operator= ( const Cpx< aType > &  cm  ) 

Function overloads the assignment operator =. The function copies the complex object to an existing complex object.

Parameters:
cm a complex object to be copied
Returns:
the copy of a complex object

bool operator== ( aType  scalar  )  const

Function overloads the equality operator ==. The function compares the value of a complex number and a scalar number.

Parameters:
scalar a floating point number to compare
Returns:
status flag
  • false (the real numbers are not equivalent, and/or the imaginary value is not zero)
  • true (the real numbers are equivalent and the imaginary value is zero)
Remarks:
For equivalence, the real value of the complex number must be equivalent to the corresponding real number. The imaginary part of the complex number must equal 0.

bool operator== ( const Cpx< aType > &  cm  )  const

Function overloads the equality operator ==. The function compares the values of two complex objects.

Parameters:
cm a complex object to compare
Returns:
status flag
  • false (the complex numbers are not equivalent)
  • true (the complex numbers are equivalent)
Remarks:
For equivalence, the real and imaginary values of the two complex numbers must be equal.

bool operator> ( const Cpx< aType > &  cm  )  const

Function overloads the greater-than operator >. The function compares the values of two complex objects.

Parameters:
cm a complex object to compare
Returns:
status flag
  • false (the complex object is less than the complex object to compare)
  • true (the complex object is greater than the complex object to compare)
Remarks:
To express a single value of a complex object for comparison, the square of the complex magnitude is calculated (see Cpx::fabs()).

bool operator>= ( const Cpx< aType > &  cm  )  const

Function overloads the less-than-or-equal operator <=. The function compares the values of two complex objects.

Parameters:
cm a complex object to compare
Returns:
status flag
  • false (the complex object is less than the complex object to compare)
  • true (the complex object is greater than or equal to the complex object to compare)
Remarks:
To express a single value of a complex object for comparison, the square of the complex magnitude is calculated (see Cpx::fabs()).

Cpx<aType> operator~ ( void   )  const

Function overloads the bitwise negation operator ~. The function finds the complex conjugate of a complex object.

Returns:
the complex conjugate of a complex object

std::ostream& stream ( std::ostream &  ostr  )  const

Function prints values of the complex number to the specified stream in the standard format.

Parameters:
ostr a reference to a stream
Returns:
a reference to the stream
Remarks:
The real value of the complex number precedes the imaginary number. Between the output complex values, is the sign of the imaginary value,2-i3.


Friends And Related Function Documentation

Cpx<bType> acos ( const Cpx< bType > &  cm  )  [friend]

Function overloads the <cmath> library function std::acos(). The function calculates the inverse trigonometric cosine value of a complex number.

Parameters:
cm a reference to a complex object
Returns:
the inverse cosine function complex value of a complex object
Remarks:
  • This function has two branch cuts in the complex plane.
  • A branch cut extends along the real axis from -1 to negative infinity.
  • A branch cut extends along the real axis from 1 to positive infinity.

Cpx<bType> acosh ( const Cpx< bType > &  cm  )  [friend]

Function overloads the <cmath> library function std::acosh(). The function calculates the inverse hyberbolic cosine value of a complex number.

Parameters:
cm a reference to a complex object
Returns:
the inverse hyberbolic cosine function complex value of a complex object
Remarks:
A single branch cut extends along the real axis from 1 to negative infinity.

Cpx<bType> asin ( const Cpx< bType > &  cm  )  [friend]

Function overloads the <cmath> library function std::asin(). The function calculates the inverse trigonometric sine value of a complex number.

Parameters:
cm a reference to a complex object
Returns:
the inverse sine function complex value of a complex object
Remarks:
  • This function has two branch cuts in the complex plane.
  • A branch cut extends along the real axis from -1 to negative infinity.
  • A branch cut extends along the real axis from 1 to positive infinity.

Cpx<bType> asinh ( const Cpx< bType > &  cm  )  [friend]

Function overloads the <cmath> library function std::asinh(). The function calculates the inverse hyberbolic sine value of a complex number.

Parameters:
cm a reference to a complex object
Returns:
the inverse hyberbolic sine function complex value of a complex object
Remarks:
  • This function has two branch cuts in the complex plane.
  • A branch cut extends along the imaginary axis from -1 to negative infinity.
  • A branch cut extends along the imaginary axis from 1 to positive infinity.

Cpx<bType> atan ( const Cpx< bType > &  cm  )  [friend]

Function overloads the <cmath> library function std::atan(). The function calculates the inverse trigonometric tangent value of a complex number.

Parameters:
cm a reference to a complex object
Returns:
the inverse tangent function complex value of a complex object
Remarks:
  • This function has two branch cuts in the complex plane.
  • A branch cut extends along the imaginary axis from -1 to negative infinity.
  • A branch cut extends along the imaginary axis from 1 to positive infinity.
  • A singularity exists at the value 0.5*CpxPI on the imaginary axis.

Cpx<bType> atanh ( const Cpx< bType > &  cm  )  [friend]

Function overloads the <cmath> library function std::atanh(). The function calculates the inverse hyberbolic tangent value of a complex number.

Parameters:
cm a reference to a complex object
Returns:
the inverse hyberbolic tangent function complex value of a complex object
Remarks:
  • This function has two branch cuts in the complex plane.
  • A branch cut extends along the real axis from -1 to negative infinity.
  • A branch cut extends along the real axis from 1 to positive infinity.
  • A singularity exists at the value 1 on the real axis.

Cpx<bType> ceil ( const Cpx< bType > &  cm  )  [friend]

Function overloads the <cmath> library function std::ceil(). The function rounds up each part of the complex number to the nearest whole number.

Parameters:
cm a reference to a complex object
Returns:
the rounded up complex value of a complex object

Cpx<bType> cos ( const Cpx< bType > &  cm  )  [friend]

Function overloads the <cmath> library function std::cos(). The function calculates the trigonometric cosine value of a complex number.

Parameters:
cm a reference to a complex object
Returns:
the cosine function complex value of a complex object

Cpx<bType> cosh ( const Cpx< bType > &  cm  )  [friend]

Function overloads the <cmath> library function std::cosh(). The function calculates the hyberbolic cosine value of a complex number.

Parameters:
cm a reference to a complex object
Returns:
the hyberbolic cosine function complex value of a complex object

Cpx<bType> exp ( const Cpx< bType > &  cm  )  [friend]

Function overloads the <cmath> library function std::exp(). The function calculates the exponential of a complex number.

Parameters:
cm a reference to a complex object
Returns:
the exponential complex value of a complex object

bType fabs ( const Cpx< bType > &  cm  )  [friend]

Function overloads the <cmath> library function std::fabs(). The function calculates the magnitude of a complex number.

Parameters:
cm a reference to a complex object
Returns:
the absolute value of a complex object
Remarks:
The absolute value of a complex number is defined as the square root of a complex number multiplied by its complex conjugate.

Cpx<bType> floor ( const Cpx< bType > &  cm  )  [friend]

Function overloads the <cmath> library function std::floor(). The function rounds down each part of the complex number to the nearest whole number.

Parameters:
cm a reference to a complex object
Returns:
the rounded down complex value of a complex object

Cpx<bType> log ( const Cpx< bType > &  cm  )  [friend]

Function overloads the <cmath> library function std::log(). The function calculates the natural logarithm of a complex number.

Parameters:
cm a reference to a complex object
Returns:
the logarithmic complex value of a complex object
Remarks:
A single branch cut extends along the real axis from 0 to negative infinity.

Cpx<bType> log10 ( const Cpx< bType > &  cm  )  [friend]

Function overloads the <cmath> library function std::log10(). The function determines the base-10 logarithm of a complex number.

Parameters:
cm a complex object to be multiplied
Returns:
the base-10 logarithm of a complex object
Remarks:
A single branch cut extends along the real axis from 0 to negative infinity.

Cpx<bType> operator * ( bType  scalar,
const Cpx< bType > &  cm 
) [friend]

Function overloads the multiplication operator *. The function multiplies a scalar times a complex number.

Parameters:
scalar a value to multiply
cm a complex object to be multiplied
Returns:
the product of a complex object and scalar

bool operator!= ( bType  scalar,
const Cpx< bType > &  cm 
) [friend]

Function overloads the inequality operator !=. The function compares the value of a complex number and a real number.

Parameters:
scalar a floating point number to compare
cm a complex object to be compared
Returns:
status flag
  • false (the real numbers are equivalent and the imaginary value is zero)
  • true (the real numbers are not equivalent, and/or the imaginary value is not zero)
Remarks:
For equivalence, the real value of the complex number must be equivalent to the corresponding real number. The imaginary part of the complex number must equal 0.

Cpx<bType> operator+ ( bType  scalar,
const Cpx< bType > &  cm 
) [friend]

Function overloads the addition operator +. The function finds the sum of a complex number and a scalar.

Parameters:
scalar a value to be added
cm a complex object to be added
Returns:
the sum of a complex object and scalar

Cpx<bType> operator- ( bType  scalar,
const Cpx< bType > &  cm 
) [friend]

Function overloads the subtraction operator -. The function finds the difference between a scalar and a complex number.

Parameters:
scalar a value to subtract
cm a complex object to be subtracted
Returns:
the difference between a scalar and complex object

Cpx<bType> operator/ ( bType  scalar,
const Cpx< bType > &  cm 
) [friend]

Function overloads the division operator /. The function divides a scalar by a complex number.

Parameters:
scalar a value to divide
cm a complex object to divide by
Returns:
the quotient of a scalar divided by a complex object

std::ostream& operator<< ( std::ostream &  ostr,
const Cpx< bType > &  cm 
) [friend]

Function overloads the bitwise left shift operator <<. The function prints the specified complex number to the specified stream.

Parameters:
ostr a reference to a stream
cm a reference to a complex object
Returns:
a reference to the stream
Remarks:
The output complex values are separated by a comma, 2,-3. The real value of the complex number precedes the imaginary number.

bool operator== ( bType  scalar,
const Cpx< bType > &  cm 
) [friend]

Function overloads the equality operator ==. The function compares the value of a complex number and a real number.

Parameters:
scalar a floating point number to compare
cm a complex object to be compared
Returns:
status flag
  • false (the real numbers are not equivalent, and/or the imaginary value is not zero)
  • true (the real numbers are equivalent and the imaginary value is zero)
Remarks:
For equivalence, the real value of the complex number must be equivalent to the corresponding real number. The imaginary part of the complex number must equal 0.

Cpx<bType> pow ( const Cpx< bType > &  cm,
const Cpx< bType > &  cx 
) [friend]

Function overloads the <cmath> library function std::pow(). The function calculates the value of a complex value raised to a complex valued power.

Parameters:
cm a reference to a complex valued number (mantissa)
cx a reference to a complex valued number (exponent)
Returns:
the complex value of a complex object raised to the power of a complex number
Remarks:
A single branch cut extends along the real axis from 0 to negative infinity.

Cpx<bType> pow ( const Cpx< bType > &  cm,
bType  scalar 
) [friend]

Function overloads the <cmath> library function std::pow(). The function calculates the value of a complex value raised to a real valued power.

Parameters:
cm a reference to a complex valued number (mantissa)
scalar a real valued number (exponent)
Returns:
the complex value of a complex object raised to the power of a real number
Remarks:
A single branch cut extends along the real axis from 0 to negative infinity.

Cpx<bType> pow ( bType  scalar,
const Cpx< bType > &  cx 
) [friend]

Function overloads the <cmath> library function std::pow(). The function calculates the value of a real number raised to a complex power.

Parameters:
scalar a real valued number (mantissa)
cx a reference to a complex valued number (exponent)
Returns:
the complex value of a scalar number raised to the power of a complex object

Cpx<bType> sin ( const Cpx< bType > &  cm  )  [friend]

Function overloads the <cmath> library function std::sin(). The function calculates the trigonometric sine value of a complex number.

Parameters:
cm a reference to a complex object
Returns:
the sine function complex value of a complex object

Cpx<bType> sinh ( const Cpx< bType > &  cm  )  [friend]

Function overloads the <cmath> library function std::sinh(). The function calculates the hyberbolic sine value of a complex number.

Parameters:
cm a reference to a complex object
Returns:
the hyberbolic sine function complex value of a complex object

Cpx<bType> sqrt ( const Cpx< bType > &  cm  )  [friend]

Function overloads the <cmath> library function std::sqrt(). The function calculates the value of a complex value raised to the one-half power.

Parameters:
cm a reference to a complex valued number
Returns:
the complex value of a complex object raised to the one-half power
Remarks:
A single branch cut extends along the real axis from 0 to negative infinity.

Cpx<bType> tan ( const Cpx< bType > &  cm  )  [friend]

Function overloads the <cmath> library function std::tan(). The function calculates the trigonometric tangent value of a complex number.

Parameters:
cm a reference to a complex object
Returns:
the tangent function complex value of a complex object

Cpx<bType> tanh ( const Cpx< bType > &  cm  )  [friend]

Function overloads the <cmath> library function std::tanh(). The function calculates the hyberbolic tangent value of a complex number.

Parameters:
cm a reference to a complex object
Returns:
the hyberbolic tangent function complex value of a complex object


Member Data Documentation

aType im

imaginary value of complex number

const aType LN10 = 2.302585092994045684017991 [static]

natural logarithm of ten

const aType PI = 3.141592653589793238462643 [static]

circle circumference:diameter ratio

aType re

real value of complex number


The documentation for this class was generated from the following files:
Generated on Wed Jul 19 09:24:05 2006 for CalcLib by  doxygen 1.4.7