dimensions of zero length

Hi all,
I noticed that in Numeric and in numarray it is possible to create arrays with axes of zero length. For instance: zeros([1, 0]). There seems not be much that can be done with them. What is the reason for their existence?
My real question is: When writing an extension in C, how to deal with such arrays? Should I treat them as empty arrays, that do not have any data?
Cheers, Peter

verveer@embl-heidelberg.de writes:
I noticed that in Numeric and in numarray it is possible to create arrays with axes of zero length. For instance: zeros([1, 0]). There seems not be much that can be done with them. What is the reason for their existence?
They often result as special cases from some operations. Think of them as the array equivalents of empty lists.
Creating zero-size arrays explicitly can be useful when suitable starting values for iterations are needed.
My real question is: When writing an extension in C, how to deal with such arrays? Should I treat them as empty arrays, that do not have any data?
Exactly.
Konrad.
participants (2)
-
Konrad Hinsen
-
verveer@embl-heidelberg.de