|
Dedekind 0.0.0
A structuralist C++23 Module Library
|

Public Types | |
| using | Domain = Complex |
| using | scalar_type = R |
| using | ScalarCarrier = R |
Public Member Functions | |
| constexpr | Complex (R re=R{}, R im=R{}) |
| constexpr R | real () const |
| constexpr R | imag () const |
Public Attributes | |
| R | first |
| R | second |
Friends | |
| constexpr bool | operator== (const Complex &, const Complex &)=default |
| constexpr Complex | operator+ (const Complex &a, const Complex &b) |
| constexpr Complex | operator- (const Complex &a, const Complex &b) |
| constexpr Complex | operator- (const Complex &a) |
| constexpr Complex | operator* (const Complex &a, const Complex &b) |
| constexpr Complex | operator* (const R &s, const Complex &a) |
| constexpr Complex | operator* (const Complex &a, const R &s) |
| constexpr Complex | operator/ (const Complex &a, const Complex &b) |
| Division via the conjugate identity: z / w = z · w̄ / |w|². | |
Division via the conjugate identity: z / w = z · w̄ / |w|².
(a + bi) / (c + di) = [(ac + bd) + (bc − ad)i] / (c² + d²).
Requires operator/ on the scalar R. Defined when |w|² ≠ 0; for the zero-division case the behaviour is inherited from R / R (e.g. Rational<Z> throws / asserts).
Lifts Complex<R> from HasRingOperators into HasFieldOperators (the a/b → S clause), which in turn lets Dual<Complex<R>> admit operator/ for holomorphic forward-mode automatic differentiation at compile time.