File: Spline.pm.2.5

package info (click to toggle)
libmath-gsl-perl 0.45-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 192,156 kB
  • sloc: ansic: 895,524; perl: 24,682; makefile: 12
file content (248 lines) | stat: -rw-r--r-- 7,613 bytes parent folder | download | duplicates (12)
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
# This file was automatically generated by SWIG (https://www.swig.org).
# Version 4.2.0
#
# Do not make changes to this file unless you know what you are doing - modify
# the SWIG interface file instead.

package Math::GSL::Spline;
use base qw(Exporter);
use base qw(DynaLoader);
package Math::GSL::Splinec;
bootstrap Math::GSL::Spline;
package Math::GSL::Spline;
@EXPORT = qw();

# ---------- BASE METHODS -------------

package Math::GSL::Spline;

sub TIEHASH {
    my ($classname,$obj) = @_;
    return bless $obj, $classname;
}

sub CLEAR { }

sub FIRSTKEY { }

sub NEXTKEY { }

sub FETCH {
    my ($self,$field) = @_;
    my $member_func = "swig_${field}_get";
    $self->$member_func();
}

sub STORE {
    my ($self,$field,$newval) = @_;
    my $member_func = "swig_${field}_set";
    $self->$member_func($newval);
}

sub this {
    my $ptr = shift;
    return tied(%$ptr);
}


# ------- FUNCTION WRAPPERS --------

package Math::GSL::Spline;

*gsl_error = *Math::GSL::Splinec::gsl_error;
*gsl_stream_printf = *Math::GSL::Splinec::gsl_stream_printf;
*gsl_strerror = *Math::GSL::Splinec::gsl_strerror;
*gsl_set_error_handler = *Math::GSL::Splinec::gsl_set_error_handler;
*gsl_set_error_handler_off = *Math::GSL::Splinec::gsl_set_error_handler_off;
*gsl_set_stream_handler = *Math::GSL::Splinec::gsl_set_stream_handler;
*gsl_set_stream = *Math::GSL::Splinec::gsl_set_stream;
*gsl_spline_alloc = *Math::GSL::Splinec::gsl_spline_alloc;
*gsl_spline_init = *Math::GSL::Splinec::gsl_spline_init;
*gsl_spline_name = *Math::GSL::Splinec::gsl_spline_name;
*gsl_spline_min_size = *Math::GSL::Splinec::gsl_spline_min_size;
*gsl_spline_eval_e = *Math::GSL::Splinec::gsl_spline_eval_e;
*gsl_spline_eval = *Math::GSL::Splinec::gsl_spline_eval;
*gsl_spline_eval_deriv_e = *Math::GSL::Splinec::gsl_spline_eval_deriv_e;
*gsl_spline_eval_deriv = *Math::GSL::Splinec::gsl_spline_eval_deriv;
*gsl_spline_eval_deriv2_e = *Math::GSL::Splinec::gsl_spline_eval_deriv2_e;
*gsl_spline_eval_deriv2 = *Math::GSL::Splinec::gsl_spline_eval_deriv2;
*gsl_spline_eval_integ_e = *Math::GSL::Splinec::gsl_spline_eval_integ_e;
*gsl_spline_eval_integ = *Math::GSL::Splinec::gsl_spline_eval_integ;
*gsl_spline_free = *Math::GSL::Splinec::gsl_spline_free;

############# Class : Math::GSL::Spline::gsl_spline ##############

package Math::GSL::Spline::gsl_spline;
use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
@ISA = qw( Math::GSL::Spline );
%OWNER = ();
%ITERATORS = ();
*swig_interp_get = *Math::GSL::Splinec::gsl_spline_interp_get;
*swig_interp_set = *Math::GSL::Splinec::gsl_spline_interp_set;
*swig_x_get = *Math::GSL::Splinec::gsl_spline_x_get;
*swig_x_set = *Math::GSL::Splinec::gsl_spline_x_set;
*swig_y_get = *Math::GSL::Splinec::gsl_spline_y_get;
*swig_y_set = *Math::GSL::Splinec::gsl_spline_y_set;
*swig_size_get = *Math::GSL::Splinec::gsl_spline_size_get;
*swig_size_set = *Math::GSL::Splinec::gsl_spline_size_set;
sub new {
    my $pkg = shift;
    my $self = Math::GSL::Splinec::new_gsl_spline(@_);
    bless $self, $pkg if defined($self);
}

sub DESTROY {
    return unless $_[0]->isa('HASH');
    my $self = tied(%{$_[0]});
    return unless defined $self;
    delete $ITERATORS{$self};
    if (exists $OWNER{$self}) {
        Math::GSL::Splinec::delete_gsl_spline($self);
        delete $OWNER{$self};
    }
}

sub DISOWN {
    my $self = shift;
    my $ptr = tied(%$self);
    delete $OWNER{$ptr};
}

sub ACQUIRE {
    my $self = shift;
    my $ptr = tied(%$self);
    $OWNER{$ptr} = 1;
}


# ------- VARIABLE STUBS --------

package Math::GSL::Spline;

