Standardbibliotheks-Header <complex>
Von cppreference.com
Dieser Header ist Teil der numerischen Bibliothek.
Inhalt |
[bearbeiten] Klassen
| ein komplexer Zahlentyp (Klassentemplate) |
[bearbeiten] Funktionen
Operationen | |
| wendet unäre Operatoren auf komplexe Zahlen an (function template) | |
| führt arithmetische Operationen mit komplexen Zahlen auf zwei komplexen Werten oder einer komplexen Zahl und einem Skalar durch (function template) | |
| (in C++20 entfernt) |
vergleicht zwei komplexe Zahlen oder eine komplexe Zahl und einen Skalar (function template) |
| serialisiert und deserialisiert eine komplexe Zahl (function template) | |
| gibt den Realteil zurück (function template) | |
| gibt den Imaginärteil zurück (function template) | |
| gibt den Betrag einer komplexen Zahl zurück (function template) | |
| gibt den Phasenwinkel zurück (function template) | |
| gibt das Quadrat des Betrags zurück (function template) | |
| gibt die komplexe Konjugation zurück (function template) | |
| (C++11) |
gibt die Projektion auf die Riemann-Sphäre zurück (Funktionsschablone) |
| konstruiert eine komplexe Zahl aus Betrag und Phasenwinkel (function template) | |
Exponentialfunktionen | |
| komplexer Basis-e-Exponentialwert (function template) | |
| komplexer natürlicher Logarithmus mit dem Schnitt entlang der negativen reellen Achse (function template) | |
| komplexer gemeinsamer Logarithmus mit dem Schnitt entlang der negativen reellen Achse (function template) | |
Potenzfunktionen | |
| komplexe Potenz, ein oder beide Argumente können komplexe Zahlen sein (function template) | |
| komplexe Quadratwurzel im Bereich der rechten Halbebene (function template) | |
Trigonometrische Funktionen | |
| berechnet den Sinus einer komplexen Zahl (sin(z)) (function template) | |
| berechnet den Kosinus einer komplexen Zahl (cos(z)) (function template) | |
| berechnet den Tangens einer komplexen Zahl (tan(z)) (function template) | |
| (C++11) |
berechnet den Arkussinus einer komplexen Zahl (arcsin(z)) (function template) |
| (C++11) |
berechnet den Arkuskosinus einer komplexen Zahl (arccos(z)) (function template) |
| (C++11) |
berechnet den Arkustangens einer komplexen Zahl (arctan(z)) (function template) |
Hyperbolische Funktionen | |
| berechnet den hyperbolischen Sinus einer komplexen Zahl (sinh(z)) (function template) | |
| berechnet den hyperbolischen Kosinus einer komplexen Zahl (cosh(z)) (function template) | |
| berechnet den hyperbolischen Tangens einer komplexen Zahl (tanh(z)) (function template) | |
| (C++11) |
berechnet denArea Hyperbolicus Sinus einer komplexen Zahl (arsinh(z)) (function template) |
| (C++11) |
berechnet den Area Hyperbolicus Kosinus einer komplexen Zahl (arcosh(z)) (function template) |
| (C++11) |
berechnet den Area Hyperbolicus Tangens einer komplexen Zahl (artanh(z)) (function template) |
Literale | |
| ein std::complex Literal, das eine rein imaginäre Zahl darstellt. (function) | |
[bearbeiten] Synopsis
namespace std { template<class T> class complex; template<> class complex<float>; template<> class complex<double>; template<> class complex<long double>; // operators: template<class T> constexpr complex<T> operator+( const complex<T>&, const complex<T>&); template<class T> constexpr complex<T> operator+(const complex<T>&, const T&); template<class T> constexpr complex<T> operator+(const T&, const complex<T>&); template<class T> constexpr complex<T> operator-( const complex<T>&, const complex<T>&); template<class T> constexpr complex<T> operator-(const complex<T>&, const T&); template<class T> constexpr complex<T> operator-(const T&, const complex<T>&); template<class T> constexpr complex<T> operator*( const complex<T>&, const complex<T>&); template<class T> constexpr complex<T> operator*(const complex<T>&, const T&); template<class T> constexpr complex<T> operator*(const T&, const complex<T>&); template<class T> constexpr complex<T> operator/( const complex<T>&, const complex<T>&); template<class T> constexpr complex<T> operator/(const complex<T>&, const T&); template<class T> constexpr complex<T> operator/(const T&, const complex<T>&); template<class T> constexpr complex<T> operator+(const complex<T>&); template<class T> constexpr complex<T> operator-(const complex<T>&); template<class T> constexpr bool operator==(const complex<T>&, const complex<T>&); template<class T> constexpr bool operator==(const complex<T>&, const T&); template<class T> constexpr bool operator==(const T&, const complex<T>&); template<class T> constexpr bool operator!=(const complex<T>&, const complex<T>&); template<class T> constexpr bool operator!=(const complex<T>&, const T&); template<class T> constexpr bool operator!=(const T&, const complex<T>&); template<class T, class CharT, class Traits> basic_istream<CharT, Traits>& operator>>(basic_istream<CharT, Traits>&, complex<T>&); template<class T, class CharT, class Traits> basic_ostream<CharT, Traits>& operator<<(basic_ostream<CharT, Traits>&, const complex<T>&); // values: template<class T> constexpr T real(const complex<T>&); template<class T> constexpr T imag(const complex<T>&); template<class T> T abs(const complex<T>&); template<class T> T arg(const complex<T>&); template<class T> constexpr T norm(const complex<T>&); template<class T> constexpr complex<T> conj(const complex<T>&); template<class T> complex<T> proj(const complex<T>&); template<class T> complex<T> polar(const T&, const T& = 0); // transcendentals: template<class T> complex<T> acos(const complex<T>&); template<class T> complex<T> asin(const complex<T>&); template<class T> complex<T> atan(const complex<T>&); template<class T> complex<T> acosh(const complex<T>&); template<class T> complex<T> asinh(const complex<T>&); template<class T> complex<T> atanh(const complex<T>&); template<class T> complex<T> cos (const complex<T>&); template<class T> complex<T> cosh (const complex<T>&); template<class T> complex<T> exp (const complex<T>&); template<class T> complex<T> log (const complex<T>&); template<class T> complex<T> log10(const complex<T>&); template<class T> complex<T> pow(const complex<T>&, const T&); template<class T> complex<T> pow(const complex<T>&, const complex<T>&); template<class T> complex<T> pow(const T&, const complex<T>&); template<class T> complex<T> sin (const complex<T>&); template<class T> complex<T> sinh(const complex<T>&); template<class T> complex<T> sqrt(const complex<T>&); template<class T> complex<T> tan (const complex<T>&); template<class T> complex<T> tanh(const complex<T>&); // tuple interface: template<class T> struct tuple_size; template<size_t I, class T> struct tuple_element; template<class T> struct tuple_size<complex<T>>; template<size_t I, class T> struct tuple_element<I, complex<T>>; template<size_t I, class T> constexpr T& get(complex<T>&) noexcept; template<size_t I, class T> constexpr T&& get(complex<T>&&) noexcept; template<size_t I, class T> constexpr const T& get(const complex<T>&) noexcept; template<size_t I, class T> constexpr const T&& get(const complex<T>&&) noexcept; // complex literals: inline namespace literals { inline namespace complex_literals { constexpr complex<long double> operator""il(long double); constexpr complex<long double> operator""il(unsigned long long); constexpr complex<double> operator""i(long double); constexpr complex<double> operator""i(unsigned long long); constexpr complex<float> operator""if(long double); constexpr complex<float> operator""if(unsigned long long); } } }
[bearbeiten] Klasse std::complex
template<class T> class complex { public: typedef T value_type; constexpr complex(const T& re = T(), const T& im = T()); constexpr complex(const complex&) = default; template<class X> constexpr explicit(/* see constructor page */) complex(const complex<X>&); constexpr T real() const; constexpr void real(T); constexpr T imag() const; constexpr void imag(T); constexpr complex<T>& operator= (const T&); constexpr complex<T>& operator+=(const T&); constexpr complex<T>& operator-=(const T&); constexpr complex<T>& operator*=(const T&); constexpr complex<T>& operator/=(const T&); constexpr complex& operator=(const complex&); template<class X> constexpr complex<T>& operator= (const complex<X>&); template<class X> constexpr complex<T>& operator+=(const complex<X>&); template<class X> constexpr complex<T>& operator-=(const complex<X>&); template<class X> constexpr complex<T>& operator*=(const complex<X>&); template<class X> constexpr complex<T>& operator/=(const complex<X>&); };
[bearbeiten] Fehlerberichte
Die folgenden Verhaltensändernden Fehlerberichte wurden rückwirkend auf zuvor veröffentlichte C++-Standards angewendet.
| DR | angewendet auf | Verhalten wie veröffentlicht | Korrigiertes Verhalten |
|---|---|---|---|
| LWG 79 | C++98 | das Standardargument des zweiten Parameters von polar fehlte in der Synopsis |
hinzugefügt |