Ops.pm (PDL-2.080) | : | Ops.pm (PDL-2.081) | ||
---|---|---|---|---|
skipping to change at line 69 | skipping to change at line 69 | |||
&& $foo != $overload_sub; # recursion guard | && $foo != $overload_sub; # recursion guard | |||
$foo->($_[1], $_[0], !$_[2]); | $foo->($_[1], $_[0], !$_[2]); | |||
}; } | }; } | |||
} | } | |||
BEGIN { | BEGIN { | |||
# in1, in2, out, swap if true | # in1, in2, out, swap if true | |||
$OVERLOADS{'+='} = sub { PDL::plus($_[0], $_[1], $_[0], 0); $_[0] }; | $OVERLOADS{'+='} = sub { PDL::plus($_[0], $_[1], $_[0], 0); $_[0] }; | |||
} | } | |||
#line 84 "Ops.pm" | #line 84 "Ops.pm" | |||
#line 1058 "../../blib/lib/PDL/PP.pm" | #line 949 "../../blib/lib/PDL/PP.pm" | |||
=head2 plus | =head2 plus | |||
=for sig | =for sig | |||
Signature: (a(); b(); [o]c(); int swap) | Signature: (a(); b(); [o]c(); int swap) | |||
=for ref | =for ref | |||
add two ndarrays | add two ndarrays | |||
skipping to change at line 101 | skipping to change at line 101 | |||
the third argument (see second example), or supply it (see third one). | the third argument (see second example), or supply it (see third one). | |||
=for bad | =for bad | |||
plus processes bad values. | 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. | It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. | |||
=cut | =cut | |||
#line 123 "Ops.pm" | #line 123 "Ops.pm" | |||
#line 1060 "../../blib/lib/PDL/PP.pm" | #line 951 "../../blib/lib/PDL/PP.pm" | |||
*plus = \&PDL::plus; | *plus = \&PDL::plus; | |||
#line 130 "Ops.pm" | #line 130 "Ops.pm" | |||
#line 132 "ops.pd" | #line 132 "ops.pd" | |||
{ | { | |||
my ($foo, $overload_sub); | my ($foo, $overload_sub); | |||
BEGIN { $OVERLOADS{'*'} = $overload_sub = sub(;@) { | BEGIN { $OVERLOADS{'*'} = $overload_sub = sub(;@) { | |||
return PDL::mult(@_) unless ref $_[1] | return PDL::mult(@_) unless ref $_[1] | |||
skipping to change at line 124 | skipping to change at line 124 | |||
&& $foo != $overload_sub; # recursion guard | && $foo != $overload_sub; # recursion guard | |||
$foo->($_[1], $_[0], !$_[2]); | $foo->($_[1], $_[0], !$_[2]); | |||
}; } | }; } | |||
} | } | |||
BEGIN { | BEGIN { | |||
# in1, in2, out, swap if true | # in1, in2, out, swap if true | |||
$OVERLOADS{'*='} = sub { PDL::mult($_[0], $_[1], $_[0], 0); $_[0] }; | $OVERLOADS{'*='} = sub { PDL::mult($_[0], $_[1], $_[0], 0); $_[0] }; | |||
} | } | |||
#line 150 "Ops.pm" | #line 150 "Ops.pm" | |||
#line 1058 "../../blib/lib/PDL/PP.pm" | #line 949 "../../blib/lib/PDL/PP.pm" | |||
=head2 mult | =head2 mult | |||
=for sig | =for sig | |||
Signature: (a(); b(); [o]c(); int swap) | Signature: (a(); b(); [o]c(); int swap) | |||
=for ref | =for ref | |||
multiply two ndarrays | multiply two ndarrays | |||
skipping to change at line 156 | skipping to change at line 156 | |||
the third argument (see second example), or supply it (see third one). | the third argument (see second example), or supply it (see third one). | |||
=for bad | =for bad | |||
mult processes bad values. | 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. | It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. | |||
=cut | =cut | |||
#line 189 "Ops.pm" | #line 189 "Ops.pm" | |||
#line 1060 "../../blib/lib/PDL/PP.pm" | #line 951 "../../blib/lib/PDL/PP.pm" | |||
*mult = \&PDL::mult; | *mult = \&PDL::mult; | |||
#line 196 "Ops.pm" | #line 196 "Ops.pm" | |||
#line 132 "ops.pd" | #line 132 "ops.pd" | |||
{ | { | |||
my ($foo, $overload_sub); | my ($foo, $overload_sub); | |||
BEGIN { $OVERLOADS{'-'} = $overload_sub = sub(;@) { | BEGIN { $OVERLOADS{'-'} = $overload_sub = sub(;@) { | |||
return PDL::minus(@_) unless ref $_[1] | return PDL::minus(@_) unless ref $_[1] | |||
skipping to change at line 179 | skipping to change at line 179 | |||
&& $foo != $overload_sub; # recursion guard | && $foo != $overload_sub; # recursion guard | |||
$foo->($_[1], $_[0], !$_[2]); | $foo->($_[1], $_[0], !$_[2]); | |||
}; } | }; } | |||
} | } | |||
BEGIN { | BEGIN { | |||
# in1, in2, out, swap if true | # in1, in2, out, swap if true | |||
$OVERLOADS{'-='} = sub { PDL::minus($_[0], $_[1], $_[0], 0); $_[0] }; | $OVERLOADS{'-='} = sub { PDL::minus($_[0], $_[1], $_[0], 0); $_[0] }; | |||
} | } | |||
#line 216 "Ops.pm" | #line 216 "Ops.pm" | |||
#line 1058 "../../blib/lib/PDL/PP.pm" | #line 949 "../../blib/lib/PDL/PP.pm" | |||
=head2 minus | =head2 minus | |||
=for sig | =for sig | |||
Signature: (a(); b(); [o]c(); int swap) | Signature: (a(); b(); [o]c(); int swap) | |||
=for ref | =for ref | |||
subtract two ndarrays | subtract two ndarrays | |||
skipping to change at line 211 | skipping to change at line 211 | |||
the third argument (see second example), or supply it (see third one). | the third argument (see second example), or supply it (see third one). | |||
=for bad | =for bad | |||
minus processes bad values. | 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. | It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. | |||
=cut | =cut | |||
#line 255 "Ops.pm" | #line 255 "Ops.pm" | |||
#line 1060 "../../blib/lib/PDL/PP.pm" | #line 951 "../../blib/lib/PDL/PP.pm" | |||
*minus = \&PDL::minus; | *minus = \&PDL::minus; | |||
#line 262 "Ops.pm" | #line 262 "Ops.pm" | |||
#line 132 "ops.pd" | #line 132 "ops.pd" | |||
{ | { | |||
my ($foo, $overload_sub); | my ($foo, $overload_sub); | |||
BEGIN { $OVERLOADS{'/'} = $overload_sub = sub(;@) { | BEGIN { $OVERLOADS{'/'} = $overload_sub = sub(;@) { | |||
return PDL::divide(@_) unless ref $_[1] | return PDL::divide(@_) unless ref $_[1] | |||
skipping to change at line 234 | skipping to change at line 234 | |||
&& $foo != $overload_sub; # recursion guard | && $foo != $overload_sub; # recursion guard | |||
$foo->($_[1], $_[0], !$_[2]); | $foo->($_[1], $_[0], !$_[2]); | |||
}; } | }; } | |||
} | } | |||
BEGIN { | BEGIN { | |||
# in1, in2, out, swap if true | # in1, in2, out, swap if true | |||
$OVERLOADS{'/='} = sub { PDL::divide($_[0], $_[1], $_[0], 0); $_[0] }; | $OVERLOADS{'/='} = sub { PDL::divide($_[0], $_[1], $_[0], 0); $_[0] }; | |||
} | } | |||
#line 282 "Ops.pm" | #line 282 "Ops.pm" | |||
#line 1058 "../../blib/lib/PDL/PP.pm" | #line 949 "../../blib/lib/PDL/PP.pm" | |||
=head2 divide | =head2 divide | |||
=for sig | =for sig | |||
Signature: (a(); b(); [o]c(); int swap) | Signature: (a(); b(); [o]c(); int swap) | |||
=for ref | =for ref | |||
divide two ndarrays | divide two ndarrays | |||
skipping to change at line 266 | skipping to change at line 266 | |||
the third argument (see second example), or supply it (see third one). | the third argument (see second example), or supply it (see third one). | |||
=for bad | =for bad | |||
divide processes bad values. | 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. | It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. | |||
=cut | =cut | |||
#line 321 "Ops.pm" | #line 321 "Ops.pm" | |||
#line 1060 "../../blib/lib/PDL/PP.pm" | #line 951 "../../blib/lib/PDL/PP.pm" | |||
*divide = \&PDL::divide; | *divide = \&PDL::divide; | |||
#line 328 "Ops.pm" | #line 328 "Ops.pm" | |||
#line 132 "ops.pd" | #line 132 "ops.pd" | |||
{ | { | |||
my ($foo, $overload_sub); | my ($foo, $overload_sub); | |||
BEGIN { $OVERLOADS{'>'} = $overload_sub = sub(;@) { | BEGIN { $OVERLOADS{'>'} = $overload_sub = sub(;@) { | |||
return PDL::gt(@_) unless ref $_[1] | return PDL::gt(@_) unless ref $_[1] | |||
&& (ref $_[1] ne 'PDL') | && (ref $_[1] ne 'PDL') | |||
&& defined($foo = overload::Method($_[1], '>')) | && defined($foo = overload::Method($_[1], '>')) | |||
&& $foo != $overload_sub; # recursion guard | && $foo != $overload_sub; # recursion guard | |||
$foo->($_[1], $_[0], !$_[2]); | $foo->($_[1], $_[0], !$_[2]); | |||
}; } | }; } | |||
} | } | |||
#line 344 "Ops.pm" | #line 344 "Ops.pm" | |||
#line 1058 "../../blib/lib/PDL/PP.pm" | #line 949 "../../blib/lib/PDL/PP.pm" | |||
=head2 gt | =head2 gt | |||
=for sig | =for sig | |||
Signature: (a(); b(); [o]c(); int swap) | Signature: (a(); b(); [o]c(); int swap) | |||
=for ref | =for ref | |||
the binary E<gt> (greater than) operation | the binary E<gt> (greater than) operation | |||
skipping to change at line 317 | skipping to change at line 317 | |||
the third argument (see second example), or supply it (see third one). | the third argument (see second example), or supply it (see third one). | |||
=for bad | =for bad | |||
gt processes bad values. | 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. | It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. | |||
=cut | =cut | |||
#line 383 "Ops.pm" | #line 383 "Ops.pm" | |||
#line 1060 "../../blib/lib/PDL/PP.pm" | #line 951 "../../blib/lib/PDL/PP.pm" | |||
*gt = \&PDL::gt; | *gt = \&PDL::gt; | |||
#line 390 "Ops.pm" | #line 390 "Ops.pm" | |||
#line 132 "ops.pd" | #line 132 "ops.pd" | |||
{ | { | |||
my ($foo, $overload_sub); | my ($foo, $overload_sub); | |||
BEGIN { $OVERLOADS{'<'} = $overload_sub = sub(;@) { | BEGIN { $OVERLOADS{'<'} = $overload_sub = sub(;@) { | |||
return PDL::lt(@_) unless ref $_[1] | return PDL::lt(@_) unless ref $_[1] | |||
&& (ref $_[1] ne 'PDL') | && (ref $_[1] ne 'PDL') | |||
&& defined($foo = overload::Method($_[1], '<')) | && defined($foo = overload::Method($_[1], '<')) | |||
&& $foo != $overload_sub; # recursion guard | && $foo != $overload_sub; # recursion guard | |||
$foo->($_[1], $_[0], !$_[2]); | $foo->($_[1], $_[0], !$_[2]); | |||
}; } | }; } | |||
} | } | |||
#line 406 "Ops.pm" | #line 406 "Ops.pm" | |||
#line 1058 "../../blib/lib/PDL/PP.pm" | #line 949 "../../blib/lib/PDL/PP.pm" | |||
=head2 lt | =head2 lt | |||
=for sig | =for sig | |||
Signature: (a(); b(); [o]c(); int swap) | Signature: (a(); b(); [o]c(); int swap) | |||
=for ref | =for ref | |||
the binary E<lt> (less than) operation | the binary E<lt> (less than) operation | |||
skipping to change at line 368 | skipping to change at line 368 | |||
the third argument (see second example), or supply it (see third one). | the third argument (see second example), or supply it (see third one). | |||
=for bad | =for bad | |||
lt processes bad values. | 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. | It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. | |||
=cut | =cut | |||
#line 445 "Ops.pm" | #line 445 "Ops.pm" | |||
#line 1060 "../../blib/lib/PDL/PP.pm" | #line 951 "../../blib/lib/PDL/PP.pm" | |||
*lt = \&PDL::lt; | *lt = \&PDL::lt; | |||
#line 452 "Ops.pm" | #line 452 "Ops.pm" | |||
#line 132 "ops.pd" | #line 132 "ops.pd" | |||
{ | { | |||
my ($foo, $overload_sub); | my ($foo, $overload_sub); | |||
BEGIN { $OVERLOADS{'<='} = $overload_sub = sub(;@) { | BEGIN { $OVERLOADS{'<='} = $overload_sub = sub(;@) { | |||
return PDL::le(@_) unless ref $_[1] | return PDL::le(@_) unless ref $_[1] | |||
&& (ref $_[1] ne 'PDL') | && (ref $_[1] ne 'PDL') | |||
&& defined($foo = overload::Method($_[1], '<=')) | && defined($foo = overload::Method($_[1], '<=')) | |||
&& $foo != $overload_sub; # recursion guard | && $foo != $overload_sub; # recursion guard | |||
$foo->($_[1], $_[0], !$_[2]); | $foo->($_[1], $_[0], !$_[2]); | |||
}; } | }; } | |||
} | } | |||
#line 468 "Ops.pm" | #line 468 "Ops.pm" | |||
#line 1058 "../../blib/lib/PDL/PP.pm" | #line 949 "../../blib/lib/PDL/PP.pm" | |||
=head2 le | =head2 le | |||
=for sig | =for sig | |||
Signature: (a(); b(); [o]c(); int swap) | Signature: (a(); b(); [o]c(); int swap) | |||
=for ref | =for ref | |||
the binary E<lt>= (less equal) operation | the binary E<lt>= (less equal) operation | |||
skipping to change at line 419 | skipping to change at line 419 | |||
the third argument (see second example), or supply it (see third one). | the third argument (see second example), or supply it (see third one). | |||
=for bad | =for bad | |||
le processes bad values. | 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. | It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. | |||
=cut | =cut | |||
#line 507 "Ops.pm" | #line 507 "Ops.pm" | |||
#line 1060 "../../blib/lib/PDL/PP.pm" | #line 951 "../../blib/lib/PDL/PP.pm" | |||
*le = \&PDL::le; | *le = \&PDL::le; | |||
#line 514 "Ops.pm" | #line 514 "Ops.pm" | |||
#line 132 "ops.pd" | #line 132 "ops.pd" | |||
{ | { | |||
my ($foo, $overload_sub); | my ($foo, $overload_sub); | |||
BEGIN { $OVERLOADS{'>='} = $overload_sub = sub(;@) { | BEGIN { $OVERLOADS{'>='} = $overload_sub = sub(;@) { | |||
return PDL::ge(@_) unless ref $_[1] | return PDL::ge(@_) unless ref $_[1] | |||
&& (ref $_[1] ne 'PDL') | && (ref $_[1] ne 'PDL') | |||
&& defined($foo = overload::Method($_[1], '>=')) | && defined($foo = overload::Method($_[1], '>=')) | |||
&& $foo != $overload_sub; # recursion guard | && $foo != $overload_sub; # recursion guard | |||
$foo->($_[1], $_[0], !$_[2]); | $foo->($_[1], $_[0], !$_[2]); | |||
}; } | }; } | |||
} | } | |||
#line 530 "Ops.pm" | #line 530 "Ops.pm" | |||
#line 1058 "../../blib/lib/PDL/PP.pm" | #line 949 "../../blib/lib/PDL/PP.pm" | |||
=head2 ge | =head2 ge | |||
=for sig | =for sig | |||
Signature: (a(); b(); [o]c(); int swap) | Signature: (a(); b(); [o]c(); int swap) | |||
=for ref | =for ref | |||
the binary E<gt>= (greater equal) operation | the binary E<gt>= (greater equal) operation | |||
skipping to change at line 470 | skipping to change at line 470 | |||
the third argument (see second example), or supply it (see third one). | the third argument (see second example), or supply it (see third one). | |||
=for bad | =for bad | |||
ge processes bad values. | 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. | It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. | |||
=cut | =cut | |||
#line 569 "Ops.pm" | #line 569 "Ops.pm" | |||
#line 1060 "../../blib/lib/PDL/PP.pm" | #line 951 "../../blib/lib/PDL/PP.pm" | |||
*ge = \&PDL::ge; | *ge = \&PDL::ge; | |||
#line 576 "Ops.pm" | #line 576 "Ops.pm" | |||
#line 132 "ops.pd" | #line 132 "ops.pd" | |||
{ | { | |||
my ($foo, $overload_sub); | my ($foo, $overload_sub); | |||
BEGIN { $OVERLOADS{'=='} = $overload_sub = sub(;@) { | BEGIN { $OVERLOADS{'=='} = $overload_sub = sub(;@) { | |||
return PDL::eq(@_) unless ref $_[1] | return PDL::eq(@_) unless ref $_[1] | |||
&& (ref $_[1] ne 'PDL') | && (ref $_[1] ne 'PDL') | |||
&& defined($foo = overload::Method($_[1], '==')) | && defined($foo = overload::Method($_[1], '==')) | |||
&& $foo != $overload_sub; # recursion guard | && $foo != $overload_sub; # recursion guard | |||
$foo->($_[1], $_[0], !$_[2]); | $foo->($_[1], $_[0], !$_[2]); | |||
}; } | }; } | |||
} | } | |||
#line 592 "Ops.pm" | #line 592 "Ops.pm" | |||
#line 1058 "../../blib/lib/PDL/PP.pm" | #line 949 "../../blib/lib/PDL/PP.pm" | |||
=head2 eq | =head2 eq | |||
=for sig | =for sig | |||
Signature: (a(); b(); [o]c(); int swap) | Signature: (a(); b(); [o]c(); int swap) | |||
=for ref | =for ref | |||
binary I<equal to> operation (C<==>) | binary I<equal to> operation (C<==>) | |||
skipping to change at line 521 | skipping to change at line 521 | |||
the third argument (see second example), or supply it (see third one). | the third argument (see second example), or supply it (see third one). | |||
=for bad | =for bad | |||
eq processes bad values. | 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. | It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. | |||
=cut | =cut | |||
#line 631 "Ops.pm" | #line 631 "Ops.pm" | |||
#line 1060 "../../blib/lib/PDL/PP.pm" | #line 951 "../../blib/lib/PDL/PP.pm" | |||
*eq = \&PDL::eq; | *eq = \&PDL::eq; | |||
#line 638 "Ops.pm" | #line 638 "Ops.pm" | |||
#line 132 "ops.pd" | #line 132 "ops.pd" | |||
{ | { | |||
my ($foo, $overload_sub); | my ($foo, $overload_sub); | |||
BEGIN { $OVERLOADS{'!='} = $overload_sub = sub(;@) { | BEGIN { $OVERLOADS{'!='} = $overload_sub = sub(;@) { | |||
return PDL::ne(@_) unless ref $_[1] | return PDL::ne(@_) unless ref $_[1] | |||
&& (ref $_[1] ne 'PDL') | && (ref $_[1] ne 'PDL') | |||
&& defined($foo = overload::Method($_[1], '!=')) | && defined($foo = overload::Method($_[1], '!=')) | |||
&& $foo != $overload_sub; # recursion guard | && $foo != $overload_sub; # recursion guard | |||
$foo->($_[1], $_[0], !$_[2]); | $foo->($_[1], $_[0], !$_[2]); | |||
}; } | }; } | |||
} | } | |||
#line 654 "Ops.pm" | #line 654 "Ops.pm" | |||
#line 1058 "../../blib/lib/PDL/PP.pm" | #line 949 "../../blib/lib/PDL/PP.pm" | |||
=head2 ne | =head2 ne | |||
=for sig | =for sig | |||
Signature: (a(); b(); [o]c(); int swap) | Signature: (a(); b(); [o]c(); int swap) | |||
=for ref | =for ref | |||
binary I<not equal to> operation (C<!=>) | binary I<not equal to> operation (C<!=>) | |||
skipping to change at line 572 | skipping to change at line 572 | |||
the third argument (see second example), or supply it (see third one). | the third argument (see second example), or supply it (see third one). | |||
=for bad | =for bad | |||
ne processes bad values. | 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. | It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. | |||
=cut | =cut | |||
#line 693 "Ops.pm" | #line 693 "Ops.pm" | |||
#line 1060 "../../blib/lib/PDL/PP.pm" | #line 951 "../../blib/lib/PDL/PP.pm" | |||
*ne = \&PDL::ne; | *ne = \&PDL::ne; | |||
#line 700 "Ops.pm" | #line 700 "Ops.pm" | |||
#line 132 "ops.pd" | #line 132 "ops.pd" | |||
{ | { | |||
my ($foo, $overload_sub); | my ($foo, $overload_sub); | |||
BEGIN { $OVERLOADS{'<<'} = $overload_sub = sub(;@) { | BEGIN { $OVERLOADS{'<<'} = $overload_sub = sub(;@) { | |||
return PDL::shiftleft(@_) unless ref $_[1] | return PDL::shiftleft(@_) unless ref $_[1] | |||
skipping to change at line 595 | skipping to change at line 595 | |||
&& $foo != $overload_sub; # recursion guard | && $foo != $overload_sub; # recursion guard | |||
$foo->($_[1], $_[0], !$_[2]); | $foo->($_[1], $_[0], !$_[2]); | |||
}; } | }; } | |||
} | } | |||
BEGIN { | BEGIN { | |||
# in1, in2, out, swap if true | # in1, in2, out, swap if true | |||
$OVERLOADS{'<<='} = sub { PDL::shiftleft($_[0], $_[1], $_[0], 0); $_[0] }; | $OVERLOADS{'<<='} = sub { PDL::shiftleft($_[0], $_[1], $_[0], 0); $_[0] }; | |||
} | } | |||
#line 720 "Ops.pm" | #line 720 "Ops.pm" | |||
#line 1058 "../../blib/lib/PDL/PP.pm" | #line 949 "../../blib/lib/PDL/PP.pm" | |||
=head2 shiftleft | =head2 shiftleft | |||
=for sig | =for sig | |||
Signature: (a(); b(); [o]c(); int swap) | Signature: (a(); b(); [o]c(); int swap) | |||
=for ref | =for ref | |||
leftshift C<$a> by C<$b> | leftshift C<$a> by C<$b> | |||
skipping to change at line 627 | skipping to change at line 627 | |||
the third argument (see second example), or supply it (see third one). | the third argument (see second example), or supply it (see third one). | |||
=for bad | =for bad | |||
shiftleft processes bad values. | 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. | It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. | |||
=cut | =cut | |||
#line 759 "Ops.pm" | #line 759 "Ops.pm" | |||
#line 1060 "../../blib/lib/PDL/PP.pm" | #line 951 "../../blib/lib/PDL/PP.pm" | |||
*shiftleft = \&PDL::shiftleft; | *shiftleft = \&PDL::shiftleft; | |||
#line 766 "Ops.pm" | #line 766 "Ops.pm" | |||
#line 132 "ops.pd" | #line 132 "ops.pd" | |||
{ | { | |||
my ($foo, $overload_sub); | my ($foo, $overload_sub); | |||
BEGIN { $OVERLOADS{'>>'} = $overload_sub = sub(;@) { | BEGIN { $OVERLOADS{'>>'} = $overload_sub = sub(;@) { | |||
return PDL::shiftright(@_) unless ref $_[1] | return PDL::shiftright(@_) unless ref $_[1] | |||
skipping to change at line 650 | skipping to change at line 650 | |||
&& $foo != $overload_sub; # recursion guard | && $foo != $overload_sub; # recursion guard | |||
$foo->($_[1], $_[0], !$_[2]); | $foo->($_[1], $_[0], !$_[2]); | |||
}; } | }; } | |||
} | } | |||
BEGIN { | BEGIN { | |||
# in1, in2, out, swap if true | # in1, in2, out, swap if true | |||
$OVERLOADS{'>>='} = sub { PDL::shiftright($_[0], $_[1], $_[0], 0); $_[0] }; | $OVERLOADS{'>>='} = sub { PDL::shiftright($_[0], $_[1], $_[0], 0); $_[0] }; | |||
} | } | |||
#line 786 "Ops.pm" | #line 786 "Ops.pm" | |||
#line 1058 "../../blib/lib/PDL/PP.pm" | #line 949 "../../blib/lib/PDL/PP.pm" | |||
=head2 shiftright | =head2 shiftright | |||
=for sig | =for sig | |||
Signature: (a(); b(); [o]c(); int swap) | Signature: (a(); b(); [o]c(); int swap) | |||
=for ref | =for ref | |||
rightshift C<$a> by C<$b> | rightshift C<$a> by C<$b> | |||
skipping to change at line 682 | skipping to change at line 682 | |||
the third argument (see second example), or supply it (see third one). | the third argument (see second example), or supply it (see third one). | |||
=for bad | =for bad | |||
shiftright processes bad values. | 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. | It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. | |||
=cut | =cut | |||
#line 825 "Ops.pm" | #line 825 "Ops.pm" | |||
#line 1060 "../../blib/lib/PDL/PP.pm" | #line 951 "../../blib/lib/PDL/PP.pm" | |||
*shiftright = \&PDL::shiftright; | *shiftright = \&PDL::shiftright; | |||
#line 832 "Ops.pm" | #line 832 "Ops.pm" | |||
#line 132 "ops.pd" | #line 132 "ops.pd" | |||
{ | { | |||
my ($foo, $overload_sub); | my ($foo, $overload_sub); | |||
BEGIN { $OVERLOADS{'|'} = $overload_sub = sub(;@) { | BEGIN { $OVERLOADS{'|'} = $overload_sub = sub(;@) { | |||
return PDL::or2($_[2]?@_[1,0]:@_[0,1]) unless ref $_[1] | return PDL::or2($_[2]?@_[1,0]:@_[0,1]) unless ref $_[1] | |||
skipping to change at line 705 | skipping to change at line 705 | |||
&& $foo != $overload_sub; # recursion guard | && $foo != $overload_sub; # recursion guard | |||
$foo->($_[1], $_[0], !$_[2]); | $foo->($_[1], $_[0], !$_[2]); | |||
}; } | }; } | |||
} | } | |||
BEGIN { | BEGIN { | |||
# in1, in2, out, swap if true | # in1, in2, out, swap if true | |||
$OVERLOADS{'|='} = sub { PDL::or2($_[0], $_[1], $_[0], 0); $_[0] }; | $OVERLOADS{'|='} = sub { PDL::or2($_[0], $_[1], $_[0], 0); $_[0] }; | |||
} | } | |||
#line 852 "Ops.pm" | #line 852 "Ops.pm" | |||
#line 1058 "../../blib/lib/PDL/PP.pm" | #line 949 "../../blib/lib/PDL/PP.pm" | |||
=head2 or2 | =head2 or2 | |||
=for sig | =for sig | |||
Signature: (a(); b(); [o]c(); int swap) | Signature: (a(); b(); [o]c(); int swap) | |||
=for ref | =for ref | |||
binary I<or> of two ndarrays | binary I<or> of two ndarrays | |||
skipping to change at line 737 | skipping to change at line 737 | |||
the third argument (see second example), or supply it (see third one). | the third argument (see second example), or supply it (see third one). | |||
=for bad | =for bad | |||
or2 processes bad values. | 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. | It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. | |||
=cut | =cut | |||
#line 891 "Ops.pm" | #line 891 "Ops.pm" | |||
#line 1060 "../../blib/lib/PDL/PP.pm" | #line 951 "../../blib/lib/PDL/PP.pm" | |||
*or2 = \&PDL::or2; | *or2 = \&PDL::or2; | |||
#line 898 "Ops.pm" | #line 898 "Ops.pm" | |||
#line 132 "ops.pd" | #line 132 "ops.pd" | |||
{ | { | |||
my ($foo, $overload_sub); | my ($foo, $overload_sub); | |||
BEGIN { $OVERLOADS{'&'} = $overload_sub = sub(;@) { | BEGIN { $OVERLOADS{'&'} = $overload_sub = sub(;@) { | |||
return PDL::and2($_[2]?@_[1,0]:@_[0,1]) unless ref $_[1] | return PDL::and2($_[2]?@_[1,0]:@_[0,1]) unless ref $_[1] | |||
skipping to change at line 760 | skipping to change at line 760 | |||
&& $foo != $overload_sub; # recursion guard | && $foo != $overload_sub; # recursion guard | |||
$foo->($_[1], $_[0], !$_[2]); | $foo->($_[1], $_[0], !$_[2]); | |||
}; } | }; } | |||
} | } | |||
BEGIN { | BEGIN { | |||
# in1, in2, out, swap if true | # in1, in2, out, swap if true | |||
$OVERLOADS{'&='} = sub { PDL::and2($_[0], $_[1], $_[0], 0); $_[0] }; | $OVERLOADS{'&='} = sub { PDL::and2($_[0], $_[1], $_[0], 0); $_[0] }; | |||
} | } | |||
#line 918 "Ops.pm" | #line 918 "Ops.pm" | |||
#line 1058 "../../blib/lib/PDL/PP.pm" | #line 949 "../../blib/lib/PDL/PP.pm" | |||
=head2 and2 | =head2 and2 | |||
=for sig | =for sig | |||
Signature: (a(); b(); [o]c(); int swap) | Signature: (a(); b(); [o]c(); int swap) | |||
=for ref | =for ref | |||
binary I<and> of two ndarrays | binary I<and> of two ndarrays | |||
skipping to change at line 792 | skipping to change at line 792 | |||
the third argument (see second example), or supply it (see third one). | the third argument (see second example), or supply it (see third one). | |||
=for bad | =for bad | |||
and2 processes bad values. | 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. | It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. | |||
=cut | =cut | |||
#line 957 "Ops.pm" | #line 957 "Ops.pm" | |||
#line 1060 "../../blib/lib/PDL/PP.pm" | #line 951 "../../blib/lib/PDL/PP.pm" | |||
*and2 = \&PDL::and2; | *and2 = \&PDL::and2; | |||
#line 964 "Ops.pm" | #line 964 "Ops.pm" | |||
#line 132 "ops.pd" | #line 132 "ops.pd" | |||
{ | { | |||
my ($foo, $overload_sub); | my ($foo, $overload_sub); | |||
BEGIN { $OVERLOADS{'^'} = $overload_sub = sub(;@) { | BEGIN { $OVERLOADS{'^'} = $overload_sub = sub(;@) { | |||
return PDL::xor($_[2]?@_[1,0]:@_[0,1]) unless ref $_[1] | return PDL::xor($_[2]?@_[1,0]:@_[0,1]) unless ref $_[1] | |||
skipping to change at line 815 | skipping to change at line 815 | |||
&& $foo != $overload_sub; # recursion guard | && $foo != $overload_sub; # recursion guard | |||
$foo->($_[1], $_[0], !$_[2]); | $foo->($_[1], $_[0], !$_[2]); | |||
}; } | }; } | |||
} | } | |||
BEGIN { | BEGIN { | |||
# in1, in2, out, swap if true | # in1, in2, out, swap if true | |||
$OVERLOADS{'^='} = sub { PDL::xor($_[0], $_[1], $_[0], 0); $_[0] }; | $OVERLOADS{'^='} = sub { PDL::xor($_[0], $_[1], $_[0], 0); $_[0] }; | |||
} | } | |||
#line 984 "Ops.pm" | #line 984 "Ops.pm" | |||
#line 1058 "../../blib/lib/PDL/PP.pm" | #line 949 "../../blib/lib/PDL/PP.pm" | |||
=head2 xor | =head2 xor | |||
=for sig | =for sig | |||
Signature: (a(); b(); [o]c(); int swap) | Signature: (a(); b(); [o]c(); int swap) | |||
=for ref | =for ref | |||
binary I<exclusive or> of two ndarrays | binary I<exclusive or> of two ndarrays | |||
skipping to change at line 847 | skipping to change at line 847 | |||
the third argument (see second example), or supply it (see third one). | the third argument (see second example), or supply it (see third one). | |||
=for bad | =for bad | |||
xor processes bad values. | 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. | It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. | |||
=cut | =cut | |||
#line 1023 "Ops.pm" | #line 1023 "Ops.pm" | |||
#line 1060 "../../blib/lib/PDL/PP.pm" | #line 951 "../../blib/lib/PDL/PP.pm" | |||
*xor = \&PDL::xor; | *xor = \&PDL::xor; | |||
#line 1030 "Ops.pm" | #line 1030 "Ops.pm" | |||
#line 308 "ops.pd" | #line 308 "ops.pd" | |||
BEGIN { $OVERLOADS{'~'} = sub { PDL::bitnot($_[0]) } } | BEGIN { $OVERLOADS{'~'} = sub { PDL::bitnot($_[0]) } } | |||
#line 1037 "Ops.pm" | #line 1037 "Ops.pm" | |||
#line 1058 "../../blib/lib/PDL/PP.pm" | #line 949 "../../blib/lib/PDL/PP.pm" | |||
=head2 bitnot | =head2 bitnot | |||
=for sig | =for sig | |||
Signature: (a(); [o]b()) | Signature: (a(); [o]b()) | |||
=for ref | =for ref | |||
unary bit negation | unary bit negation | |||
skipping to change at line 885 | skipping to change at line 885 | |||
This function is used to overload the unary C<~> operator/function. | This function is used to overload the unary C<~> operator/function. | |||
=for bad | =for bad | |||
bitnot processes bad values. | 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. | It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. | |||
=cut | =cut | |||
#line 1072 "Ops.pm" | #line 1072 "Ops.pm" | |||
#line 1060 "../../blib/lib/PDL/PP.pm" | #line 951 "../../blib/lib/PDL/PP.pm" | |||
*bitnot = \&PDL::bitnot; | *bitnot = \&PDL::bitnot; | |||
#line 1079 "Ops.pm" | #line 1079 "Ops.pm" | |||
#line 241 "ops.pd" | #line 241 "ops.pd" | |||
{ | { | |||
my ($foo, $overload_sub); | my ($foo, $overload_sub); | |||
BEGIN { $OVERLOADS{'**'} = $overload_sub = sub(;@) { | BEGIN { $OVERLOADS{'**'} = $overload_sub = sub(;@) { | |||
return PDL::power(@_) unless ref $_[1] | return PDL::power(@_) unless ref $_[1] | |||
skipping to change at line 908 | skipping to change at line 908 | |||
&& $foo != $overload_sub; # recursion guard | && $foo != $overload_sub; # recursion guard | |||
$foo->($_[1], $_[0], !$_[2]); | $foo->($_[1], $_[0], !$_[2]); | |||
}; } | }; } | |||
} | } | |||
BEGIN { | BEGIN { | |||
# in1, in2, out, swap if true | # in1, in2, out, swap if true | |||
$OVERLOADS{'**='} = sub { PDL::power($_[0], $_[1], $_[0], 0); $_[0] }; | $OVERLOADS{'**='} = sub { PDL::power($_[0], $_[1], $_[0], 0); $_[0] }; | |||
} | } | |||
#line 1099 "Ops.pm" | #line 1099 "Ops.pm" | |||
#line 1058 "../../blib/lib/PDL/PP.pm" | #line 949 "../../blib/lib/PDL/PP.pm" | |||
=head2 power | =head2 power | |||
=for sig | =for sig | |||
Signature: (a(); b(); [o]c(); int swap) | Signature: (a(); b(); [o]c(); int swap) | |||
=for ref | =for ref | |||
raise ndarray C<$a> to the power C<$b> | raise ndarray C<$a> to the power C<$b> | |||
=for example | =for example | |||
$c = $x->power($y,0); # explicit function call | $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 | $c = $a ** $b; # overloaded use | |||
$x->inplace->power($y,0); # modify $x inplace | $x->inplace->power($y,0); # modify $x inplace | |||
It can be made to work inplace with the C<$x-E<gt>inplace> syntax. | It can be made to work inplace with the C<$x-E<gt>inplace> syntax. | |||
This function is used to overload the binary C<**> function. | This function is used to overload the binary C<**> function. | |||
Note that when calling this function explicitly you need to supply | As of 2.065, when calling this function explicitly you can omit | |||
a third argument that should generally be zero (see first example). | the third argument (see first example), or supply it (see second one). | |||
This restriction is expected to go away in future releases. | ||||
=for bad | =for bad | |||
power processes bad values. | 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. | It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. | |||
=cut | =cut | |||
#line 1138 "Ops.pm" | #line 1138 "Ops.pm" | |||
#line 1060 "../../blib/lib/PDL/PP.pm" | #line 951 "../../blib/lib/PDL/PP.pm" | |||
*power = \&PDL::power; | *power = \&PDL::power; | |||
#line 1145 "Ops.pm" | #line 1145 "Ops.pm" | |||
#line 241 "ops.pd" | #line 241 "ops.pd" | |||
{ | { | |||
my ($foo, $overload_sub); | my ($foo, $overload_sub); | |||
BEGIN { $OVERLOADS{'atan2'} = $overload_sub = sub(;@) { | BEGIN { $OVERLOADS{'atan2'} = $overload_sub = sub(;@) { | |||
return PDL::atan2(@_) unless ref $_[1] | return PDL::atan2(@_) unless ref $_[1] | |||
&& (ref $_[1] ne 'PDL') | && (ref $_[1] ne 'PDL') | |||
&& defined($foo = overload::Method($_[1], 'atan2')) | && defined($foo = overload::Method($_[1], 'atan2')) | |||
&& $foo != $overload_sub; # recursion guard | && $foo != $overload_sub; # recursion guard | |||
$foo->($_[1], $_[0], !$_[2]); | $foo->($_[1], $_[0], !$_[2]); | |||
}; } | }; } | |||
} | } | |||
#line 1161 "Ops.pm" | #line 1161 "Ops.pm" | |||
#line 1058 "../../blib/lib/PDL/PP.pm" | #line 949 "../../blib/lib/PDL/PP.pm" | |||
=head2 atan2 | =head2 atan2 | |||
=for sig | =for sig | |||
Signature: (a(); b(); [o]c(); int swap) | Signature: (a(); b(); [o]c(); int swap) | |||
=for ref | =for ref | |||
elementwise C<atan2> of two ndarrays | elementwise C<atan2> of two ndarrays | |||
=for example | =for example | |||
$c = $x->atan2($y,0); # explicit function call | $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 | $c = atan2 $a, $b; # overloaded use | |||
$x->inplace->atan2($y,0); # modify $x inplace | $x->inplace->atan2($y,0); # modify $x inplace | |||
It can be made to work inplace with the C<$x-E<gt>inplace> syntax. | It can be made to work inplace with the C<$x-E<gt>inplace> syntax. | |||
This function is used to overload the binary C<atan2> function. | This function is used to overload the binary C<atan2> function. | |||
Note that when calling this function explicitly you need to supply | As of 2.065, when calling this function explicitly you can omit | |||
a third argument that should generally be zero (see first example). | the third argument (see first example), or supply it (see second one). | |||
This restriction is expected to go away in future releases. | ||||
=for bad | =for bad | |||
atan2 processes bad values. | 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. | It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. | |||
=cut | =cut | |||
#line 1200 "Ops.pm" | #line 1200 "Ops.pm" | |||
#line 1060 "../../blib/lib/PDL/PP.pm" | #line 951 "../../blib/lib/PDL/PP.pm" | |||
*atan2 = \&PDL::atan2; | *atan2 = \&PDL::atan2; | |||
#line 1207 "Ops.pm" | #line 1207 "Ops.pm" | |||
#line 241 "ops.pd" | #line 241 "ops.pd" | |||
{ | { | |||
my ($foo, $overload_sub); | my ($foo, $overload_sub); | |||
BEGIN { $OVERLOADS{'%'} = $overload_sub = sub(;@) { | BEGIN { $OVERLOADS{'%'} = $overload_sub = sub(;@) { | |||
return PDL::modulo(@_) unless ref $_[1] | return PDL::modulo(@_) unless ref $_[1] | |||
skipping to change at line 1014 | skipping to change at line 1014 | |||
&& $foo != $overload_sub; # recursion guard | && $foo != $overload_sub; # recursion guard | |||
$foo->($_[1], $_[0], !$_[2]); | $foo->($_[1], $_[0], !$_[2]); | |||
}; } | }; } | |||
} | } | |||
BEGIN { | BEGIN { | |||
# in1, in2, out, swap if true | # in1, in2, out, swap if true | |||
$OVERLOADS{'%='} = sub { PDL::modulo($_[0], $_[1], $_[0], 0); $_[0] }; | $OVERLOADS{'%='} = sub { PDL::modulo($_[0], $_[1], $_[0], 0); $_[0] }; | |||
} | } | |||
#line 1227 "Ops.pm" | #line 1227 "Ops.pm" | |||
#line 1058 "../../blib/lib/PDL/PP.pm" | #line 949 "../../blib/lib/PDL/PP.pm" | |||
=head2 modulo | =head2 modulo | |||
=for sig | =for sig | |||
Signature: (a(); b(); [o]c(); int swap) | Signature: (a(); b(); [o]c(); int swap) | |||
=for ref | =for ref | |||
elementwise C<modulo> operation | elementwise C<modulo> operation | |||
=for example | =for example | |||
$c = $x->modulo($y,0); # explicit function call | $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 | $c = $a % $b; # overloaded use | |||
$x->inplace->modulo($y,0); # modify $x inplace | $x->inplace->modulo($y,0); # modify $x inplace | |||
It can be made to work inplace with the C<$x-E<gt>inplace> syntax. | It can be made to work inplace with the C<$x-E<gt>inplace> syntax. | |||
This function is used to overload the binary C<%> function. | This function is used to overload the binary C<%> function. | |||
Note that when calling this function explicitly you need to supply | As of 2.065, when calling this function explicitly you can omit | |||
a third argument that should generally be zero (see first example). | the third argument (see first example), or supply it (see second one). | |||
This restriction is expected to go away in future releases. | ||||
=for bad | =for bad | |||
modulo processes bad values. | 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. | It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. | |||
=cut | =cut | |||
#line 1266 "Ops.pm" | #line 1266 "Ops.pm" | |||
#line 1060 "../../blib/lib/PDL/PP.pm" | #line 951 "../../blib/lib/PDL/PP.pm" | |||
*modulo = \&PDL::modulo; | *modulo = \&PDL::modulo; | |||
#line 1273 "Ops.pm" | #line 1273 "Ops.pm" | |||
#line 241 "ops.pd" | #line 241 "ops.pd" | |||
{ | { | |||
my ($foo, $overload_sub); | my ($foo, $overload_sub); | |||
BEGIN { $OVERLOADS{'<=>'} = $overload_sub = sub(;@) { | BEGIN { $OVERLOADS{'<=>'} = $overload_sub = sub(;@) { | |||
return PDL::spaceship(@_) unless ref $_[1] | return PDL::spaceship(@_) unless ref $_[1] | |||
&& (ref $_[1] ne 'PDL') | && (ref $_[1] ne 'PDL') | |||
&& defined($foo = overload::Method($_[1], '<=>')) | && defined($foo = overload::Method($_[1], '<=>')) | |||
&& $foo != $overload_sub; # recursion guard | && $foo != $overload_sub; # recursion guard | |||
$foo->($_[1], $_[0], !$_[2]); | $foo->($_[1], $_[0], !$_[2]); | |||
}; } | }; } | |||
} | } | |||
#line 1289 "Ops.pm" | #line 1289 "Ops.pm" | |||
#line 1058 "../../blib/lib/PDL/PP.pm" | #line 949 "../../blib/lib/PDL/PP.pm" | |||
=head2 spaceship | =head2 spaceship | |||
=for sig | =for sig | |||
Signature: (a(); b(); [o]c(); int swap) | Signature: (a(); b(); [o]c(); int swap) | |||
=for ref | =for ref | |||
elementwise "<=>" operation | elementwise "<=>" operation | |||
=for example | =for example | |||
$c = $x->spaceship($y,0); # explicit function call | $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 | $c = $a <=> $b; # overloaded use | |||
$x->inplace->spaceship($y,0); # modify $x inplace | $x->inplace->spaceship($y,0); # modify $x inplace | |||
It can be made to work inplace with the C<$x-E<gt>inplace> syntax. | It can be made to work inplace with the C<$x-E<gt>inplace> syntax. | |||
This function is used to overload the binary C<E<lt>=E<gt>> function. | This function is used to overload the binary C<E<lt>=E<gt>> function. | |||
Note that when calling this function explicitly you need to supply | As of 2.065, when calling this function explicitly you can omit | |||
a third argument that should generally be zero (see first example). | the third argument (see first example), or supply it (see second one). | |||
This restriction is expected to go away in future releases. | ||||
=for bad | =for bad | |||
spaceship processes bad values. | 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. | It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. | |||
=cut | =cut | |||
#line 1328 "Ops.pm" | #line 1328 "Ops.pm" | |||
#line 1060 "../../blib/lib/PDL/PP.pm" | #line 951 "../../blib/lib/PDL/PP.pm" | |||
*spaceship = \&PDL::spaceship; | *spaceship = \&PDL::spaceship; | |||
#line 1335 "Ops.pm" | #line 1335 "Ops.pm" | |||
#line 308 "ops.pd" | #line 308 "ops.pd" | |||
BEGIN { $OVERLOADS{'sqrt'} = sub { PDL::sqrt($_[0]) } } | BEGIN { $OVERLOADS{'sqrt'} = sub { PDL::sqrt($_[0]) } } | |||
#line 1342 "Ops.pm" | #line 1342 "Ops.pm" | |||
#line 1058 "../../blib/lib/PDL/PP.pm" | #line 949 "../../blib/lib/PDL/PP.pm" | |||
=head2 sqrt | =head2 sqrt | |||
=for sig | =for sig | |||
Signature: (a(); [o]b()) | Signature: (a(); [o]b()) | |||
=for ref | =for ref | |||
elementwise square root | elementwise square root | |||
skipping to change at line 1135 | skipping to change at line 1135 | |||
This function is used to overload the unary C<sqrt> operator/function. | This function is used to overload the unary C<sqrt> operator/function. | |||
=for bad | =for bad | |||
sqrt processes bad values. | 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. | It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. | |||
=cut | =cut | |||
#line 1377 "Ops.pm" | #line 1377 "Ops.pm" | |||
#line 1060 "../../blib/lib/PDL/PP.pm" | #line 951 "../../blib/lib/PDL/PP.pm" | |||
*sqrt = \&PDL::sqrt; | *sqrt = \&PDL::sqrt; | |||
#line 1384 "Ops.pm" | #line 1384 "Ops.pm" | |||
#line 308 "ops.pd" | #line 308 "ops.pd" | |||
BEGIN { $OVERLOADS{'sin'} = sub { PDL::sin($_[0]) } } | BEGIN { $OVERLOADS{'sin'} = sub { PDL::sin($_[0]) } } | |||
#line 1391 "Ops.pm" | #line 1391 "Ops.pm" | |||
#line 1058 "../../blib/lib/PDL/PP.pm" | #line 949 "../../blib/lib/PDL/PP.pm" | |||
=head2 sin | =head2 sin | |||
=for sig | =for sig | |||
Signature: (a(); [o]b()) | Signature: (a(); [o]b()) | |||
=for ref | =for ref | |||
the sin function | the sin function | |||
skipping to change at line 1173 | skipping to change at line 1173 | |||
This function is used to overload the unary C<sin> operator/function. | This function is used to overload the unary C<sin> operator/function. | |||
=for bad | =for bad | |||
sin processes bad values. | 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. | It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. | |||
=cut | =cut | |||
#line 1426 "Ops.pm" | #line 1426 "Ops.pm" | |||
#line 1060 "../../blib/lib/PDL/PP.pm" | #line 951 "../../blib/lib/PDL/PP.pm" | |||
*sin = \&PDL::sin; | *sin = \&PDL::sin; | |||
#line 1433 "Ops.pm" | #line 1433 "Ops.pm" | |||
#line 308 "ops.pd" | #line 308 "ops.pd" | |||
BEGIN { $OVERLOADS{'cos'} = sub { PDL::cos($_[0]) } } | BEGIN { $OVERLOADS{'cos'} = sub { PDL::cos($_[0]) } } | |||
#line 1440 "Ops.pm" | #line 1440 "Ops.pm" | |||
#line 1058 "../../blib/lib/PDL/PP.pm" | #line 949 "../../blib/lib/PDL/PP.pm" | |||
=head2 cos | =head2 cos | |||
=for sig | =for sig | |||
Signature: (a(); [o]b()) | Signature: (a(); [o]b()) | |||
=for ref | =for ref | |||
the cos function | the cos function | |||
skipping to change at line 1211 | skipping to change at line 1211 | |||
This function is used to overload the unary C<cos> operator/function. | This function is used to overload the unary C<cos> operator/function. | |||
=for bad | =for bad | |||
cos processes bad values. | 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. | It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. | |||
=cut | =cut | |||
#line 1475 "Ops.pm" | #line 1475 "Ops.pm" | |||
#line 1060 "../../blib/lib/PDL/PP.pm" | #line 951 "../../blib/lib/PDL/PP.pm" | |||
*cos = \&PDL::cos; | *cos = \&PDL::cos; | |||
#line 1482 "Ops.pm" | #line 1482 "Ops.pm" | |||
#line 308 "ops.pd" | #line 308 "ops.pd" | |||
BEGIN { $OVERLOADS{'!'} = sub { PDL::not($_[0]) } } | BEGIN { $OVERLOADS{'!'} = sub { PDL::not($_[0]) } } | |||
#line 1489 "Ops.pm" | #line 1489 "Ops.pm" | |||
#line 1058 "../../blib/lib/PDL/PP.pm" | #line 949 "../../blib/lib/PDL/PP.pm" | |||
=head2 not | =head2 not | |||
=for sig | =for sig | |||
Signature: (a(); [o]b()) | Signature: (a(); [o]b()) | |||
=for ref | =for ref | |||
the elementwise I<not> operation | the elementwise I<not> operation | |||
skipping to change at line 1249 | skipping to change at line 1249 | |||
This function is used to overload the unary C<!> operator/function. | This function is used to overload the unary C<!> operator/function. | |||
=for bad | =for bad | |||
not processes bad values. | 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. | It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. | |||
=cut | =cut | |||
#line 1524 "Ops.pm" | #line 1524 "Ops.pm" | |||
#line 1060 "../../blib/lib/PDL/PP.pm" | #line 951 "../../blib/lib/PDL/PP.pm" | |||
*not = \&PDL::not; | *not = \&PDL::not; | |||
#line 1531 "Ops.pm" | #line 1531 "Ops.pm" | |||
#line 308 "ops.pd" | #line 308 "ops.pd" | |||
BEGIN { $OVERLOADS{'exp'} = sub { PDL::exp($_[0]) } } | BEGIN { $OVERLOADS{'exp'} = sub { PDL::exp($_[0]) } } | |||
#line 1538 "Ops.pm" | #line 1538 "Ops.pm" | |||
#line 1058 "../../blib/lib/PDL/PP.pm" | #line 949 "../../blib/lib/PDL/PP.pm" | |||
=head2 exp | =head2 exp | |||
=for sig | =for sig | |||
Signature: (a(); [o]b()) | Signature: (a(); [o]b()) | |||
=for ref | =for ref | |||
the exponential function | the exponential function | |||
skipping to change at line 1287 | skipping to change at line 1287 | |||
This function is used to overload the unary C<exp> operator/function. | This function is used to overload the unary C<exp> operator/function. | |||
=for bad | =for bad | |||
exp processes bad values. | 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. | It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. | |||
=cut | =cut | |||
#line 1573 "Ops.pm" | #line 1573 "Ops.pm" | |||
#line 1060 "../../blib/lib/PDL/PP.pm" | #line 951 "../../blib/lib/PDL/PP.pm" | |||
*exp = \&PDL::exp; | *exp = \&PDL::exp; | |||
#line 1580 "Ops.pm" | #line 1580 "Ops.pm" | |||
#line 308 "ops.pd" | #line 308 "ops.pd" | |||
BEGIN { $OVERLOADS{'log'} = sub { PDL::log($_[0]) } } | BEGIN { $OVERLOADS{'log'} = sub { PDL::log($_[0]) } } | |||
#line 1587 "Ops.pm" | #line 1587 "Ops.pm" | |||
#line 1058 "../../blib/lib/PDL/PP.pm" | #line 949 "../../blib/lib/PDL/PP.pm" | |||
=head2 log | =head2 log | |||
=for sig | =for sig | |||
Signature: (a(); [o]b()) | Signature: (a(); [o]b()) | |||
=for ref | =for ref | |||
the natural logarithm | the natural logarithm | |||
skipping to change at line 1325 | skipping to change at line 1325 | |||
This function is used to overload the unary C<log> operator/function. | This function is used to overload the unary C<log> operator/function. | |||
=for bad | =for bad | |||
log processes bad values. | 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. | It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. | |||
=cut | =cut | |||
#line 1622 "Ops.pm" | #line 1622 "Ops.pm" | |||
#line 1060 "../../blib/lib/PDL/PP.pm" | #line 951 "../../blib/lib/PDL/PP.pm" | |||
*log = \&PDL::log; | *log = \&PDL::log; | |||
#line 1629 "Ops.pm" | #line 1629 "Ops.pm" | |||
#line 1058 "../../blib/lib/PDL/PP.pm" | #line 949 "../../blib/lib/PDL/PP.pm" | |||
=head2 re | =head2 re | |||
=for sig | =for sig | |||
Signature: (complexv(); real [o]b()) | Signature: (complexv(); real [o]b()) | |||
=for ref | =for ref | |||
Returns the real part of a complex number. | Returns the real part of a complex number. | |||
=for bad | =for bad | |||
re processes bad values. | 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. | It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. | |||
=cut | =cut | |||
#line 1654 "Ops.pm" | #line 1654 "Ops.pm" | |||
#line 1060 "../../blib/lib/PDL/PP.pm" | #line 951 "../../blib/lib/PDL/PP.pm" | |||
*re = \&PDL::re; | *re = \&PDL::re; | |||
#line 1661 "Ops.pm" | #line 1661 "Ops.pm" | |||
#line 1058 "../../blib/lib/PDL/PP.pm" | #line 949 "../../blib/lib/PDL/PP.pm" | |||
=head2 im | =head2 im | |||
=for sig | =for sig | |||
Signature: (complexv(); real [o]b()) | Signature: (complexv(); real [o]b()) | |||
=for ref | =for ref | |||
Returns the imaginary part of a complex number. | Returns the imaginary part of a complex number. | |||
=for bad | =for bad | |||
im processes bad values. | 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. | It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. | |||
=cut | =cut | |||
#line 1686 "Ops.pm" | #line 1686 "Ops.pm" | |||
#line 1060 "../../blib/lib/PDL/PP.pm" | #line 951 "../../blib/lib/PDL/PP.pm" | |||
*im = \&PDL::im; | *im = \&PDL::im; | |||
#line 1693 "Ops.pm" | #line 1693 "Ops.pm" | |||
#line 1058 "../../blib/lib/PDL/PP.pm" | #line 949 "../../blib/lib/PDL/PP.pm" | |||
=head2 _cabs | =head2 _cabs | |||
=for sig | =for sig | |||
Signature: (complexv(); real [o]b()) | Signature: (complexv(); real [o]b()) | |||
=for ref | =for ref | |||
Returns the absolute (length) of a complex number. | Returns the absolute (length) of a complex number. | |||
=for bad | =for bad | |||
_cabs processes bad values. | _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. | It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. | |||
=cut | =cut | |||
#line 1718 "Ops.pm" | #line 1718 "Ops.pm" | |||
#line 1060 "../../blib/lib/PDL/PP.pm" | #line 951 "../../blib/lib/PDL/PP.pm" | |||
#line 1723 "Ops.pm" | #line 1723 "Ops.pm" | |||
#line 1060 "../../blib/lib/PDL/PP.pm" | #line 951 "../../blib/lib/PDL/PP.pm" | |||
#line 1728 "Ops.pm" | #line 1728 "Ops.pm" | |||
#line 1058 "../../blib/lib/PDL/PP.pm" | #line 949 "../../blib/lib/PDL/PP.pm" | |||
=head2 log10 | =head2 log10 | |||
=for sig | =for sig | |||
Signature: (a(); [o]b()) | Signature: (a(); [o]b()) | |||
=for ref | =for ref | |||
the base 10 logarithm | the base 10 logarithm | |||
skipping to change at line 1434 | skipping to change at line 1434 | |||
This function is used to overload the unary C<log10> operator/function. | This function is used to overload the unary C<log10> operator/function. | |||
=for bad | =for bad | |||
log10 processes bad values. | 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. | It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. | |||
=cut | =cut | |||
#line 1763 "Ops.pm" | #line 1763 "Ops.pm" | |||
#line 1059 "../../blib/lib/PDL/PP.pm" | #line 950 "../../blib/lib/PDL/PP.pm" | |||
sub PDL::log10 { | sub PDL::log10 { | |||
my $x = shift; | my $x = shift; | |||
if ( ! UNIVERSAL::isa($x,"PDL") ) { return log($x) / log(10); } | if ( ! UNIVERSAL::isa($x,"PDL") ) { return log($x) / log(10); } | |||
my $y; | my $y; | |||
if ( $x->is_inplace ) { $x->set_inplace(0); $y = $x; } | if ( $x->is_inplace ) { $x->set_inplace(0); $y = $x; } | |||
elsif( ref($x) eq "PDL"){ | elsif( ref($x) eq "PDL"){ | |||
#PDL Objects, use nullcreate: | #PDL Objects, use nullcreate: | |||
$y = PDL->nullcreate($x); | $y = PDL->nullcreate($x); | |||
}else{ | }else{ | |||
#PDL-Derived Object, use copy: (Consistent with | #PDL-Derived Object, use copy: (Consistent with | |||
# Auto-creation docs in Objects.pod) | # Auto-creation docs in Objects.pod) | |||
$y = $x->copy; | $y = $x->copy; | |||
} | } | |||
&PDL::_log10_int( $x, $y ); | &PDL::_log10_int( $x, $y ); | |||
return $y; | return $y; | |||
}; | }; | |||
#line 1786 "Ops.pm" | #line 1786 "Ops.pm" | |||
#line 1060 "../../blib/lib/PDL/PP.pm" | #line 951 "../../blib/lib/PDL/PP.pm" | |||
*log10 = \&PDL::log10; | *log10 = \&PDL::log10; | |||
#line 1793 "Ops.pm" | #line 1793 "Ops.pm" | |||
#line 1058 "../../blib/lib/PDL/PP.pm" | #line 949 "../../blib/lib/PDL/PP.pm" | |||
=head2 assgn | =head2 assgn | |||
=for sig | =for sig | |||
Signature: (a(); [o]b()) | Signature: (a(); [o]b()) | |||
=for ref | =for ref | |||
Plain numerical assignment. This is used to implement the ".=" operator | Plain numerical assignment. This is used to implement the ".=" operator | |||
=for bad | =for bad | |||
assgn processes bad values. | 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. | It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. | |||
=cut | =cut | |||
#line 1818 "Ops.pm" | #line 1818 "Ops.pm" | |||
#line 1060 "../../blib/lib/PDL/PP.pm" | #line 951 "../../blib/lib/PDL/PP.pm" | |||
*assgn = \&PDL::assgn; | *assgn = \&PDL::assgn; | |||
#line 1825 "Ops.pm" | #line 1825 "Ops.pm" | |||
#line 1058 "../../blib/lib/PDL/PP.pm" | #line 949 "../../blib/lib/PDL/PP.pm" | |||
=head2 carg | =head2 carg | |||
=for sig | =for sig | |||
Signature: (complexv(); real [o]b()) | Signature: (complexv(); real [o]b()) | |||
=for ref | =for ref | |||
Returns the polar angle of a complex number. | Returns the polar angle of a complex number. | |||
=for bad | =for bad | |||
carg processes bad values. | 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. | It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. | |||
=cut | =cut | |||
#line 1850 "Ops.pm" | #line 1850 "Ops.pm" | |||
#line 1060 "../../blib/lib/PDL/PP.pm" | #line 951 "../../blib/lib/PDL/PP.pm" | |||
*carg = \&PDL::carg; | *carg = \&PDL::carg; | |||
#line 1857 "Ops.pm" | #line 1857 "Ops.pm" | |||
#line 1058 "../../blib/lib/PDL/PP.pm" | #line 949 "../../blib/lib/PDL/PP.pm" | |||
=head2 conj | =head2 conj | |||
=for sig | =for sig | |||
Signature: (complexv(); [o]b()) | Signature: (complexv(); [o]b()) | |||
=for ref | =for ref | |||
complex conjugate. | complex conjugate. | |||
=for bad | =for bad | |||
conj processes bad values. | 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. | It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. | |||
=cut | =cut | |||
#line 1882 "Ops.pm" | #line 1882 "Ops.pm" | |||
#line 1060 "../../blib/lib/PDL/PP.pm" | #line 951 "../../blib/lib/PDL/PP.pm" | |||
*conj = \&PDL::conj; | *conj = \&PDL::conj; | |||
#line 1889 "Ops.pm" | #line 1889 "Ops.pm" | |||
#line 1058 "../../blib/lib/PDL/PP.pm" | #line 949 "../../blib/lib/PDL/PP.pm" | |||
=head2 czip | =head2 czip | |||
=for sig | =for sig | |||
Signature: (r(); i(); complex [o]c()) | Signature: (r(); i(); complex [o]c()) | |||
convert real, imaginary to native complex, (sort of) like LISP zip | convert real, imaginary to native complex, (sort of) like LISP zip | |||
function. Will add the C<r> ndarray to "i" times the C<i> ndarray. Only | function. Will add the C<r> ndarray to "i" times the C<i> ndarray. Only | |||
takes real ndarrays as input. | takes real ndarrays as input. | |||
=for bad | =for bad | |||
czip does not process bad values. | 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. | It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. | |||
=cut | =cut | |||
#line 1915 "Ops.pm" | #line 1915 "Ops.pm" | |||
#line 1060 "../../blib/lib/PDL/PP.pm" | #line 951 "../../blib/lib/PDL/PP.pm" | |||
*czip = \&PDL::czip; | *czip = \&PDL::czip; | |||
#line 1922 "Ops.pm" | #line 1922 "Ops.pm" | |||
#line 1058 "../../blib/lib/PDL/PP.pm" | #line 949 "../../blib/lib/PDL/PP.pm" | |||
=head2 ipow | =head2 ipow | |||
=for sig | =for sig | |||
Signature: (a(); indx b(); [o] ans()) | Signature: (a(); indx b(); [o] ans()) | |||
=for ref | =for ref | |||
raise ndarray C<$a> to integer power C<$b> | raise ndarray C<$a> to integer power C<$b> | |||
=for example | =for example | |||
$c = $x->ipow($y,0); # explicit function call | $c = $x->ipow($y); # as method | |||
$c = ipow $x, $y; | $c = ipow $x, $y; | |||
$x->inplace->ipow($y,0); # modify $x inplace | $x->inplace->ipow($y); # modify $x inplace | |||
It can be made to work inplace with the C<$x-E<gt>inplace> syntax. | It can be made to work inplace with the C<$x-E<gt>inplace> syntax. | |||
Note that when calling this function explicitly you need to supply | ||||
a third argument that should generally be zero (see first example). | ||||
This restriction is expected to go away in future releases. | ||||
Algorithm from L<Wikipedia|http://en.wikipedia.org/wiki/Exponentiation_by_squari ng> | Algorithm from L<Wikipedia|http://en.wikipedia.org/wiki/Exponentiation_by_squari ng> | |||
=for bad | =for bad | |||
ipow does not process bad values. | 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. | It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. | |||
=cut | =cut | |||
#line 1963 "Ops.pm" | #line 1960 "Ops.pm" | |||
#line 1060 "../../blib/lib/PDL/PP.pm" | #line 951 "../../blib/lib/PDL/PP.pm" | |||
*ipow = \&PDL::ipow; | *ipow = \&PDL::ipow; | |||
#line 1970 "Ops.pm" | #line 1967 "Ops.pm" | |||
#line 570 "ops.pd" | #line 567 "ops.pd" | |||
=head2 abs | =head2 abs | |||
=for ref | =for ref | |||
Returns the absolute value of a number. | Returns the absolute value of a number. | |||
=cut | =cut | |||
sub PDL::abs { $_[0]->type->real ? goto &PDL::_rabs : goto &PDL::_cabs } | sub PDL::abs { $_[0]->type->real ? goto &PDL::_rabs : goto &PDL::_cabs } | |||
#line 1986 "Ops.pm" | #line 1983 "Ops.pm" | |||
#line 582 "ops.pd" | #line 579 "ops.pd" | |||
BEGIN { $OVERLOADS{'abs'} = sub { PDL::abs($_[0]) } } | BEGIN { $OVERLOADS{'abs'} = sub { PDL::abs($_[0]) } } | |||
#line 1993 "Ops.pm" | #line 1990 "Ops.pm" | |||
#line 584 "ops.pd" | #line 581 "ops.pd" | |||
=head2 abs2 | =head2 abs2 | |||
=for ref | =for ref | |||
Returns the square of the absolute value of a number. | Returns the square of the absolute value of a number. | |||
=cut | =cut | |||
sub PDL::abs2 ($) { my $r = &PDL::abs; $r * $r } | sub PDL::abs2 ($) { my $r = &PDL::abs; $r * $r } | |||
#line 2009 "Ops.pm" | #line 2006 "Ops.pm" | |||
#line 1058 "../../blib/lib/PDL/PP.pm" | #line 949 "../../blib/lib/PDL/PP.pm" | |||
=head2 r2C | =head2 r2C | |||
=for sig | =for sig | |||
Signature: (r(); complex [o]c()) | Signature: (r(); complex [o]c()) | |||
=for ref | =for ref | |||
convert real to native complex, with an imaginary part of zero | convert real to native complex, with an imaginary part of zero | |||
=for bad | =for bad | |||
r2C does not process bad values. | 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. | It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. | |||
=cut | =cut | |||
#line 2034 "Ops.pm" | #line 2031 "Ops.pm" | |||
#line 1059 "../../blib/lib/PDL/PP.pm" | #line 950 "../../blib/lib/PDL/PP.pm" | |||
sub PDL::r2C ($) { | sub PDL::r2C ($) { | |||
return $_[0] if UNIVERSAL::isa($_[0], 'PDL') and !$_[0]->type->real; | return $_[0] if UNIVERSAL::isa($_[0], 'PDL') and !$_[0]->type->real; | |||
my $r = $_[1] // PDL->nullcreate($_[0]); | my $r = $_[1] // PDL->nullcreate($_[0]); | |||
PDL::_r2C_int($_[0], $r); | PDL::_r2C_int($_[0], $r); | |||
$r; | $r; | |||
} | } | |||
#line 2046 "Ops.pm" | #line 2043 "Ops.pm" | |||
#line 1060 "../../blib/lib/PDL/PP.pm" | #line 951 "../../blib/lib/PDL/PP.pm" | |||
*r2C = \&PDL::r2C; | *r2C = \&PDL::r2C; | |||
#line 2053 "Ops.pm" | #line 2050 "Ops.pm" | |||
#line 1058 "../../blib/lib/PDL/PP.pm" | #line 949 "../../blib/lib/PDL/PP.pm" | |||
=head2 i2C | =head2 i2C | |||
=for sig | =for sig | |||
Signature: (i(); complex [o]c()) | Signature: (i(); complex [o]c()) | |||
=for ref | =for ref | |||
convert imaginary to native complex, with a real part of zero | convert imaginary to native complex, with a real part of zero | |||
=for bad | =for bad | |||
i2C does not process bad values. | 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. | It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. | |||
=cut | =cut | |||
#line 2078 "Ops.pm" | #line 2075 "Ops.pm" | |||
#line 1059 "../../blib/lib/PDL/PP.pm" | #line 950 "../../blib/lib/PDL/PP.pm" | |||
sub PDL::i2C ($) { | sub PDL::i2C ($) { | |||
return $_[0] if UNIVERSAL::isa($_[0], 'PDL') and !$_[0]->type->real; | return $_[0] if UNIVERSAL::isa($_[0], 'PDL') and !$_[0]->type->real; | |||
my $r = $_[1] // PDL->nullcreate($_[0]); | my $r = $_[1] // PDL->nullcreate($_[0]); | |||
PDL::_i2C_int($_[0], $r); | PDL::_i2C_int($_[0], $r); | |||
$r; | $r; | |||
} | } | |||
#line 2090 "Ops.pm" | #line 2087 "Ops.pm" | |||
#line 1060 "../../blib/lib/PDL/PP.pm" | #line 951 "../../blib/lib/PDL/PP.pm" | |||
*i2C = \&PDL::i2C; | *i2C = \&PDL::i2C; | |||
#line 2097 "Ops.pm" | #line 2094 "Ops.pm" | |||
#line 627 "ops.pd" | #line 624 "ops.pd" | |||
# This is to used warn if an operand is non-numeric or non-PDL. | # This is to used warn if an operand is non-numeric or non-PDL. | |||
sub warn_non_numeric_op_wrapper { | sub warn_non_numeric_op_wrapper { | |||
require Scalar::Util; | require Scalar::Util; | |||
my ($cb, $op_name) = @_; | my ($cb, $op_name) = @_; | |||
return sub { | return sub { | |||
my ($op1, $op2) = @_; | my ($op1, $op2) = @_; | |||
warn "'$op2' is not numeric nor a PDL in operator $op_name" | warn "'$op2' is not numeric nor a PDL in operator $op_name" | |||
unless Scalar::Util::looks_like_number($op2) | unless Scalar::Util::looks_like_number($op2) | |||
|| ( Scalar::Util::blessed($op2) && $op2->isa('PDL') ); | || ( Scalar::Util::blessed($op2) && $op2->isa('PDL') ); | |||
skipping to change at line 1725 | skipping to change at line 1722 | |||
"eq" => PDL::Ops::warn_non_numeric_op_wrapper(\&PDL::eq, 'eq'), | "eq" => PDL::Ops::warn_non_numeric_op_wrapper(\&PDL::eq, 'eq'), | |||
".=" => sub { | ".=" => sub { | |||
my @args = !$_[2] ? @_[1,0] : @_[0,1]; | my @args = !$_[2] ? @_[1,0] : @_[0,1]; | |||
PDL::Ops::assgn(@args); | PDL::Ops::assgn(@args); | |||
return $args[1]; | return $args[1]; | |||
}, | }, | |||
'++' => sub { $_[0] += 1 }, | '++' => sub { $_[0] += 1 }, | |||
'--' => sub { $_[0] -= 1 }, | '--' => sub { $_[0] -= 1 }, | |||
; | ; | |||
} | } | |||
#line 2128 "Ops.pm" | #line 2125 "Ops.pm" | |||
#line 49 "ops.pd" | #line 49 "ops.pd" | |||
=head1 AUTHOR | =head1 AUTHOR | |||
Tuomas J. Lukka (lukka@fas.harvard.edu), | Tuomas J. Lukka (lukka@fas.harvard.edu), | |||
Karl Glazebrook (kgb@aaoepp.aao.gov.au), | Karl Glazebrook (kgb@aaoepp.aao.gov.au), | |||
Doug Hunt (dhunt@ucar.edu), | Doug Hunt (dhunt@ucar.edu), | |||
Christian Soeller (c.soeller@auckland.ac.nz), | Christian Soeller (c.soeller@auckland.ac.nz), | |||
Doug Burke (burke@ifa.hawaii.edu), | Doug Burke (burke@ifa.hawaii.edu), | |||
and Craig DeForest (deforest@boulder.swri.edu). | and Craig DeForest (deforest@boulder.swri.edu). | |||
=cut | =cut | |||
#line 2147 "Ops.pm" | #line 2144 "Ops.pm" | |||
# Exit with OK status | # Exit with OK status | |||
1; | 1; | |||
End of changes. 106 change blocks. | ||||
116 lines changed or deleted | 113 lines changed or added |