Unimodular Transformation - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

Home : Support : Online Help : Programming : CodeTools : Program Analysis : Unimodular Transformation

CodeTools[ProgramAnalysis]

  

UnimodularTransformation

  

apply a unimodular transformation to a ForLoop

 

Calling Sequence

Parameters

Description

Examples

Compatibility

Calling Sequence

UnimodularTransformation(loop, M)

UnimodularTransformation(loop, M, newvars)

Parameters

loop

-

ForLoop

M

-

unimodular Matrix

newvars

-

(optional) list of symbols, names for the index variables in the returned ForLoop

Description

• 

This command applies a transformation to loop's index variables via the change of coordinates , where M is a unimodular matrix,   are the index variable(s) in loop, and  are the index variable(s) in the resulting transformed ForLoop.  The loop bounds and loop body in loop are updated according to this transformation.

• 

The Matrix M is a square matrix with integer entries whose determinant is +1 or -1.  It must have the same number of rows and columns as there are elements in loop:-variables.

• 

If the optional argument newvars is not supplied, the returned ForLoop will have the same names for its index variable(s) as the original loop, but with the transformation applied.  Otherwise, the returned loop's index variable(s) will have the names in newvars, ordered from the outermost to innermost loops.

Examples

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:

(2)

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.

Compatibility

• 

The CodeTools[ProgramAnalysis][UnimodularTransformation] command was introduced in Maple 2016.

• 

For more information on Maple 2016 changes, see Updates in Maple 2016.

See Also

CodeTools[ProgramAnalysis][CreateLoop]

CodeTools[ProgramAnalysis][IterationSpace]

CodeTools[ProgramAnalysis]

 


Download Help Document