add numerical recipes library

This commit is contained in:
2025-09-12 18:55:25 +09:00
parent d4dff245bd
commit 2c75620ec9
1344 changed files with 63869 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
#include "nr.h"
void NR::banbks(Mat_I_DP &a, const int m1, const int m2, Mat_I_DP &al,
Vec_I_INT &indx, Vec_IO_DP &b)
{
int i,j,k,l,mm;
DP dum;
int n=a.nrows();
mm=m1+m2+1;
l=m1;
for (k=0;k<n;k++) {
j=indx[k]-1;
if (j!=k) SWAP(b[k],b[j]);
if (l<n) l++;
for (j=k+1;j<l;j++) b[j] -= al[k][j-k-1]*b[k];
}
l=1;
for (i=n-1;i>=0;i--) {
dum=b[i];
for (k=1;k<l;k++) dum -= a[i][k]*b[k+i];
b[i]=dum/a[i][0];
if (l<mm) l++;
}
}