3 #include <grass/gmath.h>
9 int G_ludcmp(
double **a,
int n,
int *indx,
double *d)
11 int i, imax = 0, j, k;
12 double big, dum, sum, temp;
17 for (i = 0; i <
n; i++) {
19 for (j = 0; j <
n; j++)
20 if ((temp = fabs(a[i][j])) > big)
28 for (j = 0; j <
n; j++) {
29 for (i = 0; i < j; i++) {
31 for (k = 0; k < i; k++)
32 sum -= a[i][k] * a[k][j];
36 for (i = j; i <
n; i++) {
38 for (k = 0; k < j; k++)
39 sum -= a[i][k] * a[k][j];
41 if ((dum = vv[i] * fabs(sum)) >= big) {
47 for (k = 0; k <
n; k++) {
59 dum = 1.0 / (a[j][j]);
60 for (i = j + 1; i <
n; i++)
77 for (i = 0; i <
n; i++) {
82 for (j = ii; j < i; j++)
83 sum -= a[i][j] * b[j];
88 for (i = n - 1; i >= 0; i--) {
90 for (j = i + 1; j <
n; j++)
91 sum -= a[i][j] * b[j];
int G_ludcmp(double **a, int n, int *indx, double *d)
void G_lubksb(double **a, int n, int *indx, double b[])
void G_free_vector(double *v)
Vector memory deallocation.
double * G_alloc_vector(size_t n)
Vector matrix memory allocation.