cpp: void kernel_ludcmp(int n,\nDATA_TYPE POLYBENCH_2D(A,N+1,N+1,n+1,n+1),\nDATA_TYPE POLYBENCH_1D(b,N+1,n+1),\nDATA_TYPE POLYBENCH_1D(x,N+1,n+1),\nDATA_TYPE POLYBENCH_1D(y,N+1,n+1))\n{\nint i, j, k;\n\nDATA_TYPE w;\n\n#pragma scop\nb[0] = 1.0;\nfor (i = 0; i < _PB_N; i++)\n{\nfor (j = i+1; j <= _PB_N; j++)\n{\nw = A[j][i];\nfor (k = 0; k < i; k++)\nw = w- A[j][k] * A[k][i];\nA[j][i] = w / A[i][i];\n}\nfor (j = i+1; j <= _PB_N; j++)\n{\nw = A[i+1][j];\nfor (k = 0; k <= i; k++)\nw = w  - A[i+1][k] * A[k][j];\nA[i+1][j] = w;\n}\n}\ny[0] = b[0];\nfor (i = 1; i <= _PB_N; i++)\n{\nw = b[i];\nfor (j = 0; j < i; j++)\nw = w - A[i][j] * y[j];\ny[i] = w;\n}\nx[_PB_N] = y[_PB_N] / A[_PB_N][_PB_N];\nfor (i = 0; i <= _PB_N - 1; i++)\n{\nw = y[_PB_N - 1 - (i)];\nfor (j = _PB_N - i; j <= _PB_N; j++)\nw = w - A[_PB_N - 1 - i][j] * x[j];\nx[_PB_N - 1 - i] = w / A[_PB_N - 1 - (i)][_PB_N - 1-(i)];\n}\n#pragma endscop\n\n}
fortran: subroutine kernel_ludcmp(n, a, b, x, y)\nimplicit none\n\nDATA_TYPE, dimension(n + 1, n + 1) :: a\nDATA_TYPE, dimension(n + 1) :: x\nDATA_TYPE, dimension(n + 1) :: b\nDATA_TYPE, dimension(n + 1) :: y\nDATA_TYPE :: w\ninteger :: n\ninteger :: i, j, k\n\n!$pragma scop\nb(1) = 1.0D0\ndo i = 1, _PB_N\ndo j = i + 1, _PB_N + 1\nw = a(i, j)\ndo k = 1, i - 1\nw = w - (a(k, j) * a(i, k))\nend do\na(i, j) = w / a(i, i)\nend do\ndo j = i + 1, _PB_N + 1\nw = a(j, i + 1)\ndo k = 1, i\nw = w - (a(k, i + 1) * a(j, k))\nend do\na(j, i + 1) = w\nend do\nend do\ny(1) = b(1)\ndo i = 2, _PB_N + 1\nw = b(i)\ndo j = 1, i - 1\nw = w - (a(j, i) * y(j))\nend do\ny(i) = w\nend do\nx(_PB_N + 1) = y(_PB_N + 1) / a(_PB_N + 1, _PB_N + 1)\ndo i = 1, _PB_N\nw = y(_PB_N + 1 - i)\ndo j = _PB_N + 2 - i, _PB_N + 1\nw = w - (a(j, _PB_N + 1 - i) * x(j))\nend do\nx(_PB_N + 1 - i) = w / a(_PB_N + 1 - i, _PB_N + 1 - i)\nend do\n!$pragma endscop\nend subroutine