shoot.c

来自「Numerical Recipes Software 提供的算法子程序集」· C语言 代码 · 共 28 行

C
28
字号
#include "nrutil.h"
#define EPS 1.0e-6

extern int nvar;
extern float x1,x2;

int kmax,kount;
float *xp,**yp,dxsav;

void shoot(n,v,f)
float f[],v[];
int n;
{
	void derivs(),load(),odeint(),rkqs(),score();
	int nbad,nok;
	float h1,hmin=0.0,*y;

	y=vector(1,nvar);
	kmax=0;
	h1=(x2-x1)/100.0;
	load(x1,v,y);
	odeint(y,nvar,x1,x2,EPS,h1,hmin,&nok,&nbad,derivs,rkqs);
	score(x2,y,f);
	free_vector(y,1,nvar);
}
#undef EPS
/* (C) Copr. 1986-92 Numerical Recipes Software . */

⌨️ 快捷键说明

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