#include <ComplexNumber.h>
Definition at line 28 of file ComplexNumber.h.
| typedef T Complex< T, NumberTraits >::number_type |
The type of the components of the complex number in algebraic form
Definition at line 36 of file ComplexNumber.h.
| typedef Complex< T, NumberTraits > Complex< T, NumberTraits >::complex_type |
A short name for Complex< T, NumberTraits >
Definition at line 40 of file ComplexNumber.h.
| typedef NumberTraits Complex< T, NumberTraits >::traits_type |
The AlgebraicTraits type associated to our class
Definition at line 44 of file ComplexNumber.h.
| Complex< T, NumberTraits >::Complex | ( | ) | [inline] |
Default constructor
Definition at line 49 of file ComplexNumber.h.
| Complex< T, NumberTraits >::Complex | ( | const number_type | re | ) | [inline] |
Constructor from a real number.
| re | Real part of the complex number |
Definition at line 56 of file ComplexNumber.h.
| Complex< T, NumberTraits >::Complex | ( | const number_type | re, | |
| const number_type | im | |||
| ) | [inline] |
Constructor from a real and imaginary parts.
| re | Real part of the complex number | |
| im | Imaginary part of the complex number |
Definition at line 64 of file ComplexNumber.h.
| Complex< T, NumberTraits >::Complex | ( | const complex_type & | c | ) | [inline] |
| complex_type& Complex< T, NumberTraits >::operator= | ( | const complex_type & | rhs | ) | [inline] |
Assignment operator
| rhs | object to copy |
Definition at line 78 of file ComplexNumber.h.
References Complex< T, NumberTraits >::x, and Complex< T, NumberTraits >::y.
| complex_type& Complex< T, NumberTraits >::operator= | ( | const number_type & | rhs | ) | [inline] |
Assignment operator
| rhs | Real part of complex number |
Definition at line 93 of file ComplexNumber.h.
References Complex< T, NumberTraits >::x, and Complex< T, NumberTraits >::y.
| number_type Complex< T, NumberTraits >::real | ( | ) | const [inline] |
Return the real part
Definition at line 107 of file ComplexNumber.h.
References Complex< T, NumberTraits >::x.
Referenced by Complex< T, NumberTraits >::display().
Here is the caller graph for this function:

| number_type Complex< T, NumberTraits >::imag | ( | ) | const [inline] |
Return the imaginary part
Definition at line 115 of file ComplexNumber.h.
References Complex< T, NumberTraits >::y.
Referenced by Complex< T, NumberTraits >::display().
Here is the caller graph for this function:

| number_type Complex< T, NumberTraits >::norm | ( | ) | const [inline] |
Return the norm of this complex number
Definition at line 123 of file ComplexNumber.h.
References Complex< T, NumberTraits >::one(), Complex< T, NumberTraits >::x, Complex< T, NumberTraits >::y, and Complex< T, NumberTraits >::zero().
Referenced by AlgebraicTraits< Complex< T, AlgebraicTraits< T > > >::abs(), AlgebraicTraits< Complex< T, AlgebraicTraits< T > > >::norm(), Complex< T, NumberTraits >::operator<(), and Complex< T, NumberTraits >::operator>().
Here is the call graph for this function:

Here is the caller graph for this function:

| number_type Complex< T, NumberTraits >::phase | ( | ) | const [inline] |
Return the phase of this complex number
Definition at line 161 of file ComplexNumber.h.
References Complex< T, NumberTraits >::x, and Complex< T, NumberTraits >::y.
| const complex_type Complex< T, NumberTraits >::zero | ( | ) | const [inline] |
Return the complex number equal to zero
Definition at line 172 of file ComplexNumber.h.
References Complex< T, NumberTraits >::x.
Referenced by Complex< T, NumberTraits >::display(), Complex< T, NumberTraits >::norm(), and Complex< T, NumberTraits >::sqrt().
Here is the caller graph for this function:

| const complex_type Complex< T, NumberTraits >::one | ( | ) | const [inline] |
Return the complex number equal to one
Definition at line 180 of file ComplexNumber.h.
References Complex< T, NumberTraits >::x.
Referenced by Complex< T, NumberTraits >::norm(), and Complex< T, NumberTraits >::sqrt().
Here is the caller graph for this function:

| complex_type Complex< T, NumberTraits >::sqrt | ( | ) | [inline] |
Return the square root of this complex number
Definition at line 188 of file ComplexNumber.h.
References Complex< T, NumberTraits >::one(), Complex< T, NumberTraits >::x, Complex< T, NumberTraits >::y, and Complex< T, NumberTraits >::zero().
Referenced by AlgebraicTraits< Complex< T, AlgebraicTraits< T > > >::sqrt().
Here is the call graph for this function:

Here is the caller graph for this function:

