cpp: void init_array (int n,\nDATA_TYPE *alpha,\nDATA_TYPE *beta,\nDATA_TYPE POLYBENCH_2D(A,N,N,n,n),\nDATA_TYPE POLYBENCH_1D(u1,N,n),\nDATA_TYPE POLYBENCH_1D(v1,N,n),\nDATA_TYPE POLYBENCH_1D(u2,N,n),\nDATA_TYPE POLYBENCH_1D(v2,N,n),\nDATA_TYPE POLYBENCH_1D(w,N,n),\nDATA_TYPE POLYBENCH_1D(x,N,n),\nDATA_TYPE POLYBENCH_1D(y,N,n),\nDATA_TYPE POLYBENCH_1D(z,N,n))\n{\nint i, j;\n\n*alpha = 43532;\n*beta = 12313;\n\nfor (i = 0; i < n; i++)\n{\nu1[i] = i;\nu2[i] = (i+1)/n/2.0;\nv1[i] = (i+1)/n/4.0;\nv2[i] = (i+1)/n/6.0;\ny[i] = (i+1)/n/8.0;\nz[i] = (i+1)/n/9.0;\nx[i] = 0.0;\nw[i] = 0.0;\nfor (j = 0; j < n; j++)\nA[i][j] = ((DATA_TYPE) i*j) / n;\n}\n}
fortran: subroutine init_array(n, alpha, beta,  &\na, u1, u2, v1, v2, w, x, y, z)\nimplicit none\n\nDATA_TYPE, dimension(n, n) :: a\nDATA_TYPE, dimension(n) :: u1\nDATA_TYPE, dimension(n) :: u2\nDATA_TYPE, dimension(n) :: v1\nDATA_TYPE, dimension(n) :: v2\nDATA_TYPE, dimension(n) :: w\nDATA_TYPE, dimension(n) :: x\nDATA_TYPE, dimension(n) :: y\nDATA_TYPE, dimension(n) :: z\nDATA_TYPE :: alpha, beta\ninteger :: n\ninteger :: i, j\nalpha = 43532.0D0\nbeta = 12313.0D0\n\ndo i = 1, n\nu1(i) = DBLE(i - 1)\nu2(i) = DBLE(i / n) / 2.0D0\nv1(i) = DBLE(i / n) / 4.0D0\nv2(i) = DBLE(i / n) / 6.0D0\ny(i) = DBLE(i / n) / 8.0D0\nz(i) = DBLE(i / n) / 9.0D0\nx(i) = 0.0D0\nw(i) = 0.0D0\ndo j = 1, n\na(j, i) = ((DBLE(i - 1) * DBLE(j - 1))) / DBLE(n)\nend do\nend do\nend subroutine