"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "GENERATED/PDL/Bad.pm" between
PDL-2.078.tar.gz and PDL-2.079.tar.gz

About: PDL (Perl Data Language) aims to turn perl into an efficient numerical language for scientific computing (similar to IDL and MatLab).

Bad.pm  (PDL-2.078):Bad.pm  (PDL-2.079)
# #
# GENERATED WITH PDL::PP! Don't modify! # GENERATED WITH PDL::PP! Don't modify!
# #
package PDL::Bad; package PDL::Bad;
our @EXPORT_OK = qw(badflag check_badflag badvalue orig_badvalue nbad nbadover n good ngoodover setbadat isbad isgood nbadover ngoodover setbadif setvaltobad se tnantobad setinftobad setnonfinitetobad setbadtonan setbadtoval copybad locf ); our @EXPORT_OK = qw(badflag check_badflag badvalue orig_badvalue nbad nbadover n good ngoodover setbadat isbad isgood nbadover ngoodover setbadif setvaltobad se tnantobad setinftobad setnonfinitetobad setbadtonan setbadtoval badmask copybad locf );
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 ;
skipping to change at line 79 skipping to change at line 79
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 114 "bad.pd" #line 99 "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 189 skipping to change at line 189
=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 a Perl scalar
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 bad-value flag 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
actually contains any bad values and, if not, clear the flag. actually contains any bad values and, if not, clear the flag.
It returns the final state of the bad-value flag. It returns the final state of the badflag.
=for example =for example
print "State of bad flag == ", $pdl->check_badflag; print "State of bad flag == ", $pdl->check_badflag;
=for bad =for bad
This method accepts ndarrays with or without bad values. It This method accepts ndarrays with or without bad values. It
returns an ndarray with the final bad-value. returns an ndarray with the final badflag.
=cut =cut
*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 325 "bad.pd" #line 310 "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 424 skipping to change at line 424
flag set. flag set.
=cut =cut
#line 470 "Bad.pm" #line 470 "Bad.pm"
#line 1060 "../../blib/lib/PDL/PP.pm" #line 1060 "../../blib/lib/PDL/PP.pm"
*ngoodover = \&PDL::ngoodover; *ngoodover = \&PDL::ngoodover;
#line 477 "Bad.pm" #line 477 "Bad.pm"
#line 552 "bad.pd" #line 536 "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 552 "bad.pd" #line 536 "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 564 "bad.pd" #line 548 "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);
skipping to change at line 765 skipping to change at line 765
=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.
Can be done inplace. Also see Can be done inplace. Also see
L<badmask|PDL::Math/badmask>. L</badmask>.
=for example =for example
$x->inplace->setbadtoval(23); $x->inplace->setbadtoval(23);
print "a badflag: ", $x->badflag, "\n"; print "a badflag: ", $x->badflag, "\n";
a badflag: 0 a badflag: 0
=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 898 "Bad.pm" #line 897 "Bad.pm"
#line 1060 "../../blib/lib/PDL/PP.pm" #line 1060 "../../blib/lib/PDL/PP.pm"
*setbadtoval = \&PDL::setbadtoval; *setbadtoval = \&PDL::setbadtoval;
#line 905 "Bad.pm" #line 904 "Bad.pm"
#line 1058 "../../blib/lib/PDL/PP.pm"
=head2 badmask
=for sig
Signature: (a(); b(); [o]c())
=for ref
Clears all C<infs> and C<nans> in C<$a> to the corresponding value in C<$b>.
badmask can be run with C<$x> inplace:
badmask($x->inplace,0);
$x->inplace->badmask(0);
=for bad
If bad values are present, these are also cleared.
=cut
#line 933 "Bad.pm"
#line 1060 "../../blib/lib/PDL/PP.pm"
*badmask = \&PDL::badmask;
#line 940 "Bad.pm"
#line 1058 "../../blib/lib/PDL/PP.pm" #line 1058 "../../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
skipping to change at line 824 skipping to change at line 853
$c = $x + $mask * 0 $c = $x + $mask * 0
=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 950 "Bad.pm" #line 985 "Bad.pm"
#line 1060 "../../blib/lib/PDL/PP.pm" #line 1060 "../../blib/lib/PDL/PP.pm"
*copybad = \&PDL::copybad; *copybad = \&PDL::copybad;
#line 957 "Bad.pm" #line 992 "Bad.pm"
#line 1058 "../../blib/lib/PDL/PP.pm" #line 1058 "../../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
skipping to change at line 851 skipping to change at line 880
Last Observation Carried Forward - replace Last Observation Carried Forward - replace
every BAD value with the most recent non-BAD value prior to it. every BAD value with the most recent non-BAD value prior to it.
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 985 "Bad.pm" #line 1020 "Bad.pm"
#line 1060 "../../blib/lib/PDL/PP.pm" #line 1060 "../../blib/lib/PDL/PP.pm"
*locf = \&PDL::locf; *locf = \&PDL::locf;
#line 992 "Bad.pm" #line 1027 "Bad.pm"
#line 1122 "bad.pd" #line 1130 "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
redistribute this software / documentation under certain conditions. For redistribute this software / documentation under certain conditions. For
details, see the file COPYING in the PDL distribution. If this file is details, see the file COPYING in the PDL distribution. If this file is
separated from the PDL distribution, the copyright notice should be separated from the PDL distribution, the copyright notice should be
included in the file. included in the file.
=cut =cut
#line 1016 "Bad.pm" #line 1051 "Bad.pm"
# Exit with OK status # Exit with OK status
1; 1;
 End of changes. 18 change blocks. 
18 lines changed or deleted 47 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)