Bad.pm (PDL-2.080) | : | Bad.pm (PDL-2.081) | ||
---|---|---|---|---|
skipping to change at line 17 | skipping to change at line 17 | |||
our %EXPORT_TAGS = (Func=>\@EXPORT_OK); | our %EXPORT_TAGS = (Func=>\@EXPORT_OK); | |||
use PDL::Core; | use PDL::Core; | |||
use PDL::Exporter; | use PDL::Exporter; | |||
use DynaLoader; | use DynaLoader; | |||
our @ISA = ( 'PDL::Exporter','DynaLoader' ); | our @ISA = ( 'PDL::Exporter','DynaLoader' ); | |||
push @PDL::Core::PP, __PACKAGE__; | push @PDL::Core::PP, __PACKAGE__; | |||
bootstrap PDL::Bad ; | bootstrap PDL::Bad ; | |||
#line 20 "bad.pd" | #line 19 "bad.pd" | |||
=head1 NAME | =head1 NAME | |||
PDL::Bad - PDL always processes bad values | PDL::Bad - PDL always processes bad values | |||
=head1 DESCRIPTION | =head1 DESCRIPTION | |||
This module is loaded when you do C<use PDL>, | This module is loaded when you do C<use PDL>, | |||
C<Use PDL::Lite> or C<PDL::LiteF>. | C<Use PDL::Lite> or C<PDL::LiteF>. | |||
skipping to change at line 63 | skipping to change at line 63 | |||
=back | =back | |||
=cut | =cut | |||
#line 66 "Bad.pm" | #line 66 "Bad.pm" | |||
=head1 FUNCTIONS | =head1 FUNCTIONS | |||
=cut | =cut | |||
#line 63 "bad.pd" | #line 62 "bad.pd" | |||
# really should be constants | # really should be constants | |||
$PDL::Bad::Status = 1; | $PDL::Bad::Status = 1; | |||
$PDL::Bad::UseNaN = 0; | $PDL::Bad::UseNaN = 0; | |||
$PDL::Bad::PerPdl = 1; | $PDL::Bad::PerPdl = 1; | |||
use strict; | use strict; | |||
use PDL::Types; | use PDL::Types; | |||
use PDL::Primitive; | use PDL::Primitive; | |||
############################################################ | ############################################################ | |||
############################################################ | ############################################################ | |||
#line 95 "Bad.pm" | #line 95 "Bad.pm" | |||
#line 99 "bad.pd" | #line 98 "bad.pd" | |||
############################################################ | ############################################################ | |||
############################################################ | ############################################################ | |||
*badflag = \&PDL::badflag; | *badflag = \&PDL::badflag; | |||
*badvalue = \&PDL::badvalue; | *badvalue = \&PDL::badvalue; | |||
*orig_badvalue = \&PDL::orig_badvalue; | *orig_badvalue = \&PDL::orig_badvalue; | |||
############################################################ | ############################################################ | |||
############################################################ | ############################################################ | |||
skipping to change at line 157 | skipping to change at line 157 | |||
$x->badvalue (3); $x->badflag (1); | $x->badvalue (3); $x->badflag (1); | |||
$y = sequence (10); | $y = sequence (10); | |||
$y->badvalue (4); $y->badflag (1); | $y->badvalue (4); $y->badflag (1); | |||
will set $x to be C<[0 1 2 BAD 4 5 6 7 8 9]> and $y to be | will set $x to be C<[0 1 2 BAD 4 5 6 7 8 9]> and $y to be | |||
C<[0 1 2 3 BAD 5 6 7 8 9]>. | C<[0 1 2 3 BAD 5 6 7 8 9]>. | |||
=for bad | =for bad | |||
This method does not care if you call it on an input ndarray | This method does not care if you call it on an input ndarray | |||
that has bad values. It always returns a Perl scalar | that has bad values. It always returns an ndarray | |||
with the current or new bad value. | with the current or new bad value. | |||
=head2 orig_badvalue | =head2 orig_badvalue | |||
=for ref | =for ref | |||
returns the original value used to represent bad values for | returns the original value used to represent bad values for | |||
a given type. | a given type. | |||
This routine operates the same as L</badvalue>, | This routine operates the same as L</badvalue>, | |||
skipping to change at line 182 | skipping to change at line 182 | |||
=for example | =for example | |||
$orig_badval = orig_badvalue( float ); | $orig_badval = orig_badvalue( float ); | |||
$x = ones(ushort,10); | $x = ones(ushort,10); | |||
print "The original bad data value for ushort is: ", | print "The original bad data value for ushort is: ", | |||
$x->orig_badvalue(), "\n"; | $x->orig_badvalue(), "\n"; | |||
=for bad | =for bad | |||
This method does not care if you call it on an input ndarray | This method does not care if you call it on an input ndarray | |||
that has bad values. It always returns a Perl scalar | that has bad values. It always returns an ndarray | |||
with the original bad value for the associated type. | with the original bad value for the associated type. | |||
=head2 check_badflag | =head2 check_badflag | |||
=for ref | =for ref | |||
Clear the badflag of an ndarray if it does not | Clear the badflag of an ndarray if it does not | |||
contain any bad values | contain any bad values | |||
Given an ndarray whose bad flag is set, check whether it | Given an ndarray whose bad flag is set, check whether it | |||
skipping to change at line 216 | skipping to change at line 216 | |||
*check_badflag = \&PDL::check_badflag; | *check_badflag = \&PDL::check_badflag; | |||
sub PDL::check_badflag { | sub PDL::check_badflag { | |||
my $pdl = shift; | my $pdl = shift; | |||
$pdl->badflag(0) if $pdl->badflag and $pdl->nbad == 0; | $pdl->badflag(0) if $pdl->badflag and $pdl->nbad == 0; | |||
return $pdl->badflag; | return $pdl->badflag; | |||
} # sub: check_badflag() | } # sub: check_badflag() | |||
#line 234 "Bad.pm" | #line 234 "Bad.pm" | |||
#line 310 "bad.pd" | #line 309 "bad.pd" | |||
# note: | # note: | |||
# if sent an ndarray, we have to change its bad values | # if sent an ndarray, we have to change its bad values | |||
# (but only if it contains bad values) | # (but only if it contains bad values) | |||
# - there's a slight overhead in that the badflag is | # - there's a slight overhead in that the badflag is | |||
# cleared and then set (hence propagating to all | # cleared and then set (hence propagating to all | |||
# children) but we'll ignore that) | # children) but we'll ignore that) | |||
# - we can ignore this for float/double types | # - we can ignore this for float/double types | |||
# since we can't change the bad value | # since we can't change the bad value | |||
# | # | |||
skipping to change at line 266 | skipping to change at line 266 | |||
# assume it's a number | # assume it's a number | |||
$num = $self; | $num = $self; | |||
} | } | |||
PDL::_default_badvalue_int($num); | PDL::_default_badvalue_int($num); | |||
} | } | |||
############################################################ | ############################################################ | |||
############################################################ | ############################################################ | |||
#line 287 "Bad.pm" | #line 287 "Bad.pm" | |||
#line 1058 "../../blib/lib/PDL/PP.pm" | #line 949 "../../blib/lib/PDL/PP.pm" | |||
=head2 isbad | =head2 isbad | |||
=for sig | =for sig | |||
Signature: (a(); int [o]b()) | Signature: (a(); int [o]b()) | |||
=for ref | =for ref | |||
Returns a binary mask indicating which values of | Returns a binary mask indicating which values of | |||
skipping to change at line 300 | skipping to change at line 300 | |||
=for bad | =for bad | |||
This method works with input ndarrays that are bad. The output ndarray | This method works with input ndarrays that are bad. The output ndarray | |||
will never contain bad values, but its bad value flag will be the | will never contain bad values, but its bad value flag will be the | |||
same as the input ndarray's flag. | same as the input ndarray's flag. | |||
=cut | =cut | |||
#line 327 "Bad.pm" | #line 327 "Bad.pm" | |||
#line 1060 "../../blib/lib/PDL/PP.pm" | #line 951 "../../blib/lib/PDL/PP.pm" | |||
*isbad = \&PDL::isbad; | *isbad = \&PDL::isbad; | |||
#line 334 "Bad.pm" | #line 334 "Bad.pm" | |||
#line 1058 "../../blib/lib/PDL/PP.pm" | #line 949 "../../blib/lib/PDL/PP.pm" | |||
=head2 isgood | =head2 isgood | |||
=for sig | =for sig | |||
Signature: (a(); int [o]b()) | Signature: (a(); int [o]b()) | |||
=for ref | =for ref | |||
Is a value good? | Is a value good? | |||
skipping to change at line 338 | skipping to change at line 338 | |||
=for bad | =for bad | |||
This method works with input ndarrays that are bad. The output ndarray | This method works with input ndarrays that are bad. The output ndarray | |||
will never contain bad values, but its bad value flag will be the | will never contain bad values, but its bad value flag will be the | |||
same as the input ndarray's flag. | same as the input ndarray's flag. | |||
=cut | =cut | |||
#line 373 "Bad.pm" | #line 373 "Bad.pm" | |||
#line 1060 "../../blib/lib/PDL/PP.pm" | #line 951 "../../blib/lib/PDL/PP.pm" | |||
*isgood = \&PDL::isgood; | *isgood = \&PDL::isgood; | |||
#line 380 "Bad.pm" | #line 380 "Bad.pm" | |||
#line 1058 "../../blib/lib/PDL/PP.pm" | #line 949 "../../blib/lib/PDL/PP.pm" | |||
=head2 nbadover | =head2 nbadover | |||
=for sig | =for sig | |||
Signature: (a(n); indx [o] b()) | Signature: (a(n); indx [o] b()) | |||
=for ref | =for ref | |||
Find the number of bad elements along the 1st dimension. | Find the number of bad elements along the 1st dimension. | |||
skipping to change at line 378 | skipping to change at line 378 | |||
=for bad | =for bad | |||
nbadover processes input values that are bad. The output ndarray will not have | nbadover processes input values that are bad. The output ndarray will not have | |||
any bad values, but the bad flag will be set if the input ndarray had its bad | any bad values, but the bad flag will be set if the input ndarray had its bad | |||
flag set. | flag set. | |||
=cut | =cut | |||
#line 421 "Bad.pm" | #line 421 "Bad.pm" | |||
#line 1060 "../../blib/lib/PDL/PP.pm" | #line 951 "../../blib/lib/PDL/PP.pm" | |||
*nbadover = \&PDL::nbadover; | *nbadover = \&PDL::nbadover; | |||
#line 428 "Bad.pm" | #line 428 "Bad.pm" | |||
#line 1058 "../../blib/lib/PDL/PP.pm" | #line 949 "../../blib/lib/PDL/PP.pm" | |||
=head2 ngoodover | =head2 ngoodover | |||
=for sig | =for sig | |||
Signature: (a(n); indx [o] b()) | Signature: (a(n); indx [o] b()) | |||
=for ref | =for ref | |||
Find the number of good elements along the 1st dimension. | Find the number of good elements along the 1st dimension. | |||
skipping to change at line 419 | skipping to change at line 419 | |||
=for bad | =for bad | |||
ngoodover processes input values that are bad. The output ndarray will not have | ngoodover processes input values that are bad. The output ndarray will not have | |||
any bad values, but the bad flag will be set if the input ndarray had its bad | any bad values, but the bad flag will be set if the input ndarray had its bad | |||
flag set. | flag set. | |||
=cut | =cut | |||
#line 470 "Bad.pm" | #line 470 "Bad.pm" | |||
#line 1060 "../../blib/lib/PDL/PP.pm" | #line 951 "../../blib/lib/PDL/PP.pm" | |||
*ngoodover = \&PDL::ngoodover; | *ngoodover = \&PDL::ngoodover; | |||
#line 477 "Bad.pm" | #line 477 "Bad.pm" | |||
#line 534 "bad.pd" | #line 533 "bad.pd" | |||
*nbad = \&PDL::nbad; | *nbad = \&PDL::nbad; | |||
sub PDL::nbad { | sub PDL::nbad { | |||
my($x) = @_; my $tmp; | my($x) = @_; my $tmp; | |||
$x->clump(-1)->nbadover($tmp=PDL->nullcreate($x) ); | $x->clump(-1)->nbadover($tmp=PDL->nullcreate($x) ); | |||
return $tmp; | return $tmp; | |||
} | } | |||
#line 490 "Bad.pm" | #line 490 "Bad.pm" | |||
#line 534 "bad.pd" | #line 533 "bad.pd" | |||
*ngood = \&PDL::ngood; | *ngood = \&PDL::ngood; | |||
sub PDL::ngood { | sub PDL::ngood { | |||
my($x) = @_; my $tmp; | my($x) = @_; my $tmp; | |||
$x->clump(-1)->ngoodover($tmp=PDL->nullcreate($x) ); | $x->clump(-1)->ngoodover($tmp=PDL->nullcreate($x) ); | |||
return $tmp; | return $tmp; | |||
} | } | |||
#line 503 "Bad.pm" | #line 503 "Bad.pm" | |||
#line 546 "bad.pd" | #line 545 "bad.pd" | |||
=head2 nbad | =head2 nbad | |||
=for ref | =for ref | |||
Returns the number of bad values in an ndarray | Returns the number of bad values in an ndarray | |||
=for usage | =for usage | |||
$x = nbad($data); | $x = nbad($data); | |||
=for bad | =for bad | |||
Accepts good and bad input ndarrays; output is a Perl scalar | Accepts good and bad input ndarrays; output is an ndarray | |||
and therefore is always good. | and is always good. | |||
=head2 ngood | =head2 ngood | |||
=for ref | =for ref | |||
Returns the number of good values in an ndarray | Returns the number of good values in an ndarray | |||
=for usage | =for usage | |||
$x = ngood($data); | $x = ngood($data); | |||
=for bad | =for bad | |||
Accepts good and bad input ndarrays; output is a Perl scalar | Accepts good and bad input ndarrays; output is an ndarray | |||
and therefore is always good. | and is always good. | |||
=head2 setbadat | =head2 setbadat | |||
=for ref | =for ref | |||
Set the value to bad at a given position. | Set the value to bad at a given position. | |||
=for usage | =for usage | |||
setbadat $ndarray, @position | setbadat $ndarray, @position | |||
skipping to change at line 522 | skipping to change at line 522 | |||
*setbadat = \&PDL::setbadat; | *setbadat = \&PDL::setbadat; | |||
sub PDL::setbadat { | sub PDL::setbadat { | |||
barf 'Usage: setbadat($pdl, $x, $y, ...)' if $#_<1; | barf 'Usage: setbadat($pdl, $x, $y, ...)' if $#_<1; | |||
my $self = shift; | my $self = shift; | |||
PDL::Core::set_c ($self, [@_], $self->badvalue); | PDL::Core::set_c ($self, [@_], $self->badvalue); | |||
$self->badflag(1); | $self->badflag(1); | |||
return $self; | return $self; | |||
} | } | |||
#line 584 "Bad.pm" | #line 584 "Bad.pm" | |||
#line 1058 "../../blib/lib/PDL/PP.pm" | #line 949 "../../blib/lib/PDL/PP.pm" | |||
=head2 setbadif | =head2 setbadif | |||
=for sig | =for sig | |||
Signature: (a(); int mask(); [o]b()) | Signature: (a(); int mask(); [o]b()) | |||
=for ref | =for ref | |||
Set elements bad based on the supplied mask, otherwise | Set elements bad based on the supplied mask, otherwise | |||
skipping to change at line 568 | skipping to change at line 568 | |||
any bad values (use L</check_badflag> to check | any bad values (use L</check_badflag> to check | |||
whether there are any bad values in the output). | whether there are any bad values in the output). | |||
The input ndarray can have bad values: any bad values in the input ndarrays | The input ndarray can have bad values: any bad values in the input ndarrays | |||
are copied across to the output ndarray. | are copied across to the output ndarray. | |||
Also see L</setvaltobad> and L</setnantobad>. | Also see L</setvaltobad> and L</setnantobad>. | |||
=cut | =cut | |||
#line 636 "Bad.pm" | #line 636 "Bad.pm" | |||
#line 1060 "../../blib/lib/PDL/PP.pm" | #line 951 "../../blib/lib/PDL/PP.pm" | |||
*setbadif = \&PDL::setbadif; | *setbadif = \&PDL::setbadif; | |||
#line 643 "Bad.pm" | #line 643 "Bad.pm" | |||
#line 1058 "../../blib/lib/PDL/PP.pm" | #line 949 "../../blib/lib/PDL/PP.pm" | |||
=head2 setvaltobad | =head2 setvaltobad | |||
=for sig | =for sig | |||
Signature: (a(); [o]b(); double value) | Signature: (a(); [o]b(); double value) | |||
=for ref | =for ref | |||
Set bad all those elements which equal the supplied value. | Set bad all those elements which equal the supplied value. | |||
skipping to change at line 606 | skipping to change at line 606 | |||
=for bad | =for bad | |||
The output always has its bad flag set, even if it does not contain | The output always has its bad flag set, even if it does not contain | |||
any bad values (use L</check_badflag> to check | any bad values (use L</check_badflag> to check | |||
whether there are any bad values in the output). | whether there are any bad values in the output). | |||
Any bad values in the input ndarrays are copied across to the output ndarray. | Any bad values in the input ndarrays are copied across to the output ndarray. | |||
=cut | =cut | |||
#line 682 "Bad.pm" | #line 682 "Bad.pm" | |||
#line 1060 "../../blib/lib/PDL/PP.pm" | #line 951 "../../blib/lib/PDL/PP.pm" | |||
*setvaltobad = \&PDL::setvaltobad; | *setvaltobad = \&PDL::setvaltobad; | |||
#line 689 "Bad.pm" | #line 689 "Bad.pm" | |||
#line 1058 "../../blib/lib/PDL/PP.pm" | #line 949 "../../blib/lib/PDL/PP.pm" | |||
=head2 setnantobad | =head2 setnantobad | |||
=for sig | =for sig | |||
Signature: (a(); [o]b()) | Signature: (a(); [o]b()) | |||
=for ref | =for ref | |||
Sets NaN values (for complex, where either is NaN) in the input ndarray bad | Sets NaN values (for complex, where either is NaN) in the input ndarray bad | |||
skipping to change at line 642 | skipping to change at line 642 | |||
This method can process ndarrays with bad values: those bad values | This method can process ndarrays with bad values: those bad values | |||
are propagated into the output ndarray. Any value that is not a number | are propagated into the output ndarray. Any value that is not a number | |||
(before version 2.040 the test was for "not finite") | (before version 2.040 the test was for "not finite") | |||
is also set to bad in the output ndarray. If all values from the input | is also set to bad in the output ndarray. If all values from the input | |||
ndarray are good, the output ndarray will B<not> have its | ndarray are good, the output ndarray will B<not> have its | |||
bad flag set. | bad flag set. | |||
=cut | =cut | |||
#line 726 "Bad.pm" | #line 726 "Bad.pm" | |||
#line 1060 "../../blib/lib/PDL/PP.pm" | #line 951 "../../blib/lib/PDL/PP.pm" | |||
*setnantobad = \&PDL::setnantobad; | *setnantobad = \&PDL::setnantobad; | |||
#line 733 "Bad.pm" | #line 733 "Bad.pm" | |||
#line 1058 "../../blib/lib/PDL/PP.pm" | #line 949 "../../blib/lib/PDL/PP.pm" | |||
=head2 setinftobad | =head2 setinftobad | |||
=for sig | =for sig | |||
Signature: (a(); [o]b()) | Signature: (a(); [o]b()) | |||
=for ref | =for ref | |||
Sets non-finite values (for complex, where either is non-finite) in | Sets non-finite values (for complex, where either is non-finite) in | |||
skipping to change at line 677 | skipping to change at line 677 | |||
This method can process ndarrays with bad values: those bad values | This method can process ndarrays with bad values: those bad values | |||
are propagated into the output ndarray. Any value that is not finite | are propagated into the output ndarray. Any value that is not finite | |||
is also set to bad in the output ndarray. If all values from the input | is also set to bad in the output ndarray. If all values from the input | |||
ndarray are finite, the output ndarray will B<not> have its | ndarray are finite, the output ndarray will B<not> have its | |||
bad flag set. | bad flag set. | |||
=cut | =cut | |||
#line 769 "Bad.pm" | #line 769 "Bad.pm" | |||
#line 1060 "../../blib/lib/PDL/PP.pm" | #line 951 "../../blib/lib/PDL/PP.pm" | |||
*setinftobad = \&PDL::setinftobad; | *setinftobad = \&PDL::setinftobad; | |||
#line 776 "Bad.pm" | #line 776 "Bad.pm" | |||
#line 1058 "../../blib/lib/PDL/PP.pm" | #line 949 "../../blib/lib/PDL/PP.pm" | |||
=head2 setnonfinitetobad | =head2 setnonfinitetobad | |||
=for sig | =for sig | |||
Signature: (a(); [o]b()) | Signature: (a(); [o]b()) | |||
=for ref | =for ref | |||
Sets non-finite values (for complex, where either is non-finite) in | Sets non-finite values (for complex, where either is non-finite) in | |||
skipping to change at line 712 | skipping to change at line 712 | |||
This method can process ndarrays with bad values: those bad values | This method can process ndarrays with bad values: those bad values | |||
are propagated into the output ndarray. Any value that is not finite | are propagated into the output ndarray. Any value that is not finite | |||
is also set to bad in the output ndarray. If all values from the input | is also set to bad in the output ndarray. If all values from the input | |||
ndarray are finite, the output ndarray will B<not> have its | ndarray are finite, the output ndarray will B<not> have its | |||
bad flag set. | bad flag set. | |||
=cut | =cut | |||
#line 812 "Bad.pm" | #line 812 "Bad.pm" | |||
#line 1060 "../../blib/lib/PDL/PP.pm" | #line 951 "../../blib/lib/PDL/PP.pm" | |||
*setnonfinitetobad = \&PDL::setnonfinitetobad; | *setnonfinitetobad = \&PDL::setnonfinitetobad; | |||
#line 819 "Bad.pm" | #line 819 "Bad.pm" | |||
#line 1058 "../../blib/lib/PDL/PP.pm" | #line 949 "../../blib/lib/PDL/PP.pm" | |||
=head2 setbadtonan | =head2 setbadtonan | |||
=for sig | =for sig | |||
Signature: (a(); [o] b();) | Signature: (a(); [o] b();) | |||
=for ref | =for ref | |||
Sets Bad values to NaN | Sets Bad values to NaN | |||
skipping to change at line 747 | skipping to change at line 747 | |||
=for bad | =for bad | |||
This method processes input ndarrays with bad values. The output ndarrays will | This method processes input ndarrays with bad values. The output ndarrays will | |||
not contain bad values (insofar as NaN is not Bad as far as PDL is concerned) | not contain bad values (insofar as NaN is not Bad as far as PDL is concerned) | |||
and the output ndarray does not have its bad flag set. As an inplace | and the output ndarray does not have its bad flag set. As an inplace | |||
operation, it clears the bad flag. | operation, it clears the bad flag. | |||
=cut | =cut | |||
#line 855 "Bad.pm" | #line 855 "Bad.pm" | |||
#line 1060 "../../blib/lib/PDL/PP.pm" | #line 951 "../../blib/lib/PDL/PP.pm" | |||
*setbadtonan = \&PDL::setbadtonan; | *setbadtonan = \&PDL::setbadtonan; | |||
#line 862 "Bad.pm" | #line 862 "Bad.pm" | |||
#line 1058 "../../blib/lib/PDL/PP.pm" | #line 949 "../../blib/lib/PDL/PP.pm" | |||
=head2 setbadtoval | =head2 setbadtoval | |||
=for sig | =for sig | |||
Signature: (a(); [o]b(); double newval) | Signature: (a(); [o]b(); double newval) | |||
=for ref | =for ref | |||
Replace any bad values by a (non-bad) value. | Replace any bad values by a (non-bad) value. | |||
skipping to change at line 782 | skipping to change at line 782 | |||
=for bad | =for bad | |||
The output always has its bad flag cleared. | The output always has its bad flag cleared. | |||
If the input ndarray does not have its bad flag set, then | If the input ndarray does not have its bad flag set, then | |||
values are copied with no replacement. | values are copied with no replacement. | |||
=cut | =cut | |||
#line 897 "Bad.pm" | #line 897 "Bad.pm" | |||
#line 1060 "../../blib/lib/PDL/PP.pm" | #line 951 "../../blib/lib/PDL/PP.pm" | |||
*setbadtoval = \&PDL::setbadtoval; | *setbadtoval = \&PDL::setbadtoval; | |||
#line 904 "Bad.pm" | #line 904 "Bad.pm" | |||
#line 1058 "../../blib/lib/PDL/PP.pm" | #line 949 "../../blib/lib/PDL/PP.pm" | |||
=head2 badmask | =head2 badmask | |||
=for sig | =for sig | |||
Signature: (a(); b(); [o]c()) | Signature: (a(); b(); [o]c()) | |||
=for ref | =for ref | |||
Clears all C<infs> and C<nans> in C<$a> to the corresponding value in C<$b>. | Clears all C<infs> and C<nans> in C<$a> to the corresponding value in C<$b>. | |||
skipping to change at line 811 | skipping to change at line 811 | |||
badmask($x->inplace,0); | badmask($x->inplace,0); | |||
$x->inplace->badmask(0); | $x->inplace->badmask(0); | |||
=for bad | =for bad | |||
If bad values are present, these are also cleared. | If bad values are present, these are also cleared. | |||
=cut | =cut | |||
#line 933 "Bad.pm" | #line 933 "Bad.pm" | |||
#line 1060 "../../blib/lib/PDL/PP.pm" | #line 951 "../../blib/lib/PDL/PP.pm" | |||
*badmask = \&PDL::badmask; | *badmask = \&PDL::badmask; | |||
#line 940 "Bad.pm" | #line 940 "Bad.pm" | |||
#line 1058 "../../blib/lib/PDL/PP.pm" | #line 949 "../../blib/lib/PDL/PP.pm" | |||
=head2 copybad | =head2 copybad | |||
=for sig | =for sig | |||
Signature: (a(); mask(); [o]b()) | Signature: (a(); mask(); [o]b()) | |||
=for ref | =for ref | |||
Copies values from one ndarray to another, setting them | Copies values from one ndarray to another, setting them | |||
skipping to change at line 855 | skipping to change at line 855 | |||
=for bad | =for bad | |||
This handles input ndarrays that are bad. If either C<$x> | This handles input ndarrays that are bad. If either C<$x> | |||
or C<$mask> have bad values, those values will be marked | or C<$mask> have bad values, those values will be marked | |||
as bad in the output ndarray and the output ndarray will have | as bad in the output ndarray and the output ndarray will have | |||
its bad value flag set to true. | its bad value flag set to true. | |||
=cut | =cut | |||
#line 985 "Bad.pm" | #line 985 "Bad.pm" | |||
#line 1060 "../../blib/lib/PDL/PP.pm" | #line 951 "../../blib/lib/PDL/PP.pm" | |||
*copybad = \&PDL::copybad; | *copybad = \&PDL::copybad; | |||
#line 992 "Bad.pm" | #line 992 "Bad.pm" | |||
#line 1058 "../../blib/lib/PDL/PP.pm" | #line 949 "../../blib/lib/PDL/PP.pm" | |||
=head2 locf | =head2 locf | |||
=for sig | =for sig | |||
Signature: (a(n); [o]b(n)) | Signature: (a(n); [o]b(n)) | |||
=for ref | =for ref | |||
Last Observation Carried Forward - replace | Last Observation Carried Forward - replace | |||
skipping to change at line 882 | skipping to change at line 882 | |||
Any leading BADs will be set to 0. | Any leading BADs will be set to 0. | |||
=for bad | =for bad | |||
locf processes bad values. | locf 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 1020 "Bad.pm" | #line 1020 "Bad.pm" | |||
#line 1060 "../../blib/lib/PDL/PP.pm" | #line 951 "../../blib/lib/PDL/PP.pm" | |||
*locf = \&PDL::locf; | *locf = \&PDL::locf; | |||
#line 1027 "Bad.pm" | #line 1027 "Bad.pm" | |||
#line 1092 "bad.pd" | #line 1091 "bad.pd" | |||
=head1 AUTHOR | =head1 AUTHOR | |||
Doug Burke (djburke@cpan.org), 2000, 2001, 2003, 2006. | Doug Burke (djburke@cpan.org), 2000, 2001, 2003, 2006. | |||
The per-ndarray bad value support is by Heiko Klein (2006). | The per-ndarray bad value support is by Heiko Klein (2006). | |||
CPAN documentation fixes by David Mertens (2010, 2013). | CPAN documentation fixes by David Mertens (2010, 2013). | |||
All rights reserved. There is no warranty. You are allowed to | All rights reserved. There is no warranty. You are allowed to | |||
End of changes. 40 change blocks. | ||||
42 lines changed or deleted | 42 lines changed or added |