source:
Sophya/trunk/ArchTOIPipe/Processors/dlubksb.c@
3748
| Last change on this file since 3748 was 1944, checked in by , 24 years ago | |
|---|---|
| File size: 348 bytes | |
| Line | |
|---|---|
| 1 | void dlubksb(double **a, int n, int *indx, double b[]) |
| 2 | { |
| 3 | int i,ii=0,ip,j; |
| 4 | double sum; |
| 5 | |
| 6 | for (i=1;i<=n;i++) { |
| 7 | ip=indx[i]; |
| 8 | sum=b[ip]; |
| 9 | b[ip]=b[i]; |
| 10 | if (ii) |
| 11 | for (j=ii;j<=i-1;j++) sum -= a[i][j]*b[j]; |
| 12 | else if (sum) ii=i; |
| 13 | b[i]=sum; |
| 14 | } |
| 15 | for (i=n;i>=1;i--) { |
| 16 | sum=b[i]; |
| 17 | for (j=i+1;j<=n;j++) sum -= a[i][j]*b[j]; |
| 18 | b[i]=sum/a[i][i]; |
| 19 | } |
| 20 | } |
Note:
See TracBrowser
for help on using the repository browser.
![(please configure the [header_logo] section in trac.ini)](/PI/chrome/site/your_project_logo.png)