~ubuntu-branches/ubuntu/trusty/cloog/trusty

« back to all changes in this revision

Viewing changes to test/published/Web/web3.cloog

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2013-01-13 04:29:53 UTC
  • mfrom: (3.1.3 sid)
  • Revision ID: package-import@ubuntu.com-20130113042953-yffow2nvsub33dcd
New upstream version.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# CLooG example file #3.
 
2
# Please read the first example which is fully documented to understand the
 
3
# different parts of this input file.
 
4
#
 
5
################################################################################
 
6
# The problem here is to generate the scanning code for the integral points    #
 
7
# inside two different 2-dimensional polyhedra (geometrically two rectangles). #
 
8
#                                      |                                       #
 
9
#                j^                    |                                       #
 
10
#                 | (P1)i>=2           |        for (i=2;i<=p-1;i++)           #
 
11
#  Context:       | | (P2)i>=m         |        | for (j=2;j<=n;j++)           #
 
12
#  m>n>p>2        | | | (P1)i<=n       |        | | S1 ;                       #
 
13
#                 | | | | (P2)i<=p     |                                       #
 
14
#  P1 System:     | | | | |            |        for (i=p;i<=n;i++)             #
 
15
#  2<=i<=n      m-+-+-@@@@@--(P2)j<=p  |        | for (j=2;j<=p-1;j++)         #
 
16
#  2<=j<=n        | | @@@@@           ==>       | | S1 ;                       #
 
17
#               n-+-**###@@--(P1)j<=n  |        | for (j=p;j<=n;j++)           #
 
18
#  P2 System:     | **###@@            |        | | S1 ;                       #
 
19
#  p<=i<=m      p-+-**###@@--(P2)j>=m  |        | | S2 ;                       #
 
20
#  p<=j<=m        | ***** |            |        | for (j=n+1;j<=m;j++)         #
 
21
#               2-+-*****-+--(P1)j>=2  |        | | S2 ;                       #
 
22
#  *:P1 alone     | | | | |            |                                       #
 
23
#  @:P2 alone   0-+-+-+-+-+-->i        |        for (i=n+1;i<=m;i++)           #
 
24
#  #:P1 and P2    | | | | |            |        | for (j=p;j<=m;j++)           #
 
25
#                 0 2 p n m            |        | | S2 ;                       #
 
26
#                                      |                                       #
 
27
################################################################################
 
28
 
 
29
# 1. Language: C
 
30
c
 
31
 
 
32
# 2. Parameters {m,n,p | m>n>p>2}
 
33
3 5           # 3 rows and 5 columns
 
34
#  m  n  p  1
 
35
1  0  0  1 -3 # p>=3   (i.e. p>2)
 
36
1  0  1 -1 -1 # n>=p+1 (i.e. n>p)
 
37
1  1 -1  0 -1 # m>=n+1 (i.e. m>n)
 
38
 
 
39
# 3. We set manually the parameter name: m, n and p
 
40
1
 
41
m n p
 
42
 
 
43
# 4. Number of polyhedra:
 
44
2
 
45
 
 
46
# 5. The polyhedron description:
 
47
#    - the first one
 
48
1
 
49
# {i, j | 2<=i<=n 2<=j<=n}
 
50
4 7                       # 4 rows, 7 columns
 
51
#   i   j   m   n   p   1
 
52
1   1   0   0   0   0  -2 # i>=2
 
53
1  -1   0   0   1   0   0 # i<=n
 
54
1   0   1   0   0   0  -2 # j>=2
 
55
1   0  -1   0   1   0   0 # j<=n
 
56
0   0   0                 # 3 zeroes !
 
57
 
 
58
#    - the second one
 
59
1
 
60
# {j, j | p<=i<=m p<=j<=m}
 
61
4 7                       # 4 rows, 7 columns
 
62
#   i   j   m   n   p   1
 
63
1   1   0   0   0  -1   0 # i>=p
 
64
1  -1   0   1   0   0   0 # i<=m
 
65
1   0   1   0   0  -1   0 # j>=p
 
66
1   0  -1   1   0   0   0 # j<=m
 
67
0   0   0                 # 3 zeroes !
 
68
 
 
69
# 6. We let CLooG choose the iterator names
 
70
0
 
71
 
 
72
# 7. Let CLoog scan the polyhedra in the way it wants.
 
73
0