1Math(3) User Contributed Perl Documentation Math(3)
2
3
4
6 PDL::Math - extended mathematical operations and special functions
7
9 use PDL::Math;
10
11 use PDL::Graphics::TriD;
12 imag3d [SURF2D,bessj0(rvals(zeroes(50,50))/2)];
13
15 This module extends PDL with more advanced mathematical functions than
16 provided by standard Perl.
17
18 All the functions have one input pdl, and one output, unless otherwise
19 stated.
20
21 Many of the functions are linked from the system maths library or the
22 Cephes maths library (determined when PDL is compiled); a few are
23 implemented entirely in PDL.
24
26 acos
27
28 Signature: (a(); [o]b())
29
30 The usual trigonometric function. Works inplace.
31
32 asin
33
34 Signature: (a(); [o]b())
35
36 The usual trigonometric function. Works inplace.
37
38 atan
39
40 Signature: (a(); [o]b())
41
42 The usual trigonometric function. Works inplace.
43
44 cosh
45
46 Signature: (a(); [o]b())
47
48 The standard hyperbolic function. Works inplace.
49
50 sinh
51
52 Signature: (a(); [o]b())
53
54 The standard hyperbolic function. Works inplace.
55
56 tan
57
58 Signature: (a(); [o]b())
59
60 The usual trigonometric function. Works inplace.
61
62 tanh
63
64 Signature: (a(); [o]b())
65
66 The standard hyperbolic function. Works inplace.
67
68 ceil
69
70 Signature: (a(); [o]b())
71
72 Round to integral values in floating-point format. Works inplace.
73
74 floor
75
76 Signature: (a(); [o]b())
77
78 Round to integral values in floating-point format. Works inplace.
79
80 rint
81
82 Signature: (a(); [o]b())
83
84 Round to integral values in floating-point format. Works inplace.
85
86 pow
87
88 Signature: (a(); b(); [o]c())
89
90 Synonym for `**'. Works inplace.
91
92 acosh
93
94 Signature: (a(); [o]b())
95
96 The standard hyperbolic function. Works inplace.
97
98 asinh
99
100 Signature: (a(); [o]b())
101
102 The standard hyperbolic function. Works inplace.
103
104 atanh
105
106 Signature: (a(); [o]b())
107
108 The standard hyperbolic function. Works inplace.
109
110 erf
111
112 Signature: (a(); [o]b())
113
114 The error function. Works inplace.
115
116 erfc
117
118 Signature: (a(); [o]b())
119
120 The complement of the error function. Works inplace.
121
122 bessj0
123
124 Signature: (a(); [o]b())
125
126 The standard Bessel function. Works inplace.
127
128 bessj1
129
130 Signature: (a(); [o]b())
131
132 The standard Bessel function. Works inplace.
133
134 bessy0
135
136 Signature: (a(); [o]b())
137
138 The standard Bessel function. Works inplace.
139
140 bessy1
141
142 Signature: (a(); [o]b())
143
144 The standard Bessel function. Works inplace.
145
146 bessjn
147
148 Signature: (a(); int n(); [o]b())
149
150 The standard Bessel function. This has a second integer argument which
151 gives the order of the function required.
152 Works inplace.
153
154 bessyn
155
156 Signature: (a(); int n(); [o]b())
157
158 The standard Bessel function. This has a second integer argument which
159 gives the order of the function required.
160 Works inplace.
161
162 lgamma
163
164 Signature: (a(); [o]b(); int[o]s())
165
166 log gamma function
167
168 This returns 2 piddles -- the first set gives the log(gamma) values,
169 while the second set, of integer values, gives the sign of the gamma
170 function. This is useful for determining factorials, amongst other
171 things.
172
173 badmask
174
175 Signature: (a(); b(); [o]c())
176
177 Clears all "infs" and "nans" in $a to the corresponding value in $b.
178
179 badmask can be run with $a inplace:
180
181 badmask($a->inplace,0);
182 $a->inplace->badmask(0);
183
184 isfinite
185
186 Signature: (a(); int [o]mask())
187
188 Sets $mask true if $a is not a "NaN" or "inf" (either positive or nega‐
189 tive). Works inplace.
190
191 erfi
192
193 Signature: (a(); [o]b())
194
195 The inverse of the error function. Works inplace.
196
197 ndtri
198
199 Signature: (a(); [o]b())
200
201 The value for which the area under the Gaussian probability density
202 function (integrated from minus infinity) is equal to the argument (cf
203 erfi). Works inplace.
204
205 polyroots
206
207 Signature: (cr(n); ci(n); [o]rr(m); [o]ri(m))
208
209 Complex roots of a complex polynomial, given coefficients in order of
210 decreasing powers.
211
212 ($rr, $ri) = polyroots($cr, $ci);
213
215 Hasn't been tested on all platforms to ensure Cephes versions are
216 picked up automatically and used correctly.
217
219 Copyright (C) R.J.R. Williams 1997 (rjrw@ast.leeds.ac.uk), Karl Glaze‐
220 brook (kgb@aaoepp.aao.gov.au) and Tuomas J. Lukka (Tuomas.Lukka@hel‐
221 sinki.fi). Portions (C) Craig DeForest 2002 (deforest@boul‐
222 der.swri.edu).
223
224 All rights reserved. There is no warranty. You are allowed to redis‐
225 tribute this software / documentation under certain conditions. For
226 details, see the file COPYING in the PDL distribution. If this file is
227 separated from the PDL distribution, the PDL copyright notice should be
228 included in the file.
229
230
231
232perl v5.8.8 2006-12-02 Math(3)