File: Sys.pm.1.16

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 (280 lines) | stat: -rw-r--r-- 8,478 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
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
# 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::Sys;
use base qw(Exporter);
use base qw(DynaLoader);
package Math::GSL::Sysc;
bootstrap Math::GSL::Sys;
package Math::GSL::Sys;
@EXPORT = qw();

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

package Math::GSL::Sys;

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::Sys;

*gsl_error = *Math::GSL::Sysc::gsl_error;
*gsl_stream_printf = *Math::GSL::Sysc::gsl_stream_printf;
*gsl_strerror = *Math::GSL::Sysc::gsl_strerror;
*gsl_set_error_handler = *Math::GSL::Sysc::gsl_set_error_handler;
*gsl_set_error_handler_off = *Math::GSL::Sysc::gsl_set_error_handler_off;
*gsl_set_stream_handler = *Math::GSL::Sysc::gsl_set_stream_handler;
*gsl_set_stream = *Math::GSL::Sysc::gsl_set_stream;
*gsl_log1p = *Math::GSL::Sysc::gsl_log1p;
*gsl_expm1 = *Math::GSL::Sysc::gsl_expm1;
*gsl_hypot = *Math::GSL::Sysc::gsl_hypot;
*gsl_hypot3 = *Math::GSL::Sysc::gsl_hypot3;
*gsl_acosh = *Math::GSL::Sysc::gsl_acosh;
*gsl_asinh = *Math::GSL::Sysc::gsl_asinh;
*gsl_atanh = *Math::GSL::Sysc::gsl_atanh;
*gsl_isnan = *Math::GSL::Sysc::gsl_isnan;
*gsl_isinf = *Math::GSL::Sysc::gsl_isinf;
*gsl_finite = *Math::GSL::Sysc::gsl_finite;
*gsl_nan = *Math::GSL::Sysc::gsl_nan;
*gsl_posinf = *Math::GSL::Sysc::gsl_posinf;
*gsl_neginf = *Math::GSL::Sysc::gsl_neginf;
*gsl_fdiv = *Math::GSL::Sysc::gsl_fdiv;
*gsl_coerce_double = *Math::GSL::Sysc::gsl_coerce_double;
*gsl_coerce_float = *Math::GSL::Sysc::gsl_coerce_float;
*gsl_coerce_long_double = *Math::GSL::Sysc::gsl_coerce_long_double;
*gsl_ldexp = *Math::GSL::Sysc::gsl_ldexp;
*gsl_frexp = *Math::GSL::Sysc::gsl_frexp;
*gsl_fcmp = *Math::GSL::Sysc::gsl_fcmp;

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

package Math::GSL::Sys;

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

our @EXPORT = qw();
our @EXPORT_OK = qw/
               gsl_log1p
               gsl_expm1
               gsl_hypot
               gsl_hypot3
               gsl_acosh
               gsl_asinh
               gsl_atanh
               gsl_isnan
               gsl_isinf
               gsl_finite
               gsl_posinf
               gsl_neginf
               gsl_fdiv
               gsl_coerce_double
               gsl_coerce_float
               gsl_coerce_long_double
               gsl_ldexp
               gsl_frexp
               gsl_fcmp
               gsl_nan
               gsl_isnan
               gsl_inf
               $GSL_NAN
               $GSL_POSINF
               $GSL_NEGINF
             /;

our %EXPORT_TAGS = ( all => \@EXPORT_OK );
our $GSL_NAN    = gsl_nan();
our $GSL_POSINF = gsl_posinf();
our $GSL_NEGINF = gsl_neginf();

__END__

=encoding utf8

=head1 NAME

Math::GSL::Sys - Misc Math Functions

=head1 SYNOPSIS

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

=head1 DESCRIPTION

This module contains various useful math functions that are not usually
provided by standard libraries.

=over

=item * C<gsl_log1p($x)>

This function computes the value of \log(1+$x) in a way that is accurate for
small $x. It provides an alternative to the BSD math function log1p(x).

=item * C<gsl_expm1($x)>

This function computes the value of \exp($x)-1 in a way that is accurate for
small $x. It provides an alternative to the BSD math function expm1(x).

=item * C<gsl_hypot($x, $y)>

This function computes the value of \sqrt{$x^2 + $y^2} in a way that avoids
overflow. It provides an alternative to the BSD math function hypot($x,$y).

=item * C<gsl_hypot3($x, $y, $z)>

This function computes the value of \sqrt{$x^2 + $y^2 + $z^2} in a way that
avoids overflow.

=item * C<gsl_acosh($x)>

This function computes the value of \arccosh($x). It provides an alternative to
the standard math function acosh($x).

=item * C<gsl_asinh($x)>

This function computes the value of \arcsinh($x). It provides an alternative to
the standard math function asinh($x).

=item * C<gsl_atanh($x)>

This function computes the value of \arctanh($x). It provides an alternative to
the standard math function atanh($x).

=item * C<gsl_isnan($x)>

This function returns 1 if $x is not-a-number.

=item * C<gsl_isinf($x)>

This function returns +1 if $x is positive infinity, -1 if $x is negative
infinity and 0 otherwise.

=item * C<gsl_finite($x)>

This function returns 1 if $x is a real number, and 0 if it is infinite or not-a-number.

=item * C<gsl_posinf >

=item * C<gsl_neginf >

=item * C<gsl_fdiv >

=item * C<gsl_coerce_double >

=item * C<gsl_coerce_float >

=item * C<gsl_coerce_long_double >

=item * C<gsl_ldexp($x, $e)>

This function computes the value of $x * 2**$e. It provides an alternative to
the standard math function ldexp($x,$e).

=item * C<gsl_frexp($x)>

This function splits the number $x into its normalized fraction f and exponent
e, such that $x = f * 2^e and 0.5 <= f < 1. The function returns f and then the
exponent in e. If $x is zero, both f and e are set to zero. This function
provides an alternative to the standard math function frexp(x, e).

=item * C<gsl_fcmp($x, $y, $epsilon)>

This function determines whether $x and $y are approximately equal to a
relative accuracy $epsilon. The relative accuracy is measured using an interval
of size 2 \delta, where \delta = 2^k \epsilon and k is the maximum base-2
exponent of $x and $y as computed by the function frexp. If $x and $y lie
within this interval, they are considered approximately equal and the function
returns 0. Otherwise if $x < $y, the function returns -1, or if $x > $y, the
function returns +1. Note that $x and $y are compared to relative accuracy, so
this function is not suitable for testing whether a value is approximately
zero. The implementation is based on the package fcmp by T.C. Belding.

=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;