Added some more tags to SF subsystem.
[Math-GSL.git] / Complex.i
blobcb6a3c23052e266df315c42516710944a20ed750
1 %module Complex
2 %{
3 #include "/usr/local/include/gsl/gsl_complex.h"
4 #include "/usr/local/include/gsl/gsl_complex_math.h"
5 %}
7 %include "/usr/local/include/gsl/gsl_complex.h"
8 %include "/usr/local/include/gsl/gsl_complex_math.h"
11 %include "carrays.i"
12 %array_functions(double, doubleArray);
14 /* r= real+i*imag */
15 //gsl_complex gsl_complex_rect (double x, double y);
17 /* r= r e^(i theta) */
18 //gsl_complex gsl_complex_polar (double r, double theta);
20 %perlcode %{
22 @EXPORT_OK = qw(
23 gsl_complex_arg gsl_complex_abs gsl_complex_rect gsl_complex_polar doubleArray_getitem
24 gsl_complex_rect gsl_complex_polar gsl_complex_arg gsl_complex_abs gsl_complex_abs2
25 gsl_complex_logabs gsl_complex_add gsl_complex_sub gsl_complex_mul gsl_complex_div
26 gsl_complex_add_real gsl_complex_sub_real gsl_complex_mul_real gsl_complex_div_real
27 gsl_complex_add_imag gsl_complex_sub_imag gsl_complex_mul_imag gsl_complex_div_imag
28 gsl_complex_conjugate gsl_complex_inverse gsl_complex_negative gsl_complex_sqrt
29 gsl_complex_sqrt_real gsl_complex_pow gsl_complex_pow_real gsl_complex_exp
30 gsl_complex_log gsl_complex_log10 gsl_complex_log_b gsl_complex_sin
31 gsl_complex_cos gsl_complex_sec gsl_complex_csc gsl_complex_tan
32 gsl_complex_cot gsl_complex_arcsin gsl_complex_arcsin_real gsl_complex_arccos
33 gsl_complex_arccos_real gsl_complex_arcsec gsl_complex_arcsec_real gsl_complex_arccsc
34 gsl_complex_arccsc_real gsl_complex_arctan gsl_complex_arccot gsl_complex_sinh
35 gsl_complex_cosh gsl_complex_sech gsl_complex_csch gsl_complex_tanh
36 gsl_complex_coth gsl_complex_arcsinh gsl_complex_arccosh gsl_complex_arccosh_real
37 gsl_complex_arcsech gsl_complex_arccsch gsl_complex_arctanh gsl_complex_arctanh_real
38 gsl_complex_arccoth new_doubleArray delete_doubleArray doubleArray_setitem
41 %EXPORT_TAGS = ( all => [ @EXPORT_OK ] );
43 sub new {
44 my ($class, @values) = @_;
45 my $this = {};
46 $this->{_complex} = gsl_complex_rect($values[0], $values[1]);
47 bless $this, $class;
49 sub real {
50 my ($self) = @_;
51 return doubleArray_getitem($self->{_complex}->{dat}, 0 );
54 sub imag {
55 my ($self) = @_;
56 return doubleArray_getitem($self->{_complex}->{dat}, 1 );