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

15
lib/nr/ansi/recipes/lop.c Normal file
View File

@@ -0,0 +1,15 @@
void lop(double **out, double **u, int n)
{
int i,j;
double h,h2i;
h=1.0/(n-1);
h2i=1.0/(h*h);
for (j=2;j<n;j++)
for (i=2;i<n;i++)
out[i][j]=h2i*(u[i+1][j]+u[i-1][j]+u[i][j+1]+u[i][j-1]-
4.0*u[i][j])+u[i][j]*u[i][j];
for (i=1;i<=n;i++)
out[i][1]=out[i][n]=out[1][i]=out[n][i]=0.0;
}