($loc)#:I.,loc = y NB. nice
before the days of I. (and for that matter $.) the more direct way
($loc)#: y i.~,loc
while not as fast as Paul's I. phrase, is quite a lot faster
than the $.$. convolution (about 5 times when loc is 1000x1000
while the I. phase is about 6 times faster - both take a lot
less memory than the $.$. phrase, 5.5 and 11 times respectively)
- joey
At 14:28 -0500 2007/04/30, [EMAIL PROTECTED] wrote:
,4 $. $. loc = y {This works for a scalar y}
($loc)#:I.,loc = y {This is probably faster for a scalar y}
Not sure why you use i. ?
Paul Gauthier
APL Software Developer - Senior
[EMAIL PROTECTED]
Phone: 312-739-3467
Fax: 312-739-3496
CheckFree. The Company that Powers Payment on the WebSM.
http://www.checkfree.com/paybillsonline
Tracy Harms <[EMAIL PROTECTED]>
Sent by: [EMAIL PROTECTED]
04/30/2007 02:12 PM
Please respond to
General forum <[email protected]>
To
[email protected]
cc
Subject
[Jgeneral] identifying the coordinates of a unique atom
My last little J project has been posted on the wiki:
http://www.jsoftware.com/jwiki/TracyHarms/misc/wrapmap
I'd like peer review of one portion of my code, in
particular, where I suspect it may be clunky.
Where loc is a table of unique (location) values, I
used the following phrase to obtain the coordinate
vector identifying the given value within the table.
,4 $. $. -. y i. loc
While I understand how this functions to get the
result I desired, it seems to me that I've used i. in
a manner contrary to its design. My hunch is that my
solution is either awkward or eccentric, and that I've
not yet learned the more natural way to accomplish
coordinate identification.
If that is true, I'd like to know. (If, instead, my
technique lies among the set of reasonable
alternatives, that would be nice to learn, too.)
Tracy Harms
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm