summaryrefslogtreecommitdiff
path: root/test/published/Web/web3.cloog
blob: e719a5c4d782ecab460c5f0c7e0cb1e8f8586346 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# CLooG example file #3.
# Please read the first example which is fully documented to understand the
# different parts of this input file.
#
################################################################################
# The problem here is to generate the scanning code for the integral points    #
# inside two different 2-dimensional polyhedra (geometrically two rectangles). #
#                                      |                                       #
#                j^                    |                                       #
#                 | (P1)i>=2           |        for (i=2;i<=p-1;i++)           #
#  Context:       | | (P2)i>=m         |        | for (j=2;j<=n;j++)           #
#  m>n>p>2        | | | (P1)i<=n       |        | | S1 ;                       #
#                 | | | | (P2)i<=p     |                                       #
#  P1 System:     | | | | |            |        for (i=p;i<=n;i++)             #
#  2<=i<=n      m-+-+-@@@@@--(P2)j<=p  |        | for (j=2;j<=p-1;j++)         #
#  2<=j<=n        | | @@@@@           ==>       | | S1 ;                       #
#               n-+-**###@@--(P1)j<=n  |        | for (j=p;j<=n;j++)           #
#  P2 System:     | **###@@            |        | | S1 ;                       #
#  p<=i<=m      p-+-**###@@--(P2)j>=m  |        | | S2 ;                       #
#  p<=j<=m        | ***** |            |        | for (j=n+1;j<=m;j++)         #
#               2-+-*****-+--(P1)j>=2  |        | | S2 ;                       #
#  *:P1 alone     | | | | |            |                                       #
#  @:P2 alone   0-+-+-+-+-+-->i        |        for (i=n+1;i<=m;i++)           #
#  #:P1 and P2    | | | | |            |        | for (j=p;j<=m;j++)           #
#                 0 2 p n m            |        | | S2 ;                       #
#                                      |                                       #
################################################################################

# 1. Language: C
c

# 2. Parameters {m,n,p | m>n>p>2}
3 5           # 3 rows and 5 columns
#  m  n  p  1
1  0  0  1 -3 # p>=3   (i.e. p>2)
1  0  1 -1 -1 # n>=p+1 (i.e. n>p)
1  1 -1  0 -1 # m>=n+1 (i.e. m>n)

# 3. We set manually the parameter name: m, n and p
1
m n p

# 4. Number of polyhedra:
2

# 5. The polyhedron description:
#    - the first one
1
# {i, j | 2<=i<=n 2<=j<=n}
4 7                       # 4 rows, 7 columns
#   i   j   m   n   p   1
1   1   0   0   0   0  -2 # i>=2
1  -1   0   0   1   0   0 # i<=n
1   0   1   0   0   0  -2 # j>=2
1   0  -1   0   1   0   0 # j<=n
0   0   0                 # 3 zeroes !

#    - the second one
1
# {j, j | p<=i<=m p<=j<=m}
4 7                       # 4 rows, 7 columns
#   i   j   m   n   p   1
1   1   0   0   0  -1   0 # i>=p
1  -1   0   1   0   0   0 # i<=m
1   0   1   0   0  -1   0 # j>=p
1   0  -1   1   0   0   0 # j<=m
0   0   0                 # 3 zeroes !

# 6. We let CLooG choose the iterator names
0

# 7. Let CLoog scan the polyhedra in the way it wants.
0