[Maxima] array and matrix?

Robert Dodier robert.dodier at gmail.com
Wed Dec 27 10:43:45 CST 2006


On 12/27/06, sen1 at math.msu.edu <sen1 at math.msu.edu> wrote:

> What is the difference between an 2-dimensional array and a matrix?

In Maxima, a matrix is implemented as a nested list (namely a list
of rows of the matrix).
E.g. (($MATRIX) ((MLIST) 1 2 3) ((MLIST) 4 5 6))

Maxima has two array types. (At least two -- not sure if I'm forgetting
something.) (1) Undeclared arrays -- these are implemented as Lisp
hash tables. (2) Declared arrays -- these are implemented as Lisp arrays.
Among the declared arrays, there is a distinction between arrays
created by the array function and those created by the make_array function.

Common Lisp has a built-in array type, but Maxima doesn't use it to
implement matrices. This is probably because Maxima came long
before CL. I have worked on a reimplementation of the Maxima matrix
type to build it on top of a Lisp array instead of a Lisp list. The hard
part here is updating all the bits of code which assume they know what
a matrix looks like internally. It is within the realm of possibility.

> Also, there seem to be no examples of "array_make", "makearray", or
> "fillarray"
>
> How does one use these, and for what purposes?

I'll try to update the documentation for those items.
I'm sorry that the array documentation is far from clear.

All the best
Robert Dodier


More information about the Maxima mailing list