"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "t/ops.t" between
PDL-2.082.tar.gz and PDL-2.083.tar.gz

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

ops.t  (PDL-2.082):ops.t  (PDL-2.083)
skipping to change at line 134 skipping to change at line 134
} }
{ {
# Simple function tests # Simple function tests
my $pa = pdl(2,3); my $pa = pdl(2,3);
ok(all( approx(exp($pa), pdl(7.3891,20.0855))), 'exponential'); ok(all( approx(exp($pa), pdl(7.3891,20.0855))), 'exponential');
ok(all( approx(sqrt($pa), pdl(1.4142, 1.7321))), 'sqrt makes decimal'); ok(all( approx(sqrt($pa), pdl(1.4142, 1.7321))), 'sqrt makes decimal');
} }
{ {
my @w;
local $SIG{__WARN__} = sub { push @w, @_ };
# And and Or # And and Or
ok(all( approx(pdl(1,0,1) & pdl(1,1,0), pdl(1,0,0))), 'elementwise and'); ok(all( approx(pdl(1,0,1) & pdl(1,1,0), pdl(1,0,0))), 'elementwise and');
ok(all( approx(pdl(1,0,1) | pdl(1,1,0), pdl(1,1,1))), 'elementwise or'); ok(all( approx(pdl(1,0,1) | pdl(1,1,0), pdl(1,1,1))), 'elementwise or');
is_deeply \@w, [], 'no warnings' or diag explain \@w;
} }
{ {
# atan2 # atan2
ok (all( approx(atan2(pdl(1,1), pdl(1,1)), ones(2) * atan2(1,1))), 'atan2'); ok (all( approx(atan2(pdl(1,1), pdl(1,1)), ones(2) * atan2(1,1))), 'atan2');
ok (all( approx(PDL::atan2(pdl(1,1), pdl(1,1)), ones(2) * PDL::atan2(1,1))), 'at an2'); ok (all( approx(PDL::atan2(pdl(1,1), pdl(1,1)), ones(2) * PDL::atan2(1,1))), 'at an2');
} }
{ {
my $pa = sequence (3,4); my $pa = sequence (3,4);
skipping to change at line 304 skipping to change at line 306
{ {
my $startgood = sequence(10); my $startgood = sequence(10);
my $hasbad = sequence(5); my $hasbad = sequence(5);
$hasbad->inplace->setvaltobad(3); $hasbad->inplace->setvaltobad(3);
$startgood->slice('0:4') .= $hasbad; $startgood->slice('0:4') .= $hasbad;
ok $startgood->badflag, 'startgood badflag now true'; ok $startgood->badflag, 'startgood badflag now true';
ok $startgood->nbad == 1, 'badflag propagation with .='; ok $startgood->nbad == 1, 'badflag propagation with .=';
} }
is_deeply [(zeroes(1,1,0) & zeroes(1,1,0))->dims], [1,1,0]; # used to segfault
done_testing; done_testing;
 End of changes. 4 change blocks. 
1 lines changed or deleted 5 lines changed or added

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