Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
complex< T > Struct Template Reference

Complex numbers. More...

#include <complex.h>

Inherits array< T, 2 >.

Public Types

using base_type = array< T, 2 >
 

Public Member Functions

template<typename U >
requires std::constructible_from<T, U>
complexoperator= (U &&r)
 Specialized assignment operator.
 
Constructors
template<typename U = T>
requires std::constructible_from<T,U>
constexpr complex (const T &r=0, const U &i=0)
 
template<typename U >
requires std::constructible_from<T,U>
constexpr complex (const array< U, 2 > &src)
 
template<typename U >
requires std::constructible_from<T, U>
constexpr complex (const std::complex< U > &src)
 

Conversion to std::complex (with optimal float or double type based on T) – not on 'U'!

constexpr auto std_complex (void) const -> decltype(std::complex(std::declval< T >(), std::declval< T >()))
 
template<typename U >
static constexpr auto std_complex (complex< U > u) -> decltype(std::complex(std::declval< T >(), std::declval< T >()))
 

Addition

constexpr complex operator+ (T u) const
 
template<typename U >
constexpr complex operator+ (complex< U > u) const
 
template<typename U >
constexpr complexoperator+= (U u)
 
constexpr complex operator+ (T u, complex &t)
 

Subtraction

constexpr complex operator- (T u) const
 
template<typename U >
constexpr complex operator- (complex< U > u) const
 
template<typename U >
constexpr complexoperator-= (U u)
 
constexpr complex operator- (T u, complex &t)
 

Multiplication

constexpr complex operator* (T u) const
 
template<typename U >
constexpr complex operator* (complex< U > u) const
 
template<typename U >
constexpr complexoperator*= (U u)
 
constexpr complex operator* (T u, complex &t)
 

Division

constexpr complex operator/ (T u) const
 
template<typename U >
constexpr complex operator/ (complex< U > u) const
 
template<typename U >
constexpr complexoperator/= (U u)
 
constexpr complex operator/ (T u, complex &t)
 

Detailed Description

template<typename T>
struct backbone::complex< T >

Complex numbers.

Member Typedef Documentation

◆ base_type

using base_type = array<T,2>

Constructor & Destructor Documentation

◆ complex() [1/3]

constexpr complex ( const T &  r = 0,
const U &  i = 0 
)
inlineconstexpr

◆ complex() [2/3]

constexpr complex ( const array< U, 2 > &  src)
inlineconstexpr

◆ complex() [3/3]

constexpr complex ( const std::complex< U > &  src)
inlineconstexpr

Member Function Documentation

◆ operator*() [1/2]

constexpr complex operator* ( complex< U >  u) const
inlineconstexpr

◆ operator*() [2/2]

constexpr complex operator* ( u) const
inlineconstexpr

◆ operator*=()

constexpr complex & operator*= ( u)
inlineconstexpr

◆ operator+() [1/2]

constexpr complex operator+ ( complex< U >  u) const
inlineconstexpr

◆ operator+() [2/2]

constexpr complex operator+ ( u) const
inlineconstexpr

◆ operator+=()

constexpr complex & operator+= ( u)
inlineconstexpr

◆ operator-() [1/2]

constexpr complex operator- ( complex< U >  u) const
inlineconstexpr

◆ operator-() [2/2]

constexpr complex operator- ( u) const
inlineconstexpr

◆ operator-=()

constexpr complex & operator-= ( u)
inlineconstexpr

◆ operator/() [1/2]

constexpr complex operator/ ( complex< U >  u) const
inlineconstexpr

◆ operator/() [2/2]

constexpr complex operator/ ( u) const
inlineconstexpr

◆ operator/=()

constexpr complex & operator/= ( u)
inlineconstexpr

◆ operator=()

complex & operator= ( U &&  r)
inline

Specialized assignment operator.

◆ std_complex() [1/2]

static constexpr auto std_complex ( complex< U >  u) -> decltype(std::complex(std::declval<T>(), std::declval<T>()))
inlinestaticconstexpr

◆ std_complex() [2/2]

constexpr auto std_complex ( void  ) const -> decltype(std::complex(std::declval<T>(), std::declval<T>()))
inlineconstexpr

Friends And Related Function Documentation

◆ operator*

constexpr complex operator* ( u,
complex< T > &  t 
)
friend

◆ operator+

constexpr complex operator+ ( u,
complex< T > &  t 
)
friend

◆ operator-

constexpr complex operator- ( u,
complex< T > &  t 
)
friend

◆ operator/

constexpr complex operator/ ( u,
complex< T > &  t 
)
friend

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