>
|
|
Create a ForLoop from the given procedure:
>
|
heateq := proc(A, m, n)
local i1, j1;
for i1 to m do
for j1 from i1 + 1 to n do
A[i1, j1] := A[i1 - 1, j1 - 1] + 2*A[i1 - 1, j1] + A[i1 - 1, j1 + 1] + 3:
end do:
end do:
end proc;
|
| (1) |
>
|
|
Create a unimodular matrix:
>
|
|
Apply a unimodular transformation to loop so that the returned loop has index variables named i2 and j2:
>
|
|
| (3) |
The inverse transformation can be applied to generate a ForLoop that is equivalent to the original procedure :
>
|
|
>
|
|
| (4) |
The final procedure has a different upper bound on the outer loop than the original, but the two procedures are equivalent.