On 3/24/07, June Kim <[EMAIL PROTECTED]> wrote:
What is the model of Deal in terms of Roll?
This should do:
swap=: (|[EMAIL PROTECTED] { ])`[`]}
dealall=: i. ([: > [: swap&.>/ ,&.> , [: < [) [EMAIL PROTECTED]
deal=: [ {. [EMAIL PROTECTED]
That said, as Eugene McDonnell's article points out, there are more
efficient approaches when x is a tiny fraction of y, and y is large, in x?y
For example:
dealSmallPart=: , ([EMAIL PROTECTED] {. ~.@([EMAIL PROTECTED]/@[ , ])^:([EMAIL
PROTECTED] < [EMAIL PROTECTED])^:_) ($0)"_
--
Raul
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm