I wrote:
> Also, note that that benchmark has some rather silly requirements.
> For example, it requires that permutations be generated in a
> particular order.

Here is an implementation of allpr which, I believe, satisfies
the [silly] alioth benchmark requirement for the first 30 values
of "all permutations".

nperm=: [: >: i. A.~ [: i. !
arb=:(-64*96>])a.i.'@ADECBRSVWUTPQONLMIHFGJK`adecb'
allpr=:(,~(arb~.@:<.<:@#) |."[EMAIL PROTECTED] |[EMAIL PROTECTED])@nperm

In other words: I think the simplest approach to dealing with
that "requirement" is: prepend an arbitrary set of permutations
at the front.  This costs almost nothing, in terms of time, and
I believe it's less complicated than attempting to reverse
engineer or emulate whatever their original algorithm was.

-- 
Raul

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to