Newsgroups: comp.lang.apl
Path: watmath!watserv2.uwaterloo.ca!torn!spool.mu.edu!umn.edu!csus.edu!sfsuvax1.sfsu.edu!emclean
From: emclean@sfsuvax1.sfsu.edu (Emmett McLean)
Subject: Re: Efficient combinations verb 
Message-ID: <1993Jan5.042527.15853@csus.edu>
Sender: news@csus.edu
Organization: San Francisco State University
Distribution: NA
Date: Tue, 5 Jan 1993 04:25:27 GMT
Lines: 21

Hmm? I finally got a chance to try out Rogers comb and
comb1 verb on both the NeXT and the VAX and in each
instance I get an index error for m > 2.

    start =. i.@-.-
    count =. <:@[ ! <:@[ + |.@start
    index =. ;@:((i.-])&.>)
    recur =. (count#start) ,. (index@count{comb&.<:)
    test  =. *@[ *. <
    basis =. i.@(<: , [)
    comb  =. basis`recur @. test

    seed  =. *@[ i.@{ 1 0&,:@(,&1)@>:@(-~)
    em    =. >:@{:@$
    en    =. 2&+@{:@{:
    g     =. em (count#start) en
    h     =. em (index@count) en
    grow  =. g ,. h { >:
    comb1 =. [ grow@]^:(>{:@$) seed


