Re: APL and (very) large arrays
- From: "Stefano \"WildHeart\" Lanzavecchia" <wildstf@xxxxxxxxxxx>
- Date: Wed, 11 Jan 2006 09:42:54 +0100
> 2) The two biggest elements of a vector (for instance to build the
> associated Huffman code. Surely there must be a better way than
> sorting the whole vector and then making a 2 take ?
As far as I know, there's no better way. You can avoid the finally indexing
by doing the 2 take of the index vector, but I cannot really see how to
improve the algorithm given the overhead of the interpreter. Of course some
cleverer guy will prove me wrong straight-away. I mean: you could always
max1<-ceiling/vec
max2<-ceiling/vec without max1
but you would still have to traverse the original vector three times and
make one almost full one copy of it so, unless you timed it against your
favourite implementation, you wouldn't know if that would be faster than the
gradedown for any size of vec.
--
WildHeart'2k6
.
- Follow-Ups:
- Re: APL and (very) large arrays
- From: Randy Macdonald
- Re: APL and (very) large arrays
- References:
- APL and (very) large arrays
- From: fda
- APL and (very) large arrays
- Prev by Date: APL and (very) large arrays
- Next by Date: Re: APL in its ghetto (?)
- Previous by thread: APL and (very) large arrays
- Next by thread: Re: APL and (very) large arrays
- Index(es):