18 int G_ludcmp(
double **a,
int n,
int *indx,
double *d)
20 int i, imax = 0, j, k;
21 double big, dum, sum, temp;
23 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++)
110 for (i = 0; i < n; i++) {
115 for (j = ii; j < i; j++)
116 sum -= a[i][j] * b[j];
121 for (i = n - 1; i >= 0; i--) {
123 for (j = i + 1; j < n; j++)
124 sum -= a[i][j] * b[j];
125 b[i] = sum / a[i][i];
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.
double * G_alloc_vector(size_t)
Vector matrix memory allocation.