Re: RFC 148 (v1) Add reshape() for multi-dimensional array reshaping

[email protected] (Karl Glazebrook)
Newsgroups perl.perl6.language.data
Message-ID <[email protected]>
There is already a reshape() in PDL.

Obviously that only applies to PDL arrays.

But if PDL style arrays get in to the core, then that sort of
functionality ought to arise.

OK here is a basic question: how do we specify element access in
PDL type arrays?

$a[$i][$j][$k] or $a[$i,$j,$k]

Most numerical languages use the second form, because the array
is stored as one big data list, which is indexed, rather than a
a list of lists.

This is important for how we access elements efficiently in compact
arrays - we don't want [][][] to invoke 3 overloaded subroutines, just one.
However one supposes it can be made to work either way.

Comments?


Karl
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.