2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
26
27
28
29
30
31
34
35
36
38#define SHZ_CMPLXF(x, y) shz_cinitf(x, y)
56
57
58
61SHZ_INLINE shz_complex_t
shz_cinitf(
float real,
float imag) SHZ_NOEXCEPT;
64SHZ_INLINE shz_complex_t
shz_cpolarf(
float r,
float theta) SHZ_NOEXCEPT;
67SHZ_INLINE
bool shz_cequalf(shz_complex_t lhs, shz_complex_t rhs) SHZ_NOEXCEPT;
70SHZ_INLINE
float shz_crealf(shz_complex_t c) SHZ_NOEXCEPT;
73SHZ_INLINE
float shz_cimagf(shz_complex_t c) SHZ_NOEXCEPT;
78
79
80
83SHZ_INLINE shz_complex_t
shz_caddf(shz_complex_t lhs, shz_complex_t rhs) SHZ_NOEXCEPT;
86SHZ_INLINE shz_complex_t
shz_csubf(shz_complex_t lhs, shz_complex_t rhs) SHZ_NOEXCEPT;
89SHZ_INLINE shz_complex_t
shz_cmulf(shz_complex_t lhs, shz_complex_t rhs) SHZ_NOEXCEPT;
92SHZ_INLINE shz_complex_t
shz_cdivf(shz_complex_t lhs, shz_complex_t rhs) SHZ_NOEXCEPT;
95SHZ_INLINE shz_complex_t
shz_cscalef(shz_complex_t c,
float v) SHZ_NOEXCEPT;
98SHZ_INLINE shz_complex_t
shz_crecipf(shz_complex_t c) SHZ_NOEXCEPT;
103
104
105
108SHZ_INLINE
float shz_cabsf(shz_complex_t c) SHZ_NOEXCEPT;
117SHZ_INLINE
float shz_cargf(shz_complex_t c) SHZ_NOEXCEPT;
120SHZ_INLINE shz_complex_t
shz_conjf(shz_complex_t c) SHZ_NOEXCEPT;
123SHZ_INLINE shz_complex_t
shz_cprojf(shz_complex_t c) SHZ_NOEXCEPT;
128
129
130
133SHZ_INLINE shz_complex_t
shz_csqrtf(shz_complex_t c) SHZ_NOEXCEPT;
136SHZ_INLINE shz_complex_t
shz_cpowf(shz_complex_t base, shz_complex_t exp) SHZ_NOEXCEPT;
139SHZ_INLINE shz_complex_t
shz_cexpf(shz_complex_t c) SHZ_NOEXCEPT;
142SHZ_INLINE shz_complex_t
shz_clogf(shz_complex_t c) SHZ_NOEXCEPT;
145SHZ_INLINE shz_complex_t
shz_clog10f(shz_complex_t c) SHZ_NOEXCEPT;
150
151
152
155SHZ_INLINE shz_complex_t
shz_csinf(shz_complex_t c) SHZ_NOEXCEPT;
158SHZ_INLINE shz_complex_t
shz_ccosf(shz_complex_t c) SHZ_NOEXCEPT;
161SHZ_INLINE shz_complex_t
shz_ctanf(shz_complex_t c) SHZ_NOEXCEPT;
164SHZ_INLINE shz_complex_t
shz_ccscf(shz_complex_t c) SHZ_NOEXCEPT;
167SHZ_INLINE shz_complex_t
shz_csecf(shz_complex_t c) SHZ_NOEXCEPT;
170SHZ_INLINE shz_complex_t
shz_ccotf(shz_complex_t c) SHZ_NOEXCEPT;
173SHZ_INLINE shz_complex_t
shz_casinf(shz_complex_t c) SHZ_NOEXCEPT;
176SHZ_INLINE shz_complex_t
shz_cacosf(shz_complex_t c) SHZ_NOEXCEPT;
179SHZ_INLINE shz_complex_t
shz_catanf(shz_complex_t c) SHZ_NOEXCEPT;
182SHZ_INLINE shz_complex_t
shz_cacscf(shz_complex_t c) SHZ_NOEXCEPT;
185SHZ_INLINE shz_complex_t
shz_casecf(shz_complex_t c) SHZ_NOEXCEPT;
188SHZ_INLINE shz_complex_t
shz_cacotf(shz_complex_t c) SHZ_NOEXCEPT;
193
194
195
198SHZ_INLINE shz_complex_t
shz_csinhf(shz_complex_t c) SHZ_NOEXCEPT;
201SHZ_INLINE shz_complex_t
shz_ccoshf(shz_complex_t c) SHZ_NOEXCEPT;
204SHZ_INLINE shz_complex_t
shz_ctanhf(shz_complex_t c) SHZ_NOEXCEPT;
207SHZ_INLINE shz_complex_t
shz_ccschf(shz_complex_t c) SHZ_NOEXCEPT;
210SHZ_INLINE shz_complex_t
shz_csechf(shz_complex_t c) SHZ_NOEXCEPT;
213SHZ_INLINE shz_complex_t
shz_ccothf(shz_complex_t c) SHZ_NOEXCEPT;
216SHZ_INLINE shz_complex_t
shz_casinhf(shz_complex_t c) SHZ_NOEXCEPT;
219SHZ_INLINE shz_complex_t
shz_cacoshf(shz_complex_t c) SHZ_NOEXCEPT;
222SHZ_INLINE shz_complex_t
shz_catanhf(shz_complex_t c) SHZ_NOEXCEPT;
225SHZ_INLINE shz_complex_t
shz_cacschf(shz_complex_t c) SHZ_NOEXCEPT;
228SHZ_INLINE shz_complex_t
shz_casechf(shz_complex_t c) SHZ_NOEXCEPT;
231SHZ_INLINE shz_complex_t
shz_cacothf(shz_complex_t c) SHZ_NOEXCEPT;
236
237
238
241
242
243
244
245
246
247
248
249
250
251
252
253
254void shz_fft(shz_complex_t* s, size_t size) SHZ_NOEXCEPT;
258#include "inline/shz_complex.inl.h"
float shz_inv_cabsf(shz_complex_t c) SHZ_NOEXCEPT
Returns the inverse of the absolute value (or inverse of the magnitude) of the complex number,...
shz_complex_t shz_cacoshf(shz_complex_t c) SHZ_NOEXCEPT
Calculates and returns the complex hyperbolic arccosine of c.
#define SHZ_CMPLXF(x, y)
Initializes a complex number.
shz_complex_t shz_ccotf(shz_complex_t c) SHZ_NOEXCEPT
Calculates and returns the complex cotangent of c.
shz_complex_t shz_cmulf(shz_complex_t lhs, shz_complex_t rhs) SHZ_NOEXCEPT
Multiplies two complex numbers together, returning the complex result.
void shz_fft(shz_complex_t *s, size_t size) SHZ_NOEXCEPT
Fast Fourier Transform.
float shz_cimagf(shz_complex_t c) SHZ_NOEXCEPT
Returns the imaginary component of a complex number.
shz_complex_t shz_catanf(shz_complex_t c) SHZ_NOEXCEPT
Calculates and returns the complex arctangent of c.
shz_complex_t shz_casinf(shz_complex_t c) SHZ_NOEXCEPT
Calculates and returns the complex arcsine of c.
shz_complex_t shz_csinf(shz_complex_t c) SHZ_NOEXCEPT
Calculates and returns the complex sine of c.
shz_complex_t shz_csechf(shz_complex_t c) SHZ_NOEXCEPT
Calculates and returns the complex hyperbolic secant of c.
shz_complex_t shz_ccschf(shz_complex_t c) SHZ_NOEXCEPT
Calculates and returns the complex hyperbolic cosecant of c.
shz_complex_t shz_crecipf(shz_complex_t c) SHZ_NOEXCEPT
Returns the multiplicative inverse or reciprocal of the complex number, c.
float shz_cabsf(shz_complex_t c) SHZ_NOEXCEPT
Returns the absolute value (or magnitude) of the complex number, c.
shz_complex_t shz_cacothf(shz_complex_t c) SHZ_NOEXCEPT
Calculates and returns the complex hyperbolic arccotangent of c.
shz_complex_t shz_ctanf(shz_complex_t c) SHZ_NOEXCEPT
Calculates and returns the complex tangent of c.
#define SHZ_CMPLXF32(x, y)
Initializes a complex number.
shz_complex_t shz_cscalef(shz_complex_t c, float v) SHZ_NOEXCEPT
Scales both componets of the complex number, c, by the value, v, returning the result.
shz_complex_t shz_cprojf(shz_complex_t c) SHZ_NOEXCEPT
Calculates the projection of the complex number, c, onto the Riemann sphere.
shz_complex_t shz_cdivf(shz_complex_t lhs, shz_complex_t rhs) SHZ_NOEXCEPT
Divides lhs by rhs, returning the complex result.
shz_complex_t shz_csubf(shz_complex_t lhs, shz_complex_t rhs) SHZ_NOEXCEPT
Subtracts rhs from lhs and returns the complex result.
shz_complex_t shz_casechf(shz_complex_t c) SHZ_NOEXCEPT
Calculates and returns the complex hyperbolic arcsecant of c.
shz_complex_t shz_cacotf(shz_complex_t c) SHZ_NOEXCEPT
Calculates and returns the complex arccotangent of c.
shz_complex_t shz_csqrtf(shz_complex_t c) SHZ_NOEXCEPT
Computes and returns the complex square root of c.
shz_complex_t shz_casinhf(shz_complex_t c) SHZ_NOEXCEPT
Calculates and returns the complex hyperbolic arcsine of c.
bool shz_cequalf(shz_complex_t lhs, shz_complex_t rhs) SHZ_NOEXCEPT
Checks for equality between two complex numbers with either an absolute or relative tolerance.
float shz_cnormf(shz_complex_t c) SHZ_NOEXCEPT
Returns the squared magnitude of the complex number, c.
shz_complex_t shz_caddf(shz_complex_t lhs, shz_complex_t rhs) SHZ_NOEXCEPT
Adds two complex numbers together and returns the result.
shz_complex_t shz_casecf(shz_complex_t c) SHZ_NOEXCEPT
Calculates and returns the complex arcsecant of c.
shz_complex_t shz_clogf(shz_complex_t c) SHZ_NOEXCEPT
Computes and returns the complex natural logarithm of c.
float shz_crealf(shz_complex_t c) SHZ_NOEXCEPT
Returns the real component of a complex number.
shz_complex_t shz_csecf(shz_complex_t c) SHZ_NOEXCEPT
Calculates and returns the complex secant of c.
shz_complex_t shz_cpolarf(float r, float theta) SHZ_NOEXCEPT
Returns a complex number with a magnitude of r, and a phase angle of theta (in radians).
shz_complex_t shz_ccoshf(shz_complex_t c) SHZ_NOEXCEPT
Calculates and returns the complex hyperbolic cosine of c.
shz_complex_t shz_complex
shz_complex_t alias for those who don't like POSIX-style.
shz_complex_t shz_cexpf(shz_complex_t c) SHZ_NOEXCEPT
Returns the complex base e exponential of c.
shz_complex_t shz_cinitf(float real, float imag) SHZ_NOEXCEPT
Returns a complex number which has been initialized to contain the given component values.
shz_complex_t shz_conjf(shz_complex_t c) SHZ_NOEXCEPT
Returns the complex conjugate of c.
shz_complex_t shz_catanhf(shz_complex_t c) SHZ_NOEXCEPT
Calculates and returns the complex hyperbolic arctangent of c.
shz_complex_t shz_cpowf(shz_complex_t base, shz_complex_t exp) SHZ_NOEXCEPT
Raises the complex base to the complex exp power, returning a complex result.
shz_complex_t shz_cacschf(shz_complex_t c) SHZ_NOEXCEPT
Calculates and returns the complex hyperbolic arccosecant of c.
float shz_cargf(shz_complex_t c) SHZ_NOEXCEPT
Returns the phase angle of the complex number, c.
shz_complex_t shz_ccosf(shz_complex_t c) SHZ_NOEXCEPT
Calculates and returns the complex cosine of c.
shz_complex_t shz_ctanhf(shz_complex_t c) SHZ_NOEXCEPT
Calculates and returns the complex hyperbolic tangent of c.
shz_complex_t shz_cacosf(shz_complex_t c) SHZ_NOEXCEPT
Calculates and returns the complex arccosine of c.
shz_complex_t shz_csinhf(shz_complex_t c) SHZ_NOEXCEPT
Calculates and returns the complex hyperbolic sine of c.
shz_complex_t shz_clog10f(shz_complex_t c) SHZ_NOEXCEPT
Computes and returns the complex base 10 logarithm of c.
shz_complex_t shz_ccothf(shz_complex_t c) SHZ_NOEXCEPT
Calculates and returns the complex hyperbolic cotangent of c.
shz_complex_t shz_cacscf(shz_complex_t c) SHZ_NOEXCEPT
Calculates and returns the complex arccosecant of c.
shz_complex_t shz_ccscf(shz_complex_t c) SHZ_NOEXCEPT
Calculates and returns the complex cosecant of c.
Represents a floating-point complex number real/imaginary pair.
float real
The real portion of the complex number.
float imag
The imaginary portion of the complex number.