Skip to content

shz::complex

Markdown

C++ wrapper around a floating-point complex number, real/imaginary pair.

  • Header: #include <sh4zam/shz_complex.hpp> (source)
  • C type: shz_complex_t (layout-compatible; the C API accepts it directly)
  • Bases: shz_complex_t
complex() noexcept=default
complex(const complex &rhs) noexcept=default
complex(float re, float im=0.0f) noexcept
complex(const shz_complex_t &cplx) noexcept
complex(const volatile shz_complex_t &cplx) noexcept

Default constructor.

complex & operator+=(const complex &rhs) noexcept

Adds and accumulates rhs onto the given complex number.

Calls: shz_caddf()

complex & operator-=(const complex &rhs) noexcept

Subtracts rhs from the given complex number, assigning it to the result.

Calls: shz_csubf()

complex & operator*=(const complex &rhs) noexcept
complex & operator*=(float scale) noexcept

Multiplies and accumulates rhs by the given complex number.

Calls: shz_cmulf(), shz_cscalef()

complex & operator/=(const complex &rhs) noexcept

Divides the given complex number by rhs, assigning it to the result.

Calls: shz_cdivf()

float shz_complex_t::imag

The imaginary portion of the complex number.

Inherited from shz::vecN.

float shz_complex_t::real

The real portion of the complex number.

Inherited from shz::vecN.