A more efficient alternative is
grad1=:(sort i.]) {:"1 @sort@:,. [EMAIL PROTECTED]
ts'grade y'[y=:":&.> 1e5 [EMAIL PROTECTED] 1e5
0.99774888 38603584
ts'grad1 y'
0.2651007 4195136
(grad1-:grade) y
1
ts'grade y'[y=:1e6 [EMAIL PROTECTED] 100
9.2366727 3.7365843e8
ts'grad1 y'
0.16542411 33555264
(grad1-:grade) y
1
ts'grade y'[y=:1e6 [EMAIL PROTECTED] 0
9.0147876 3.7365843e8
ts'grad1 y'
1.1208075 33555264
(grad1-:grade) y
1
R.E. Boss
> -----Oorspronkelijk bericht-----
> Van: [EMAIL PROTECTED] [mailto:programming-
> [EMAIL PROTECTED] Namens Roger Hui
> Verzonden: vrijdag 3 augustus 2007 7:27
> Aan: Programming forum
> Onderwerp: Re: [Jprogramming] burstsort - using Burst Tries: fastest sort?
>
> > However, for my purposes, "grade" is usually more useful than "sort".
>
> Grade can be derived readily from sort:
>
> sort=: /:~
> grade=: > @ ({:"1"_) @ sort @ (;"_1 [EMAIL PROTECTED])
>
> grade 'metonymic'
> 8 1 7 0 6 4 3 2 5
> /: 'metonymic'
> 8 1 7 0 6 4 3 2 5
>
> For a related discussion, see
> http://www.jsoftware.com/jwiki/Essays/Sorting_versus_Grading
>
>
>
> ----- Original Message -----
> From: Devon McCormick <[EMAIL PROTECTED]>
> Date: Thursday, August 2, 2007 18:57
> Subject: Re: [Jprogramming] burstsort - using Burst Tries: fastest sort?
> To: Programming forum <[email protected]>
>
> > I would be happy to let Roger implement this for J, just as he
> > has already
> > implemented very good random number generators and factoring
> > algorithms.
> > However, for my purposes, "grade" is usually more useful than "sort".
> >
> > I don't mean this as a put-down. Any real breakthrough in
> > sorting is
> > potentially
> > of great benefit to us all, but not necessarily at the level of
> > a J
> > application.
> > The power of the language is in encapsulating high-level
> > concepts, not
> > in the low-level
> > details of the implementation of a well-known concept like sorting.
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm