1 /** D bindings for GSL. 2 Authors: Chibisi Chima-Okereke 3 Copyright: Copyright (c) 2016, Chibisi Chima-Okereke. All rights reserved. 4 License: Boost License 1.0 5 */ 6 7 module gsl.complex; 8 //import core.stdc.complex; 9 10 extern (C): 11 12 //gsl_complex 13 alias double* gsl_complex_packed; 14 alias float* gsl_complex_packed_float; 15 alias real* gsl_complex_packed_long_double; 16 alias const(double)* gsl_const_complex_packed; 17 alias const(float)* gsl_const_complex_packed_float; 18 alias const(real)* gsl_const_complex_packed_long_double; 19 alias double* gsl_complex_packed_array; 20 alias float* gsl_complex_packed_array_float; 21 alias real* gsl_complex_packed_array_long_double; 22 alias const(double)* gsl_const_complex_packed_array; 23 alias const(float)* gsl_const_complex_packed_array_float; 24 alias const(real)* gsl_const_complex_packed_array_long_double; 25 alias double* gsl_complex_packed_ptr; 26 alias float* gsl_complex_packed_float_ptr; 27 alias real* gsl_complex_packed_long_double_ptr; 28 alias const(double)* gsl_const_complex_packed_ptr; 29 alias const(float)* gsl_const_complex_packed_float_ptr; 30 alias const(real)* gsl_const_complex_packed_long_double_ptr; 31 32 struct gsl_complex_long_double 33 { 34 real[2] dat; 35 } 36 37 struct gsl_complex 38 { 39 double[2] dat; 40 } 41 42 struct gsl_complex_float 43 { 44 float[2] dat; 45 } 46 47 48 49 // gsl_complex_math 50 gsl_complex gsl_complex_polar (double r, double theta); 51 gsl_complex gsl_complex_rect (double x, double y); 52 double gsl_complex_arg (gsl_complex z); 53 double gsl_complex_abs (gsl_complex z); 54 double gsl_complex_abs2 (gsl_complex z); 55 double gsl_complex_logabs (gsl_complex z); 56 gsl_complex gsl_complex_add (gsl_complex a, gsl_complex b); 57 gsl_complex gsl_complex_sub (gsl_complex a, gsl_complex b); 58 gsl_complex gsl_complex_mul (gsl_complex a, gsl_complex b); 59 gsl_complex gsl_complex_div (gsl_complex a, gsl_complex b); 60 gsl_complex gsl_complex_add_real (gsl_complex a, double x); 61 gsl_complex gsl_complex_sub_real (gsl_complex a, double x); 62 gsl_complex gsl_complex_mul_real (gsl_complex a, double x); 63 gsl_complex gsl_complex_div_real (gsl_complex a, double x); 64 gsl_complex gsl_complex_add_imag (gsl_complex a, double y); 65 gsl_complex gsl_complex_sub_imag (gsl_complex a, double y); 66 gsl_complex gsl_complex_mul_imag (gsl_complex a, double y); 67 gsl_complex gsl_complex_div_imag (gsl_complex a, double y); 68 gsl_complex gsl_complex_conjugate (gsl_complex z); 69 gsl_complex gsl_complex_inverse (gsl_complex a); 70 gsl_complex gsl_complex_negative (gsl_complex a); 71 gsl_complex gsl_complex_sqrt (gsl_complex z); 72 gsl_complex gsl_complex_sqrt_real (double x); 73 gsl_complex gsl_complex_pow (gsl_complex a, gsl_complex b); 74 gsl_complex gsl_complex_pow_real (gsl_complex a, double b); 75 gsl_complex gsl_complex_exp (gsl_complex a); 76 gsl_complex gsl_complex_log (gsl_complex a); 77 gsl_complex gsl_complex_log10 (gsl_complex a); 78 gsl_complex gsl_complex_log_b (gsl_complex a, gsl_complex b); 79 gsl_complex gsl_complex_sin (gsl_complex a); 80 gsl_complex gsl_complex_cos (gsl_complex a); 81 gsl_complex gsl_complex_sec (gsl_complex a); 82 gsl_complex gsl_complex_csc (gsl_complex a); 83 gsl_complex gsl_complex_tan (gsl_complex a); 84 gsl_complex gsl_complex_cot (gsl_complex a); 85 gsl_complex gsl_complex_arcsin (gsl_complex a); 86 gsl_complex gsl_complex_arcsin_real (double a); 87 gsl_complex gsl_complex_arccos (gsl_complex a); 88 gsl_complex gsl_complex_arccos_real (double a); 89 gsl_complex gsl_complex_arcsec (gsl_complex a); 90 gsl_complex gsl_complex_arcsec_real (double a); 91 gsl_complex gsl_complex_arccsc (gsl_complex a); 92 gsl_complex gsl_complex_arccsc_real (double a); 93 gsl_complex gsl_complex_arctan (gsl_complex a); 94 gsl_complex gsl_complex_arccot (gsl_complex a); 95 gsl_complex gsl_complex_sinh (gsl_complex a); 96 gsl_complex gsl_complex_cosh (gsl_complex a); 97 gsl_complex gsl_complex_sech (gsl_complex a); 98 gsl_complex gsl_complex_csch (gsl_complex a); 99 gsl_complex gsl_complex_tanh (gsl_complex a); 100 gsl_complex gsl_complex_coth (gsl_complex a); 101 gsl_complex gsl_complex_arcsinh (gsl_complex a); 102 gsl_complex gsl_complex_arccosh (gsl_complex a); 103 gsl_complex gsl_complex_arccosh_real (double a); 104 gsl_complex gsl_complex_arcsech (gsl_complex a); 105 gsl_complex gsl_complex_arccsch (gsl_complex a); 106 gsl_complex gsl_complex_arctanh (gsl_complex a); 107 gsl_complex gsl_complex_arctanh_real (double a); 108 gsl_complex gsl_complex_arccoth (gsl_complex a);