| complex_type Complex< T, NumberTraits >::operator- | ( | ) | const [inline] |
Unary minus operator
Definition at line 253 of file ComplexNumber.h.
References Complex< T, NumberTraits >::x, and Complex< T, NumberTraits >::y.
| complex_type Complex< T, NumberTraits >::operator+ | ( | const complex_type & | rhs | ) | const [inline] |
Addition operator
Definition at line 260 of file ComplexNumber.h.
References Complex< T, NumberTraits >::x, and Complex< T, NumberTraits >::y.
| complex_type Complex< T, NumberTraits >::operator- | ( | const complex_type & | rhs | ) | const [inline] |
Subtraction operator
Definition at line 267 of file ComplexNumber.h.
References Complex< T, NumberTraits >::x, and Complex< T, NumberTraits >::y.
| complex_type Complex< T, NumberTraits >::operator * | ( | const complex_type & | rhs | ) | const [inline] |
Multiplication operator
Definition at line 274 of file ComplexNumber.h.
References Complex< T, NumberTraits >::x, and Complex< T, NumberTraits >::y.
| complex_type Complex< T, NumberTraits >::operator/ | ( | const complex_type & | rhs | ) | const [inline] |
Division operator
Definition at line 281 of file ComplexNumber.h.
References Complex< T, NumberTraits >::x, and Complex< T, NumberTraits >::y.
| complex_type& Complex< T, NumberTraits >::operator+= | ( | const complex_type & | rhs | ) | [inline] |
Addition assignment operator
Definition at line 306 of file ComplexNumber.h.
References Complex< T, NumberTraits >::x, and Complex< T, NumberTraits >::y.
| complex_type& Complex< T, NumberTraits >::operator-= | ( | const complex_type & | rhs | ) | [inline] |
Subtraction assignment operator
Definition at line 314 of file ComplexNumber.h.
References Complex< T, NumberTraits >::x, and Complex< T, NumberTraits >::y.
| complex_type& Complex< T, NumberTraits >::operator *= | ( | const complex_type & | rhs | ) | [inline] |
Multiplication assignment operator
Definition at line 323 of file ComplexNumber.h.
References Complex< T, NumberTraits >::x, and Complex< T, NumberTraits >::y.
| complex_type& Complex< T, NumberTraits >::operator/= | ( | const complex_type & | rhs | ) | [inline] |
Division assignment operator
Definition at line 333 of file ComplexNumber.h.
| bool Complex< T, NumberTraits >::operator== | ( | const complex_type & | rhs | ) | const [inline] |
Equality operator
Definition at line 341 of file ComplexNumber.h.
References Complex< T, NumberTraits >::x, and Complex< T, NumberTraits >::y.
| bool Complex< T, NumberTraits >::operator< | ( | const complex_type & | rhs | ) | const [inline] |
Less than operator
Definition at line 357 of file ComplexNumber.h.
References Complex< T, NumberTraits >::norm().
Here is the call graph for this function:

| complex_type& Complex< T, NumberTraits >::operator+= | ( | const number_type & | rhs | ) | [inline] |
Addition assignment operator
Definition at line 369 of file ComplexNumber.h.
References Complex< T, NumberTraits >::x.
| complex_type& Complex< T, NumberTraits >::operator-= | ( | const number_type & | rhs | ) | [inline] |
Subtraction assignment operator
Definition at line 377 of file ComplexNumber.h.
References Complex< T, NumberTraits >::x.
| complex_type& Complex< T, NumberTraits >::operator *= | ( | const number_type & | rhs | ) | [inline] |
Multiplication assignment operator
Definition at line 385 of file ComplexNumber.h.
References Complex< T, NumberTraits >::x, and Complex< T, NumberTraits >::y.
| complex_type& Complex< T, NumberTraits >::operator/= | ( | const number_type & | rhs | ) | [inline] |
Division assignment operator
Definition at line 394 of file ComplexNumber.h.
References Complex< T, NumberTraits >::x, and Complex< T, NumberTraits >::y.
| void Complex< T, NumberTraits >::display | ( | std::ostream & | os = std::cout |
) | const [inline] |
Output this number to an std::ostream
| os | std::ostream derived stream reference |
Definition at line 479 of file ComplexNumber.h.
References Complex< T, NumberTraits >::imag(), Complex< T, NumberTraits >::real(), and Complex< T, NumberTraits >::zero().
Here is the call graph for this function:

