liba 0.1.15
An algorithm library based on C/C++
|
Data Structures | |
struct | a_complex |
instance structure for complex number More... | |
Macros | |
#define | A_COMPLEX_PRI(RF, RC, IF, IC) |
#define | A_COMPLEX_C(R, I) |
#define | a_complex_c(r, i) |
Typedefs | |
typedef struct a_complex | a_complex |
instance structure for complex number | |
Functions | |
static void | a_complex_rect (a_complex *ctx, double real, double imag) |
constructs a complex number from real and imaginary parts | |
void | a_complex_polar (a_complex *ctx, double rho, double theta) |
constructs a complex number from polar form | |
unsigned int | a_complex_parse (a_complex *ctx, char const *str) |
parse a string into a complex number | |
bool | a_complex_eq (a_complex x, a_complex y) |
complex number x is equal to complex number y | |
bool | a_complex_ne (a_complex x, a_complex y) |
complex number x is not equal to complex number y | |
double | a_complex_logabs (a_complex z) |
computes the natural logarithm of magnitude of a complex number | |
double | a_complex_abs2 (a_complex z) |
computes the squared magnitude of a complex number | |
double | a_complex_abs (a_complex z) |
computes the magnitude of a complex number | |
double | a_complex_arg (a_complex z) |
computes the phase angle of a complex number | |
void | a_complex_proj (a_complex *ctx, a_complex z) |
computes the projection on Riemann sphere | |
void | a_complex_proj_ (a_complex *ctx) |
void | a_complex_conj (a_complex *ctx, a_complex z) |
computes the complex conjugate | |
void | a_complex_conj_ (a_complex *ctx) |
void | a_complex_neg (a_complex *ctx, a_complex z) |
computes the complex negative | |
void | a_complex_neg_ (a_complex *ctx) |
void | a_complex_add (a_complex *ctx, a_complex x, a_complex y) |
addition of complex numbers | |
void | a_complex_add_ (a_complex *ctx, a_complex z) |
void | a_complex_add_real (a_complex *ctx, a_complex x, double y) |
void | a_complex_add_real_ (a_complex *ctx, double x) |
void | a_complex_add_imag (a_complex *ctx, a_complex x, double y) |
void | a_complex_add_imag_ (a_complex *ctx, double x) |
void | a_complex_sub (a_complex *ctx, a_complex x, a_complex y) |
subtraction of complex numbers | |
void | a_complex_sub_ (a_complex *ctx, a_complex z) |
void | a_complex_sub_real (a_complex *ctx, a_complex x, double y) |
void | a_complex_sub_real_ (a_complex *ctx, double x) |
void | a_complex_sub_imag (a_complex *ctx, a_complex x, double y) |
void | a_complex_sub_imag_ (a_complex *ctx, double x) |
void | a_complex_mul (a_complex *ctx, a_complex x, a_complex y) |
multiplication of complex numbers | |
void | a_complex_mul_ (a_complex *ctx, a_complex z) |
void | a_complex_mul_real (a_complex *ctx, a_complex x, double y) |
void | a_complex_mul_real_ (a_complex *ctx, double x) |
void | a_complex_mul_imag (a_complex *ctx, a_complex x, double y) |
void | a_complex_mul_imag_ (a_complex *ctx, double x) |
void | a_complex_div (a_complex *ctx, a_complex x, a_complex y) |
division of complex numbers | |
void | a_complex_div_ (a_complex *ctx, a_complex z) |
void | a_complex_div_real (a_complex *ctx, a_complex x, double y) |
void | a_complex_div_real_ (a_complex *ctx, double x) |
void | a_complex_div_imag (a_complex *ctx, a_complex x, double y) |
void | a_complex_div_imag_ (a_complex *ctx, double x) |
void | a_complex_inv (a_complex *ctx, a_complex z) |
inverse of a complex number | |
void | a_complex_inv_ (a_complex *ctx) |
void | a_complex_sqrt (a_complex *ctx, a_complex z) |
computes the complex square root | |
void | a_complex_sqrt_ (a_complex *ctx) |
void | a_complex_sqrt_real (a_complex *ctx, double x) |
void | a_complex_pow (a_complex *ctx, a_complex z, a_complex a) |
complex number z raised to complex power a | |
void | a_complex_pow_ (a_complex *ctx, a_complex a) |
void | a_complex_pow_real (a_complex *ctx, a_complex z, double a) |
complex number z raised to real power a | |
void | a_complex_pow_real_ (a_complex *ctx, double a) |
void | a_complex_exp (a_complex *ctx, a_complex z) |
computes the complex base-e exponential | |
void | a_complex_exp_ (a_complex *ctx) |
void | a_complex_log (a_complex *ctx, a_complex z) |
computes the complex natural logarithm | |
void | a_complex_log_ (a_complex *ctx) |
void | a_complex_log2 (a_complex *ctx, a_complex z) |
computes the complex base-2 logarithm | |
void | a_complex_log2_ (a_complex *ctx) |
void | a_complex_log10 (a_complex *ctx, a_complex z) |
computes the complex base-10 logarithm | |
void | a_complex_log10_ (a_complex *ctx) |
void | a_complex_logb (a_complex *ctx, a_complex z, a_complex b) |
computes the complex base-b logarithm | |
void | a_complex_logb_ (a_complex *ctx, a_complex b) |
void | a_complex_sin (a_complex *ctx, a_complex z) |
computes the complex sine | |
void | a_complex_sin_ (a_complex *ctx) |
void | a_complex_cos (a_complex *ctx, a_complex z) |
computes the complex cosine | |
void | a_complex_cos_ (a_complex *ctx) |
void | a_complex_tan (a_complex *ctx, a_complex z) |
computes the complex tangent | |
void | a_complex_tan_ (a_complex *ctx) |
void | a_complex_sec (a_complex *ctx, a_complex z) |
computes the complex secant | |
void | a_complex_sec_ (a_complex *ctx) |
void | a_complex_csc (a_complex *ctx, a_complex z) |
computes the complex cosecant | |
void | a_complex_csc_ (a_complex *ctx) |
void | a_complex_cot (a_complex *ctx, a_complex z) |
computes the complex cotangent | |
void | a_complex_cot_ (a_complex *ctx) |
void | a_complex_asin (a_complex *ctx, a_complex z) |
computes the complex arc sine | |
void | a_complex_asin_ (a_complex *ctx) |
void | a_complex_asin_real (a_complex *ctx, double x) |
void | a_complex_acos (a_complex *ctx, a_complex z) |
computes the complex arc cosine | |
void | a_complex_acos_ (a_complex *ctx) |
void | a_complex_acos_real (a_complex *ctx, double x) |
void | a_complex_atan (a_complex *ctx, a_complex z) |
computes the complex arc tangent | |
void | a_complex_atan_ (a_complex *ctx) |
void | a_complex_asec (a_complex *ctx, a_complex z) |
computes the complex arc secant | |
void | a_complex_asec_ (a_complex *ctx) |
void | a_complex_asec_real (a_complex *ctx, double x) |
void | a_complex_acsc (a_complex *ctx, a_complex z) |
computes the complex arc cosecant | |
void | a_complex_acsc_ (a_complex *ctx) |
void | a_complex_acsc_real (a_complex *ctx, double x) |
void | a_complex_acot (a_complex *ctx, a_complex z) |
computes the complex arc cotangent | |
void | a_complex_acot_ (a_complex *ctx) |
void | a_complex_sinh (a_complex *ctx, a_complex z) |
computes the complex hyperbolic sine | |
void | a_complex_sinh_ (a_complex *ctx) |
void | a_complex_cosh (a_complex *ctx, a_complex z) |
computes the complex hyperbolic cosine | |
void | a_complex_cosh_ (a_complex *ctx) |
void | a_complex_tanh (a_complex *ctx, a_complex z) |
computes the complex hyperbolic tangent | |
void | a_complex_tanh_ (a_complex *ctx) |
void | a_complex_sech (a_complex *ctx, a_complex z) |
computes the complex hyperbolic secant | |
void | a_complex_sech_ (a_complex *ctx) |
void | a_complex_csch (a_complex *ctx, a_complex z) |
computes the complex hyperbolic cosecant | |
void | a_complex_csch_ (a_complex *ctx) |
void | a_complex_coth (a_complex *ctx, a_complex z) |
computes the complex hyperbolic cotangent | |
void | a_complex_coth_ (a_complex *ctx) |
void | a_complex_asinh (a_complex *ctx, a_complex z) |
computes the complex arc hyperbolic sine | |
void | a_complex_asinh_ (a_complex *ctx) |
void | a_complex_acosh (a_complex *ctx, a_complex z) |
computes the complex arc hyperbolic cosine | |
void | a_complex_acosh_ (a_complex *ctx) |
void | a_complex_acosh_real (a_complex *ctx, double x) |
void | a_complex_atanh (a_complex *ctx, a_complex z) |
computes the complex arc hyperbolic tangent | |
void | a_complex_atanh_ (a_complex *ctx) |
void | a_complex_atanh_real (a_complex *ctx, double x) |
void | a_complex_asech (a_complex *ctx, a_complex z) |
computes the complex arc hyperbolic secant | |
void | a_complex_asech_ (a_complex *ctx) |
void | a_complex_acsch (a_complex *ctx, a_complex z) |
computes the complex arc hyperbolic cosecant | |
void | a_complex_acsch_ (a_complex *ctx) |
void | a_complex_acoth (a_complex *ctx, a_complex z) |
computes the complex arc hyperbolic cotangent | |
void | a_complex_acoth_ (a_complex *ctx) |
#define A_COMPLEX_C | ( | R, | |
I ) |
#define a_complex_c | ( | r, | |
i ) |
#define A_COMPLEX_PRI | ( | RF, | |
RC, | |||
IF, | |||
IC ) |
format constants for the fprintf family of functions
double a_complex_abs | ( | a_complex | z | ) |
computes the magnitude of a complex number
z | a complex number |
double a_complex_abs2 | ( | a_complex | z | ) |
computes the squared magnitude of a complex number
z | a complex number |
computes the complex arc cosine
ctx | = \( \arccos(z) \) |
z | a complex number |
computes the complex arc hyperbolic cosine
\[ \mathrm{arccosh}(z)=\log(z-\sqrt{z^2-1}) \]
ctx | = \( \mathrm{arccosh}(z) \) |
z | a complex number |
computes the complex arc cotangent
\[ \mathrm{arccot}(z)=\mathrm{arctan}(\frac{1}{z}) \]
ctx | = \( \mathrm{arccot}(z) \) |
z | a complex number |
computes the complex arc hyperbolic cotangent
\[ \mathrm{arccoth}(z)=\mathrm{arctanh}(\frac{1}{z}) \]
ctx | = \( \mathrm{arccoth}(z) \) |
z | a complex number |
computes the complex arc cosecant
\[ \mathrm{arccsc}(z)=\mathrm{arcsin}(\frac{1}{z}) \]
ctx | = \( \mathrm{arccsc}(z) \) |
z | a complex number |
computes the complex arc hyperbolic cosecant
\[ \mathrm{arccsch}(z)=\mathrm{arcsinh}(\frac{1}{z}) \]
ctx | = \( \mathrm{arccsch}(z) \) |
z | a complex number |
addition of complex numbers
\[ (a+b i)+(c+d i)=(a+c)+(b+d)i \]
ctx | = \( x + y \) |
x | complex number on the left |
y | complex number on the right |
double a_complex_arg | ( | a_complex | z | ) |
computes the phase angle of a complex number
z | a complex number |
computes the complex arc secant
\[ \mathrm{arcsec}(z)=\mathrm{arccos}(\frac{1}{z}) \]
ctx | = \( \mathrm{arcsec}(z) \) |
z | a complex number |
computes the complex arc hyperbolic secant
\[ \mathrm{arcsech}(z)=\mathrm{arccosh}(\frac{1}{z}) \]
ctx | = \( \mathrm{arcsech}(z) \) |
z | a complex number |
computes the complex arc sine
ctx | = \( \arcsin(z) \) |
z | a complex number |
computes the complex arc hyperbolic sine
ctx | = \( \mathrm{arcsinh}(z) \) |
z | a complex number |
computes the complex arc tangent
ctx | = \( \arctan(z) \) |
z | a complex number |
computes the complex arc hyperbolic tangent
ctx | = \( \mathrm{arctanh}(z) \) |
z | a complex number |
computes the complex conjugate
ctx | = \( (a,-b{i}) \) |
z | a complex number |
computes the complex cosine
\[ \cos(z)=\frac{\exp(z{i})+\exp(-z{i})}{2} \]
ctx | = \( \cos(z) \) |
z | a complex number |
computes the complex hyperbolic cosine
\[ \cosh(z)=\frac{\exp(z)+\exp(-z)}{2} \]
ctx | = \( \cosh(z) \) |
z | a complex number |
computes the complex cotangent
\[ \cot(z)=\frac{1}{\tan(z)} \]
ctx | = \( \cot(z) \) |
z | a complex number |
computes the complex hyperbolic cotangent
\[ \mathrm{coth}(z)=\frac{1}{\tanh(z)} \]
ctx | = \( \mathrm{coth}(z) \) |
z | a complex number |
computes the complex cosecant
\[ \csc(z)=\frac{1}{\sin(z)} \]
ctx | = \( \csc(z) \) |
z | a complex number |
computes the complex hyperbolic cosecant
\[ \mathrm{csch}(z)=\frac{1}{\sinh(z)} \]
ctx | = \( \mathrm{csch}(z) \) |
z | a complex number |
division of complex numbers
\[ \frac{(a+b i)}{(c+d i)}=\frac{(a+b i)(c-d i)}{(c+d i)(c-d i)}=\frac{a c+b c i-a d i-b d i^{2}}{c^{2}-(d i)^{2}}=\frac{(a c+b d)+(b c-a d) i}{c^{2}+d^{2}}=\left(\frac{a c+b d}{c^{2}+d^{2}}\right)+\left(\frac{b c-a d}{c^{2}+d^{2}}\right) i \]
ctx | = \( x \div y \) |
x | complex number on the left |
y | complex number on the right |
complex number x is equal to complex number y
x | complex number on the left |
y | complex number on the right |
computes the complex base-e exponential
ctx | = \( e^z \) |
z | a complex number |
inverse of a complex number
\[ \frac{a-bi}{a^2+b^2}=\left(\frac{a}{a^2+b^2}\right)-\left(\frac{b}{a^2+b^2}\right)i \]
ctx | inverse or reciprocal \( \frac{1}{z} \) |
z | a complex number |
computes the complex natural logarithm
ctx | = \( \ln{z} \) |
z | a complex number |
computes the complex base-10 logarithm
ctx | = \( \lg{z} \) |
z | a complex number |
computes the complex base-2 logarithm
ctx | = \( \log_{2}{z} \) |
z | a complex number |
double a_complex_logabs | ( | a_complex | z | ) |
computes the natural logarithm of magnitude of a complex number
z | a complex number |
computes the complex base-b logarithm
ctx | = \( \log_{b}{z} \) |
z | a complex number |
b | a complex number |
multiplication of complex numbers
\[ (a+b i)(c+d i)=a c+b c i+a d i+b d i^{2}=(a c-b d)+(b c+a d) i \]
ctx | = \( x \times y \) |
x | complex number on the left |
y | complex number on the right |
complex number x is not equal to complex number y
x | complex number on the left |
y | complex number on the right |
computes the complex negative
ctx | = \( (-a,-b{i}) \) |
z | a complex number |
unsigned int a_complex_parse | ( | a_complex * | ctx, |
char const * | str ) |
parse a string into a complex number
ctx | points to an instance structure for complex number |
str | complex number string to be parsed |
void a_complex_polar | ( | a_complex * | ctx, |
double | rho, | ||
double | theta ) |
constructs a complex number from polar form
ctx | = \( (\rho\cos\theta,\rho\sin\theta{i}) \) |
rho | a distance from a reference point |
theta | an angle from a reference direction |
complex number z raised to complex power a
ctx | = \( z^a \) |
z | a complex number |
a | a complex number |
complex number z raised to real power a
ctx | = \( z^a \) |
z | a complex number |
a | a real number |
computes the projection on Riemann sphere
ctx | = \( z \) or \( (\inf,\rm{copysign}(0,b)i) \) |
z | a complex number |
|
inlinestatic |
constructs a complex number from real and imaginary parts
ctx | = \( (\rm{Re},\rm{Im}) \) |
real | real part of complex number |
imag | imaginary part of complex number |
computes the complex secant
\[ \sec(z)=\frac{1}{\cos(z)} \]
ctx | = \( \sec(z) \) |
z | a complex number |
computes the complex hyperbolic secant
\[ \mathrm{sech}(z)=\frac{1}{\cosh(z)} \]
ctx | = \( \mathrm{sech}(z) \) |
z | a complex number |
computes the complex sine
\[ \sin(z)=\frac{\exp(z{i})-\exp(-z{i})}{2{i}} \]
ctx | = \( \sin(z) \) |
z | a complex number |
computes the complex hyperbolic sine
\[ \sinh(z)=\frac{\exp(z)-\exp(-z)}{2} \]
ctx | = \( \sinh(z) \) |
z | a complex number |
computes the complex square root
ctx | = \( \sqrt{z} \) |
z | a complex number |
subtraction of complex numbers
\[ (a+b i)-(c+d i)=(a-c)+(b-d)i \]
ctx | = \( x - y \) |
x | complex number on the left |
y | complex number on the right |
computes the complex tangent
\[ \tan(z)=\frac{\sin(z)}{\cos(z)} \]
ctx | = \( \tan(z) \) |
z | a complex number |