[comp.sys.next] IdentityMatrix in Mathematica -- Why So Slow?

joe@oregon.uoregon.edu (Joe St Sauver) (07/29/89)

A Decision Sciences faculty member recently was curious about the matrix
performance of Mathematica -- just as a test, he wanted to see how long it
would take to create a 100x100 identity matrix and then invert it.

He was somewhat surprised to find that creation of the identity matrix with
Mathematica's IdentityMatrix command took quite some time (on the order of
minutes).

Does anyone have a cogent explanation for why it takes Mathematica so long
to create a matrix with ones on the diagonal and zeroes everywhere else?
Presumably, the delays are due to Mathematica's construction of some sort of
internal data structures, but I'm curious about what *particular* constructs
result in this rather sorry performance.

And, of course, the faculty member is also curious if there is a way to 
increase the speed of matrix operations if infinite precision and all of 
Mathematica's other whiz bang features aren't required. Suggestions?

Joe St Sauver (JOE@OREGON.UOREGON.EDU)
Statistical Programmer and Consultant
University of Oregon Computing Center