CLooG 0.18.4
[cloog.git] / test / cholesky2.good.c
blobee4b344bb1fa918c663dcf71aba920ac42c6d07f
1 /* Generated from ../../../git/cloog/test/cholesky2.cloog by CLooG 0.14.0-72-gefe2fc2 gmp bits in 0.11s. */
2 extern void hash(int);
4 /* Useful macros. */
5 #define floord(n,d) (((n)<0) ? -((-(n)+(d)-1)/(d)) : (n)/(d))
6 #define ceild(n,d) (((n)<0) ? -((-(n))/(d)) : ((n)+(d)-1)/(d))
7 #define max(x,y) ((x) > (y) ? (x) : (y))
8 #define min(x,y) ((x) < (y) ? (x) : (y))
10 #define S1(i) { hash(1); hash(i); }
11 #define S2(i,j) { hash(2); hash(i); hash(j); }
12 #define S3(i) { hash(3); hash(i); }
13 #define S4(i,j) { hash(4); hash(i); hash(j); }
14 #define S5(i,j,k) { hash(5); hash(i); hash(j); hash(k); }
15 #define S6(i,j) { hash(6); hash(i); hash(j); }
17 void test(int M)
19 /* Scattering iterators. */
20 int c1, c2, c3;
21 /* Original iterators. */
22 int i, j, k;
23 if (M >= 2) {
24 for (c2=1;c2<=M-1;c2++) {
25 S1(c2) ;
26 for (c3=c2+1;c3<=M;c3++) {
27 S4(c2,c3) ;
30 S1(M) ;
32 if (M == 1) {
33 S1(1) ;
35 if (M >= 2) {
36 S3(1) ;
38 if (M >= 3) {
39 S6(1,2) ;
40 for (c2=3;c2<=M;c2++) {
41 S6(1,c2) ;
42 for (i=2;i<=c2-1;i++) {
43 S5(i,c2,1) ;
47 if (M == 2) {
48 S6(1,2) ;
50 for (c1=3;c1<=3*M-7;c1++) {
51 if ((c1+2)%3 == 0) {
52 i = (c1+2)/3 ;
53 S3((c1+2)/3) ;
55 if (c1%3 == 0) {
56 c2 = (c1+3)/3 ;
57 i = (c1+3)/3 ;
58 S2((c1+3)/3,c1/3) ;
60 c2 = floord(c1+6,3) ;
61 if ((c1+1)%3 == 0) {
62 i = (c1+1)/3 ;
63 S6((c1+1)/3,c2) ;
65 if (c1%3 == 0) {
66 S2(c2,c1/3) ;
68 for (c2=ceild(c1+7,3);c2<=M;c2++) {
69 if ((c1+1)%3 == 0) {
70 i = (c1+1)/3 ;
71 S6((c1+1)/3,c2) ;
73 if (c1%3 == 0) {
74 S2(c2,c1/3) ;
76 if ((c1+1)%3 == 0) {
77 c3 = (c1+1)/3 ;
78 for (i=ceild(c1+4,3);i<=c2-1;i++) {
79 k = (c1+1)/3 ;
80 S5(i,c2,(c1+1)/3) ;
85 for (c1=max(3*M-6,3);c1<=3*M-4;c1++) {
86 if ((c1+2)%3 == 0) {
87 i = (c1+2)/3 ;
88 S3((c1+2)/3) ;
90 if (c1%3 == 0) {
91 c2 = (c1+3)/3 ;
92 i = (c1+3)/3 ;
93 S2((c1+3)/3,c1/3) ;
95 for (c2=ceild(c1+4,3);c2<=M;c2++) {
96 if ((c1+1)%3 == 0) {
97 i = (c1+1)/3 ;
98 S6((c1+1)/3,c2) ;
100 if (c1%3 == 0) {
101 S2(c2,c1/3) ;
105 if (M >= 2) {
106 c1 = 3*M-3 ;
107 j = M-1 ;
108 S2(M,M-1) ;
110 if (M >= 1) {
111 c1 = 3*M-2 ;
112 S3(M) ;