# std::complex< Type > Struct Template Reference

List of all members.

## Public Types
typedef Type | value_type
| Value typedef.
## Public Member Functions
| complex (const Type &=Type(), const Type &=Type())
| Default constructor. First parameter is x, second parameter is y. Unspecified parameters default to 0.
template<typename Up> | complex (const complex< Up > &)
| Copy constructor.
Type & | real ()
| Return real part of complex number.
const Type & | real () const
| Return real part of complex number.
Type & | imag ()
| Return imaginary part of complex number.
const Type & | imag () const
| Return imaginary part of complex number.
complex< Type > & | operator= (const Type &)
| Assign this complex number to scalar t.
complex< Type > & | operator+= (const Type &)
| Add t to this complex number.
complex< Type > & | operator-= (const Type &)
| Subtract t from this complex number.
complex< Type > & | operator *= (const Type &)
| Multiply this complex number by t.
complex< Type > & | operator/= (const Type &)
| Divide this complex number by t.
template<typename Up> complex< Type > & | operator= (const complex< Up > &)
| Assign this complex number to complex z.
template<typename Up> complex< Type > & | operator+= (const complex< Up > &)
| Add z to this complex number.
template<typename Up> complex< Type > & | operator-= (const complex< Up > &)
| Subtract z from this complex number.
template<typename Up> complex< Type > & | operator *= (const complex< Up > &)
| Multiply this complex number by z.
template<typename Up> complex< Type > & | operator/= (const complex< Up > &)
| Divide this complex number by z.

## Detailed Description

### template<typename Type>
struct std::complex< Type >

Template to represent complex numbers.

Specializations for float, double, and long double are part of the library. Results with any other type are not guaranteed.

Parameters:

  | Tp | Type of real and imaginary values.

Definition at line 116 of file complex.

## Member Typedef Documentation

template<typename Type>
typedef Type std::complex< Type >::value_type

| Value typedef. Definition at line 119 of file complex.

## Constructor & Destructor Documentation

template<typename Type>
std::complex< Type >::complex | ( | const Type & | = `Type()`,
|  | const Type & | = `Type()`
| ) | `[inline]`

| Default constructor. First parameter is x, second parameter is y. Unspecified parameters default to 0. Definition at line 195 of file complex.

template<typename Type>
template<typename Up>
std::complex< Type >::complex | ( | const complex< Up > & |  | ) | `[inline]`

| Copy constructor. Definition at line 201 of file complex.

## Member Function Documentation

template<typename Type>
const Type & std::complex< Type >::imag | ( |  | ) | const`[inline]`

| Return imaginary part of complex number. Definition at line 191 of file complex.

template<typename Type>
Type & std::complex< Type >::imag | ( |  | ) | `[inline]`

| Return imaginary part of complex number. Definition at line 187 of file complex. Referenced by std::conj(), std::complex< Type >::operator *=(), std::operator!=(), std::complex< Type >::operator+=(), std::operator-(), std::complex< Type >::operator-=(), std::complex< Type >::operator/=(), std::complex< Type >::operator=(), std::operator==(), and std::pow().

template<typename Type>
template<typename Up>
complex< Type > & std::complex< Type >::operator *= | ( | const complex< Up > & |  | ) |

| Multiply this complex number by z. Definition at line 288 of file complex. References std::complex< Type >::imag(), and std::complex< Type >::real().

template<typename Type>
complex< Type > & std::complex< Type >::operator *= | ( | const Type & |  | ) |

| Multiply this complex number by t. Definition at line 234 of file complex.

template<typename Type>
template<typename Up>
complex< Type > & std::complex< Type >::operator+= | ( | const complex< Up > & |  | ) |

| Add z to this complex number. Definition at line 265 of file complex. References std::complex< Type >::imag(), and std::complex< Type >::real().

template<typename Type>
complex< Type > & std::complex< Type >::operator+= | ( | const Type & |  | ) | `[inline]`

| Add t to this complex number. Definition at line 216 of file complex.

template<typename Type>
template<typename Up>
complex< Type > & std::complex< Type >::operator-= | ( | const complex< Up > & |  | ) |

| Subtract z from this complex number. Definition at line 276 of file complex. References std::complex< Type >::imag(), and std::complex< Type >::real().

template<typename Type>
complex< Type > & std::complex< Type >::operator-= | ( | const Type & |  | ) | `[inline]`

| Subtract t from this complex number. Definition at line 225 of file complex.

template<typename Type>
template<typename Up>
complex< Type > & std::complex< Type >::operator/= | ( | const complex< Up > & |  | ) |

| Divide this complex number by z. Definition at line 301 of file complex. References std::complex< Type >::imag(), std::norm(), and std::complex< Type >::real().

template<typename Type>
complex< Type > & std::complex< Type >::operator/= | ( | const Type & |  | ) |

| Divide this complex number by t. Definition at line 244 of file complex.

template<typename Type>
template<typename Up>
complex< Type > & std::complex< Type >::operator= | ( | const complex< Up > & |  | ) |

| Assign this complex number to complex z. Definition at line 254 of file complex. References std::complex< Type >::imag(), and std::complex< Type >::real().

template<typename Type>
complex< Type > & std::complex< Type >::operator= | ( | const Type & |  | ) |

| Assign this complex number to scalar t. Definition at line 206 of file complex.

template<typename Type>
const Type & std::complex< Type >::real | ( |  | ) | const`[inline]`

| Return real part of complex number. Definition at line 183 of file complex.

template<typename Type>
Type & std::complex< Type >::real | ( |  | ) | `[inline]`

| Return real part of complex number. Definition at line 179 of file complex. Referenced by std::conj(), std::complex< Type >::operator *=(), std::operator!=(), std::operator+(), std::complex< Type >::operator+=(), std::operator-(), std::complex< Type >::operator-=(), std::complex< Type >::operator/=(), std::complex< Type >::operator=(), std::operator==(), and std::pow().

The documentation for this struct was generated from the following file:

- complex