|
template<typename T > |
T | real (const Complex< T > &a) |
| Return real value of Complex number.
|
|
template<typename T > |
T | imag (const Complex< T > &a) |
| Retrun imaginary value of Complex number.
|
|
template<typename T > |
Complex< T > | polar (T r, T arg) |
| Return complex number given by polar representation.
|
|
template<typename T1 , typename T2 , typename Tr = hila::type_plus<T1, T2>> |
Complex< Tr > | operator+ (const Complex< T1 > &a, const Complex< T2 > &b) |
| Addition operator Complex + Complex.
|
|
template<typename T , typename A , std::enable_if_t< hila::is_arithmetic< A >::value, int > = 0> |
auto | operator+ (const Complex< T > &c, const A &a) |
| Addition operator Complex + Scalar.
|
|
template<typename T , typename A , std::enable_if_t< hila::is_arithmetic< A >::value, int > = 0> |
auto | operator+ (const A &a, const Complex< T > &c) |
| Addition operator Scalar + Complex.
|
|
template<typename T1 , typename T2 , typename Tr = hila::type_plus<T1, T2>> |
Complex< Tr > | operator- (const Complex< T1 > &a, const Complex< T2 > &b) |
| Subtraction operator Complex - Complex.
|
|
template<typename T , typename A , std::enable_if_t< hila::is_arithmetic< A >::value, int > = 0> |
auto | operator- (const Complex< T > &c, const A &a) |
| Subtraction operator Complex - Scalar.
|
|
template<typename T , typename A , std::enable_if_t< hila::is_arithmetic< A >::value, int > = 0> |
auto | operator- (const A &a, const Complex< T > &c) |
| Subtraction operator Scalar - Complex.
|
|
template<typename T1 , typename T2 , typename Tr = hila::type_mul<T1, T2>> |
Complex< Tr > | operator* (const Complex< T1 > &a, const Complex< T2 > &b) |
| Multiplication operator Complex * Complex.
|
|
template<typename T , typename A , std::enable_if_t< hila::is_arithmetic< A >::value, int > = 0> |
auto | operator* (const Complex< T > &c, const A &a) |
| Multiplication operator Complex * Scalar This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
|
template<typename T , typename A , std::enable_if_t< hila::is_arithmetic< A >::value, int > = 0> |
auto | operator* (const A &a, const Complex< T > &c) |
| Multiplication operator Scalar * Complex This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
|
template<typename T1 , typename T2 , typename Tr = hila::type_mul<T1, T2>> |
Complex< Tr > | operator/ (const Complex< T1 > &a, const Complex< T2 > &b) |
| Division operator Complex / Complex.
|
|
template<typename T , typename A , std::enable_if_t< hila::is_arithmetic< A >::value, int > = 0> |
auto | operator/ (const Complex< T > &c, const A &a) |
| Division operator Complex / Scalar.
|
|
template<typename T , typename A , std::enable_if_t< hila::is_arithmetic< A >::value, int > = 0> |
auto | operator/ (const A &a, const Complex< T > &c) |
| Division operator Scalar / Complex.
|
|
template<typename T > |
Complex< T > | mul_add (const Complex< T > &a, const Complex< T > &b, const Complex< T > &c) |
| Multiply add with Complex numbers.
|
|
template<typename A , typename B > |
bool | operator== (const Complex< A > &a, const Complex< B > &b) |
| Compare equality of two complex numbers.
|
|
template<typename A , typename B , std::enable_if_t< hila::is_arithmetic< B >::value, int > = 0> |
bool | operator== (const Complex< A > &a, const B b) |
| Compare equality of Complex and scalar.
|
|
template<typename A , typename B , std::enable_if_t< hila::is_arithmetic< A >::value, int > = 0> |
bool | operator== (const A a, const Complex< B > &b) |
| Compare equality of Scalar and Complex.
|
|
template<typename A , typename B > |
bool | operator!= (const Complex< A > &a, const Complex< B > &b) |
| Compare non-equality of two complex numbers.
|
|
template<typename A , typename B , std::enable_if_t< hila::is_arithmetic< B >::value, int > = 0> |
bool | operator!= (const Complex< A > &a, const B b) |
| Compare non-equality of Complex number and Scalar.
|
|
template<typename A , typename B , std::enable_if_t< hila::is_arithmetic< A >::value, int > = 0> |
bool | operator!= (const A a, const Complex< B > &b) |
| Compare non-equality of Scalar and Complex number.
|
|
template<typename T > |
T | abs (const Complex< T > &a) |
| Return absolute value of Complex number.
|
|
template<typename T > |
T | arg (const Complex< T > &a) |
| Return argument of Complex number.
|
|
template<typename T > |
Complex< T > | conj (const Complex< T > &val) |
| Return conjugate of Complex number.
|
|
template<typename T > |
Complex< T > | dagger (const Complex< T > &val) |
| Return dagger of Complex number.
|
|
template<typename T > |
auto | squarenorm (const Complex< T > &val) |
| Return Squarenorm of Complex number.
|
|
template<typename T > |
std::ostream & | operator<< (std::ostream &strm, const Complex< T > &A) |
| Print a complex value as (re,im)
|
|
template<typename T > |
std::string | hila::to_string (const Complex< T > &A, int prec=8, char separator=' ') |
| Return Complex number as std::string.
|
|
template<typename T > |
std::string | hila::prettyprint (const Complex< T > &A, int prec=8) |
| Return well formatted Complex number as std::string.
|
|
constexpr Imaginary_t< double > | I (1.0) |
| Imaginary unit I - global variable.
|
|
template<typename T > |
Complex< T > | exp (const Complex< T > z) |
| \(\exp(z)\)
|
|
template<typename T , std::enable_if_t< hila::is_arithmetic< T >::value, int > = 0> |
Complex< T > | expi (T a) |
| \(\exp(i\cdot x)\)
|
|
template<typename T > |
Complex< T > | log (Complex< T > z) |
| \(\log{z}\)
|
|
template<typename T > |
Complex< T > | sqrt (Complex< T > z) |
| \(\sqrt{z}\)
|
|
template<typename T > |
Complex< T > | cbrt (Complex< T > z) |
| \(\sqrt[3]{z}\)
|
|
template<typename A , typename B > |
auto | pow (Complex< A > z, Complex< B > p) |
| pow(z.p) = \(z^p\) = \(exp(p*log(z))\)
|
|
template<typename T > |
Complex< T > | sin (Complex< T > z) |
|
template<typename T > |
Complex< T > | cos (Complex< T > z) |
|
template<typename T > |
Complex< T > | tan (Complex< T > z) |
| \(\tan(z) = \frac{\sin(z)}{\cos(z)}\) - rely on optimizer to simplify
|
|
template<typename T > |
Complex< T > | sinh (Complex< T > z) |
|
template<typename T > |
Complex< T > | cosh (Complex< T > z) |
|
template<typename T > |
Complex< T > | tanh (Complex< T > z) |
| \(\tanh(z)\)
|
|
template<typename T > |
Complex< T > | atan (Complex< T > z) |
| \(\arctan(z)\)
|
|
template<typename T > |
Complex< T > | asin (Complex< T > z) |
| \(\arcsin(z)\)
|
|
template<typename T > |
Complex< T > | acos (Complex< T > z) |
| \(\arccos(z)\)
|
|
template<typename T > |
Complex< T > | atanh (Complex< T > z) |
| \(\text{artanh}(z)\)
|
|
template<typename T > |
Complex< T > | asinh (Complex< T > z) |
| \(\text{arsinh}(z)\)
|
|
template<typename T > |
Complex< T > | acosh (Complex< T > z) |
| \(\text{arcosh}(z)\)
|
|
constexpr Imaginary_t< double > | operator""_i (long double a) |
|
Definition of Complex types.
This file contains definitions and methods for Complex numbers and Imaginary type.
NOTE: All overloads for operators +,-,/,* are not documented separately since there exists a function for each combinations of scalar,imaginary and complex number representations. All versions are documented in the Complex – Complex definitions.
Definition in file cmplx.h.