Skip to content

Commit

Permalink
DRY in ImageND
Browse files Browse the repository at this point in the history
  • Loading branch information
mohawk2 committed Mar 2, 2024
1 parent dbf1528 commit 2c24771
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
7 changes: 2 additions & 5 deletions Libtmp/ImageND/imagend.pd
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,7 @@ sub PDL::convolveND {
###
# Pad the array to include boundary conditions
my $adims = pdl($x->dims);
my $adims = $x->shape;
my $koff = ($kdims/2)->ceil - 1;
my $aa = $x->range( -$koff, $adims + $kdims, $opt->{Boundary} )
Expand All @@ -680,10 +680,7 @@ sub PDL::convolveND {
# FFT works best on doubles; do our work there then cast back
# at the end.
$aa = double($aa);
my $aai = $aa->zeroes;
my $kk = $aa->zeroes;
my $kki = $aa->zeroes;
$_ = $aa->zeroes for my ($aai, $kk, $kki);
my $tmp; # work around new perl -d "feature"
($tmp = $kk->range( - ($kdims/2)->floor, $kdims, 'p')) .= $k;
PDL::fftnd($kk, $kki);
Expand Down
2 changes: 1 addition & 1 deletion Libtmp/ImageND/t/imagend.t
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ my $pb = pdl( [-1,0],[0,1] );
my $pc = convolveND($pa,$pb,{m=>'d',b=>'e'});
ok( all PDL::approx($pc,$ans_e, $eps) ) or diag $pc;
$pc = convolveND($pa,$pb,{m=>'f',b=>'e'});
ok( all PDL::approx($pc,$ans_e, $eps) );
ok( all PDL::approx($pc,$ans_e, $eps) ) or diag $pc;
}

{
Expand Down
2 changes: 1 addition & 1 deletion Libtmp/Minuit/minuit.pd
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ Example:
$iflag = mn_excm('set strategy',$arglist);
# each command can be specified by a minimal string that uniquely
# identifies it (see Chapter 4 of Minuit manual). The comannd above
# identifies it (see Chapter 4 of Minuit manual). The command above
# is equivalent to:
$iflag = mn_excm('set stra',$arglis);
Expand Down

0 comments on commit 2c24771

Please sign in to comment.