Maxima: what does Maxima call "array"?

I am a bit confused; I noticed that if:

a[sqrt(2)] : 1;
arrays;

      

I would get:

[a]

      

So a

is an array for Maxima ... but sqrt(2)

an irrational number.

I use to think of an array as a collection of elements sorted by indices, where those indices are integers ... I admit that my definition for "array" is highly dependent on other "non-character" programming languages. In these languages, arrays are "mapped" to a specific contiguous area of ​​computer memory. Therefore, it is natural to use integer as indices, since integer is countable. However, real numbers are not countable.

Obviously, maxims seem to have a different definition for the term "array": what is it? (the documentation doesn't define it, at least there's no introductory paragraph in the documentation section dealing with arrays )

+3


source to share


1 answer


The maximum understanding of arrays, lists and matrices is quite confusing, as various ideas have been outlined over the years of the project.

Maxima "subscript" = character with an index (with an arbitrary index) and an unassigned value. For example. a[sqrt(2)]

without an assigned value.

Maxima "uneclared array" = hash table with arbitrary keys associated with an array character as a property of the character, not a value. Yours a[sqrt(2)] : 1

is an example of an undeclared array. Maxima creates an array the a

first time a value is assigned.

Maximum "declared array" = contiguous storage associated with the character of the array as a property of the character, not the value.



Maxima "Lisp array" = contiguous storage associated with an array character as a character value.

Maxima "swift array" = hash table associated with the array character as the character value.

Yes, it's a mess. Sorry about that. These are all interesting ideas, but there is no single structure. I didn't even mention lists and matrices. Hope this helps anyway.

+3


source







All Articles