ts 'p i. i.#p'
0.00602786 1.57363e6

Compared to:
>    ts '/:p'
>  0.00611782 1.04922e6
>     ts '(i.#p) p}p'
>  0.0112338 1.57389e6

p i. i.#p is also known in APL but seldom used 
to compute /:p because it's slower than (i.#p) p}p



----- Original Message -----
From: Zsbán Ambrus <[EMAIL PROTECTED]>
Date: Wednesday, November 5, 2008 15:35
Subject: Re: [Jprogramming] cut on length
To: Programming forum <[email protected]>

> On Thu, Nov 6, 2008 at 00:17, Roger Hui <[EMAIL PROTECTED]> wrote:
> > Re: The implementation should reward conciseness.
> >
> > In APL it was (and is) well-known that the inverse of
> > a permutation p can be computed as   (i.#p) p}p
> > and is more efficient than /:p .  But watch this:
> 
> How does (p i.(i.#p)) compare to these?


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

Reply via email to