2 int ludcmp(
double a[N][N],
int indx[N],
double vv[N]) {
4 double big, dum, sum,
temp;
7 for (i = 0; i < N; i++) {
9 for (
j = 0;
j < N;
j++)
12 fprintf(stderr,
"Singular matrix in routine ludcmp");
17 for (
j = 0;
j < N;
j++) {
18 for (i = 0; i <
j; i++) {
20 for (k = 0; k < i; k++) sum -=
a[i][k] *
a[k][
j];
24 for (i =
j; i < N; i++) {
26 for (k = 0; k <
j; k++) sum -=
a[i][k] *
a[k][
j];
28 if ((dum = vv[i] * fabs(sum)) >= big) {
34 for (k = 0; k < N; k++) {
44 dum = (1.0 /
a[
j][
j]);
45 for (i =
j + 1; i < N; i++)
a[i][
j] *= dum;
53 void lubksb(
double a[N][N],
int indx[N],
double b[N]) {
57 for (i = 0; i < N; i++) {
62 for (
j = ii - 1;
j < i;
j++) sum -=
a[i][
j] *
b[
j];
67 for (i = N - 1; i >= 0; i--) {
69 for (
j = i + 1;
j < N;
j++) sum -=
a[i][
j] *
b[
j];
int ludcmp(double a[N][N], int indx[N], double vv[N])
void lubksb(double a[N][N], int indx[N], double b[N])