On 1/13/2012 7:16 PM, Karl Glazebrook wrote:
"shape" sounds sensible to me.

What about "dummy dimensions" ?

Dummy or not, they still count in the shape, e.g.,

pdl> $a = zeros(3,2)

pdl> p $a->info
PDL: Double D [3,2]

pdl> p $a(,*5)->info
PDL: Double D [3,5,2]

In the first case, $a has shape [3,2]
while in the second case, the piddle
with the extra dummy dim has shape [3,5,2].

--Chris


On 06/01/2012, at 2:04 PM, chm wrote:

I've just pushed a minimal PDL::shape method and
sub to the latest PDL git.  Please report any
problems.  It is basically pdl($piddle->dims) so
identical except for output type: pdl vs list.

--Chris

On 1/4/2012 9:36 PM, chm wrote:
I propose we use "shape" as the standard term to
describe the set of dimension extents for a piddle.
E.g., roughly and without error checking:

pdl>  sub shape { pdl($_[0]->dims) }

pdl>  $a = zeros(3,2,5);

pdl>  p shape($a)
[3 2 5]

This follows the notation in a number of other
array languages such as Fortran 95 and later,
http://gcc.gnu.org/onlinedocs/gfortran/SHAPE.html
I think standardizing on this terminology could
clarify documentation and be useful in the PDL
Book endeavor.

Thoughts?
Chris

_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl

Reply via email to