oaComplex Class Template Reference


Public Methods

 oaComplex ()
 oaComplex (obj realIn, obj imagIn)
 oaComplex (const oaComplex &c)
obj & real ()
obj & imag ()
obj real () const
obj imag () const
oaComplex & operator+= (const oaComplex &c)
oaComplex & operator-= (const oaComplex &c)
oaComplex & operator *= (const oaComplex &c)
oaComplex & operator/= (const oaComplex &c)
oaComplex & operator= (const oaComplex &c)
oaComplex operator- () const
oaBoolean operator== (const oaComplex &c)
oaBoolean operator!= (const oaComplex &c)
oaBoolean operator== (const oaComplex &c) const
oaBoolean operator!= (const oaComplex &c) const

Friends

class oaChecker< oaComplex< obj > >

Detailed Description

template<class obj>
class oaComplex< obj >

The oaComplex template class represents a complex number, which has real and imaginary parts.


Constructor & Destructor Documentation

template<class obj>
oaComplex< obj >::oaComplex   [inline]
 

This function constructs an oaComplex template class, setting both the real and imaginary parts to 0.0.

template<class obj>
oaComplex< obj >::oaComplex obj    realIn,
obj    imagIn
[inline]
 

This function constructs an oaComplex template class, setting the real and imaginary parts to the specified values.

Parameters:
realIn The real value to set
imagIn The imaginary value to set

template<class obj>
oaComplex< obj >::oaComplex const oaComplex< obj > &    c [inline]
 

This is the copy constructor for the oaComplex<T obj> class.

Parameters:
c oaComplex object to be copied


Member Function Documentation

template<class obj>
obj oaComplex< obj >::imag   const [inline]
 

This function returns the imaginary part of this complex number.

template<class obj>
obj & oaComplex< obj >::imag   [inline]
 

This function returns a reference to the imaginary part of this complex number.

template<class obj>
oaComplex oaComplex< obj >::operator *= const oaComplex< obj > &    c [inline]
 

This function is the multiplication operator for the oaComplex class, multiplying this complex number by the specified c complex number, setting the value of this complex number to the result, and returning a reference to the result.

template<class obj>
oaBoolean oaComplex< obj >::operator!= const oaComplex< obj > &    c const [inline]
 

This function checks if either the real or imaginary parts of this complex number are not equal to the real and imaginary parts, respectively, of the specified c complex number. If either part (or both parts) of the two complex numbers are not equal, this function returns true. Otherwise, this function returns false.

template<class obj>
oaBoolean oaComplex< obj >::operator!= const oaComplex< obj > &    c [inline]
 

template<class obj>
oaComplex oaComplex< obj >::operator+= const oaComplex< obj > &    c [inline]
 

This function is the addition operator for the oaComplex class, adding the specified c complex number to this complex number, setting the value of this complex number to the result, and returning a reference to the result.

template<class obj>
oaComplex oaComplex< obj >::operator-   const [inline]
 

This function is the unary minus for the oaComplex class, returning the negative of this complex number.

template<class obj>
oaComplex oaComplex< obj >::operator-= const oaComplex< obj > &    c [inline]
 

This function is the subtraction operator for the oaComplex class, subtracting the specified c complex number from this complex number, setting the value of this complex number to the result, and returning a reference to the result.

template<class obj>
oaComplex oaComplex< obj >::operator/= const oaComplex< obj > &    c [inline]
 

This function is the division operator for the oaComplex class, dividing this complex number by the specified c complex number, setting the value of this complex number to the result, and returning a reference to the result.

template<class obj>
oaComplex & oaComplex< obj >::operator= const oaComplex< obj > &    c [inline]
 

This function is the assignment operator that copies the specified oaComplex object and returns it. The function copies all member data so the duplicate does not rely on information from the original.

template<class obj>
oaBoolean oaComplex< obj >::operator== const oaComplex< obj > &    c const [inline]
 

This function checks if both the real and imaginary parts of this complex number are the same as the real and imaginary parts, respectively, of the specified c complex number. If both parts of the two complex numbers are equal, this function returns true. Otherwise, this function returns false.

template<class obj>
oaBoolean oaComplex< obj >::operator== const oaComplex< obj > &    c [inline]
 

template<class obj>
obj oaComplex< obj >::real   const [inline]
 

This function returns the real part of this complex number.

template<class obj>
obj & oaComplex< obj >::real   [inline]
 

This function returns a reference to the real part of this complex number.


Friends And Related Function Documentation

template<class obj>
friend class oaChecker< oaComplex< obj > > [friend]
 


The documentation for this class was generated from the following files:

Return to top of page