.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Ops 3pm" .TH Ops 3pm 2024-04-25 "perl v5.38.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME PDL::Ops \- Fundamental mathematical operators .SH DESCRIPTION .IX Header "DESCRIPTION" This module provides the functions used by PDL to overload the basic mathematical operators (\f(CW\*(C`+ \- / *\*(C'\fR etc.) and functions (\f(CW\*(C`sin sqrt\*(C'\fR etc.) .PP It also includes the function \f(CW\*(C`log10\*(C'\fR, which should be a perl function so that we can overload it! .PP Matrix multiplication (the operator \f(CW\*(C`x\*(C'\fR) is handled by the module PDL::Primitive. .SH SYNOPSIS .IX Header "SYNOPSIS" none .SH FUNCTIONS .IX Header "FUNCTIONS" .SS plus .IX Subsection "plus" .Vb 1 \& Signature: (a(); b(); [o]c(); int $swap) .Ve .PP add two ndarrays .PP .Vb 8 \& $c = $x + $y; # overloaded call \& $c = PDL::plus($x, $y); # explicit call with default swap of 0 \& $c = PDL::plus($x, $y, 0); # explicit call with explicit swap of 0 \& $c = PDL::plus($x, $y, 1); # explicit call with trailing 1 to swap args \& PDL::plus($x, $y, $c, 1); # all params given \& $x\->plus($y, $c, 0); # method call, all params given \& $c = $x\->plus($y); # method call \& $x\->inplace\->plus($y); # modify $x inplace .Ve .PP It can be made to work inplace with the \f(CW\*(C`$x\->inplace\*(C'\fR syntax. This function is used to overload the binary \f(CW\*(C`+\*(C'\fR operator. As of 2.065, when calling this function explicitly you can omit the third argument (see second example), or supply it (see third one). .PP plus processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. .SS mult .IX Subsection "mult" .Vb 1 \& Signature: (a(); b(); [o]c(); int $swap) .Ve .PP multiply two ndarrays .PP .Vb 8 \& $c = $x * $y; # overloaded call \& $c = PDL::mult($x, $y); # explicit call with default swap of 0 \& $c = PDL::mult($x, $y, 0); # explicit call with explicit swap of 0 \& $c = PDL::mult($x, $y, 1); # explicit call with trailing 1 to swap args \& PDL::mult($x, $y, $c, 1); # all params given \& $x\->mult($y, $c, 0); # method call, all params given \& $c = $x\->mult($y); # method call \& $x\->inplace\->mult($y); # modify $x inplace .Ve .PP It can be made to work inplace with the \f(CW\*(C`$x\->inplace\*(C'\fR syntax. This function is used to overload the binary \f(CW\*(C`*\*(C'\fR operator. As of 2.065, when calling this function explicitly you can omit the third argument (see second example), or supply it (see third one). .PP mult processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. .SS minus .IX Subsection "minus" .Vb 1 \& Signature: (a(); b(); [o]c(); int $swap) .Ve .PP subtract two ndarrays .PP .Vb 8 \& $c = $x \- $y; # overloaded call \& $c = PDL::minus($x, $y); # explicit call with default swap of 0 \& $c = PDL::minus($x, $y, 0); # explicit call with explicit swap of 0 \& $c = PDL::minus($x, $y, 1); # explicit call with trailing 1 to swap args \& PDL::minus($x, $y, $c, 1); # all params given \& $x\->minus($y, $c, 0); # method call, all params given \& $c = $x\->minus($y); # method call \& $x\->inplace\->minus($y); # modify $x inplace .Ve .PP It can be made to work inplace with the \f(CW\*(C`$x\->inplace\*(C'\fR syntax. This function is used to overload the binary \f(CW\*(C`\-\*(C'\fR operator. As of 2.065, when calling this function explicitly you can omit the third argument (see second example), or supply it (see third one). .PP minus processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. .SS divide .IX Subsection "divide" .Vb 1 \& Signature: (a(); b(); [o]c(); int $swap) .Ve .PP divide two ndarrays .PP .Vb 8 \& $c = $x / $y; # overloaded call \& $c = PDL::divide($x, $y); # explicit call with default swap of 0 \& $c = PDL::divide($x, $y, 0); # explicit call with explicit swap of 0 \& $c = PDL::divide($x, $y, 1); # explicit call with trailing 1 to swap args \& PDL::divide($x, $y, $c, 1); # all params given \& $x\->divide($y, $c, 0); # method call, all params given \& $c = $x\->divide($y); # method call \& $x\->inplace\->divide($y); # modify $x inplace .Ve .PP It can be made to work inplace with the \f(CW\*(C`$x\->inplace\*(C'\fR syntax. This function is used to overload the binary \f(CW\*(C`/\*(C'\fR operator. As of 2.065, when calling this function explicitly you can omit the third argument (see second example), or supply it (see third one). .PP divide processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. .SS gt .IX Subsection "gt" .Vb 1 \& Signature: (a(); b(); [o]c(); int $swap) .Ve .PP the binary > (greater than) operation .PP .Vb 8 \& $c = $x > $y; # overloaded call \& $c = PDL::gt($x, $y); # explicit call with default swap of 0 \& $c = PDL::gt($x, $y, 0); # explicit call with explicit swap of 0 \& $c = PDL::gt($x, $y, 1); # explicit call with trailing 1 to swap args \& PDL::gt($x, $y, $c, 1); # all params given \& $x\->gt($y, $c, 0); # method call, all params given \& $c = $x\->gt($y); # method call \& $x\->inplace\->gt($y); # modify $x inplace .Ve .PP It can be made to work inplace with the \f(CW\*(C`$x\->inplace\*(C'\fR syntax. This function is used to overload the binary \f(CW\*(C`>\*(C'\fR operator. As of 2.065, when calling this function explicitly you can omit the third argument (see second example), or supply it (see third one). .PP gt processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. .SS lt .IX Subsection "lt" .Vb 1 \& Signature: (a(); b(); [o]c(); int $swap) .Ve .PP the binary < (less than) operation .PP .Vb 8 \& $c = $x < $y; # overloaded call \& $c = PDL::lt($x, $y); # explicit call with default swap of 0 \& $c = PDL::lt($x, $y, 0); # explicit call with explicit swap of 0 \& $c = PDL::lt($x, $y, 1); # explicit call with trailing 1 to swap args \& PDL::lt($x, $y, $c, 1); # all params given \& $x\->lt($y, $c, 0); # method call, all params given \& $c = $x\->lt($y); # method call \& $x\->inplace\->lt($y); # modify $x inplace .Ve .PP It can be made to work inplace with the \f(CW\*(C`$x\->inplace\*(C'\fR syntax. This function is used to overload the binary \f(CW\*(C`<\*(C'\fR operator. As of 2.065, when calling this function explicitly you can omit the third argument (see second example), or supply it (see third one). .PP lt processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. .SS le .IX Subsection "le" .Vb 1 \& Signature: (a(); b(); [o]c(); int $swap) .Ve .PP the binary <= (less equal) operation .PP .Vb 8 \& $c = $x <= $y; # overloaded call \& $c = PDL::le($x, $y); # explicit call with default swap of 0 \& $c = PDL::le($x, $y, 0); # explicit call with explicit swap of 0 \& $c = PDL::le($x, $y, 1); # explicit call with trailing 1 to swap args \& PDL::le($x, $y, $c, 1); # all params given \& $x\->le($y, $c, 0); # method call, all params given \& $c = $x\->le($y); # method call \& $x\->inplace\->le($y); # modify $x inplace .Ve .PP It can be made to work inplace with the \f(CW\*(C`$x\->inplace\*(C'\fR syntax. This function is used to overload the binary \f(CW\*(C`<=\*(C'\fR operator. As of 2.065, when calling this function explicitly you can omit the third argument (see second example), or supply it (see third one). .PP le processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. .SS ge .IX Subsection "ge" .Vb 1 \& Signature: (a(); b(); [o]c(); int $swap) .Ve .PP the binary >= (greater equal) operation .PP .Vb 8 \& $c = $x >= $y; # overloaded call \& $c = PDL::ge($x, $y); # explicit call with default swap of 0 \& $c = PDL::ge($x, $y, 0); # explicit call with explicit swap of 0 \& $c = PDL::ge($x, $y, 1); # explicit call with trailing 1 to swap args \& PDL::ge($x, $y, $c, 1); # all params given \& $x\->ge($y, $c, 0); # method call, all params given \& $c = $x\->ge($y); # method call \& $x\->inplace\->ge($y); # modify $x inplace .Ve .PP It can be made to work inplace with the \f(CW\*(C`$x\->inplace\*(C'\fR syntax. This function is used to overload the binary \f(CW\*(C`>=\*(C'\fR operator. As of 2.065, when calling this function explicitly you can omit the third argument (see second example), or supply it (see third one). .PP ge processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. .SS eq .IX Subsection "eq" .Vb 1 \& Signature: (a(); b(); [o]c(); int $swap) .Ve .PP binary \fIequal to\fR operation (\f(CW\*(C`==\*(C'\fR) .PP .Vb 8 \& $c = $x == $y; # overloaded call \& $c = PDL::eq($x, $y); # explicit call with default swap of 0 \& $c = PDL::eq($x, $y, 0); # explicit call with explicit swap of 0 \& $c = PDL::eq($x, $y, 1); # explicit call with trailing 1 to swap args \& PDL::eq($x, $y, $c, 1); # all params given \& $x\->eq($y, $c, 0); # method call, all params given \& $c = $x\->eq($y); # method call \& $x\->inplace\->eq($y); # modify $x inplace .Ve .PP It can be made to work inplace with the \f(CW\*(C`$x\->inplace\*(C'\fR syntax. This function is used to overload the binary \f(CW\*(C`==\*(C'\fR operator. As of 2.065, when calling this function explicitly you can omit the third argument (see second example), or supply it (see third one). .PP eq processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. .SS ne .IX Subsection "ne" .Vb 1 \& Signature: (a(); b(); [o]c(); int $swap) .Ve .PP binary \fInot equal to\fR operation (\f(CW\*(C`!=\*(C'\fR) .PP .Vb 8 \& $c = $x != $y; # overloaded call \& $c = PDL::ne($x, $y); # explicit call with default swap of 0 \& $c = PDL::ne($x, $y, 0); # explicit call with explicit swap of 0 \& $c = PDL::ne($x, $y, 1); # explicit call with trailing 1 to swap args \& PDL::ne($x, $y, $c, 1); # all params given \& $x\->ne($y, $c, 0); # method call, all params given \& $c = $x\->ne($y); # method call \& $x\->inplace\->ne($y); # modify $x inplace .Ve .PP It can be made to work inplace with the \f(CW\*(C`$x\->inplace\*(C'\fR syntax. This function is used to overload the binary \f(CW\*(C`!=\*(C'\fR operator. As of 2.065, when calling this function explicitly you can omit the third argument (see second example), or supply it (see third one). .PP ne processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. .SS shiftleft .IX Subsection "shiftleft" .Vb 1 \& Signature: (a(); b(); [o]c(); int $swap) .Ve .PP leftshift \f(CW$a\fR by \f(CW$b\fR .PP .Vb 8 \& $c = $x << $y; # overloaded call \& $c = PDL::shiftleft($x, $y); # explicit call with default swap of 0 \& $c = PDL::shiftleft($x, $y, 0); # explicit call with explicit swap of 0 \& $c = PDL::shiftleft($x, $y, 1); # explicit call with trailing 1 to swap args \& PDL::shiftleft($x, $y, $c, 1); # all params given \& $x\->shiftleft($y, $c, 0); # method call, all params given \& $c = $x\->shiftleft($y); # method call \& $x\->inplace\->shiftleft($y); # modify $x inplace .Ve .PP It can be made to work inplace with the \f(CW\*(C`$x\->inplace\*(C'\fR syntax. This function is used to overload the binary \f(CW\*(C`<<\*(C'\fR operator. As of 2.065, when calling this function explicitly you can omit the third argument (see second example), or supply it (see third one). .PP shiftleft processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. .SS shiftright .IX Subsection "shiftright" .Vb 1 \& Signature: (a(); b(); [o]c(); int $swap) .Ve .PP rightshift \f(CW$a\fR by \f(CW$b\fR .PP .Vb 8 \& $c = $x >> $y; # overloaded call \& $c = PDL::shiftright($x, $y); # explicit call with default swap of 0 \& $c = PDL::shiftright($x, $y, 0); # explicit call with explicit swap of 0 \& $c = PDL::shiftright($x, $y, 1); # explicit call with trailing 1 to swap args \& PDL::shiftright($x, $y, $c, 1); # all params given \& $x\->shiftright($y, $c, 0); # method call, all params given \& $c = $x\->shiftright($y); # method call \& $x\->inplace\->shiftright($y); # modify $x inplace .Ve .PP It can be made to work inplace with the \f(CW\*(C`$x\->inplace\*(C'\fR syntax. This function is used to overload the binary \f(CW\*(C`>>\*(C'\fR operator. As of 2.065, when calling this function explicitly you can omit the third argument (see second example), or supply it (see third one). .PP shiftright processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. .SS or2 .IX Subsection "or2" .Vb 1 \& Signature: (a(); b(); [o]c(); int $swap) .Ve .PP binary \fIor\fR of two ndarrays .PP .Vb 8 \& $c = $x | $y; # overloaded call \& $c = PDL::or2($x, $y); # explicit call with default swap of 0 \& $c = PDL::or2($x, $y, 0); # explicit call with explicit swap of 0 \& $c = PDL::or2($x, $y, 1); # explicit call with trailing 1 to swap args \& PDL::or2($x, $y, $c, 1); # all params given \& $x\->or2($y, $c, 0); # method call, all params given \& $c = $x\->or2($y); # method call \& $x\->inplace\->or2($y); # modify $x inplace .Ve .PP It can be made to work inplace with the \f(CW\*(C`$x\->inplace\*(C'\fR syntax. This function is used to overload the binary \f(CW\*(C`|\*(C'\fR operator. As of 2.065, when calling this function explicitly you can omit the third argument (see second example), or supply it (see third one). .PP or2 processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. .SS and2 .IX Subsection "and2" .Vb 1 \& Signature: (a(); b(); [o]c(); int $swap) .Ve .PP binary \fIand\fR of two ndarrays .PP .Vb 8 \& $c = $x & $y; # overloaded call \& $c = PDL::and2($x, $y); # explicit call with default swap of 0 \& $c = PDL::and2($x, $y, 0); # explicit call with explicit swap of 0 \& $c = PDL::and2($x, $y, 1); # explicit call with trailing 1 to swap args \& PDL::and2($x, $y, $c, 1); # all params given \& $x\->and2($y, $c, 0); # method call, all params given \& $c = $x\->and2($y); # method call \& $x\->inplace\->and2($y); # modify $x inplace .Ve .PP It can be made to work inplace with the \f(CW\*(C`$x\->inplace\*(C'\fR syntax. This function is used to overload the binary \f(CW\*(C`&\*(C'\fR operator. As of 2.065, when calling this function explicitly you can omit the third argument (see second example), or supply it (see third one). .PP and2 processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. .SS xor .IX Subsection "xor" .Vb 1 \& Signature: (a(); b(); [o]c(); int $swap) .Ve .PP binary \fIexclusive or\fR of two ndarrays .PP .Vb 8 \& $c = $x ^ $y; # overloaded call \& $c = PDL::xor($x, $y); # explicit call with default swap of 0 \& $c = PDL::xor($x, $y, 0); # explicit call with explicit swap of 0 \& $c = PDL::xor($x, $y, 1); # explicit call with trailing 1 to swap args \& PDL::xor($x, $y, $c, 1); # all params given \& $x\->xor($y, $c, 0); # method call, all params given \& $c = $x\->xor($y); # method call \& $x\->inplace\->xor($y); # modify $x inplace .Ve .PP It can be made to work inplace with the \f(CW\*(C`$x\->inplace\*(C'\fR syntax. This function is used to overload the binary \f(CW\*(C`^\*(C'\fR operator. As of 2.065, when calling this function explicitly you can omit the third argument (see second example), or supply it (see third one). .PP xor processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. .SS bitnot .IX Subsection "bitnot" .Vb 1 \& Signature: (a(); [o]b()) .Ve .PP unary bit negation .PP .Vb 2 \& $y = ~ $x; \& $x\->inplace\->bitnot; # modify $x inplace .Ve .PP It can be made to work inplace with the \f(CW\*(C`$x\->inplace\*(C'\fR syntax. This function is used to overload the unary \f(CW\*(C`~\*(C'\fR operator/function. .PP bitnot processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. .SS power .IX Subsection "power" .Vb 1 \& Signature: (a(); b(); [o]c(); int $swap) .Ve .PP raise ndarray \f(CW$a\fR to the power \f(CW$b\fR .PP .Vb 4 \& $c = $x\->power($y); # explicit call with default swap of 0 \& $c = $x\->power($y, 1); # explicit call with trailing 1 to swap args \& $c = $a ** $b; # overloaded use \& $x\->inplace\->power($y,0); # modify $x inplace .Ve .PP It can be made to work inplace with the \f(CW\*(C`$x\->inplace\*(C'\fR syntax. This function is used to overload the binary \f(CW\*(C`**\*(C'\fR function. As of 2.065, when calling this function explicitly you can omit the third argument (see first example), or supply it (see second one). .PP power processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. .SS atan2 .IX Subsection "atan2" .Vb 1 \& Signature: (a(); b(); [o]c(); int $swap) .Ve .PP elementwise \f(CW\*(C`atan2\*(C'\fR of two ndarrays .PP .Vb 4 \& $c = $x\->atan2($y); # explicit call with default swap of 0 \& $c = $x\->atan2($y, 1); # explicit call with trailing 1 to swap args \& $c = atan2 $a, $b; # overloaded use \& $x\->inplace\->atan2($y,0); # modify $x inplace .Ve .PP It can be made to work inplace with the \f(CW\*(C`$x\->inplace\*(C'\fR syntax. This function is used to overload the binary \f(CW\*(C`atan2\*(C'\fR function. As of 2.065, when calling this function explicitly you can omit the third argument (see first example), or supply it (see second one). .PP atan2 processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. .SS modulo .IX Subsection "modulo" .Vb 1 \& Signature: (a(); b(); [o]c(); int $swap) .Ve .PP elementwise \f(CW\*(C`modulo\*(C'\fR operation .PP .Vb 4 \& $c = $x\->modulo($y); # explicit call with default swap of 0 \& $c = $x\->modulo($y, 1); # explicit call with trailing 1 to swap args \& $c = $a % $b; # overloaded use \& $x\->inplace\->modulo($y,0); # modify $x inplace .Ve .PP It can be made to work inplace with the \f(CW\*(C`$x\->inplace\*(C'\fR syntax. This function is used to overload the binary \f(CW\*(C`%\*(C'\fR function. As of 2.065, when calling this function explicitly you can omit the third argument (see first example), or supply it (see second one). .PP modulo processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. .SS spaceship .IX Subsection "spaceship" .Vb 1 \& Signature: (a(); b(); [o]c(); int $swap) .Ve .PP elementwise "<=>" operation .PP .Vb 4 \& $c = $x\->spaceship($y); # explicit call with default swap of 0 \& $c = $x\->spaceship($y, 1); # explicit call with trailing 1 to swap args \& $c = $a <=> $b; # overloaded use \& $x\->inplace\->spaceship($y,0); # modify $x inplace .Ve .PP It can be made to work inplace with the \f(CW\*(C`$x\->inplace\*(C'\fR syntax. This function is used to overload the binary \f(CW\*(C`<=>\*(C'\fR function. As of 2.065, when calling this function explicitly you can omit the third argument (see first example), or supply it (see second one). .PP spaceship processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. .SS sqrt .IX Subsection "sqrt" .Vb 1 \& Signature: (a(); [o]b()) .Ve .PP elementwise square root .PP .Vb 2 \& $y = sqrt $x; \& $x\->inplace\->sqrt; # modify $x inplace .Ve .PP It can be made to work inplace with the \f(CW\*(C`$x\->inplace\*(C'\fR syntax. This function is used to overload the unary \f(CW\*(C`sqrt\*(C'\fR operator/function. .PP sqrt processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. .SS sin .IX Subsection "sin" .Vb 1 \& Signature: (a(); [o]b()) .Ve .PP the sin function .PP .Vb 2 \& $y = sin $x; \& $x\->inplace\->sin; # modify $x inplace .Ve .PP It can be made to work inplace with the \f(CW\*(C`$x\->inplace\*(C'\fR syntax. This function is used to overload the unary \f(CW\*(C`sin\*(C'\fR operator/function. .PP sin processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. .SS cos .IX Subsection "cos" .Vb 1 \& Signature: (a(); [o]b()) .Ve .PP the cos function .PP .Vb 2 \& $y = cos $x; \& $x\->inplace\->cos; # modify $x inplace .Ve .PP It can be made to work inplace with the \f(CW\*(C`$x\->inplace\*(C'\fR syntax. This function is used to overload the unary \f(CW\*(C`cos\*(C'\fR operator/function. .PP cos processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. .SS not .IX Subsection "not" .Vb 1 \& Signature: (a(); [o]b()) .Ve .PP the elementwise \fInot\fR operation .PP .Vb 2 \& $y = ! $x; \& $x\->inplace\->not; # modify $x inplace .Ve .PP It can be made to work inplace with the \f(CW\*(C`$x\->inplace\*(C'\fR syntax. This function is used to overload the unary \f(CW\*(C`!\*(C'\fR operator/function. .PP not processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. .SS exp .IX Subsection "exp" .Vb 1 \& Signature: (a(); [o]b()) .Ve .PP the exponential function .PP .Vb 2 \& $y = exp $x; \& $x\->inplace\->exp; # modify $x inplace .Ve .PP It can be made to work inplace with the \f(CW\*(C`$x\->inplace\*(C'\fR syntax. This function is used to overload the unary \f(CW\*(C`exp\*(C'\fR operator/function. .PP exp processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. .SS log .IX Subsection "log" .Vb 1 \& Signature: (a(); [o]b()) .Ve .PP the natural logarithm .PP .Vb 2 \& $y = log $x; \& $x\->inplace\->log; # modify $x inplace .Ve .PP It can be made to work inplace with the \f(CW\*(C`$x\->inplace\*(C'\fR syntax. This function is used to overload the unary \f(CW\*(C`log\*(C'\fR operator/function. .PP log processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. .SS re .IX Subsection "re" .Vb 1 \& Signature: (complexv(); real [o]b()) .Ve .PP Returns the real part of a complex number. Flows data back & forth. .PP re processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. .SS im .IX Subsection "im" .Vb 1 \& Signature: (complexv(); real [o]b()) .Ve .PP Returns the imaginary part of a complex number. Flows data back & forth. .PP im processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. .SS _cabs .IX Subsection "_cabs" .Vb 1 \& Signature: (complexv(); real [o]b()) .Ve .PP Returns the absolute (length) of a complex number. .PP _cabs processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. .SS log10 .IX Subsection "log10" .Vb 1 \& Signature: (a(); [o]b()) .Ve .PP the base 10 logarithm .PP .Vb 2 \& $y = log10 $x; \& $x\->inplace\->log10; # modify $x inplace .Ve .PP It can be made to work inplace with the \f(CW\*(C`$x\->inplace\*(C'\fR syntax. This function is used to overload the unary \f(CW\*(C`log10\*(C'\fR operator/function. .PP log10 processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. .SS assgn .IX Subsection "assgn" .Vb 1 \& Signature: (a(); [o]b()) .Ve .PP Plain numerical assignment. This is used to implement the ".=" operator .PP assgn processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. .SS carg .IX Subsection "carg" .Vb 1 \& Signature: (complexv(); real [o]b()) .Ve .PP Returns the polar angle of a complex number. .PP carg processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. .SS conj .IX Subsection "conj" .Vb 1 \& Signature: (complexv(); [o]b()) .Ve .PP complex conjugate. .PP conj processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. .SS czip .IX Subsection "czip" .Vb 1 \& Signature: (r(); i(); complex [o]c()) .Ve .PP convert real, imaginary to native complex, (sort of) like LISP zip function. Will add the \f(CW\*(C`r\*(C'\fR ndarray to "i" times the \f(CW\*(C`i\*(C'\fR ndarray. Only takes real ndarrays as input. .PP czip does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. .SS ipow .IX Subsection "ipow" .Vb 1 \& Signature: (a(); indx b(); [o] ans()) .Ve .PP raise ndarray \f(CW$a\fR to integer power \f(CW$b\fR .PP .Vb 3 \& $c = $x\->ipow($y); # as method \& $c = ipow $x, $y; \& $x\->inplace\->ipow($y); # modify $x inplace .Ve .PP It can be made to work inplace with the \f(CW\*(C`$x\->inplace\*(C'\fR syntax. .PP Algorithm from Wikipedia .PP ipow does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. .SS abs .IX Subsection "abs" Returns the absolute value of a number. .SS abs2 .IX Subsection "abs2" Returns the square of the absolute value of a number. .SS r2C .IX Subsection "r2C" .Vb 1 \& Signature: (r(); complex [o]c()) .Ve .PP convert real to native complex, with an imaginary part of zero .PP r2C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. .SS i2C .IX Subsection "i2C" .Vb 1 \& Signature: (i(); complex [o]c()) .Ve .PP convert imaginary to native complex, with a real part of zero .PP i2C does not process bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. .SH AUTHOR .IX Header "AUTHOR" Tuomas J. Lukka (lukka@fas.harvard.edu), Karl Glazebrook (kgb@aaoepp.aao.gov.au), Doug Hunt (dhunt@ucar.edu), Christian Soeller (c.soeller@auckland.ac.nz), Doug Burke (burke@ifa.hawaii.edu), and Craig DeForest (deforest@boulder.swri.edu).