develooper Front page | perl.perl6.language | Postings from May 2005

Re: hyperoperators and multi-dimensional datastructures

Thread Previous | Thread Next
From:
Luke Palmer
Date:
May 19, 2005 09:45
Subject:
Re: hyperoperators and multi-dimensional datastructures
Message ID:
7ca3f01605051909455afb6ec6@mail.gmail.com
On 5/18/05, Anthony Heading <ajrh@ajrh.net> wrote:
> Is there a way to target hyperoperators at different axes of a
> multi-dimensional array?  This is an attractive feature of
> various APL-like languages, viz. e.g. in J:
> 
>     a =. 2 5 $ i. 7      - a simple 2-by-5 array
>     a
> 0 1 2 3 4               - like this
> 5 6 0 1 2
> 
> 
>     +/"1 a              - sum reduce over axis 1
> 10 14

    [+]<< @a

>     +/"2 a              - sum reduce over axis 2
> 5 7 2 4 6

Can't think of any for this one.  Or maybe it's this one that I can
think of it for, and the other one which I can't.

I think we're beginning to re-invent PDL.  Poorly.

Luke

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About