liba 0.1.15
An algorithm library based on C/C++
 
Loading...
Searching...
No Matches
complex.h
Go to the documentation of this file.
1
5
6#ifndef LIBA_COMPLEX_H
7#define LIBA_COMPLEX_H
8
9#include "a.h"
10
16
17/* clang-format off */
19#define A_COMPLEX_C(real, imag) {a_float_c(real), a_float_c(imag)}
20/* clang-format on */
21
23#define a_complex_c(x) a_cast_s(a_complex, x)
24#define a_complex_(_, x) a_cast_s(a_complex _, x)
25
29typedef struct a_complex
30{
31 a_float real;
34
35#if defined(__cplusplus)
36extern "C" {
37#endif /* __cplusplus */
38#if defined(LIBA_COMPLEX_C)
39#undef A_INTERN
40#define A_INTERN A_INLINE
41#endif /* LIBA_COMPLEX_C */
42
49static A_INLINE void a_complex_rect(a_complex *ctx, a_float real, a_float imag)
50{
51 ctx->real = real;
52 ctx->imag = imag;
53}
54
61A_EXTERN void a_complex_polar(a_complex *ctx, a_float rho, a_float theta);
62
69A_EXTERN unsigned int a_complex_parse(a_complex *ctx, char const *str);
70
78
86
87/* Properties of complex numbers */
88
95
102
109
116
117/* Complex arithmetic operators */
118
124#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
125A_EXTERN void a_complex_proj(a_complex *ctx, a_complex z);
126#endif /* A_HAVE_INLINE */
127A_EXTERN void a_complex_proj_(a_complex *ctx);
128#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
129A_INTERN void a_complex_proj(a_complex *ctx, a_complex z)
130{
131 a_complex_proj_(&z);
132 *ctx = z;
133}
134#endif /* A_HAVE_INLINE */
135
141#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
142A_EXTERN void a_complex_conj(a_complex *ctx, a_complex z);
143#endif /* A_HAVE_INLINE */
144#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
145A_INTERN void a_complex_conj(a_complex *ctx, a_complex z)
146{
147 ctx->real = +z.real;
148 ctx->imag = -z.imag;
149}
150#endif /* A_HAVE_INLINE */
151#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
152A_EXTERN void a_complex_conj_(a_complex *ctx);
153#endif /* A_HAVE_INLINE */
154#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
155A_INTERN void a_complex_conj_(a_complex *ctx)
156{
157 ctx->imag = -ctx->imag;
158}
159#endif /* A_HAVE_INLINE */
160
166#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
167A_EXTERN void a_complex_neg(a_complex *ctx, a_complex z);
168#endif /* A_HAVE_INLINE */
169#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
170A_INTERN void a_complex_neg(a_complex *ctx, a_complex z)
171{
172 ctx->real = -z.real;
173 ctx->imag = -z.imag;
174}
175#endif /* A_HAVE_INLINE */
176#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
177A_EXTERN void a_complex_neg_(a_complex *ctx);
178#endif /* A_HAVE_INLINE */
179#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
180A_INTERN void a_complex_neg_(a_complex *ctx)
181{
182 ctx->real = -ctx->real;
183 ctx->imag = -ctx->imag;
184}
185#endif /* A_HAVE_INLINE */
186
193#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
194A_EXTERN void a_complex_add(a_complex *ctx, a_complex x, a_complex y);
195#endif /* A_HAVE_INLINE */
196#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
197A_INTERN void a_complex_add(a_complex *ctx, a_complex x, a_complex y)
198{
199 ctx->real = x.real + y.real;
200 ctx->imag = x.imag + y.imag;
201}
202#endif /* A_HAVE_INLINE */
203#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
204A_EXTERN void a_complex_add_(a_complex *ctx, a_complex z);
205#endif /* A_HAVE_INLINE */
206#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
207A_INTERN void a_complex_add_(a_complex *ctx, a_complex z)
208{
209 ctx->real += z.real;
210 ctx->imag += z.imag;
211}
212#endif /* A_HAVE_INLINE */
213#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
214A_EXTERN void a_complex_add_real(a_complex *ctx, a_complex x, a_float y);
215#endif /* A_HAVE_INLINE */
216#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
217A_INTERN void a_complex_add_real(a_complex *ctx, a_complex x, a_float y)
218{
219 ctx->real = x.real + y;
220 ctx->imag = x.imag;
221}
222#endif /* A_HAVE_INLINE */
223#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
224A_EXTERN void a_complex_add_real_(a_complex *ctx, a_float x);
225#endif /* A_HAVE_INLINE */
226#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
227A_INTERN void a_complex_add_real_(a_complex *ctx, a_float x)
228{
229 ctx->real += x;
230}
231#endif /* A_HAVE_INLINE */
232#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
233A_EXTERN void a_complex_add_imag(a_complex *ctx, a_complex x, a_float y);
234#endif /* A_HAVE_INLINE */
235#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
236A_INTERN void a_complex_add_imag(a_complex *ctx, a_complex x, a_float y)
237{
238 ctx->real = x.real;
239 ctx->imag = x.imag + y;
240}
241#endif /* A_HAVE_INLINE */
242#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
243A_EXTERN void a_complex_add_imag_(a_complex *ctx, a_float x);
244#endif /* A_HAVE_INLINE */
245#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
246A_INTERN void a_complex_add_imag_(a_complex *ctx, a_float x)
247{
248 ctx->imag += x;
249}
250#endif /* A_HAVE_INLINE */
251
258#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
259A_EXTERN void a_complex_sub(a_complex *ctx, a_complex x, a_complex y);
260#endif /* A_HAVE_INLINE */
261#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
262A_INTERN void a_complex_sub(a_complex *ctx, a_complex x, a_complex y)
263{
264 ctx->real = x.real - y.real;
265 ctx->imag = x.imag - y.imag;
266}
267#endif /* A_HAVE_INLINE */
268#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
269A_EXTERN void a_complex_sub_(a_complex *ctx, a_complex z);
270#endif /* A_HAVE_INLINE */
271#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
272A_INTERN void a_complex_sub_(a_complex *ctx, a_complex z)
273{
274 ctx->real -= z.real;
275 ctx->imag -= z.imag;
276}
277#endif /* A_HAVE_INLINE */
278#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
279A_EXTERN void a_complex_sub_real(a_complex *ctx, a_complex x, a_float y);
280#endif /* A_HAVE_INLINE */
281#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
282A_INTERN void a_complex_sub_real(a_complex *ctx, a_complex x, a_float y)
283{
284 ctx->real = x.real - y;
285 ctx->imag = x.imag;
286}
287#endif /* A_HAVE_INLINE */
288#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
289A_EXTERN void a_complex_sub_real_(a_complex *ctx, a_float x);
290#endif /* A_HAVE_INLINE */
291#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
292A_INTERN void a_complex_sub_real_(a_complex *ctx, a_float x)
293{
294 ctx->real -= x;
295}
296#endif /* A_HAVE_INLINE */
297#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
298A_EXTERN void a_complex_sub_imag(a_complex *ctx, a_complex x, a_float y);
299#endif /* A_HAVE_INLINE */
300#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
301A_INTERN void a_complex_sub_imag(a_complex *ctx, a_complex x, a_float y)
302{
303 ctx->real = x.real;
304 ctx->imag = x.imag - y;
305}
306#endif /* A_HAVE_INLINE */
307#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
308A_EXTERN void a_complex_sub_imag_(a_complex *ctx, a_float x);
309#endif /* A_HAVE_INLINE */
310#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
311A_INTERN void a_complex_sub_imag_(a_complex *ctx, a_float x)
312{
313 ctx->imag -= x;
314}
315#endif /* A_HAVE_INLINE */
316
323#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
324A_EXTERN void a_complex_mul(a_complex *ctx, a_complex x, a_complex y);
325#endif /* A_HAVE_INLINE */
326A_EXTERN void a_complex_mul_(a_complex *ctx, a_complex z);
327#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
328A_INTERN void a_complex_mul(a_complex *ctx, a_complex x, a_complex y)
329{
330 a_complex_mul_(&x, y);
331 *ctx = x;
332}
333#endif /* A_HAVE_INLINE */
334#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
335A_EXTERN void a_complex_mul_real(a_complex *ctx, a_complex x, a_float y);
336#endif /* A_HAVE_INLINE */
337#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
338A_INTERN void a_complex_mul_real(a_complex *ctx, a_complex x, a_float y)
339{
340 ctx->real = x.real * y;
341 ctx->imag = x.imag * y;
342}
343#endif /* A_HAVE_INLINE */
344#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
345A_EXTERN void a_complex_mul_real_(a_complex *ctx, a_float x);
346#endif /* A_HAVE_INLINE */
347#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
348A_INTERN void a_complex_mul_real_(a_complex *ctx, a_float x)
349{
350 ctx->real *= x;
351 ctx->imag *= x;
352}
353#endif /* A_HAVE_INLINE */
354#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
355A_EXTERN void a_complex_mul_imag(a_complex *ctx, a_complex x, a_float y);
356#endif /* A_HAVE_INLINE */
357#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
358A_INTERN void a_complex_mul_imag(a_complex *ctx, a_complex x, a_float y)
359{
360 ctx->real = -x.imag * y;
361 ctx->imag = x.real * y;
362}
363#endif /* A_HAVE_INLINE */
364#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
365A_EXTERN void a_complex_mul_imag_(a_complex *ctx, a_float x);
366#endif /* A_HAVE_INLINE */
367#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
368A_INTERN void a_complex_mul_imag_(a_complex *ctx, a_float x)
369{
370 a_float const real = ctx->real;
371 ctx->real = -ctx->imag * x;
372 ctx->imag = real * x;
373}
374#endif /* A_HAVE_INLINE */
375
382#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
383A_EXTERN void a_complex_div(a_complex *ctx, a_complex x, a_complex y);
384#endif /* A_HAVE_INLINE */
385A_EXTERN void a_complex_div_(a_complex *ctx, a_complex z);
386#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
387A_INTERN void a_complex_div(a_complex *ctx, a_complex x, a_complex y)
388{
389 a_complex_div_(&x, y);
390 *ctx = x;
391}
392#endif /* A_HAVE_INLINE */
393#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
394A_EXTERN void a_complex_div_real(a_complex *ctx, a_complex x, a_float y);
395#endif /* A_HAVE_INLINE */
396#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
397A_INTERN void a_complex_div_real(a_complex *ctx, a_complex x, a_float y)
398{
399 ctx->real = x.real / y;
400 ctx->imag = x.imag / y;
401}
402#endif /* A_HAVE_INLINE */
403#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
404A_EXTERN void a_complex_div_real_(a_complex *ctx, a_float x);
405#endif /* A_HAVE_INLINE */
406#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
407A_INTERN void a_complex_div_real_(a_complex *ctx, a_float x)
408{
409 ctx->real /= x;
410 ctx->imag /= x;
411}
412#endif /* A_HAVE_INLINE */
413#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
414A_EXTERN void a_complex_div_imag(a_complex *ctx, a_complex x, a_float y);
415#endif /* A_HAVE_INLINE */
416#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
417A_INTERN void a_complex_div_imag(a_complex *ctx, a_complex x, a_float y)
418{
419 ctx->real = -x.imag / y;
420 ctx->imag = x.real / y;
421}
422#endif /* A_HAVE_INLINE */
423#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
424A_EXTERN void a_complex_div_imag_(a_complex *ctx, a_float x);
425#endif /* A_HAVE_INLINE */
426#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
427A_INTERN void a_complex_div_imag_(a_complex *ctx, a_float x)
428{
429 a_float const real = ctx->real;
430 ctx->real = -ctx->imag / x;
431 ctx->imag = real / x;
432}
433#endif /* A_HAVE_INLINE */
434
440#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
441A_EXTERN void a_complex_inv(a_complex *ctx, a_complex z);
442#endif /* A_HAVE_INLINE */
443A_EXTERN void a_complex_inv_(a_complex *ctx);
444#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
445A_INTERN void a_complex_inv(a_complex *ctx, a_complex z)
446{
447 a_complex_inv_(&z);
448 *ctx = z;
449}
450#endif /* A_HAVE_INLINE */
451
452/* Elementary Complex Functions */
453
459#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
460A_EXTERN void a_complex_sqrt(a_complex *ctx, a_complex z);
461#endif /* A_HAVE_INLINE */
462A_EXTERN void a_complex_sqrt_(a_complex *ctx);
463A_EXTERN void a_complex_sqrt_real(a_complex *ctx, a_float x);
464#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
465A_INTERN void a_complex_sqrt(a_complex *ctx, a_complex z)
466{
467 a_complex_sqrt_(&z);
468 *ctx = z;
469}
470#endif /* A_HAVE_INLINE */
471
478#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
479A_EXTERN void a_complex_pow(a_complex *ctx, a_complex z, a_complex a);
480#endif /* A_HAVE_INLINE */
481A_EXTERN void a_complex_pow_(a_complex *ctx, a_complex a);
482#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
483A_INTERN void a_complex_pow(a_complex *ctx, a_complex z, a_complex a)
484{
485 a_complex_pow_(&z, a);
486 *ctx = z;
487}
488#endif /* A_HAVE_INLINE */
489
496#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
498#endif /* A_HAVE_INLINE */
499A_EXTERN void a_complex_pow_real_(a_complex *ctx, a_float a);
500#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
501A_INTERN void a_complex_pow_real(a_complex *ctx, a_complex z, a_float a)
502{
503 a_complex_pow_real_(&z, a);
504 *ctx = z;
505}
506#endif /* A_HAVE_INLINE */
507
513#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
514A_EXTERN void a_complex_exp(a_complex *ctx, a_complex z);
515#endif /* A_HAVE_INLINE */
516A_EXTERN void a_complex_exp_(a_complex *ctx);
517#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
518A_INTERN void a_complex_exp(a_complex *ctx, a_complex z)
519{
520 a_complex_exp_(&z);
521 *ctx = z;
522}
523#endif /* A_HAVE_INLINE */
524
530#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
531A_EXTERN void a_complex_log(a_complex *ctx, a_complex z);
532#endif /* A_HAVE_INLINE */
533A_EXTERN void a_complex_log_(a_complex *ctx);
534#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
535A_INTERN void a_complex_log(a_complex *ctx, a_complex z)
536{
537 a_complex_log_(&z);
538 *ctx = z;
539}
540#endif /* A_HAVE_INLINE */
541
547#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
548A_EXTERN void a_complex_log2(a_complex *ctx, a_complex z);
549#endif /* A_HAVE_INLINE */
550A_EXTERN void a_complex_log2_(a_complex *ctx);
551#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
552A_INTERN void a_complex_log2(a_complex *ctx, a_complex z)
553{
554 a_complex_log2_(&z);
555 *ctx = z;
556}
557#endif /* A_HAVE_INLINE */
558
564#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
565A_EXTERN void a_complex_log10(a_complex *ctx, a_complex z);
566#endif /* A_HAVE_INLINE */
567A_EXTERN void a_complex_log10_(a_complex *ctx);
568#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
569A_INTERN void a_complex_log10(a_complex *ctx, a_complex z)
570{
571 a_complex_log10_(&z);
572 *ctx = z;
573}
574#endif /* A_HAVE_INLINE */
575
582#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
583A_EXTERN void a_complex_logb(a_complex *ctx, a_complex z, a_complex b);
584#endif /* A_HAVE_INLINE */
585A_EXTERN void a_complex_logb_(a_complex *ctx, a_complex b);
586#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
587A_INTERN void a_complex_logb(a_complex *ctx, a_complex z, a_complex b)
588{
589 a_complex_logb_(&z, b);
590 *ctx = z;
591}
592#endif /* A_HAVE_INLINE */
593
594/* Complex Trigonometric Functions */
595
601#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
602A_EXTERN void a_complex_sin(a_complex *ctx, a_complex z);
603#endif /* A_HAVE_INLINE */
604A_EXTERN void a_complex_sin_(a_complex *ctx);
605#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
606A_INTERN void a_complex_sin(a_complex *ctx, a_complex z)
607{
608 a_complex_sin_(&z);
609 *ctx = z;
610}
611#endif /* A_HAVE_INLINE */
612
618#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
619A_EXTERN void a_complex_cos(a_complex *ctx, a_complex z);
620#endif /* A_HAVE_INLINE */
621A_EXTERN void a_complex_cos_(a_complex *ctx);
622#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
623A_INTERN void a_complex_cos(a_complex *ctx, a_complex z)
624{
625 a_complex_cos_(&z);
626 *ctx = z;
627}
628#endif /* A_HAVE_INLINE */
629
635#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
636A_EXTERN void a_complex_tan(a_complex *ctx, a_complex z);
637#endif /* A_HAVE_INLINE */
638A_EXTERN void a_complex_tan_(a_complex *ctx);
639#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
640A_INTERN void a_complex_tan(a_complex *ctx, a_complex z)
641{
642 a_complex_tan_(&z);
643 *ctx = z;
644}
645#endif /* A_HAVE_INLINE */
646
652#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
653A_EXTERN void a_complex_sec(a_complex *ctx, a_complex z);
654#endif /* A_HAVE_INLINE */
655A_EXTERN void a_complex_sec_(a_complex *ctx);
656#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
657A_INTERN void a_complex_sec(a_complex *ctx, a_complex z)
658{
659 a_complex_sec_(&z);
660 *ctx = z;
661}
662#endif /* A_HAVE_INLINE */
663
669#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
670A_EXTERN void a_complex_csc(a_complex *ctx, a_complex z);
671#endif /* A_HAVE_INLINE */
672A_EXTERN void a_complex_csc_(a_complex *ctx);
673#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
674A_INTERN void a_complex_csc(a_complex *ctx, a_complex z)
675{
676 a_complex_csc_(&z);
677 *ctx = z;
678}
679#endif /* A_HAVE_INLINE */
680
686#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
687A_EXTERN void a_complex_cot(a_complex *ctx, a_complex z);
688#endif /* A_HAVE_INLINE */
689A_EXTERN void a_complex_cot_(a_complex *ctx);
690#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
691A_INTERN void a_complex_cot(a_complex *ctx, a_complex z)
692{
693 a_complex_cot_(&z);
694 *ctx = z;
695}
696#endif /* A_HAVE_INLINE */
697
698/* Inverse Complex Trigonometric Functions */
699
705#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
706A_EXTERN void a_complex_asin(a_complex *ctx, a_complex z);
707#endif /* A_HAVE_INLINE */
708A_EXTERN void a_complex_asin_(a_complex *ctx);
709A_EXTERN void a_complex_asin_real(a_complex *ctx, a_float x);
710#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
711A_INTERN void a_complex_asin(a_complex *ctx, a_complex z)
712{
713 a_complex_asin_(&z);
714 *ctx = z;
715}
716#endif /* A_HAVE_INLINE */
717
723#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
724A_EXTERN void a_complex_acos(a_complex *ctx, a_complex z);
725#endif /* A_HAVE_INLINE */
726A_EXTERN void a_complex_acos_(a_complex *ctx);
727A_EXTERN void a_complex_acos_real(a_complex *ctx, a_float x);
728#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
729A_INTERN void a_complex_acos(a_complex *ctx, a_complex z)
730{
731 a_complex_acos_(&z);
732 *ctx = z;
733}
734#endif /* A_HAVE_INLINE */
735
741#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
742A_EXTERN void a_complex_atan(a_complex *ctx, a_complex z);
743#endif /* A_HAVE_INLINE */
744A_EXTERN void a_complex_atan_(a_complex *ctx);
745#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
746A_INTERN void a_complex_atan(a_complex *ctx, a_complex z)
747{
748 a_complex_atan_(&z);
749 *ctx = z;
750}
751#endif /* A_HAVE_INLINE */
752
758#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
759A_EXTERN void a_complex_asec(a_complex *ctx, a_complex z);
760#endif /* A_HAVE_INLINE */
761A_EXTERN void a_complex_asec_(a_complex *ctx);
762A_EXTERN void a_complex_asec_real(a_complex *ctx, a_float x);
763#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
764A_INTERN void a_complex_asec(a_complex *ctx, a_complex z)
765{
766 a_complex_asec_(&z);
767 *ctx = z;
768}
769#endif /* A_HAVE_INLINE */
770
776#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
777A_EXTERN void a_complex_acsc(a_complex *ctx, a_complex z);
778#endif /* A_HAVE_INLINE */
779A_EXTERN void a_complex_acsc_(a_complex *ctx);
780A_EXTERN void a_complex_acsc_real(a_complex *ctx, a_float x);
781#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
782A_INTERN void a_complex_acsc(a_complex *ctx, a_complex z)
783{
784 a_complex_acsc_(&z);
785 *ctx = z;
786}
787#endif /* A_HAVE_INLINE */
788
794#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
795A_EXTERN void a_complex_acot(a_complex *ctx, a_complex z);
796#endif /* A_HAVE_INLINE */
797A_EXTERN void a_complex_acot_(a_complex *ctx);
798#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
799A_INTERN void a_complex_acot(a_complex *ctx, a_complex z)
800{
801 a_complex_acot_(&z);
802 *ctx = z;
803}
804#endif /* A_HAVE_INLINE */
805
806/* Complex Hyperbolic Functions */
807
813#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
814A_EXTERN void a_complex_sinh(a_complex *ctx, a_complex z);
815#endif /* A_HAVE_INLINE */
816A_EXTERN void a_complex_sinh_(a_complex *ctx);
817#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
818A_INTERN void a_complex_sinh(a_complex *ctx, a_complex z)
819{
820 a_complex_sinh_(&z);
821 *ctx = z;
822}
823#endif /* A_HAVE_INLINE */
824
830#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
831A_EXTERN void a_complex_cosh(a_complex *ctx, a_complex z);
832#endif /* A_HAVE_INLINE */
833A_EXTERN void a_complex_cosh_(a_complex *ctx);
834#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
835A_INTERN void a_complex_cosh(a_complex *ctx, a_complex z)
836{
837 a_complex_cosh_(&z);
838 *ctx = z;
839}
840#endif /* A_HAVE_INLINE */
841
847#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
848A_EXTERN void a_complex_tanh(a_complex *ctx, a_complex z);
849#endif /* A_HAVE_INLINE */
850A_EXTERN void a_complex_tanh_(a_complex *ctx);
851#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
852A_INTERN void a_complex_tanh(a_complex *ctx, a_complex z)
853{
854 a_complex_tanh_(&z);
855 *ctx = z;
856}
857#endif /* A_HAVE_INLINE */
858
864#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
865A_EXTERN void a_complex_sech(a_complex *ctx, a_complex z);
866#endif /* A_HAVE_INLINE */
867A_EXTERN void a_complex_sech_(a_complex *ctx);
868#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
869A_INTERN void a_complex_sech(a_complex *ctx, a_complex z)
870{
871 a_complex_sech_(&z);
872 *ctx = z;
873}
874#endif /* A_HAVE_INLINE */
875
881#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
882A_EXTERN void a_complex_csch(a_complex *ctx, a_complex z);
883#endif /* A_HAVE_INLINE */
884A_EXTERN void a_complex_csch_(a_complex *ctx);
885#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
886A_INTERN void a_complex_csch(a_complex *ctx, a_complex z)
887{
888 a_complex_csch_(&z);
889 *ctx = z;
890}
891#endif /* A_HAVE_INLINE */
892
898#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
899A_EXTERN void a_complex_coth(a_complex *ctx, a_complex z);
900#endif /* A_HAVE_INLINE */
901A_EXTERN void a_complex_coth_(a_complex *ctx);
902#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
903A_INTERN void a_complex_coth(a_complex *ctx, a_complex z)
904{
905 a_complex_coth_(&z);
906 *ctx = z;
907}
908#endif /* A_HAVE_INLINE */
909
910/* Inverse Complex Hyperbolic Functions */
911
917#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
918A_EXTERN void a_complex_asinh(a_complex *ctx, a_complex z);
919#endif /* A_HAVE_INLINE */
920A_EXTERN void a_complex_asinh_(a_complex *ctx);
921#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
922A_INTERN void a_complex_asinh(a_complex *ctx, a_complex z)
923{
924 a_complex_asinh_(&z);
925 *ctx = z;
926}
927#endif /* A_HAVE_INLINE */
928
934#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
935A_EXTERN void a_complex_acosh(a_complex *ctx, a_complex z);
936#endif /* A_HAVE_INLINE */
937A_EXTERN void a_complex_acosh_(a_complex *ctx);
938A_EXTERN void a_complex_acosh_real(a_complex *ctx, a_float x);
939#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
940A_INTERN void a_complex_acosh(a_complex *ctx, a_complex z)
941{
942 a_complex_acosh_(&z);
943 *ctx = z;
944}
945#endif /* A_HAVE_INLINE */
946
952#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
953A_EXTERN void a_complex_atanh(a_complex *ctx, a_complex z);
954#endif /* A_HAVE_INLINE */
955A_EXTERN void a_complex_atanh_(a_complex *ctx);
956A_EXTERN void a_complex_atanh_real(a_complex *ctx, a_float x);
957#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
958A_INTERN void a_complex_atanh(a_complex *ctx, a_complex z)
959{
960 a_complex_atanh_(&z);
961 *ctx = z;
962}
963#endif /* A_HAVE_INLINE */
964
970#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
971A_EXTERN void a_complex_asech(a_complex *ctx, a_complex z);
972#endif /* A_HAVE_INLINE */
973A_EXTERN void a_complex_asech_(a_complex *ctx);
974#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
975A_INTERN void a_complex_asech(a_complex *ctx, a_complex z)
976{
977 a_complex_asech_(&z);
978 *ctx = z;
979}
980#endif /* A_HAVE_INLINE */
981
987#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
988A_EXTERN void a_complex_acsch(a_complex *ctx, a_complex z);
989#endif /* A_HAVE_INLINE */
990A_EXTERN void a_complex_acsch_(a_complex *ctx);
991#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
992A_INTERN void a_complex_acsch(a_complex *ctx, a_complex z)
993{
994 a_complex_acsch_(&z);
995 *ctx = z;
996}
997#endif /* A_HAVE_INLINE */
998
1004#if !defined A_HAVE_INLINE || defined(LIBA_COMPLEX_C)
1005A_EXTERN void a_complex_acoth(a_complex *ctx, a_complex z);
1006#endif /* A_HAVE_INLINE */
1007A_EXTERN void a_complex_acoth_(a_complex *ctx);
1008#if defined(A_HAVE_INLINE) || defined(LIBA_COMPLEX_C)
1009A_INTERN void a_complex_acoth(a_complex *ctx, a_complex z)
1010{
1011 a_complex_acoth_(&z);
1012 *ctx = z;
1013}
1014#endif /* A_HAVE_INLINE */
1015
1016#if defined(LIBA_COMPLEX_C)
1017#undef A_INTERN
1018#define A_INTERN static A_INLINE
1019#endif /* LIBA_COMPLEX_C */
1020#if defined(__cplusplus)
1021} /* extern "C" */
1022#endif /* __cplusplus */
1023
1025
1026#endif /* a/complex.h */
algorithm library
void a_complex_asin(a_complex *ctx, a_complex z)
computes the complex arc sine
void a_complex_coth(a_complex *ctx, a_complex z)
computes the complex hyperbolic cotangent
void a_complex_conj(a_complex *ctx, a_complex z)
computes the complex conjugate
void a_complex_asech(a_complex *ctx, a_complex z)
computes the complex arc hyperbolic secant
a_float a_complex_arg(a_complex z)
computes the phase angle of a complex number
void a_complex_sub(a_complex *ctx, a_complex x, a_complex y)
subtraction of complex numbers
void a_complex_csch(a_complex *ctx, a_complex z)
computes the complex hyperbolic cosecant
static void a_complex_rect(a_complex *ctx, a_float real, a_float imag)
constructs a complex number from real and imaginary parts
Definition complex.h:49
void a_complex_sec(a_complex *ctx, a_complex z)
computes the complex secant
void a_complex_pow(a_complex *ctx, a_complex z, a_complex a)
complex number z raised to complex power a
a_float a_complex_abs(a_complex z)
computes the magnitude of a complex number
a_bool a_complex_eq(a_complex x, a_complex y)
complex number x is equal to complex number y
void a_complex_csc(a_complex *ctx, a_complex z)
computes the complex cosecant
void a_complex_atan(a_complex *ctx, a_complex z)
computes the complex arc tangent
a_bool a_complex_ne(a_complex x, a_complex y)
complex number x is not equal to complex number y
void a_complex_inv(a_complex *ctx, a_complex z)
inverse of a complex number
void a_complex_asinh(a_complex *ctx, a_complex z)
computes the complex arc hyperbolic sine
void a_complex_acot(a_complex *ctx, a_complex z)
computes the complex arc cotangent
void a_complex_pow_real(a_complex *ctx, a_complex z, a_float a)
complex number z raised to real power a
void a_complex_acsc(a_complex *ctx, a_complex z)
computes the complex arc cosecant
void a_complex_acos(a_complex *ctx, a_complex z)
computes the complex arc cosine
a_float a_complex_logabs(a_complex z)
computes the natural logarithm of magnitude of a complex number
void a_complex_tan(a_complex *ctx, a_complex z)
computes the complex tangent
a_float a_complex_abs2(a_complex z)
computes the squared magnitude of a complex number
void a_complex_cos(a_complex *ctx, a_complex z)
computes the complex cosine
void a_complex_div(a_complex *ctx, a_complex x, a_complex y)
division of complex numbers
void a_complex_sinh(a_complex *ctx, a_complex z)
computes the complex hyperbolic sine
void a_complex_acsch(a_complex *ctx, a_complex z)
computes the complex arc hyperbolic cosecant
void a_complex_sech(a_complex *ctx, a_complex z)
computes the complex hyperbolic secant
void a_complex_tanh(a_complex *ctx, a_complex z)
computes the complex hyperbolic tangent
void a_complex_asec(a_complex *ctx, a_complex z)
computes the complex arc secant
void a_complex_acoth(a_complex *ctx, a_complex z)
computes the complex arc hyperbolic cotangent
void a_complex_log(a_complex *ctx, a_complex z)
computes the complex natural logarithm
void a_complex_sin(a_complex *ctx, a_complex z)
computes the complex sine
void a_complex_logb(a_complex *ctx, a_complex z, a_complex b)
computes the complex base-b logarithm
void a_complex_neg(a_complex *ctx, a_complex z)
computes the complex negative
void a_complex_sqrt(a_complex *ctx, a_complex z)
computes the complex square root
void a_complex_mul(a_complex *ctx, a_complex x, a_complex y)
multiplication of complex numbers
void a_complex_polar(a_complex *ctx, a_float rho, a_float theta)
constructs a complex number from polar form
void a_complex_acosh(a_complex *ctx, a_complex z)
computes the complex arc hyperbolic cosine
unsigned int a_complex_parse(a_complex *ctx, char const *str)
parse a string into a complex number
void a_complex_cot(a_complex *ctx, a_complex z)
computes the complex cotangent
void a_complex_add(a_complex *ctx, a_complex x, a_complex y)
addition of complex numbers
void a_complex_atanh(a_complex *ctx, a_complex z)
computes the complex arc hyperbolic tangent
void a_complex_log2(a_complex *ctx, a_complex z)
computes the complex base-2 logarithm
void a_complex_cosh(a_complex *ctx, a_complex z)
computes the complex hyperbolic cosine
void a_complex_exp(a_complex *ctx, a_complex z)
computes the complex base-e exponential
void a_complex_log10(a_complex *ctx, a_complex z)
computes the complex base-10 logarithm
void a_complex_proj(a_complex *ctx, a_complex z)
computes the projection on Riemann sphere
double a_float
compiler built-in floating-point number type
Definition a.h:1003
bool a_bool
type, capable of holding one of the two values: 1 and 0
Definition a.h:320
instance structure for complex number
Definition complex.h:30
a_float imag
Definition complex.h:32