c21-1 (779629), страница 4
Текст из файла (страница 4)
Further reproduction, or any copying of machinereadable files (including this one) to any servercomputer, is strictly prohibited. To order Numerical Recipes books,diskettes, or CDROMsvisit website http://www.nr.com or call 1-800-872-7423 (North America only),or send email to trade@cup.cam.ac.uk (outside North America).float rf(float x, float y, float z);float rj(float x, float y, float z, float p);void rk4(float y[], float dydx[], int n, float x, float h, float yout[],void (*derivs)(float, float [], float []));void rkck(float y[], float dydx[], int n, float x, float h,float yout[], float yerr[], void (*derivs)(float, float [], float []));void rkdumb(float vstart[], int nvar, float x1, float x2, int nstep,void (*derivs)(float, float [], float []));void rkqs(float y[], float dydx[], int n, float *x,float htry, float eps, float yscal[], float *hdid, float *hnext,void (*derivs)(float, float [], float []));void rlft3(float ***data, float **speq, unsigned long nn1,unsigned long nn2, unsigned long nn3, int isign);float rofunc(float b);void rotate(float **r, float **qt, int n, int i, float a, float b);void rsolv(float **a, int n, float d[], float b[]);void rstrct(double **uc, double **uf, int nc);float rtbis(float (*func)(float), float x1, float x2, float xacc);float rtflsp(float (*func)(float), float x1, float x2, float xacc);float rtnewt(void (*funcd)(float, float *, float *), float x1, float x2,float xacc);float rtsafe(void (*funcd)(float, float *, float *), float x1, float x2,float xacc);float rtsec(float (*func)(float), float x1, float x2, float xacc);void rzextr(int iest, float xest, float yest[], float yz[], float dy[], int nv);void savgol(float c[], int np, int nl, int nr, int ld, int m);void score(float xf, float y[], float f[]);void scrsho(float (*fx)(float));float select(unsigned long k, unsigned long n, float arr[]);float selip(unsigned long k, unsigned long n, float arr[]);void shell(unsigned long n, float a[]);void shoot(int n, float v[], float f[]);void shootf(int n, float v[], float f[]);void simp1(float **a, int mm, int ll[], int nll, int iabf, int *kp,float *bmax);void simp2(float **a, int m, int n, int *ip, int kp);void simp3(float **a, int i1, int k1, int ip, int kp);void simplx(float **a, int m, int n, int m1, int m2, int m3, int *icase,int izrov[], int iposv[]);void simpr(float y[], float dydx[], float dfdx[], float **dfdy,int n, float xs, float htot, int nstep, float yout[],void (*derivs)(float, float [], float []));void sinft(float y[], int n);void slvsm2(double **u, double **rhs);void slvsml(double **u, double **rhs);void sncndn(float uu, float emmc, float *sn, float *cn, float *dn);double snrm(unsigned long n, double sx[], int itol);void sobseq(int *n, float x[]);void solvde(int itmax, float conv, float slowc, float scalv[],int indexv[], int ne, int nb, int m, float **y, float ***c, float **s);void sor(double **a, double **b, double **c, double **d, double **e,double **f, double **u, int jmax, double rjac);void sort(unsigned long n, float arr[]);void sort2(unsigned long n, float arr[], float brr[]);void sort3(unsigned long n, float ra[], float rb[], float rc[]);void spctrm(FILE *fp, float p[], int m, int k, int ovrlap);void spear(float data1[], float data2[], unsigned long n, float *d, float *zd,float *probd, float *rs, float *probrs);void sphbes(int n, float x, float *sj, float *sy, float *sjp, float *syp);void splie2(float x1a[], float x2a[], float **ya, int m, int n, float **y2a);void splin2(float x1a[], float x2a[], float **ya, float **y2a, int m, int n,float x1, float x2, float *y);void spline(float x[], float y[], int n, float yp1, float ypn, float y2[]);void splint(float xa[], float ya[], float y2a[], int n, float x, float *y);938Appendix A#else /* ANSI */Sample page from NUMERICAL RECIPES IN C: THE ART OF SCIENTIFIC COMPUTING (ISBN 0-521-43108-5)Copyright (C) 1988-1992 by Cambridge University Press.Programs Copyright (C) 1988-1992 by Numerical Recipes Software.Permission is granted for internet users to make one paper copy for their own personal use.
Further reproduction, or any copying of machinereadable files (including this one) to any servercomputer, is strictly prohibited. To order Numerical Recipes books,diskettes, or CDROMsvisit website http://www.nr.com or call 1-800-872-7423 (North America only),or send email to trade@cup.cam.ac.uk (outside North America).void spread(float y, float yy[], unsigned long n, float x, int m);void sprsax(float sa[], unsigned long ija[], float x[], float b[],unsigned long n);void sprsin(float **a, int n, float thresh, unsigned long nmax, float sa[],unsigned long ija[]);void sprspm(float sa[], unsigned long ija[], float sb[], unsigned long ijb[],float sc[], unsigned long ijc[]);void sprstm(float sa[], unsigned long ija[], float sb[], unsigned long ijb[],float thresh, unsigned long nmax, float sc[], unsigned long ijc[]);void sprstp(float sa[], unsigned long ija[], float sb[], unsigned long ijb[]);void sprstx(float sa[], unsigned long ija[], float x[], float b[],unsigned long n);void stifbs(float y[], float dydx[], int nv, float *xx,float htry, float eps, float yscal[], float *hdid, float *hnext,void (*derivs)(float, float [], float []));void stiff(float y[], float dydx[], int n, float *x,float htry, float eps, float yscal[], float *hdid, float *hnext,void (*derivs)(float, float [], float []));void stoerm(float y[], float d2y[], int nv, float xs,float htot, int nstep, float yout[],void (*derivs)(float, float [], float []));void svbksb(float **u, float w[], float **v, int m, int n, float b[],float x[]);void svdcmp(float **a, int m, int n, float w[], float **v);void svdfit(float x[], float y[], float sig[], int ndata, float a[],int ma, float **u, float **v, float w[], float *chisq,void (*funcs)(float, float [], int));void svdvar(float **v, int ma, float w[], float **cvm);void toeplz(float r[], float x[], float y[], int n);void tptest(float data1[], float data2[], unsigned long n, float *t, float *prob);void tqli(float d[], float e[], int n, float **z);float trapzd(float (*func)(float), float a, float b, int n);void tred2(float **a, int n, float d[], float e[]);void tridag(float a[], float b[], float c[], float r[], float u[],unsigned long n);float trncst(float x[], float y[], int iorder[], int ncity, int n[]);void trnspt(int iorder[], int ncity, int n[]);void ttest(float data1[], unsigned long n1, float data2[], unsigned long n2,float *t, float *prob);void tutest(float data1[], unsigned long n1, float data2[], unsigned long n2,float *t, float *prob);void twofft(float data1[], float data2[], float fft1[], float fft2[],unsigned long n);void vander(double x[], double w[], double q[], int n);void vegas(float regn[], int ndim, float (*fxn)(float [], float), int init,unsigned long ncall, int itmx, int nprn, float *tgral, float *sd,float *chi2a);void voltra(int n, int m, float t0, float h, float *t, float **f,float (*g)(int, float), float (*ak)(int, int, float, float));void wt1(float a[], unsigned long n, int isign,void (*wtstep)(float [], unsigned long, int));void wtn(float a[], unsigned long nn[], int ndim, int isign,void (*wtstep)(float [], unsigned long, int));void wwghts(float wghts[], int n, float h,void (*kermom)(double [], double ,int));int zbrac(float (*func)(float), float *x1, float *x2);void zbrak(float (*fx)(float), float x1, float x2, int n, float xb1[],float xb2[], int *nb);float zbrent(float (*func)(float), float x1, float x2, float tol);void zrhqr(float a[], int m, float rtr[], float rti[]);float zriddr(float (*func)(float), float x1, float x2, float xacc);void zroots(fcomplex a[], int m, fcomplex roots[], int polish);Sample page from NUMERICAL RECIPES IN C: THE ART OF SCIENTIFIC COMPUTING (ISBN 0-521-43108-5)Copyright (C) 1988-1992 by Cambridge University Press.Programs Copyright (C) 1988-1992 by Numerical Recipes Software.Permission is granted for internet users to make one paper copy for their own personal use.
Further reproduction, or any copying of machinereadable files (including this one) to any servercomputer, is strictly prohibited. To order Numerical Recipes books,diskettes, or CDROMsvisit website http://www.nr.com or call 1-800-872-7423 (North America only),or send email to trade@cup.cam.ac.uk (outside North America).#endif /* _NR_H_ */939Table of Prototype Declarations (nr.h)/* traditional - K&R */void addint();void airy();Rest of traditional declarations are here on the diskette.#endif /* ANSI */Utility RoutinesNon-Copyright Notice: This Appendix and its utility routines are herewithplaced into the public domain. Anyone may copy them freely for any purpose.We of course accept no liability whatsoever for any such use.The routines listed below are used by many of the Recipes in this book.
The firstroutine, nrerror, is invoked to terminate program execution — with an appropriatemessage — when a fatal error is encountered. The other routines are used to allocateand deallocate memory for vectors and matrices, as explained in detail in §1.2. Allmemory allocation and deallocation in Numerical Recipes in C is done using theseroutines as intermediaries. Therefore, if you want to allocate memory in somedifferent way, you need change only these routines, not the programs themselves.On the diskette, these routines are in the file nrutil.c. Also listed here isthe header file nrutil.h.















