M
ABC
STUV
PQR
WXY
PQR
WXY
]m=.32-~a.i.M
33 34 35 0
51 52 53 54
48 49 50 0
0 0 0 0
55 56 57 0
0 0 0 0
0 0 0 0
48 49 50 0
55 56 57 0
0 0 0 0
0 0 0 0
]m0=.([^:(0=]))/\ 0{"1 m
33 51 48 48 55 55 55 48 55 55 55
]mm=.(0{"1 m)+(100*1{"1 m)+(10000*2{"1 m)+(1000000*3{"1 m)
353433 54535251 504948 0 575655 0 0 504948 575655 0 0
]mmm=.([^:(0=]))/\ mm
353433 54535251 504948 504948 575655 575655 575655 504948 575655 575655
575655
]nn3=. <.mmm%1000000
0 54 0 0 0 0 0 0 0 0 0
]nn2=."._2{."1 ":,"0<.mmm%10000
35 53 50 50 57 57 57 50 57 57 57
]nn1=."._2{."1 ":,"0<.mmm%100
34 52 49 49 56 56 56 49 56 56 56
]nn0=."._2{."1 ":,"0 mmm
33 51 48 48 55 55 55 48 55 55 55
]m2=.nn0,.nn1,.nn2,.nn3
33 34 35 0
51 52 53 54
48 49 50 0
48 49 50 0
55 56 57 0
55 56 57 0
55 56 57 0
48 49 50 0
55 56 57 0
55 56 57 0
55 56 57 0
(m2+32) { a.
ABC
STUV
PQR
PQR
WXY
WXY
WXY
PQR
WXY
WXY
WXY
2006/12/12, Oleg Kobchenko <[EMAIL PROTECTED]>:
More generally
([^:(0=]))/\ 5 4 0 0 5 0 3 0 0 0 7
5 4 4 4 5 5 3 3 3 3 7
--- Oleg Kobchenko <[EMAIL PROTECTED]> wrote:
> How about variation on the theme
>
> >./\ 3 4 0 0 5 0 6 0 0 0 7
> 3 4 4 4 5 5 6 6 6 6 7
>
>
> --- Dan Bron <[EMAIL PROTECTED]> wrote:
>
> > Raul wrote:
> > > drag=: {~ [EMAIL PROTECTED] >./\@:* ([EMAIL PROTECTED] 1{.0{.])
> >
> > Thank you; this is indeed faster; I've replaced my definition with
> > yours. However, I was hoping for a solution that would complete in
> > about half the time of the solutions I provided. That is, I'd like a
> > 2x or 100% speedup; drag is only about 20% faster than drag0 on my
> > dataset.
> >
> > Any other lines of attack?
> >
> > -Dan
> >
> > ----------------------------------------------------------------------
> > For information about J forums see http://www.jsoftware.com/forums.htm
> >
>
>
>
>
>
____________________________________________________________________________________
> Need a quick answer? Get one in minutes from people who know.
> Ask your question on www.Answers.yahoo.com
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
____________________________________________________________________________________
Have a burning question?
Go to www.Answers.yahoo.com and get answers from real people who know.
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
--
Björn Helgason, Verkfræðingur
Fugl&Fiskur ehf, Þerneyjarsund 23, Box 127
801 Grímsnes ,t-póst: [EMAIL PROTECTED]
Skype: gosiminn, gsm: +3546985532
Landslags og skrúðgarðagerð, gröfuþjónusta
http://groups.google.com/group/J-Programming
Tæknikunnátta höndlar hið flókna, sköpunargáfa er meistari einfaldleikans
góður kennari getur stigið á tær án þess að glansinn fari af skónum
/|_ .-----------------------------------.
,' .\ / | Með léttri lund verður |
,--' _,' | Dagurinn í dag |
/ / | Enn betri en gærdagurinn |
( -. | `-----------------------------------'
| ) | (\_ _/)
(`-. '--.) (='.'=)
`. )----' (")_(")
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm