variable evaluation



On 4/3/07, Zoho Vignochi <zoho.vignochi at gmail.com> wrote:

> go(n1) := block ( [this],
>         n:n1,
>         array(a,n,n),
>         array([Cpp,K],n),

Seems to me you could just cut out the array declarations here
and let a, Cpp, and K be so-called undeclared arrays (which are
essentially hash tables with index values as the keys).
The #### represent unassigned values in a declared array.
May as well just omit them.

> a[i,i-j]:solve(coeff(collectterms(expand(A),c),c,2*(i-j)+1),a[i,i-j]) ),
>                 K[i]:solve(coeff(collectterms(expand(A),c),c,1),K[i]) )

solve returns a list like [x = ..., x = ...] to represent multiple solutions;
that's why a[1, 1] = ... shows up in the value assigned to a[1, 1].
You could put a[i, i - j] : map(rhs, solve(...)) and likewise for K[i].
But it seems like a helpful consequence of the present code that
a[i, j] = ... shows up in the value --- otherwise you would have to
piece that together from arrayinfo(a) (to get the indices) and
listarray(a) (to get the values).

HTH
Robert