Your analysis is almost right.  Actually, {."1 benefits
from Integrated Rank Support, which means that the
loop over the operand is a tight inner loop rather than
starting the whole verb up anew for each 1-cell.

So, [EMAIL PROTECTED] starts {. and +. for each 0-cell, while
{."1@:+. starts +. once and {. once.

Henry Rich

> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of 
> Graham Parkhouse
> Sent: Monday, January 08, 2007 12:05 PM
> To: [email protected]
> Subject: [Jprogramming] RE: Why won't this plot?
> 
> Henry wrote
> 
> >> [EMAIL PROTECTED] Applied in this situation is a nice example of the
> >> usefulness of @ .
> >
> >If you're going to use this much, use
> >
> >{."1@:+.
> >
> >which is quite a bit faster.  It's a good exercise for you
> >to learn why, too.
> >
> >Henry Rich
> 
>    ([EMAIL PROTECTED])b. 0   
> 0 0 0
>    ({."1@:+.)b. 0   
> _ _ _
> 
> Above is the difference between @ and @:
> 
> Am I right in thinking that the first function performs +. 
> followed by {. on
> every atom of the argument iteratively, while the second 
> performs +. on the
> whole argument (which is more efficient) but then does the "1 
> operation
> iteratively (no more efficiently then the first function)?
> 
> Thank you, John, for the link -- this is not a new problem. 
> But Roger did
> recognise it as a bug.
> 
> Graham Parkhouse
> 
> 
> ----------------------------------------------------------------------
> For information about J forums see 
> http://www.jsoftware.com/forums.htm

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to