*GSL_VERSION = *Math::GSL::Splinec::GSL_VERSION;
*GSL_MAJOR_VERSION = *Math::GSL::Splinec::GSL_MAJOR_VERSION;
*GSL_MINOR_VERSION = *Math::GSL::Splinec::GSL_MINOR_VERSION;
*GSL_POSZERO = *Math::GSL::Splinec::GSL_POSZERO;
*GSL_NEGZERO = *Math::GSL::Splinec::GSL_NEGZERO;
*GSL_SUCCESS = *Math::GSL::Splinec::GSL_SUCCESS;
*GSL_FAILURE = *Math::GSL::Splinec::GSL_FAILURE;
*GSL_CONTINUE = *Math::GSL::Splinec::GSL_CONTINUE;
*GSL_EDOM = *Math::GSL::Splinec::GSL_EDOM;
*GSL_ERANGE = *Math::GSL::Splinec::GSL_ERANGE;
*GSL_EFAULT = *Math::GSL::Splinec::GSL_EFAULT;
*GSL_EINVAL = *Math::GSL::Splinec::GSL_EINVAL;
*GSL_EFAILED = *Math::GSL::Splinec::GSL_EFAILED;
*GSL_EFACTOR = *Math::GSL::Splinec::GSL_EFACTOR;
*GSL_ESANITY = *Math::GSL::Splinec::GSL_ESANITY;
*GSL_ENOMEM = *Math::GSL::Splinec::GSL_ENOMEM;
*GSL_EBADFUNC = *Math::GSL::Splinec::GSL_EBADFUNC;
*GSL_ERUNAWAY = *Math::GSL::Splinec::GSL_ERUNAWAY;
*GSL_EMAXITER = *Math::GSL::Splinec::GSL_EMAXITER;
*GSL_EZERODIV = *Math::GSL::Splinec::GSL_EZERODIV;
*GSL_EBADTOL = *Math::GSL::Splinec::GSL_EBADTOL;
*GSL_ETOL = *Math::GSL::Splinec::GSL_ETOL;
*GSL_EUNDRFLW = *Math::GSL::Splinec::GSL_EUNDRFLW;
*GSL_EOVRFLW = *Math::GSL::Splinec::GSL_EOVRFLW;
*GSL_ELOSS = *Math::GSL::Splinec::GSL_ELOSS;
*GSL_EROUND = *Math::GSL::Splinec::GSL_EROUND;
*GSL_EBADLEN = *Math::GSL::Splinec::GSL_EBADLEN;
*GSL_ENOTSQR = *Math::GSL::Splinec::GSL_ENOTSQR;
*GSL_ESING = *Math::GSL::Splinec::GSL_ESING;
*GSL_EDIVERGE = *Math::GSL::Splinec::GSL_EDIVERGE;
*GSL_EUNSUP = *Math::GSL::Splinec::GSL_EUNSUP;
*GSL_EUNIMPL = *Math::GSL::Splinec::GSL_EUNIMPL;
*GSL_ECACHE = *Math::GSL::Splinec::GSL_ECACHE;
*GSL_ETABLE = *Math::GSL::Splinec::GSL_ETABLE;
*GSL_ENOPROG = *Math::GSL::Splinec::GSL_ENOPROG;
*GSL_ENOPROGJ = *Math::GSL::Splinec::GSL_ENOPROGJ;
*GSL_ETOLF = *Math::GSL::Splinec::GSL_ETOLF;
*GSL_ETOLX = *Math::GSL::Splinec::GSL_ETOLX;
*GSL_ETOLG = *Math::GSL::Splinec::GSL_ETOLG;
*GSL_EOF = *Math::GSL::Splinec::GSL_EOF;

@EXPORT_OK = qw/
               gsl_spline_alloc
               gsl_spline_init
               gsl_spline_name
               gsl_spline_min_size
               gsl_spline_eval_e
               gsl_spline_eval
               gsl_spline_eval_deriv_e
               gsl_spline_eval_deriv
               gsl_spline_eval_deriv2_e
               gsl_spline_eval_deriv2
               gsl_spline_eval_integ_e
               gsl_spline_eval_integ
               gsl_spline_free
             /;
%EXPORT_TAGS = ( all => [ @EXPORT_OK ] );

__END__

=encoding utf8

=head1 NAME

Math::GSL::Spline - Splines

=head1 SYNOPSIS

    use Math::GSL::Spline qw/:all/;

=head1 DESCRIPTION

The functions described in the Interp module required the user to supply
pointers to the x and y arrays on each call. The following functions are
equivalent to the corresponding gsl_interp functions but maintain a copy of
this data in the gsl_spline object. This removes the need to pass both xa and
ya as arguments on each evaluation.

=over

=item * C<gsl_spline_alloc($T, $size)>

=item * C<gsl_spline_init($spline, $xa, $ya, $size)>

=item * C<gsl_spline_free($spline)>

=item * C<gsl_spline_name($spline)>

=item * C<gsl_spline_min_size($spline)>

=item * C<gsl_spline_eval_e($spline, $x, $acc)>

=item * C<gsl_spline_eval($spline, $x, $acc)>

=item * C<gsl_spline_eval_deriv_e($spline, $x, $acc)>

=item * C<gsl_spline_eval_deriv($spline, $x, $acc)>

=item * C<gsl_spline_eval_deriv2_e($spline, $x, $acc)>

=item * C<gsl_spline_eval_deriv2($spline, $x, $acc)>

=item * C<gsl_spline_eval_integ_e($spline, $a, $b, $acc)>

=item * C<gsl_spline_eval_integ($spline, $a, $b, $acc)>

=back

For more information on the functions, we refer you to the GSL official
documentation: L<http://www.gnu.org/software/gsl/manual/html_node/>


=head1 AUTHORS

Jonathan "Duke" Leto <jonathan@leto.net> and Thierry Moisan <thierry.moisan@gmail.com>

=head1 COPYRIGHT AND LICENSE

Copyright (C) 2008-2024 Jonathan "Duke" Leto and Thierry Moisan

This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.

=cut


1;