⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 spread.c

📁 适合大型数值计算代码 现在网络上已经找不到了 购买需要20$
💻 C
字号:
#define NRANSI#include "nrutil.h"void spread(float y, float yy[], unsigned long n, float x, int m){	int ihi,ilo,ix,j,nden;	static int nfac[11]={0,1,1,2,6,24,120,720,5040,40320,362880};	float fac;	if (m > 10) nrerror("factorial table too small in spread");	ix=(int)x;	if (x == (float)ix) yy[ix] += y;	else {		ilo=LMIN(LMAX((long)(x-0.5*m+1.0),1),n-m+1);		ihi=ilo+m-1;		nden=nfac[m];		fac=x-ilo;		for (j=ilo+1;j<=ihi;j++) fac *= (x-j);		yy[ihi] += y*fac/(nden*(x-ihi));		for (j=ihi-1;j>=ilo;j--) {			nden=(nden/(j+1-ilo))*(j-ihi);			yy[j] += y*fac/(nden*(x-j));		}	}}#undef NRANSI

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -