"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "t/ufunc.t" between
PDL-2.076.tar.gz and PDL-2.077.tar.gz

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

ufunc.t  (PDL-2.076):ufunc.t  (PDL-2.077)
skipping to change at line 121 skipping to change at line 121
my $nan = nan(); my $nan = nan();
my $x = pdl($nan, 0, 1, 2); my $x = pdl($nan, 0, 1, 2);
my $y = pdl(0, 1, 2, $nan); my $y = pdl(0, 1, 2, $nan);
ok($x->min == $y->min, "min with NaNs"); ok($x->min == $y->min, "min with NaNs");
ok($x->max == $y->max, "max with NaNs"); ok($x->max == $y->max, "max with NaNs");
} }
my $empty = which(ones(5)>5); my $empty = which(ones(5)>5);
$x = $empty->double->maximum; $x = $empty->double->maximum;
ok( $x->nelem==1, "maximum over an empty dim yields 1 value"); ok( $x->nelem==1, "maximum over an empty dim yields 1 value");
ok(!($x*0==0), "max of empty nonbad float gives NaN"); is $x.'', 'BAD', "max of empty nonbad float gives BAD";
$x = $empty->byte->maximum;
ok($x==0, "max of empty nonbad int type gives 0");
# test bad value handling with pctover and max # test bad value handling with max
#
$empty->badflag(1); $empty->badflag(1);
$x = $empty->maximum; $x = $empty->maximum;
ok( $x->isbad, "bad flag gets set on max over an empty dim"); ok( $x->isbad, "bad flag gets set on max over an empty dim");
my $xbad = $x;
$xbad->badflag(1);
$xbad->inplace->setvaltobad(7);
my $xgood = $xbad->where($xbad->isgood);
my $allbad = $xbad->where($xbad->isbad);
ok( $xbad->pctover(0.1) == $xgood->pctover(0.1), "pctover(0.1) badvals" );
ok( $xbad->pctover(0.9) == $xgood->pctover(0.9), "pctover(0.9) badvals" );
ok( $allbad->pctover(0.1)->isbad, "pctover(0.1) all badvals" );
ok( $allbad->pctover(0.9)->isbad, "pctover(0.9) all badvals" );
#Test subroutines directly. #Test subroutines directly.
#set up ndarrays #set up ndarrays
my $f=pdl(1,2,3,4,5); my $f=pdl(1,2,3,4,5);
my $g=pdl (0,1); my $g=pdl (0,1);
my $h=pdl(1, 0,-1); my $h=pdl(1, 0,-1);
my $i=pdl (1,0); my $i=pdl (1,0);
my $j=pdl(-3, 3, -5, 10); my $j=pdl(-3, 3, -5, 10);
 End of changes. 3 change blocks. 
14 lines changed or deleted 2 lines changed or added

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