File: Roots.i

package info (click to toggle)
libmath-gsl-perl 0.49-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 192,040 kB
  • sloc: ansic: 895,452; perl: 24,787; makefile: 12
file content (37 lines) | stat: -rw-r--r-- 1,061 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
%module "Math::GSL::Roots"
%include "gsl_typemaps.i"
%include "typemaps.i"
%include "renames.i"

%typemap(freearg) gsl_function *;
%newobject gsl_root_fsolver_alloc;
%extend gsl_root_fsolver {
    ~gsl_root_fsolver() {
        struct gsl_function *gsl_f = (struct gsl_function *) $self->function;
        if (gsl_f != NULL) {
            struct gsl_function_perl *perl_f = (struct gsl_function_perl *) $self->function->params;
            gsl_function_perl_free(perl_f);
        }
        gsl_root_fsolver_free($self);
    }
 }

%typemap(freearg) gsl_function_fdf *;
%newobject gsl_root_fdfsolver_alloc;
%extend gsl_root_fdfsolver {
    ~gsl_root_fdfsolver() {
        if ($self->fdf != NULL) {
            struct gsl_function_fdf_perl *perl_fdf = (struct gsl_function_fdf_perl *) $self->fdf->params;
            gsl_function_fdf_perl_free(perl_fdf);
        }
        gsl_root_fdfsolver_free($self);
    }
 }

%{
    #include "gsl/gsl_types.h"
    #include "gsl/gsl_roots.h"
%}
%include "gsl/gsl_types.h"
%include "gsl/gsl_roots.h"
%include "../pod/Roots.pod"