Skip to content

Commit

Permalink
simplify rldvec use of offsets
Browse files Browse the repository at this point in the history
  • Loading branch information
mohawk2 committed Jan 14, 2024
1 parent 7594975 commit 99698b8
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions Basic/Slices/slices.pd
Original file line number Diff line number Diff line change
Expand Up @@ -1224,23 +1224,22 @@ sub PDL::rldvec {
# XXX Need to improve emulation of threading in auto-generating c
my ($rowlen) = $b->dim(0);
my ($size) = $a->sumover->max;
my (@dims) = $a->dims;
shift(@dims);
my (undef, @dims) = $a->dims;
$c = $b->zeroes($b->type,$rowlen,$size,@dims);
}
&PDL::_rldvec_int($a,$b,$c);
return $c;
}
EOC
Code =>pp_line_numbers(__LINE__, <<'EOC'),
PDL_Indx i,nrows,bn,cn=0, sn=$SIZE(N);
for (bn=0; bn<sn; bn++) {
nrows = $a(N=>bn);
PDL_Indx cn=0;
loop (N) %{
PDL_Indx i, nrows = $a();
for (i=0; i<nrows; i++) {
loop (M) %{ $c(N=>cn) = $b(N=>bn); %}
loop (M) %{ $c(N=>cn) = $b(); %}
cn++;
}
}
%}
EOC
Doc =><<'EOD'
=for ref
Expand Down Expand Up @@ -1301,8 +1300,7 @@ sub PDL::rldseq {
my ($a,$b,$c) = @_;
if (!defined($c)) {
my $size = $a->sumover->max;
my (@dims) = $a->dims;
shift(@dims);
my (undef, @dims) = $a->dims;
$c = $b->zeroes($b->type,$size,@dims);
}
&PDL::_rldseq_int($a,$b,$c);
Expand Down

0 comments on commit 99698b8

Please sign in to comment.