[Numpy-discussion] big picture? One proposal
dfb at mrao.cam.ac.uk
Fri Mar 8 08:05:29 CST 2002
On Fri, 8 Mar 2002, Konrad Hinsen wrote:
> > regarding to consider arrays as a mathematical concept too. Just in
> > mathematics I never (need to) use arrays in that way (my fields are
> > mathematical analysis, integrable systems, and not computer science nor
> I meant "mathematical" as a school of thought (going from the abstract
> to the concrete), not as a domain of research. I don't know any area
> of mathematics either that uses the array concept, but it is
> definitely common in computer science (as a structured collection of
> similar data). Image data is a good example.
Just my 2c worth: I count myself in the "mathematical" school despite
being a physicist. I look at matrices as having a specific algebra which,
for instance, cannot be easily made to apply to higher-dimensional arrays.
Therefore they are not just arrays looked at in a different way. For
object-oriented thinkers this means they are different objects. They may
"inherit" a lot of attributes from arrays but are not arrays.
Another point to note is that a specific complaint earlier in the
thread was the computational inefficiency of using numpy arrays for
matrix-intensive operations. It seems to me that it would be far easier to
write an optimised set of code for matrices if they were known to be
a separate class. An example (which is probably not useful, but serves
for illustration) is that one could "cache" or delay transposes etc,
knowing that a matrix-multiply was likely to be about to come up. This
sort of thing would be more difficult if the result of the transpose would
have to be sensible when followed by a generic array operation.
More information about the Numpy-discussion