I don't know the exact definition of n-norm (blush) but
if you just want to take the absolute value of y, you can add
another adverb

   N=: (^&) (+/&.) (@:|)
   2 N
+/&.(^&2)@:|

But, I think this is a thorny path.  There's no reason
not to use the explicit adverb:

   N =: 1 : '+/&.:(^&m) @: |'
   2 N
+/&.:(^&2)@:| 

Just make sure you don't mention x and y in your adverbs unless you have to.

Henry Rich

> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of John Randall
> Sent: Sunday, August 05, 2007 6:54 PM
> To: Programming forum
> Subject: Re: [Jprogramming] real vector normalization rounding error?
> 
> I tried writing the L_p norm along these lines.  Not being a whiz
> at adverbs, I only got so far.
> 
> N=: (^&) (+/&.)
> 
>    2 N
> +/&.(^&2)
> 
>    2 N 3 4
> 5
> 
> However, for odd x, you really need to take the absolute value of y,
> and I cannot see how to do it tacitly.
> 
> Any ideas?
> 
> Best wishes,
> 
> John
> 
> 
> ----------------------------------------------------------------------
> 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