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,17 @@
#include "nr.h"
void NR::cholsl(Mat_I_DP &a, Vec_I_DP &p, Vec_I_DP &b, Vec_O_DP &x)
{
int i,k;
DP sum;
int n=a.nrows();
for (i=0;i<n;i++) {
for (sum=b[i],k=i-1;k>=0;k--) sum -= a[i][k]*x[k];
x[i]=sum/p[i];
}
for (i=n-1;i>=0;i--) {
for (sum=x[i],k=i+1;k<n;k++) sum -= a[k][i]*x[k];
x[i]=sum/p[i];
}
}