Canoe
Comprehensive Atmosphere N' Ocean Engine
lubksb.c
Go to the documentation of this file.
1 
14 void lubksb(double **a, int n, int *indx, double *b) {
15  int i, ii = 0, ip, j;
16  double sum;
17 
18  for (i = 0; i < n; i++) {
19  ip = indx[i];
20  sum = b[ip];
21  b[ip] = b[i];
22  if (ii)
23  for (j = ii - 1; j < i; j++) sum -= a[i][j] * b[j];
24  else if (sum)
25  ii = i + 1;
26  b[i] = sum;
27  }
28  for (i = n - 1; i >= 0; i--) {
29  sum = b[i];
30  for (j = i + 1; j < n; j++) sum -= a[i][j] * b[j];
31  b[i] = sum / a[i][i];
32  }
33 }
void lubksb(double **a, int n, int *indx, double *b)
Definition: lubksb.c:14