| void Complex< T, NumberTraits >::load | ( | std::istream & | is | ) | [inline] |
Load this complex number from a stream
| is | stream to load from |
Definition at line 492 of file ComplexNumber.h.
References Complex< T, NumberTraits >::x, and Complex< T, NumberTraits >::y.
| void Complex< T, NumberTraits >::save | ( | std::ostream & | os | ) | const [inline] |
Save this complex number to a stream
| os | stream to save to |
Definition at line 501 of file ComplexNumber.h.
References Complex< T, NumberTraits >::x, and Complex< T, NumberTraits >::y.
| std::ostream& operator<< | ( | std::ostream & | os, | |
| const complex_type & | number | |||
| ) | [friend] |
std::ostream insertion operator
Definition at line 239 of file ComplexNumber.h.
| std::istream& operator>> | ( | std::istream & | is, | |
| complex_type & | number | |||
| ) | [friend] |
std::istream extraction operator
Definition at line 246 of file ComplexNumber.h.
| complex_type operator+ | ( | const complex_type & | lhs, | |
| const number_type & | rhs | |||
| ) | [friend] |
Addition operator
Definition at line 402 of file ComplexNumber.h.
| complex_type operator+ | ( | const number_type & | lhs, | |
| const complex_type & | rhs | |||
| ) | [friend] |
Addition operator
Definition at line 408 of file ComplexNumber.h.
| complex_type operator- | ( | const complex_type & | lhs, | |
| const number_type & | rhs | |||
| ) | [friend] |
Subtraction operator
Definition at line 414 of file ComplexNumber.h.
| complex_type operator- | ( | const number_type & | lhs, | |
| const complex_type & | rhs | |||
| ) | [friend] |
Subtraction operator
Definition at line 420 of file ComplexNumber.h.
| complex_type operator * | ( | const complex_type & | lhs, | |
| const number_type & | rhs | |||
| ) | [friend] |
Multiplication operator
Definition at line 426 of file ComplexNumber.h.
| complex_type operator * | ( | const number_type & | lhs, | |
| const complex_type & | rhs | |||
| ) | [friend] |
Multiplication operator
Definition at line 432 of file ComplexNumber.h.
| complex_type operator/ | ( | const complex_type & | lhs, | |
| const number_type & | rhs | |||
| ) | [friend] |
Division operator
Definition at line 438 of file ComplexNumber.h.
| complex_type operator/ | ( | const number_type & | lhs, | |
| const complex_type & | rhs | |||
| ) | [friend] |
Division operator
Definition at line 444 of file ComplexNumber.h.
| bool operator== | ( | const complex_type & | lhs, | |
| const number_type & | rhs | |||
| ) | [friend] |
Equality comparison operator
Definition at line 450 of file ComplexNumber.h.
| bool operator== | ( | const number_type & | lhs, | |
| const complex_type & | rhs | |||
| ) | [friend] |
Equality comparison operator
Definition at line 457 of file ComplexNumber.h.
| number_type Complex< T, NumberTraits >::x |
the real part of the complex number
Definition at line 509 of file ComplexNumber.h.
Referenced by AlgebraicTraits< Complex< T, AlgebraicTraits< T > > >::equals(), AlgebraicTraits< Complex< T, AlgebraicTraits< T > > >::is_zero(), Complex< T, NumberTraits >::load(), Complex< T, NumberTraits >::norm(), Complex< T, NumberTraits >::one(), AlgebraicTraits< Complex< T, AlgebraicTraits< T > > >::one(), Complex< T, NumberTraits >::operator *(), Complex< T, NumberTraits >::operator *=(), Complex< T, NumberTraits >::operator!=(), Complex< T, NumberTraits >::operator+(), Complex< T, NumberTraits >::operator+=(), Complex< T, NumberTraits >::operator-(), Complex< T, NumberTraits >::operator-=(), Complex< T, NumberTraits >::operator/(), Complex< T, NumberTraits >::operator/=(), Complex< T, NumberTraits >::operator=(), Complex< T, NumberTraits >::operator==(), Complex< T, NumberTraits >::phase(), Complex< T, NumberTraits >::real(), Complex< T, NumberTraits >::save(), Complex< T, NumberTraits >::sqrt(), Complex< T, NumberTraits >::zero(), and AlgebraicTraits< Complex< T, AlgebraicTraits< T > > >::zero().
| number_type Complex< T, NumberTraits >::y |
the imaginary part of the complex number
Definition at line 511 of file ComplexNumber.h.
Referenced by AlgebraicTraits< Complex< T, AlgebraicTraits< T > > >::equals(), Complex< T, NumberTraits >::imag(), AlgebraicTraits< Complex< T, AlgebraicTraits< T > > >::is_zero(), Complex< T, NumberTraits >::load(), Complex< T, NumberTraits >::norm(), Complex< T, NumberTraits >::operator *(), Complex< T, NumberTraits >::operator *=(), Complex< T, NumberTraits >::operator!=(), Complex< T, NumberTraits >::operator+(), Complex< T, NumberTraits >::operator+=(), Complex< T, NumberTraits >::operator-(), Complex< T, NumberTraits >::operator-=(), Complex< T, NumberTraits >::operator/(), Complex< T, NumberTraits >::operator/=(), Complex< T, NumberTraits >::operator=(), Complex< T, NumberTraits >::operator==(), Complex< T, NumberTraits >::phase(), Complex< T, NumberTraits >::save(), and Complex< T, NumberTraits >::sqrt().