Ops.pm (PDL-2.077) | : | Ops.pm (PDL-2.078) | ||
---|---|---|---|---|
skipping to change at line 852 | skipping to change at line 852 | |||
The state of the bad-value flag of the output ndarrays is unknown. | The state of the bad-value flag of the output ndarrays is unknown. | |||
=cut | =cut | |||
#line 1023 "Ops.pm" | #line 1023 "Ops.pm" | |||
#line 1060 "../../blib/lib/PDL/PP.pm" | #line 1060 "../../blib/lib/PDL/PP.pm" | |||
*xor = \&PDL::xor; | *xor = \&PDL::xor; | |||
#line 1030 "Ops.pm" | #line 1030 "Ops.pm" | |||
#line 314 "ops.pd" | #line 315 "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 1058 "../../blib/lib/PDL/PP.pm" | |||
=head2 bitnot | =head2 bitnot | |||
=for sig | =for sig | |||
skipping to change at line 1102 | skipping to change at line 1102 | |||
The state of the bad-value flag of the output ndarrays is unknown. | The state of the bad-value flag of the output ndarrays is unknown. | |||
=cut | =cut | |||
#line 1328 "Ops.pm" | #line 1328 "Ops.pm" | |||
#line 1060 "../../blib/lib/PDL/PP.pm" | #line 1060 "../../blib/lib/PDL/PP.pm" | |||
*spaceship = \&PDL::spaceship; | *spaceship = \&PDL::spaceship; | |||
#line 1335 "Ops.pm" | #line 1335 "Ops.pm" | |||
#line 314 "ops.pd" | #line 315 "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 1058 "../../blib/lib/PDL/PP.pm" | |||
=head2 sqrt | =head2 sqrt | |||
=for sig | =for sig | |||
skipping to change at line 1140 | skipping to change at line 1140 | |||
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 1060 "../../blib/lib/PDL/PP.pm" | |||
*sqrt = \&PDL::sqrt; | *sqrt = \&PDL::sqrt; | |||
#line 1384 "Ops.pm" | #line 1384 "Ops.pm" | |||
#line 314 "ops.pd" | #line 315 "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 1058 "../../blib/lib/PDL/PP.pm" | |||
=head2 sin | =head2 sin | |||
=for sig | =for sig | |||
skipping to change at line 1178 | skipping to change at line 1178 | |||
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 1060 "../../blib/lib/PDL/PP.pm" | |||
*sin = \&PDL::sin; | *sin = \&PDL::sin; | |||
#line 1433 "Ops.pm" | #line 1433 "Ops.pm" | |||
#line 314 "ops.pd" | #line 315 "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 1058 "../../blib/lib/PDL/PP.pm" | |||
=head2 cos | =head2 cos | |||
=for sig | =for sig | |||
skipping to change at line 1216 | skipping to change at line 1216 | |||
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 1060 "../../blib/lib/PDL/PP.pm" | |||
*cos = \&PDL::cos; | *cos = \&PDL::cos; | |||
#line 1482 "Ops.pm" | #line 1482 "Ops.pm" | |||
#line 314 "ops.pd" | #line 315 "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 1058 "../../blib/lib/PDL/PP.pm" | |||
=head2 not | =head2 not | |||
=for sig | =for sig | |||
skipping to change at line 1254 | skipping to change at line 1254 | |||
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 1060 "../../blib/lib/PDL/PP.pm" | |||
*not = \&PDL::not; | *not = \&PDL::not; | |||
#line 1531 "Ops.pm" | #line 1531 "Ops.pm" | |||
#line 314 "ops.pd" | #line 315 "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 1058 "../../blib/lib/PDL/PP.pm" | |||
=head2 exp | =head2 exp | |||
=for sig | =for sig | |||
skipping to change at line 1292 | skipping to change at line 1292 | |||
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 1060 "../../blib/lib/PDL/PP.pm" | |||
*exp = \&PDL::exp; | *exp = \&PDL::exp; | |||
#line 1580 "Ops.pm" | #line 1580 "Ops.pm" | |||
#line 314 "ops.pd" | #line 315 "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 1058 "../../blib/lib/PDL/PP.pm" | |||
=head2 log | =head2 log | |||
=for sig | =for sig | |||
skipping to change at line 1606 | skipping to change at line 1606 | |||
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 1971 "Ops.pm" | #line 1971 "Ops.pm" | |||
#line 1060 "../../blib/lib/PDL/PP.pm" | #line 1060 "../../blib/lib/PDL/PP.pm" | |||
*ipow = \&PDL::ipow; | *ipow = \&PDL::ipow; | |||
#line 1978 "Ops.pm" | #line 1978 "Ops.pm" | |||
#line 584 "ops.pd" | #line 585 "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 1994 "Ops.pm" | #line 1994 "Ops.pm" | |||
#line 596 "ops.pd" | #line 597 "ops.pd" | |||
BEGIN { $OVERLOADS{'abs'} = sub { PDL::abs($_[0]) } } | BEGIN { $OVERLOADS{'abs'} = sub { PDL::abs($_[0]) } } | |||
#line 2001 "Ops.pm" | #line 2001 "Ops.pm" | |||
#line 598 "ops.pd" | #line 599 "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 } | |||
skipping to change at line 1707 | skipping to change at line 1707 | |||
PDL::_i2C_int($_[0], $r); | PDL::_i2C_int($_[0], $r); | |||
$r; | $r; | |||
} | } | |||
#line 2098 "Ops.pm" | #line 2098 "Ops.pm" | |||
#line 1060 "../../blib/lib/PDL/PP.pm" | #line 1060 "../../blib/lib/PDL/PP.pm" | |||
*i2C = \&PDL::i2C; | *i2C = \&PDL::i2C; | |||
#line 2105 "Ops.pm" | #line 2105 "Ops.pm" | |||
#line 641 "ops.pd" | #line 642 "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') ); | |||
End of changes. 11 change blocks. | ||||
11 lines changed or deleted | 11 lines changed or added |