1Ops(3)                User Contributed Perl Documentation               Ops(3)
2
3
4

NAME

6       PDL::Ops - Fundamental mathematical operators
7

DESCRIPTION

9       This module provides the functions used by PDL to overload the basic
10       mathematical operators ("+ - / *" etc.) and functions ("sin sqrt" etc.)
11
12       It also includes the function "log10", which should be a perl function
13       so that we can overload it!
14
15       Matrix multiplication (the operator "x") is handled by the module
16       PDL::Primitive.
17

SYNOPSIS

19       none
20

FUNCTIONS

22   plus
23         Signature: (a(); b(); [o]c(); int swap)
24
25       add two piddles
26
27          $c = plus $a, $b, 0;     # explicit call with trailing 0
28          $c = $a + $b;           # overloaded call
29          $a->inplace->plus($b,0);  # modify $a inplace
30
31       It can be made to work inplace with the "$a->inplace" syntax.  This
32       function is used to overload the binary "+" operator.  Note that when
33       calling this function explicitly you need to supply a third argument
34       that should generally be zero (see first example).  This restriction is
35       expected to go away in future releases.
36
37       plus does handle bad values.  The state of the bad-value flag of the
38       output piddles is unknown.
39
40   mult
41         Signature: (a(); b(); [o]c(); int swap)
42
43       multiply two piddles
44
45          $c = mult $a, $b, 0;     # explicit call with trailing 0
46          $c = $a * $b;           # overloaded call
47          $a->inplace->mult($b,0);  # modify $a inplace
48
49       It can be made to work inplace with the "$a->inplace" syntax.  This
50       function is used to overload the binary "*" operator.  Note that when
51       calling this function explicitly you need to supply a third argument
52       that should generally be zero (see first example).  This restriction is
53       expected to go away in future releases.
54
55       mult does handle bad values.  The state of the bad-value flag of the
56       output piddles is unknown.
57
58   minus
59         Signature: (a(); b(); [o]c(); int swap)
60
61       subtract two piddles
62
63          $c = minus $a, $b, 0;     # explicit call with trailing 0
64          $c = $a - $b;           # overloaded call
65          $a->inplace->minus($b,0);  # modify $a inplace
66
67       It can be made to work inplace with the "$a->inplace" syntax.  This
68       function is used to overload the binary "-" operator.  Note that when
69       calling this function explicitly you need to supply a third argument
70       that should generally be zero (see first example).  This restriction is
71       expected to go away in future releases.
72
73       minus does handle bad values.  The state of the bad-value flag of the
74       output piddles is unknown.
75
76   divide
77         Signature: (a(); b(); [o]c(); int swap)
78
79       divide two piddles
80
81          $c = divide $a, $b, 0;     # explicit call with trailing 0
82          $c = $a / $b;           # overloaded call
83          $a->inplace->divide($b,0);  # modify $a inplace
84
85       It can be made to work inplace with the "$a->inplace" syntax.  This
86       function is used to overload the binary "/" operator.  Note that when
87       calling this function explicitly you need to supply a third argument
88       that should generally be zero (see first example).  This restriction is
89       expected to go away in future releases.
90
91       divide does handle bad values.  The state of the bad-value flag of the
92       output piddles is unknown.
93
94   gt
95         Signature: (a(); b(); [o]c(); int swap)
96
97       the binary > (greater than) operation
98
99          $c = gt $a, $b, 0;     # explicit call with trailing 0
100          $c = $a > $b;           # overloaded call
101          $a->inplace->gt($b,0);  # modify $a inplace
102
103       It can be made to work inplace with the "$a->inplace" syntax.  This
104       function is used to overload the binary ">" operator.  Note that when
105       calling this function explicitly you need to supply a third argument
106       that should generally be zero (see first example).  This restriction is
107       expected to go away in future releases.
108
109       gt does handle bad values.  The state of the bad-value flag of the
110       output piddles is unknown.
111
112   lt
113         Signature: (a(); b(); [o]c(); int swap)
114
115       the binary < (less than) operation
116
117          $c = lt $a, $b, 0;     # explicit call with trailing 0
118          $c = $a < $b;           # overloaded call
119          $a->inplace->lt($b,0);  # modify $a inplace
120
121       It can be made to work inplace with the "$a->inplace" syntax.  This
122       function is used to overload the binary "<" operator.  Note that when
123       calling this function explicitly you need to supply a third argument
124       that should generally be zero (see first example).  This restriction is
125       expected to go away in future releases.
126
127       lt does handle bad values.  The state of the bad-value flag of the
128       output piddles is unknown.
129
130   le
131         Signature: (a(); b(); [o]c(); int swap)
132
133       the binary <= (less equal) operation
134
135          $c = le $a, $b, 0;     # explicit call with trailing 0
136          $c = $a <= $b;           # overloaded call
137          $a->inplace->le($b,0);  # modify $a inplace
138
139       It can be made to work inplace with the "$a->inplace" syntax.  This
140       function is used to overload the binary "<=" operator.  Note that when
141       calling this function explicitly you need to supply a third argument
142       that should generally be zero (see first example).  This restriction is
143       expected to go away in future releases.
144
145       le does handle bad values.  The state of the bad-value flag of the
146       output piddles is unknown.
147
148   ge
149         Signature: (a(); b(); [o]c(); int swap)
150
151       the binary >= (greater equal) operation
152
153          $c = ge $a, $b, 0;     # explicit call with trailing 0
154          $c = $a >= $b;           # overloaded call
155          $a->inplace->ge($b,0);  # modify $a inplace
156
157       It can be made to work inplace with the "$a->inplace" syntax.  This
158       function is used to overload the binary ">=" operator.  Note that when
159       calling this function explicitly you need to supply a third argument
160       that should generally be zero (see first example).  This restriction is
161       expected to go away in future releases.
162
163       ge does handle bad values.  The state of the bad-value flag of the
164       output piddles is unknown.
165
166   eq
167         Signature: (a(); b(); [o]c(); int swap)
168
169       binary equal to operation ("==")
170
171          $c = eq $a, $b, 0;     # explicit call with trailing 0
172          $c = $a == $b;           # overloaded call
173          $a->inplace->eq($b,0);  # modify $a inplace
174
175       It can be made to work inplace with the "$a->inplace" syntax.  This
176       function is used to overload the binary "==" operator.  Note that when
177       calling this function explicitly you need to supply a third argument
178       that should generally be zero (see first example).  This restriction is
179       expected to go away in future releases.
180
181       eq does handle bad values.  The state of the bad-value flag of the
182       output piddles is unknown.
183
184   ne
185         Signature: (a(); b(); [o]c(); int swap)
186
187       binary not equal to operation ("!=")
188
189          $c = ne $a, $b, 0;     # explicit call with trailing 0
190          $c = $a != $b;           # overloaded call
191          $a->inplace->ne($b,0);  # modify $a inplace
192
193       It can be made to work inplace with the "$a->inplace" syntax.  This
194       function is used to overload the binary "!=" operator.  Note that when
195       calling this function explicitly you need to supply a third argument
196       that should generally be zero (see first example).  This restriction is
197       expected to go away in future releases.
198
199       ne does handle bad values.  The state of the bad-value flag of the
200       output piddles is unknown.
201
202   shiftleft
203         Signature: (a(); b(); [o]c(); int swap)
204
205       leftshift "a$" by $b
206
207          $c = shiftleft $a, $b, 0;     # explicit call with trailing 0
208          $c = $a << $b;           # overloaded call
209          $a->inplace->shiftleft($b,0);  # modify $a inplace
210
211       It can be made to work inplace with the "$a->inplace" syntax.  This
212       function is used to overload the binary "<<" operator.  Note that when
213       calling this function explicitly you need to supply a third argument
214       that should generally be zero (see first example).  This restriction is
215       expected to go away in future releases.
216
217       shiftleft does handle bad values.  The state of the bad-value flag of
218       the output piddles is unknown.
219
220   shiftright
221         Signature: (a(); b(); [o]c(); int swap)
222
223       leftshift "a$" by $b
224
225          $c = shiftright $a, $b, 0;     # explicit call with trailing 0
226          $c = $a >> $b;           # overloaded call
227          $a->inplace->shiftright($b,0);  # modify $a inplace
228
229       It can be made to work inplace with the "$a->inplace" syntax.  This
230       function is used to overload the binary ">>" operator.  Note that when
231       calling this function explicitly you need to supply a third argument
232       that should generally be zero (see first example).  This restriction is
233       expected to go away in future releases.
234
235       shiftright does handle bad values.  The state of the bad-value flag of
236       the output piddles is unknown.
237
238   or2
239         Signature: (a(); b(); [o]c(); int swap)
240
241       binary or of two piddles
242
243          $c = or2 $a, $b, 0;     # explicit call with trailing 0
244          $c = $a | $b;           # overloaded call
245          $a->inplace->or2($b,0);  # modify $a inplace
246
247       It can be made to work inplace with the "$a->inplace" syntax.  This
248       function is used to overload the binary "|" operator.  Note that when
249       calling this function explicitly you need to supply a third argument
250       that should generally be zero (see first example).  This restriction is
251       expected to go away in future releases.
252
253       or2 does handle bad values.  The state of the bad-value flag of the
254       output piddles is unknown.
255
256   and2
257         Signature: (a(); b(); [o]c(); int swap)
258
259       binary and of two piddles
260
261          $c = and2 $a, $b, 0;     # explicit call with trailing 0
262          $c = $a & $b;           # overloaded call
263          $a->inplace->and2($b,0);  # modify $a inplace
264
265       It can be made to work inplace with the "$a->inplace" syntax.  This
266       function is used to overload the binary "&" operator.  Note that when
267       calling this function explicitly you need to supply a third argument
268       that should generally be zero (see first example).  This restriction is
269       expected to go away in future releases.
270
271       and2 does handle bad values.  The state of the bad-value flag of the
272       output piddles is unknown.
273
274   xor
275         Signature: (a(); b(); [o]c(); int swap)
276
277       binary exclusive or of two piddles
278
279          $c = xor $a, $b, 0;     # explicit call with trailing 0
280          $c = $a ^ $b;           # overloaded call
281          $a->inplace->xor($b,0);  # modify $a inplace
282
283       It can be made to work inplace with the "$a->inplace" syntax.  This
284       function is used to overload the binary "^" operator.  Note that when
285       calling this function explicitly you need to supply a third argument
286       that should generally be zero (see first example).  This restriction is
287       expected to go away in future releases.
288
289       xor does handle bad values.  The state of the bad-value flag of the
290       output piddles is unknown.
291
292   bitnot
293         Signature: (a(); [o]b())
294
295       unary bit negation
296
297          $b = ~ $a;
298          $a->inplace->bitnot;  # modify $a inplace
299
300       It can be made to work inplace with the "$a->inplace" syntax.  This
301       function is used to overload the unary "~" operator/function.
302
303       bitnot does handle bad values.  It will set the bad-value flag of all
304       output piddles if the flag is set for any of the input piddles.
305
306   power
307         Signature: (a(); b(); [o]c(); int swap)
308
309       raise piddle $a to the power "b"
310
311          $c = $a->power($b,0); # explicit function call
312          $c = $a ** $b;    # overloaded use
313          $a->inplace->power($b,0);     # modify $a inplace
314
315       It can be made to work inplace with the "$a->inplace" syntax.  This
316       function is used to overload the binary "**" function.  Note that when
317       calling this function explicitly you need to supply a third argument
318       that should generally be zero (see first example).  This restriction is
319       expected to go away in future releases.
320
321       power does handle bad values.  The state of the bad-value flag of the
322       output piddles is unknown.
323
324   atan2
325         Signature: (a(); b(); [o]c(); int swap)
326
327       elementwise "atan2" of two piddles
328
329          $c = $a->atan2($b,0); # explicit function call
330          $c = atan2 $a, $b;    # overloaded use
331          $a->inplace->atan2($b,0);     # modify $a inplace
332
333       It can be made to work inplace with the "$a->inplace" syntax.  This
334       function is used to overload the binary "atan2" function.  Note that
335       when calling this function explicitly you need to supply a third
336       argument that should generally be zero (see first example).  This
337       restriction is expected to go away in future releases.
338
339       atan2 does handle bad values.  The state of the bad-value flag of the
340       output piddles is unknown.
341
342   modulo
343         Signature: (a(); b(); [o]c(); int swap)
344
345       elementwise "modulo" operation
346
347          $c = $a->modulo($b,0); # explicit function call
348          $c = $a % $b;    # overloaded use
349          $a->inplace->modulo($b,0);     # modify $a inplace
350
351       It can be made to work inplace with the "$a->inplace" syntax.  This
352       function is used to overload the binary "%" function.  Note that when
353       calling this function explicitly you need to supply a third argument
354       that should generally be zero (see first example).  This restriction is
355       expected to go away in future releases.
356
357       modulo does handle bad values.  The state of the bad-value flag of the
358       output piddles is unknown.
359
360   spaceship
361         Signature: (a(); b(); [o]c(); int swap)
362
363       elementwise "<=>" operation
364
365          $c = $a->spaceship($b,0); # explicit function call
366          $c = $a <=> $b;    # overloaded use
367          $a->inplace->spaceship($b,0);     # modify $a inplace
368
369       It can be made to work inplace with the "$a->inplace" syntax.  This
370       function is used to overload the binary "<=>" function.  Note that when
371       calling this function explicitly you need to supply a third argument
372       that should generally be zero (see first example).  This restriction is
373       expected to go away in future releases.
374
375       spaceship does handle bad values.  The state of the bad-value flag of
376       the output piddles is unknown.
377
378   sqrt
379         Signature: (a(); [o]b())
380
381       elementwise square root
382
383          $b = sqrt $a;
384          $a->inplace->sqrt;  # modify $a inplace
385
386       It can be made to work inplace with the "$a->inplace" syntax.  This
387       function is used to overload the unary "sqrt" operator/function.
388
389       sqrt does handle bad values.  It will set the bad-value flag of all
390       output piddles if the flag is set for any of the input piddles.
391
392   abs
393         Signature: (a(); [o]b())
394
395       elementwise absolute value
396
397          $b = abs $a;
398          $a->inplace->abs;  # modify $a inplace
399
400       It can be made to work inplace with the "$a->inplace" syntax.  This
401       function is used to overload the unary "abs" operator/function.
402
403       abs does handle bad values.  It will set the bad-value flag of all
404       output piddles if the flag is set for any of the input piddles.
405
406   sin
407         Signature: (a(); [o]b())
408
409       the sin function
410
411          $b = sin $a;
412          $a->inplace->sin;  # modify $a inplace
413
414       It can be made to work inplace with the "$a->inplace" syntax.  This
415       function is used to overload the unary "sin" operator/function.
416
417       sin does handle bad values.  It will set the bad-value flag of all
418       output piddles if the flag is set for any of the input piddles.
419
420   cos
421         Signature: (a(); [o]b())
422
423       the cos function
424
425          $b = cos $a;
426          $a->inplace->cos;  # modify $a inplace
427
428       It can be made to work inplace with the "$a->inplace" syntax.  This
429       function is used to overload the unary "cos" operator/function.
430
431       cos does handle bad values.  It will set the bad-value flag of all
432       output piddles if the flag is set for any of the input piddles.
433
434   not
435         Signature: (a(); [o]b())
436
437       the elementwise not operation
438
439          $b = ! $a;
440          $a->inplace->not;  # modify $a inplace
441
442       It can be made to work inplace with the "$a->inplace" syntax.  This
443       function is used to overload the unary "!" operator/function.
444
445       not does handle bad values.  It will set the bad-value flag of all
446       output piddles if the flag is set for any of the input piddles.
447
448   exp
449         Signature: (a(); [o]b())
450
451       the exponential function
452
453          $b = exp $a;
454          $a->inplace->exp;  # modify $a inplace
455
456       It can be made to work inplace with the "$a->inplace" syntax.  This
457       function is used to overload the unary "exp" operator/function.
458
459       exp does handle bad values.  It will set the bad-value flag of all
460       output piddles if the flag is set for any of the input piddles.
461
462   log
463         Signature: (a(); [o]b())
464
465       the natural logarithm
466
467          $b = log $a;
468          $a->inplace->log;  # modify $a inplace
469
470       It can be made to work inplace with the "$a->inplace" syntax.  This
471       function is used to overload the unary "log" operator/function.
472
473       log does handle bad values.  It will set the bad-value flag of all
474       output piddles if the flag is set for any of the input piddles.
475
476   log10
477         Signature: (a(); [o]b())
478
479       the base 10 logarithm
480
481          $b = log10 $a;
482          $a->inplace->log10;  # modify $a inplace
483
484       It can be made to work inplace with the "$a->inplace" syntax.  This
485       function is used to overload the unary "log10" operator/function.
486
487       log10 does handle bad values.  It will set the bad-value flag of all
488       output piddles if the flag is set for any of the input piddles.
489
490   assgn
491         Signature: (a(); [o]b())
492
493       Plain numerical assignment. This is used to implement the ".=" operator
494
495       assgn does not process bad values.  It will set the bad-value flag of
496       all output piddles if the flag is set for any of the input piddles.
497

AUTHOR

499       Tuomas J. Lukka (lukka@fas.harvard.edu), Karl Glazebrook
500       (kgb@aaoepp.aao.gov.au), Doug Hunt (dhunt@ucar.edu), Christian Soeller
501       (c.soeller@auckland.ac.nz), Doug Burke (burke@ifa.hawaii.edu), and
502       Craig DeForest (deforest@boulder.swri.edu).
503
504
505
506perl v5.12.3                      2011-03-31                            Ops(3)
Impressum