14 int ludcmp(
double **
a,
int n,
int *indx) {
16 double big, dum, sum,
temp;
17 double *vv = (
double *)malloc(n *
sizeof(
double));
20 for (i = 0; i < n; i++) {
22 for (
j = 0;
j < n;
j++)
25 fprintf(stderr,
"Singular matrix in routine ludcmp");
30 for (
j = 0;
j < n;
j++) {
31 for (i = 0; i <
j; i++) {
33 for (k = 0; k < i; k++) sum -=
a[i][k] *
a[k][
j];
37 for (i =
j; i < n; i++) {
39 for (k = 0; k <
j; k++) sum -=
a[i][k] *
a[k][
j];
41 if ((dum = vv[i] * fabs(sum)) >= big) {
47 for (k = 0; k < n; k++) {
57 dum = (1.0 /
a[
j][
j]);
58 for (i =
j + 1; i < n; i++)
a[i][
j] *= dum;
int ludcmp(double **a, int n, int *indx)