Hi. I'm using PP to define a function that takes a piddle with some
constant dimensions, and I'm having a bit of trouble.
The function is defined as:
pp_def("testfunc",
Pars => ' a(n,1); [o]b(n,2);',
Code => ''
);
If I try to call this function with
my $a = testfunc( pdl(1,2,3) );
the perl simply croaks with "Out of memory!". Calling this function with
testfunc( pdl(1,2,3), my $a );
doesn't crash immediately, but the output piddle is n-by-1 NOT n-by-2. I now
realize that in the definition above, I'm not asking for an n-by-2, piddle,
rather the "2" is a name for that dimension that can have an arbitrary size. I
discovered that I can make that function work my adding another key to pp_def():
RedoDimsCode => '$SIZE(1) = 1; $SIZE(2) = 2;',
This works in the simplest case, but not completely. If I define an input piddle
to be n-by-2 this way, and pass in an n-by-1 piddle instead of n-by-2, nothing
complains. Is this the correct behavior? Is "RedoDimsCode" the right way to do
this? Should PP treat numerical dimensions as constant sizes instead of just
another named dimension? Thanks.
_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl