### The Maxima on-line user's manual

Algebra Calculator

#### Arrayinfo

Function: arrayinfo (<A>) Returns information about the array <A>. The argument <A> may be a declared array, an undeclared (hashed) array, an array function, or a subscripted function.

For declared arrays, `arrayinfo` returns a list comprising the atom `declared`, the number of dimensions, and the size of each dimension. The elements of the array, both bound and unbound, are returned by `listarray`.

For undeclared arrays (hashed arrays), `arrayinfo` returns a list comprising the atom `hashed`, the number of subscripts, and the subscripts of every element which has a value. The values are returned by `listarray`.

For array functions, `arrayinfo` returns a list comprising the atom `hashed`, the number of subscripts, and any subscript values for which there are stored function values. The stored function values are returned by `listarray`.

For subscripted functions, `arrayinfo` returns a list comprising the atom `hashed`, the number of subscripts, and any subscript values for which there are lambda expressions. The lambda expressions are returned by `listarray`.

Examples:

`arrayinfo` and `listarray` applied to a declared array.

```          (%i1) array (aa, 2, 3);
(%o1)                          aa
(%i2) aa [2, 3] : %pi;
(%o2)                          %pi
(%i3) aa [1, 2] : %e;
(%o3)                          %e
(%i4) arrayinfo (aa);
(%o4)                 [declared, 2, [2, 3]]
(%i5) listarray (aa);
(%o5) [#####, #####, #####, #####, #####, #####, %e, #####,
#####, #####, #####, %pi]```

`arrayinfo` and `listarray` applied to an undeclared (hashed) array.

```          (%i1) bb [FOO] : (a + b)^2;
2
(%o1)                       (b + a)
(%i2) bb [BAR] : (c - d)^3;
3
(%o2)                       (c - d)
(%i3) arrayinfo (bb);
(%o3)               [hashed, 1, [BAR], [FOO]]
(%i4) listarray (bb);
3         2
(%o4)                 [(c - d) , (b + a) ]```

`arrayinfo` and `listarray` applied to an array function.

```          (%i1) cc [x, y] := y / x;
y
(%o1)                      cc     := -
x, y    x
(%i2) cc [u, v];
v
(%o2)                           -
u
(%i3) cc [4, z];
z
(%o3)                           -
4
(%i4) arrayinfo (cc);
(%o4)              [hashed, 2, [4, z], [u, v]]
(%i5) listarray (cc);
z  v
(%o5)                        [-, -]
4  u```

`arrayinfo` and `listarray` applied to a subscripted function.

```          (%i1) dd [x] (y) := y ^ x;
x
(%o1)                     dd (y) := y
x
(%i2) dd [a + b];
b + a
(%o2)                  lambda([y], y     )
(%i3) dd [v - u];
v - u
(%o3)                  lambda([y], y     )
(%i4) arrayinfo (dd);
(%o4)             [hashed, 1, [b + a], [v - u]]
(%i5) listarray (dd);
b + a                v - u
(%o5)      [lambda([y], y     ), lambda([y], y     )]```

```(%o1)                                true
(%i2) ```

### Related Examples

ct_coords:[t,r,theta,...

lg:matrix([-1,0,0,0],...

Calculate

##### arrayinfo-block-cons-if-sort

P [s1,s2,s3,s4,s5] :=...

srt[s1,s2,s3,s4,s5] :...

P [s1,s2,s3,s4,s5] :=...

Calculate

? arrayinfo;

Calculate

##### arrayinfo-block-if-sort

P [s1,s2,s3,s4,s5] :=...

P[2,2,2,2,2];

g[s1,s2,s3,s4,s5] := ...

Calculate

##### arrayinfo-block-if-sort

P (s1,s2,s3,s4,s5) :=...

foo[sort([3,5,1,5,1])...

foo[sort([3,5,1,5,1])...

Calculate

##### arrayinfo-block-if-sort

P (s1,s2,s3,s4,s5) :=...

foo[sort([3,5,1,5,1])...

foo[sort([3,5,0,5,1])...

Calculate

##### arrayinfo-block-if-sort

P (s1,s2,s3,s4,s5) :=...

P(2,1,4,2,2);

foo[sort([3,5,1,5,1])...

Calculate

##### arrayinfo-block-if-sort-subvar

P (s1,s2,s3,s4,s5) :=...

foo[sort([3,5,1,5,1])...

if foo[sort([3,5,0,5,...

Calculate

##### arrayinfo-block-if-sort

P [s1,s2,s3,s4,s5] :=...

P[2,2,2,2,2];

g[s1,s2,s3,s4,s5] := ...

Calculate

##### arrayinfo-block-if-sort

P [s1,s2,s3,s4,s5] :=...

P[2,2,2,2,2];

g[s1,s2,s3,s4,s5] := ...

Calculate