It's nuanses, I'd say "i, j and values". I also
wanted to contrast "(perhaps i,.j and value as *two* map files)",
because accessing i and j separately is convenient
and splitting them from one file will result in
unmapped copies.

--- Roger Hui <[EMAIL PROTECTED]> wrote:

> Roger: Better to just map i and j and values separately
> Oleg: Or maybe three mapped files: i, j, values.
> 
> What is the difference between the two descriptions?
> 
> 
> 
> ----- Original Message -----
> From: Oleg Kobchenko <[EMAIL PROTECTED]>
> Date: Thursday, January 10, 2008 2:59
> Subject: Re: [Jgeneral] table (i,j,value)  to matrix
> To: General forum <[email protected]>
> 
> > --- Roger Hui <[EMAIL PROTECTED]> wrote:
> > > Better to just map i and j and values separately 
> > > (perhaps i,.j and value as two map files), and apply your
> > > iterative methods to these.
> > 
> > Or maybe three mapped files: i, j, values.
> > Then access to the matrix is simply relational.
> > See http://www.jsoftware.com/jwiki/DB/Flwor
> > 
> >    i.3 
> > 4              NB. matrix
> > 0 1  2  3
> > 4 5  6  7
> > 8 9 10 11
> >    (#: i.@(*/)) 3 4   NB. index odometer
> > 0 0
> > 0 1
> > 0 2
> > 0 3
> > 1 0
> > 1 1
> > 1 2
> > 1 3
> > 2 0
> > 2 1
> > 2 2
> > 2 3
> >    'r c'=. |:(#: i.@(*/)) 3 4
> >    v=. ,@i. 3 4
> >    
> > r,.c,.v            NB. relational form
> > 0 0  0
> > 0 1  1
> > 0 2  2
> > 0 3  3
> > 1 0  4
> > 1 1  5
> > 1 2  6
> > 1 3  7
> > 2 0  8
> > 2 1  9
> > 2 2 10
> > 2 3 11
> >    1 = 
> > r              NB. row 1 mask
> > 0 0 0 0 1 1 1 1 0 0 0 0
> >    v #~ 
> > 1=r           NB. SQL: select v where r=1
> > 4 5 6 7
> >    1 2 =/ 
> > r           NB. rows 1 2 mask
> > 0 0 0 0 1 1 1 1 0 0 0 0
> > 0 0 0 0 0 0 0 0 1 1 1 1
> >    v #~ 1 2 =/ r      NB. 
> > rows 1 2 value
> > 4 5  6  7
> > 8 9 10 11
> >    
> >    1 = 
> > c              NB. column 1 mask
> > 0 1 0 0 0 1 0 0 0 1 0 0
> >    v #~ 1 = 
> > c         NB. etc ...
> > 1 5 9
> > 
> >    v #~ c = 1
> > 1 5 9
> >    1 3 =/ c
> > 0 1 0 0 0 1 0 0 0 1 0 0
> > 0 0 0 1 0 0 0 1 0 0 0 1
> >    v #~ 1 3 =/ c
> > 1 5  9
> > 3 7 11
> > 
> > 
> >    (t#r),.(t#c),.v#~t=. 0=4|v NB. 4 multiple
> > 0 0 0
> > 1 0 4
> > 2 0 8
> >    
> >    (~.r) ,. 
> > r+//.v            NB. sum by rows
> > 0  6
> > 1 22
> > 2 38
> >    +/"1 i.3 4
> > 6 22 38
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
> 



      
____________________________________________________________________________________
Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ 

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

Reply via email to