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,18 @@
#include "nr.h"
void NR::mprove(Mat_I_DP &a, Mat_I_DP &alud, Vec_I_INT &indx, Vec_I_DP &b,
Vec_IO_DP &x)
{
int i,j;
int n=x.size();
Vec_DP r(n);
for (i=0;i<n;i++) {
long double sdp = -b[i];
for (j=0;j<n;j++)
sdp += (long double) a[i][j]*(long double) x[j];
r[i]=sdp;
}
lubksb(alud,indx,r);
for (i=0;i<n;i++) x[i] -= r[i];
}