Thanks, Ric, Oleg and Bill for your comments.
They have helped clarify my thinking too.
Oleg wrote:
I did not mean that "dimension" need to replace the word
rank, if only in phrasal expressions like 3-dimensional
array. Otherwise "rank" of array is very clear and unambiguous.
The DoJ clearly defines rank as # @ $ It is clear and unambiguous. It is
defined as a property of an array. It is also used as a property of a part
of an array in the usage rank-k cells of the array.
I was pointing out that _in the Dictionary_, "dimension"
is synonymous with shape but applied as measure in index
space rather to arrays, thus uncountable. However,
_I am_ now more inclined to refer to shape or such measure as
"dimentions" (plural), as in dimensions of a k-cell are
k trailing axes of the shape.
I have wondered if your spelling 'dimentions' and 'dimensions' are meant to
be different and I am not understanding some nuance of meaning.
In R dim(a) corresponds to J's $ a
length(dim(a)) is the rank # @ $ a
measure or length for axis k
rk <-dim(a)[[k]] k{$ a
indices along axis k i. k{$a
1:rk
Its shape is a single element vector, which is simply the number of items
(tally) in the list.
I.e. is a vector whose single element is the tally... (rank usage)
A dimension n noun is simply a list of dimension n-1 nouns of the same
I'd say, a rank-3 noun, or 3-dimensional noun, ...
(otherwise, I think, it's neologism, whereas it good
to stay in familiar paradigm)
I agree with the point both you and Bill make about changes in terminology.
I too am very conservative with respect to material in the DoJ. Whether we
use the terminology in my previous post or the standard rank n form, the
recursive structure of definition in terms of lists often provides an
alternative and illuminating way of thinking of the array structure.
shape. Each time we form a list, we add to the set of axes over which
the
array is defined. Each atom in the array becomes a value at some point
in a
discrete n dimensional space.
Very well put. Even, ... we prepend a dimension to axes ...
(if you like dimensions :) )
I think Oleg suggests referring to the location in the shape vector as
the
axis. For most high dimensional nouns it is essential to be able to
refer
to specific axes. Using axis for that is consistent with common usage in
many contexts.
How about:
- rank (of noun) is length of shape or index vector
- shape is vector of dimensions
- dimention is extent of indices at axis
- index is value (0..dimention-1 in index vector) at axis
- axis is location (0..rank-1) in shape or index vector
This terminology is a better reflection of the DoJ than the use of dimension
in my note. It still does not address the difference of usage of rank with
repect to verbs.
Three-dimensional does not mean that its dimension
is three, but that it has three dimensions. E.g.
noun of shape 4 5 6 has dimentions 4 5 6 (or 4x5x6):
dimension at axis 0 is 4 , dimension at axis 1 is 5, etc.
Note definition in Wikipedia:
the dimensions of a space are the total
number of different parameters
If dimention were synonymous with rank, it should
have been used in singular "the dimention of space is
the total number of parameters".
I do not understand this. If I have a 3-dimensional array with shape 4 5 6
I merely need three values to specify a point within that array. However if
I have a function defined over the array it may need 120 values or
parameters to specify it. The tasks of identifying a point in a three
dimensional space, and of defining a function over that space are quite
different.
...
In the DoJ rank is used three ways. It is used for the conjunction, it
is
used to specify the dimension in the sense above (II.A) and it is used to
specify the dimension of a function argument or arguments(II.B). I have
the
greatest respect for the years of careful work which Ken and Roger have
put
into the DoJ but I think the word rank is used for too many related but
distinct ideas.
I think on the contrary: the consistent reference to "rank"
creates possitive association.
A good language usually overloads words, but over years of observing comment
in this forum misunderstandings about 'rank' are perhaps the commonest
single stumbling block for persons learning J. In an array language, the
concept we call rank of a noun in J must play a central role. In a language
like J where the arrays are all regular arrays it is even more important.
It is a part of the genius of J that all interaction between verbs and the
data is controlled by the rank of the nouns on which the verbs operate, and
the rank of the nouns for which the verbs are defined. In every case if the
rank conjunction is not used with the verb there is an implicit conjunction
defined by the defaults. Calling these rules about the application of verbs
the 'rank' conjunction recognizes that they are all about the number of axes
of the arguments, but does associate a very different set of additional
concepts with the word 'rank'. As you noted unmodified execution
constrains the arrays which may be used to cells. Accessing subarrays
which are not a cell will require additional code.
Fraser
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm