First commit : 0.14.0 version (with roadmap in doc instead of
[cloog.git] / test / published / Web / web2.cloog
blob7293f90f86e95554b0941dbbd8cd03444f6fe8d8
1 # CLooG example file #2.
2 # Please read the first example which is fully documented to understand the
3 # six first parts of the input file. This example explains the seventh one.
5 ################################################################################
6 # The problem here is to impose a scanning order for the polyhedron of the     #
7 # first example : the points are ordered by i+j values (a well known skewing). #
8 #                      |                          |                            #
9 #    j^                |   i^           i<=c1-2   |                            #
10 #     | i>=2           |    |  c1>=4   / c1<=2*n  |                            #
11 #     | |   i<=n       |    |   |     / | i>=c1-n |                            #
12 #     | |   |          |    |   |    /  |/        |                            #
13 #   n-+-*****--j<=n    |  n-+---+---*****--i<=n   | for (c1=4;c1<=2*n;c1++){   #
14 #     | *****          |    |   |  *****|         |  for (i=max(c1-n,2);       #
15 #     | *****         ==>   |   | ***** |        ==>      i<=min(c1-2,n);i++){ #
16 #     | *****          |    |   |*****  |         |   j = c1-i ;               #
17 #   2-+-*****--j>=2    |  2-+---*****---+--i>=2   |   S1 ;                     #
18 #     | |   |          |    |  /|  /    |         |  }                         #
19 #   0-+-+---+--->i     |  0-+---+-------+--->c1   | }                          #
20 #     | |   |          |    |   |       |         |                            #
21 #     0 2   n          |    0   4      2n         |                            #
22 #                      |                          |                            #
23 #   Context : n>=2     |  Scattering function:    |                            #
24 #   System  : 2<=i<=n  |  c1=i+j                  |                            #
25 #             2<=j<=m  |                          |                            #
26 #                      |                          |                            #
27 ################################################################################
29 # 1. Language: C
32 # 2. Parameters {n | n>= 2}
33 1 3
34 #  n  1
35 1  1 -2
37 # 3. We set manually the parameter name: n
41 # 4. Number of polyhedra:
44 # 5. The polyhedron description:
46 # {j, j | 2<=i<=n 2<=j<=n}
47 4 5
48 #   i   j   n   1
49 1   1   0   0  -2 # i>=2
50 1  -1   0   1   0 # i<=n
51 1   0   1   0  -2 # j>=2
52 1   0  -1   1   0 # j<=n
53 0   0   0         # 3 zeroes !
55 # 6. We let CLooG choose the iterator names
58 # 7. Seventh, we define the scanning order. In CLooG speaking, we talk about
59 #    scattering functions (a shortcut for scheduling, allocation etc.). It may
60 #    be useful to read the CLooG documentation about this point since it is
61 #    not trivial if you are not comfortable with transformations in the polytope
62 #    model. We describe them in three parts:
63 #    7.1 The number of scattering functions. It must be either 0 (in this case
64 #        there is no particular scanning order and CLooG will do what it wants)
65 #        or the number of polyhedra (set in part 4.).
66 #    7.2 The list of scattering functions. Each scattering function is a
67 #        constraint matrix (as those that describe context or polyhedra) but
68 #        made exclusively of equalities. They equate each new scattering
69 #        dimension with an affine expression of the original polyhedron
70 #        dimensions, the parameters and the scalar. CLooG will only respect the
71 #        ordering given by the scattering dimensions. If there are several 
72 #        scattering dimensions, CLooG will use the lexicographic ordering (the
73 #        first dimension leads, then the second one and so on). Every scattering
74 #        functions must have the same number of scattering dimensions.
75 #        Here we have c1=i+j, a one-dimensional scattering. It means that the
76 #        points of the original polyhedron with the same i+j value will be
77 #        scanned during the same iteration of the outer loop.
78 #    7.3 We set the scattering dimension names. We just put 0 if we want to let
79 #        CLooG decide names, 1 otherwise. If we put 1, at the next line we give
80 #        the space-separated parameter list.
81 1   # One scattering function (since there is only one polyhedron)
82 1 6 # The scattering function is a matrix of one row and six columns
83 # c1   i   j   n   1
84 0  1  -1  -1   0   0 # c1 = i+j
85 0   # We let CLooG choose the scattering dimension names