|
Expression Templates Library (ETL)
|
Complex number implementation. More...
#include <complex.hpp>

Public Types | |
| using | value_type = T |
| The value type. | |
Public Member Functions | |
| constexpr | complex (const T &re=T(), const T &im=T()) |
| Construct a complex number. More... | |
| constexpr | complex (const complex &rhs)=default |
| Construct a complex number by copy. More... | |
| template<typename X > | |
| constexpr | complex (const complex< X > &rhs) |
| Construct a complex number by copy from another complex with different inner type. More... | |
| complex & | operator= (const T &rhs) noexcept |
| Assign a real part to the complex number. More... | |
| complex & | operator= (const complex &rhs) noexcept=default |
| Assign a complex number by copy. More... | |
| complex & | operator= (const std::complex< T > &rhs) noexcept |
| Assign a complex number by copy. More... | |
| template<typename X > | |
| complex & | operator+= (const complex< X > &rhs) |
| Adds a complex number. More... | |
| template<typename X > | |
| complex & | operator-= (const complex< X > &rhs) |
| Subtracts a complex number. More... | |
| template<typename X > | |
| complex & | operator*= (const complex< X > &rhs) |
| Multipliies a complex number. More... | |
| template<typename X > | |
| complex & | operator/= (const complex< X > &rhs) |
| Divides a complex number. More... | |
Public Attributes | |
| value_type | real |
| The real part. | |
| value_type | imag |
| The imaginary part. | |
Complex number implementation.
This implementation is binary-compatible with std::complex. This implementation is not opaque like std::complex and its operation can be inlined.
|
inline |
Construct a complex number.
| re | The real part |
| im | The imaginary part |
|
default |
Construct a complex number by copy.
| rhs | The complex to copy from |
|
inline |
Construct a complex number by copy from another complex with different inner type.
| rhs | The complex to copy from |
|
inline |
Multipliies a complex number.
| rhs | The complex number to add |
|
inline |
Adds a complex number.
| rhs | The complex number to add |
|
inline |
Subtracts a complex number.
| rhs | The complex number to add |
|
inline |
Divides a complex number.
| rhs | The complex number to add |
|
inlinenoexcept |
Assign a real part to the complex number.
| rhs | The real part |
|
defaultnoexcept |
Assign a complex number by copy.
| rhs | The complex number to copy |
|
inlinenoexcept |
Assign a complex number by copy.
| rhs | The complex number to copy |
1.8.13