--- Terrence Brannon <[EMAIL PROTECTED]> wrote:

> On 4/1/07, Oleg Kobchenko <[EMAIL PROTECTED]> wrote:
> > "Size" is non-normative terms and word "rank" should
> > be used here. What was meant is "size of shape", i.e.
> > number of items in the shape vector.
> 
> ok, so given
> q =: 4 5 6
> if I index into q as q[2] then the resultant array is of shape 5 6
> The number of items in the shape vector is 2
> So, yes, size is simply rank for the array resulting from an index operation.

I meant, don't use the word "size", it's confusing.
Better to say "length" meaning # Tally,
and "rank" meaning the length of shape [EMAIL PROTECTED]

> > However, to talk
> > about the number of items on the outer-most axis of array,
> > a better word is "length", because it suggests only one
> > dimension.
> 
> Not for me. "length" to me implies the length of a list, not the rank
> of an array.
> A 1-cell reminds me a list, and the shape of that 1-cell is what a
> Lisp programmer might call the length of a list.

I was applying "length" to "length of shape of cell" (i.e. rank of cell),
as you obeserve, "length of cell", is the number of leading items.

Now about the word "list". It means the rank-1 frame (leading dimension)
of rank(N-1) cells for any rank-N array. Rank-1 list (of 0-cells, atoms)
is typically called vector, and list of vectors is naturally a matrix.

> so, again:
> q =: 4 5 6
> q[2][2] yields a 1-cell with shape 6 and "size" 1

rank 1, that is

   q=: i.4 5 6     NB. not q =: 4 5 6
   $  2{ 2{ q      NB. same as (<2 2) { q
6
   #$ 2{ 2{ q
1

> and you would say length is 1, but I would say it's length is 6. But

No, length of shape (rank) is 1, but length is 6.

> as long as length is not used in j terminology in this article, we can
> drop this discussion.
> 
> 
> > The normative way to say rank is using
> > primitives # Tally of $ Shape.
> >
> > To know what is the rank of frame, if you pick a given
> > rank of cell, can be determined as rank of result of boxing
> > with the rank of cell:
> 
> actually it is understood that the cell rank could be subtracted from
> the rank of the entire array to get the rank of the frame...
> 
> q =: 4 5 6
> so a 1-cell implies the frame has rank 2 etc etc... he has a table in
> article on this.
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
> 



 
____________________________________________________________________________________
Don't get soaked.  Take a quick peek at the forecast
with the Yahoo! Search weather shortcut.
http://tools.search.yahoo.com/shortcuts/#loc_weather
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to