Quote:

> My current implementation uses lists, but perhaps I should use arrays.

You could also consider quadtrees, think of each matrix as four

quadrants, each also being a matrix or a scalar value (or, for

performance, an n by n array)

(Or, if you need arbitrarily dimensioned matrices, not just powers of

two, you could divide each dimension into some prime number, and get a

more arbitray, but messy, implementation.)

Using trees makes a lot of operations neatly recursive, and probably

gives you the benefit of cheap sparse matrices as well as good cache

behaviour for free.

Quote:

> Can somebody give me an impression of the speed benefit of arrays

> compared to lists?

I would say this is an implementation issue, but I expect arrays to be

faster.

Quote:

> Perhaps it's worth the trouble to reimplement my matrix stuff.

Perhaps. I'd be very interested in any code you produce. Stray

thought: matrices are usually linear functions on vectors, the

rectangular bunch of numbers is just the representation. I think one

should be able to type something like

x' = b - D' (L + U) x

where

(L,D,U) = split A

D' = inv D

kzm

--

If I haven't seen further, it is by standing in the footprints of giants