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,24 @@
#include <cmath>
#include "nr.h"
using namespace std;
DP x;
void NR::quadmx(Mat_O_DP &a)
{
const DP PI=3.14159263589793238;
int j,k;
DP h,xx,cx;
int n=a.nrows();
Vec_DP wt(n);
h=PI/(n-1);
for (j=0;j<n;j++) {
x=xx=j*h;
wwghts(wt,h,kermom);
cx=cos(xx);
for (k=0;k<n;k++)
a[j][k]=wt[k]*cx*cos(k*h);
++a[j][j];
}
}