#include int metrop(de,t) float de,t; { float ran3(); static long gljdum=1; return de < 0.0 || ran3(&gljdum) < exp(-…
Numerical+Recipe 源代码
汇集 Numerical+Recipe 相关的电路原理图、PCB工程文件、单片机/FPGA源代码、数据手册与应用设计方案。
float erff(x) float x; { float gammp(); return x < 0.0 ? -gammp(0.5,x*x) : gammp(0.5,x*x); } /* (C) Copr. 1986-92 Numeri…
void slvsml(u,rhs) double **rhs,**u; { void fill0(); double h=0.5; fill0(u,3); u[2][2] = -h*h*rhs[2][2]/4.0; } /* (C…
float factln(n) int n; { float gammln(); void nrerror(); static float a[101]; if (n < 0) nrerror("Negative factorial i…
void lop(out,u,n) double **out,**u; int n; { int i,j; double h,h2i; h=1.0/(n-1); h2i=1.0/(h*h); for (j=2;j
void fill0(u,n) double **u; int n; { int i,j; for (j=1;j
extern unsigned long ija[]; extern double sa[]; void asolve(n,b,x,itrnsp) double b[],x[]; int itrnsp; unsigned long n; { …
extern unsigned long ija[]; extern double sa[]; void atimes(n,x,r,itrnsp) double r[],x[]; int itrnsp; unsigned long n; { …
void piksrt(n,arr) float arr[]; int n; { int i,j; float a; for (j=2;j 0 && arr[i] > a) { arr[i+1]=arr[i]; i--; …
#include #include "nrutil.h" float elle(phi,ak) float ak,phi; { float rd(),rf(); float cc,q,s; s=sin(phi); cc=SQR…