Template Struct Complex

Struct Documentation

template<typename T>
struct Complex

analog of std::complex<Real> for non-real numeric rings

Public Types

using value_type = T

Public Functions

constexpr Complex() = delete
template<typename A, typename B = A, typename = std::enable_if_t<std::is_arithmetic_v<A> && std::is_constructible_v<T, A> && std::is_arithmetic_v<B> && std::is_constructible_v<T, B>>>
inline constexpr Complex(A real, B imag = 0)
inline constexpr Complex(T real, T imag = 0)
constexpr Complex(const Complex&) = default
constexpr Complex(Complex&&) = default
constexpr Complex &operator=(const Complex&) = default
constexpr Complex &operator=(Complex&&) = default
inline constexpr const T &real() const
inline constexpr const T &imag() const
inline constexpr bool is_zero() const
inline constexpr bool is_identity() const
inline std::wstring to_latex() const
inline std::wstring to_wolfram() const
inline std::size_t hash_value() const
inline constexpr Complex &operator+=(const T &scalar)
inline constexpr Complex &operator-=(const T &scalar)
inline constexpr Complex &operator*=(const T &scalar)
template<class X>
inline constexpr Complex &operator+=(const Complex<X> &other)
template<class X>
inline constexpr Complex &operator-=(const Complex<X> &other)
template<class X>
inline constexpr Complex &operator*=(const Complex<X> &other)

Public Members

T re = {}
T im = {}