HILA
|
Definition of Complex types. More...
#include "plumbing/defs.h"
Go to the source code of this file.
Classes | |
class | Complex< T > |
Complex definition. More... | |
class | Imaginary_t< T > |
Imaginary type, used to represent purely imaginary numbers. More... | |
struct | hila::is_complex_or_arithmetic< T > |
hila::is_complex_or_arithmetic<T>::value More... | |
Namespaces | |
namespace | hila |
Invert diagonal + const. matrix using Sherman-Morrison formula. | |
Functions | |
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. | |
constexpr Imaginary_t< double > | I (1.0) |
Imaginary unit I - global variable. | |
template<typename T > | |
T | imag (const Complex< T > &a) |
Retrun imaginary value 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 > | |
Complex< T > | polar (T r, T arg) |
Return complex number given by polar representation. | |
template<typename T > | |
std::string | hila::prettyprint (const Complex< T > &A, int prec=8) |
Return well formatted Complex number as std::string. | |
template<typename T > | |
T | real (const Complex< T > &a) |
Return real value of Complex number. | |
template<typename T > | |
auto | squarenorm (const Complex< T > &val) |
Return Squarenorm of Complex number. | |
template<typename T > | |
std::string | hila::to_string (const Complex< T > &A, int prec=8, char separator=' ') |
Return Complex number as std::string. | |
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.
|
inline |
Return absolute value of Complex number.
Wrapper around Complex::abs
T | Arithmetic type of a |
a | Complex number to get abs from |
|
inline |
Return argument of Complex number.
Wrapper around Complex::arg
T | Arithmetic type of a |
a | Complex number to get arg from |
Return conjugate of Complex number.
Wrapper around Complex::conj
T | Arithmetic type of a |
a | Complex number to get conjugate from |
Return dagger of Complex number.
Wrapper around Complex::conj
T | Arithmetic type of a |
a | Complex number to get conjugate from |
|
constexpr |
Imaginary unit I - global variable.
Don't use #define'd I : this will conflict with some headers in rocm
For some reason it is sufficient to use only device
|
inline |
Retrun imaginary value of Complex number.
Wrapper around Complex::imag
T | Arithmetic type of a |
a | Complex number to get imaginary value from |
std::ostream & operator<< | ( | std::ostream & | strm, |
const Complex< T > & | A | ||
) |
Complex< T > polar | ( | T | r, |
T | arg | ||
) |
Return complex number given by polar representation.
Same as Complex::polar
T | Arithmetic type r and arg |
|
inline |
Return real value of Complex number.
Wrapper around Complex::real
T | Arithmetic type of a |
a | Complex number to get real value from |