12void ludcmp(
double **a,
int n,
int *index,
double *d) {
21#pragma omp parallel for private(j, big)
23 for (i = 1; i <= n; i++) {
25 for (j = 1; j <= n; j++)
26 if (fabs(a[i][j]) > big) big = fabs(a[i][j]);
27 if (big == 0.0)
nrerror(
"Singular matrix in routine LUDCMP");
31 for (j = 1; j <= n; j++)
33 for (i = 1; i < j; i++) {
36#pragma omp parallel for private(k) reduction(- : sum)
38 for (k = 1; k < i; k++)
39 sum = sum - a[i][k] * a[k][j];
44 for (i = j; i <= n; i++) {
47#pragma omp parallel for private(k) reduction(- : sum)
49 for (k = 1; k < j; k++)
50 sum = sum - a[i][k] * a[k][j];
53 dum = vv[i] * fabs(sum);
62#pragma omp parallel for private(k, dum)
64 for (k = 1; k <= n; k++) {
81#pragma omp parallel for private(i)
83 for (i = j + 1; i <= n; i++) a[i][j] = a[i][j] * dum;
90void lubksb(
double **a,
int n,
int *index,
double *b) {
94 for (i = 1; i <= n; i++)
101#pragma omp parallel for private(j) reduction(- : sum)
103 for (j = ii; j <= i; j++) sum = sum - a[i][j] * b[j];
109 for (i = n; i >= 1; i--)
113#pragma omp parallel for private(j) reduction(- : sum)
115 for (j = i + 1; j <= n; j++) sum = sum - a[i][j] * b[j];
116 b[i] = sum / a[i][i];
void lubksb(double **a, int n, int *index, double *b)
void ludcmp(double **a, int n, int *index, double *d)
void free_dvector(double *v, long nl, long)
double * dvector(long nl, long nh)