17 int G_ludcmp(
double **a,
int n,
int *indx,
double *d)
19 int i, imax = 0, j, k;
20 double big, dum, sum, temp;
22 int is_singular =
FALSE;
29 for (i = 0; i < n; i++) {
31 for (j = 0; j < n; j++)
32 if ((temp = fabs(a[i][j])) > big)
47 for (j = 0; j < n; j++) {
48 for (i = 0; i < j; i++) {
50 for (k = 0; k < i; k++)
51 sum -= a[i][k] * a[k][j];
57 #pragma omp parallel for private(i, k, sum, dum) shared(j, n, a, vv, big, imax)
58 for (i = j; i < n; i++) {
60 for (k = 0; k < j; k++)
61 sum -= a[i][k] * a[k][j];
63 if ((dum = vv[i] * fabs(sum)) >= big) {
69 for (k = 0; k < n; k++) {
81 dum = 1.0 / (a[j][j]);
82 for (i = j + 1; i < n; i++)
109 for (i = 0; i < n; i++) {
114 for (j = ii; j < i; j++)
115 sum -= a[i][j] *
b[j];
120 for (i = n - 1; i >= 0; i--) {
122 for (j = i + 1; j < n; j++)
123 sum -= a[i][j] *
b[j];
124 b[i] = sum / a[i][i];
double * G_alloc_vector(size_t)
Vector matrix memory allocation.
void G_free_vector(double *)
Vector memory deallocation.
int G_ludcmp(double **a, int n, int *indx, double *d)
LU decomposition.
void G_lubksb(double **a, int n, int *indx, double b[])
LU backward substitution.