You have to do more than that. e.g.:

   v=: 100 [EMAIL PROTECTED] 0
   bv=: 100 [EMAIL PROTECTED] 2

   m=: 100 37 [EMAIL PROTECTED] 0
   bm=: 100 37 [EMAIL PROTECTED] 2
   
   vm=:  (bv*v) +/ .* bm*m
   bvm =: bv +./ .* bm

But what is the alternative?  It seems to me that an "in-band"
missing value indicator is like NaN , whose mathematical
properties require very careful handling.  e.g. What should
the following be:  missing*missing?  missing^missing?
/: 1 2,missing,4 ?  (+/%#) 1 2,missing,4 ?  Replace
"missing" by NaN and you'd have the running-around-
in-circles exercise that we went through.



----- Original Message -----
From: "Philip A. Viton" <[EMAIL PROTECTED]>
Date: Friday, September 5, 2008 11:24
Subject: [Jprogramming] Re: data-munging in J
To: [email protected]

> 
> Thanks, Roger (and also for the reminder that _ % _ is NaN : it 
> must 
> have been another edge-case that I was thinking of).
> 
> Anyway, maybe I'm missing something, but how would one implement 
> the 
> boolean suggestion when one was going to do, eg v (+/ . * ) mx 
> where 
> v is a vector and mx is a matrix (ie the matrix product of v and 
> m)? 
> Wouldn't this require you to do all calculations twice, once 
> with the 
> data and one for the boolean control?
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to