I think now the problem is that your dimensional index has size 1 (the
Transforms use the innermost dim to run across dimensional index in your
vectors) while you're scaling in (the default of) two dimensions.
Independently, you're using the evil and slow "set" method and loop iteration,
when you should be using vectorized index PDLs (for speed). (Aha! Your bug is
that you are supplying too many dimensions to "set". No matter, you should
avoid set at all costs anyway).
Try this:
#!/usr/bin/perl
use PDL;
use PDL::Transform;
$a = zeroes(2,10);
$a->((0)) .= xvals(10);
$a->((1)) .= xvals(10);
print $a;
$f = t_linear(s=>3);
$d = $a->apply($f);
print $d;
On Aug 15, 2011, at 2:13 PM, Ben wrote:
> Hi Chris,
>
> I just tried what you suggested, but now I seem to get a different kind of
> error:
>
> "Slice cannot start or end above limit at
> /usr/lib64/perl5/vendor_perl/PDL/Core.pm line 799."
>
> Code below. Ideas?
>
> #!/usr/bin/perl
>
> use PDL;
> use PDL::Matrix;
> use PDL::Transform;
>
> $a = zeroes(1,2, 10);
> for ($i = 0; $i < 10; $i++) {
> $a->set(0,0,$i,$i);
> $a->set(0,1,$i,$i);
> }
> print $a;
>
> $f = t_linear(s=>3);
> $d= $a->apply($f);
>
> print $d;
>
>
>
> _______________________________________________
> Perldl mailing list
> [email protected]
> http://mailman.jach.hawaii.edu/mailman/listinfo/perldl
>
_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl