Go to the first, previous, next, last section, table of contents.
An overview of the rapid prototyping system is presented by showing how to solve the following simple problem.
The following system of inequalities describing a convex polyhedron representing a two dimensional iteration space (`i', `j') is given as the input.
First, we will find if there exists an integer solution for this system of inequalities, i.e. if there are any valid iterations within this space.
Next, we will explore two different methods to scan the iteration space. In the first method, a loop nest is created with `i' outermost and `j' innermost. In the second method we will produce a loop nest where `j' is outermost and `i' is innermost.
Here is the LIC session that is used to perform the above
mentioned tasks.
csh> lic -c
Rapid Prototyping System for Code Generation
> iter = [ 1 <= i <= N
i <= j
N - i <= j
j <= 2*i + 1 ]
1+2*i-j >= 0
i+j-N >= 0
-i+j >= 0
-i+N >= 0
-1+i >= 0
> iter.intsol()
1
> #iter = iter.order(N i j)
> iter.code(2)
for(i = max(1, (1+N)/3); i <= N; i++)
for(j = max(N-i, i); j <= 1+2*i; j++)
> #iter = iter.order(N j i)
> iter.code(2)
for(j = (1+N)/2; j <= 1+2*N; j++)
for(i = max(1, N-j, j/2); i <= min(j, N); i++)
> quit
done(0)
csh>
LIC is invoked for Prototyping system mode
LIC will print
the contents of the variable `iter' after it is created.
LIC prints 1
indicating that there is an integer solution to the system.
LIC from printing the results of the expression
evaluated by that line.
LIC program.
Go to the first, previous, next, last section, table of contents.