|
consteig
Compile-time eigenvalue and eigenvector computation for C++17
|
Constexpr complex number type. More...
#include <complex.hpp>
Public Member Functions | |
| constexpr | Complex (T r=0, T i=0) |
| Construct from real and imaginary parts (default: 0 + 0i). | |
| constexpr Complex | operator+ (const Complex &other) const |
| Complex addition. | |
| constexpr Complex & | operator+= (const Complex &other) |
| Complex addition in-place. | |
| constexpr Complex | operator- (const Complex &other) const |
| Complex subtraction. | |
| constexpr Complex | operator* (const Complex &other) const |
| Complex multiplication: (a+bi)(c+di) = (ac-bd) + (ad+bc)i. | |
| constexpr Complex | operator/ (const Complex &other) const |
Complex division: divides by |other|^2. | |
| constexpr bool | operator== (const Complex &other) const |
| Exact equality (no tolerance). Prefer equalWithin for floats. | |
| constexpr bool | operator!= (const Complex &other) const |
| Inequality. | |
Public Attributes | |
| T | real |
| Real part. | |
| T | imag |
| Imaginary part. | |
Constexpr complex number type.
A lightweight complex number with no dependency on <complex>. All arithmetic operators and utility functions are constexpr, making it suitable for compile-time computation. Returned by eigenvalues and eigenvectors for complex eigenvalue pairs.
| T | Floating-point scalar type for the real and imaginary parts. |