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::chebpc(Vec_I_DP &c, Vec_O_DP &d)
{
int k,j;
DP sv;
int n=c.size();
Vec_DP dd(n);
for (j=0;j<n;j++) d[j]=dd[j]=0.0;
d[0]=c[n-1];
for (j=n-2;j>0;j--) {
for (k=n-j;k>0;k--) {
sv=d[k];
d[k]=2.0*d[k-1]-dd[k];
dd[k]=sv;
}
sv=d[0];
d[0] = -dd[0]+c[j];
dd[0]=sv;
}
for (j=n-1;j>0;j--)
d[j]=d[j-1]-dd[j];
d[0] = -dd[0]+0.5*c[0];
}