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

hyperoperators and multi-dimensional datastructures

Thread Next
From:
Anthony Heading
Date:
May 19, 2005 00:35
Subject:
hyperoperators and multi-dimensional datastructures
Message ID:
428BF5C3.6060908@ajrh.net
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
    +/"2 a		- sum reduce over axis 2
5 7 2 4 6


Anthony

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