diff -C1 -r 206b/recipes_c-ansi/COPYRIGHT.NOTICE 208/recipes_c-ansi/COPYRIGHT.NOTICE *** 206b/recipes_c-ansi/COPYRIGHT.NOTICE Wed Feb 07 19:48:05 1996 --- 208/recipes_c-ansi/COPYRIGHT.NOTICE Sun Jul 06 08:14:49 1997 *************** *** 1,2 **** The contents of this Numerical Recipes C distribution are ! Copyright (C) 1986-1996 Numerical Recipes Software. --- 1,2 ---- The contents of this Numerical Recipes C distribution are ! Copyright (C) 1986-1997 Numerical Recipes Software. diff -C1 -r 206b/recipes_c-ansi/demo/answers/xcaldat.reslt 208/recipes_c-ansi/demo/answers/xcaldat.reslt *** 206b/recipes_c-ansi/demo/answers/xcaldat.reslt Mon Oct 19 07:45:03 1992 --- 208/recipes_c-ansi/demo/answers/xcaldat.reslt Mon Jul 07 02:36:08 1997 *************** *** 5,7 **** january 1 1 1721424 january 1 1 ! october 14 1582 2299170 october 24 1582 october 15 1582 2299161 october 15 1582 --- 5,7 ---- january 1 1 1721424 january 1 1 ! october 4 1582 2299160 october 4 1582 october 15 1582 2299161 october 15 1582 diff -C1 -r 206b/recipes_c-ansi/demo/answers/xjulday.reslt 208/recipes_c-ansi/demo/answers/xjulday.reslt *** 206b/recipes_c-ansi/demo/answers/xjulday.reslt Mon Oct 19 07:54:39 1992 --- 208/recipes_c-ansi/demo/answers/xjulday.reslt Mon Jul 07 02:36:22 1997 *************** *** 4,6 **** january 1 1 1721424 One day later ! october 14 1582 2299170 Day before Gregorian calendar october 15 1582 2299161 Gregorian calendar adopted --- 4,6 ---- january 1 1 1721424 One day later ! october 4 1582 2299160 Day before Gregorian calendar october 15 1582 2299161 Gregorian calendar adopted diff -C1 -r 206b/recipes_c-ansi/demo/bin/dates1.dat 208/recipes_c-ansi/demo/bin/dates1.dat *** 206b/recipes_c-ansi/demo/bin/dates1.dat Tue May 12 09:16:27 1992 --- 208/recipes_c-ansi/demo/bin/dates1.dat Tue Jul 01 05:56:20 1997 *************** *** 4,6 **** 01 01 1 One day later ! 10 14 1582 Day before Gregorian calendar 10 15 1582 Gregorian calendar adopted --- 4,6 ---- 01 01 1 One day later ! 10 04 1582 Day before Gregorian calendar 10 15 1582 Gregorian calendar adopted diff -C1 -r 206b/recipes_c-ansi/demo/data/dates1.dat 208/recipes_c-ansi/demo/data/dates1.dat *** 206b/recipes_c-ansi/demo/data/dates1.dat Tue May 12 09:16:27 1992 --- 208/recipes_c-ansi/demo/data/dates1.dat Tue Jul 01 05:56:20 1997 *************** *** 4,6 **** 01 01 1 One day later ! 10 14 1582 Day before Gregorian calendar 10 15 1582 Gregorian calendar adopted --- 4,6 ---- 01 01 1 One day later ! 10 04 1582 Day before Gregorian calendar 10 15 1582 Gregorian calendar adopted diff -C1 -r 206b/recipes_c-ansi/demo/include/nr.h 208/recipes_c-ansi/demo/include/nr.h *** 206b/recipes_c-ansi/demo/include/nr.h Mon Nov 09 02:27:59 1992 --- 208/recipes_c-ansi/demo/include/nr.h Sun Jul 06 09:15:45 1997 *************** *** 434,436 **** float *bmax); ! void simp2(float **a, int n, int l2[], int nl2, int *ip, int kp, float *q1); void simp3(float **a, int i1, int k1, int ip, int kp); --- 434,436 ---- 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); diff -C1 -r 206b/recipes_c-ansi/demo/results/dates1.dat 208/recipes_c-ansi/demo/results/dates1.dat *** 206b/recipes_c-ansi/demo/results/dates1.dat Tue May 12 09:16:27 1992 --- 208/recipes_c-ansi/demo/results/dates1.dat Tue Jul 01 05:56:20 1997 *************** *** 4,6 **** 01 01 1 One day later ! 10 14 1582 Day before Gregorian calendar 10 15 1582 Gregorian calendar adopted --- 4,6 ---- 01 01 1 One day later ! 10 04 1582 Day before Gregorian calendar 10 15 1582 Gregorian calendar adopted diff -C1 -r 206b/recipes_c-ansi/doc/COMPILING 208/recipes_c-ansi/doc/COMPILING *** 206b/recipes_c-ansi/doc/COMPILING Sat Feb 24 13:12:29 1996 --- 208/recipes_c-ansi/doc/COMPILING Tue Jul 15 10:42:45 1997 *************** *** 145 **** --- 145,156 ---- out[i][1]=0.0; out[i][n]=0.0; out[1][i]=0.0; out[n][i]=0.0; + + NeXT: + Use 'ranlib' instead of 'ar' in the master makefile. + In ANSI recipes/makefile, all /usr/include paths need to be + changed to /usr/include/ansi + One user reports: + - in the demo/bin/makefile, i had to simplify the OUTRULE a + little by taking out the '$?' in OUTRULE and adding another + var i called SRCPATH that points directly at where the .c + file is, and changed each rule so that : xxx.c became + : $(SRCPATH)xxx.c diff -C1 -r 206b/recipes_c-ansi/doc/COPYRIGHT.NOTICE 208/recipes_c-ansi/doc/COPYRIGHT.NOTICE *** 206b/recipes_c-ansi/doc/COPYRIGHT.NOTICE Wed Feb 07 19:48:05 1996 --- 208/recipes_c-ansi/doc/COPYRIGHT.NOTICE Sun Jul 06 08:14:49 1997 *************** *** 1,2 **** The contents of this Numerical Recipes C distribution are ! Copyright (C) 1986-1996 Numerical Recipes Software. --- 1,2 ---- The contents of this Numerical Recipes C distribution are ! Copyright (C) 1986-1997 Numerical Recipes Software. diff -C1 -r 206b/recipes_c-ansi/doc/VERSION 208/recipes_c-ansi/doc/VERSION *** 206b/recipes_c-ansi/doc/VERSION Sun Apr 23 09:10:43 1995 --- 208/recipes_c-ansi/doc/VERSION Sat Jul 19 09:26:11 1997 *************** *** 1,2 **** Numerical Recipes in C ! Unix Version 2.06 --- 1,2 ---- Numerical Recipes in C ! Unix Version 2.08 diff -C1 -r 206b/recipes_c-ansi/include/nr.h 208/recipes_c-ansi/include/nr.h *** 206b/recipes_c-ansi/include/nr.h Mon Nov 09 02:27:59 1992 --- 208/recipes_c-ansi/include/nr.h Sun Jul 06 09:15:45 1997 *************** *** 434,436 **** float *bmax); ! void simp2(float **a, int n, int l2[], int nl2, int *ip, int kp, float *q1); void simp3(float **a, int i1, int k1, int ip, int kp); --- 434,436 ---- 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); diff -C1 -r 206b/recipes_c-ansi/misc/nr.h 208/recipes_c-ansi/misc/nr.h *** 206b/recipes_c-ansi/misc/nr.h Tue Nov 17 04:28:59 1992 --- 208/recipes_c-ansi/misc/nr.h Sun Jul 06 09:15:45 1997 *************** *** 436,438 **** float *bmax); ! void simp2(float **a, int n, int l2[], int nl2, int *ip, int kp, float *q1); void simp3(float **a, int i1, int k1, int ip, int kp); --- 436,438 ---- 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); diff -C1 -r 206b/recipes_c-ansi/recipes/amoeba.c 208/recipes_c-ansi/recipes/amoeba.c *** 206b/recipes_c-ansi/recipes/amoeba.c Sun Oct 11 03:42:38 1992 --- 208/recipes_c-ansi/recipes/amoeba.c Mon Jul 14 20:33:45 1997 *************** *** 3,4 **** --- 3,5 ---- #include "nrutil.h" + #define TINY 1.0e-10 #define NMAX 5000 *************** *** 31,33 **** } ! rtol=2.0*fabs(y[ihi]-y[ilo])/(fabs(y[ihi])+fabs(y[ilo])); if (rtol < ftol) { --- 32,34 ---- } ! rtol=2.0*fabs(y[ihi]-y[ilo])/(fabs(y[ihi])+fabs(y[ilo])+TINY); if (rtol < ftol) { diff -C1 -r 206b/recipes_c-ansi/recipes/amotry.c 208/recipes_c-ansi/recipes/amotry.c *** 206b/recipes_c-ansi/recipes/amotry.c Sun Oct 11 03:42:38 1992 --- 208/recipes_c-ansi/recipes/amotry.c Mon Jul 14 20:33:45 1997 *************** *** 1 **** --- 1,2 ---- + /* note #undef's at end of file */ #define NRANSI diff -C1 -r 206b/recipes_c-ansi/recipes/arcmak.c 208/recipes_c-ansi/recipes/arcmak.c *** 206b/recipes_c-ansi/recipes/arcmak.c Sun Oct 11 03:42:39 1992 --- 208/recipes_c-ansi/recipes/arcmak.c Mon Jul 14 20:33:45 1997 *************** *** 1 **** --- 1,2 ---- + /* note #undef's at end of file */ #define NRANSI diff -C1 -r 206b/recipes_c-ansi/recipes/arcode.c 208/recipes_c-ansi/recipes/arcode.c *** 206b/recipes_c-ansi/recipes/arcode.c Sun Oct 11 03:42:39 1992 --- 208/recipes_c-ansi/recipes/arcode.c Mon Jul 14 20:33:45 1997 *************** *** 58,60 **** fprintf(stderr,"Attempting to expand its size.\n"); ! *lcode *= 1.5; if ((*codep=(unsigned char *)realloc(*codep, --- 58,60 ---- fprintf(stderr,"Attempting to expand its size.\n"); ! *lcode += *lcode/2; if ((*codep=(unsigned char *)realloc(*codep, diff -C1 -r 206b/recipes_c-ansi/recipes/banbks.c 208/recipes_c-ansi/recipes/banbks.c *** 206b/recipes_c-ansi/recipes/banbks.c Sun Oct 11 03:42:41 1992 --- 208/recipes_c-ansi/recipes/banbks.c Mon Jul 14 20:33:46 1997 *************** *** 1 **** --- 1,2 ---- + /* note #undef's at end of file */ #define SWAP(a,b) {dum=(a);(a)=(b);(b)=dum;} diff -C1 -r 206b/recipes_c-ansi/recipes/banmul.c 208/recipes_c-ansi/recipes/banmul.c *** 206b/recipes_c-ansi/recipes/banmul.c Sun Oct 11 03:42:41 1992 --- 208/recipes_c-ansi/recipes/banmul.c Mon Jul 14 20:33:46 1997 *************** *** 1 **** --- 1,2 ---- + /* note #undef's at end of file */ #define NRANSI diff -C1 -r 206b/recipes_c-ansi/recipes/bcuint.c 208/recipes_c-ansi/recipes/bcuint.c *** 206b/recipes_c-ansi/recipes/bcuint.c Sun Oct 11 03:42:42 1992 --- 208/recipes_c-ansi/recipes/bcuint.c Mon Jul 14 20:33:46 1997 *************** *** 1 **** --- 1,2 ---- + /* note #undef's at end of file */ #define NRANSI diff -C1 -r 206b/recipes_c-ansi/recipes/beschb.c 208/recipes_c-ansi/recipes/beschb.c *** 206b/recipes_c-ansi/recipes/beschb.c Sun Mar 19 17:59:23 1995 --- 208/recipes_c-ansi/recipes/beschb.c Mon Jul 14 20:33:46 1997 *************** *** 1 **** --- 1,2 ---- + /* note #undef's at end of file */ #define NUSE1 5 diff -C1 -r 206b/recipes_c-ansi/recipes/brent.c 208/recipes_c-ansi/recipes/brent.c *** 206b/recipes_c-ansi/recipes/brent.c Sun Mar 19 17:59:23 1995 --- 208/recipes_c-ansi/recipes/brent.c Mon Jul 14 20:33:47 1997 *************** *** 66,67 **** --- 66,69 ---- nrerror("Too many iterations in brent"); + *xmin=x; + return fx; } diff -C1 -r 206b/recipes_c-ansi/recipes/caldat.c 208/recipes_c-ansi/recipes/caldat.c *** 206b/recipes_c-ansi/recipes/caldat.c Sun Oct 11 03:42:47 1992 --- 208/recipes_c-ansi/recipes/caldat.c Mon Jul 14 20:33:47 1997 *************** *** 10,11 **** --- 10,13 ---- ja=julian+1+jalpha-(long) (0.25*jalpha); + } else if (julian < 0) { + ja=julian+36525*(1-julian/36525); } else *************** *** 22,23 **** --- 24,26 ---- if (*iyyy <= 0) --(*iyyy); + if (julian < 0) iyyy -= 100*(1-julian/36525); } diff -C1 -r 206b/recipes_c-ansi/recipes/chebpc.c 208/recipes_c-ansi/recipes/chebpc.c *** 206b/recipes_c-ansi/recipes/chebpc.c Sun Oct 11 03:42:48 1992 --- 208/recipes_c-ansi/recipes/chebpc.c Mon Jul 14 20:33:48 1997 *************** *** 1 **** --- 1,2 ---- + /* note #undef's at end of file */ #define NRANSI diff -C1 -r 206b/recipes_c-ansi/recipes/convlv.c 208/recipes_c-ansi/recipes/convlv.c *** 206b/recipes_c-ansi/recipes/convlv.c Sun Oct 11 03:42:50 1992 --- 208/recipes_c-ansi/recipes/convlv.c Mon Jul 14 20:33:48 1997 *************** *** 1 **** --- 1,2 ---- + /* note #undef's at end of file */ #define NRANSI diff -C1 -r 206b/recipes_c-ansi/recipes/correl.c 208/recipes_c-ansi/recipes/correl.c *** 206b/recipes_c-ansi/recipes/correl.c Sun Oct 11 03:42:51 1992 --- 208/recipes_c-ansi/recipes/correl.c Mon Jul 14 20:33:48 1997 *************** *** 1 **** --- 1,2 ---- + /* note #undef's at end of file */ #define NRANSI diff -C1 -r 206b/recipes_c-ansi/recipes/covsrt.c 208/recipes_c-ansi/recipes/covsrt.c *** 206b/recipes_c-ansi/recipes/covsrt.c Sun Oct 11 03:42:51 1992 --- 208/recipes_c-ansi/recipes/covsrt.c Mon Jul 14 20:33:49 1997 *************** *** 1 **** --- 1,2 ---- + /* note #undef's at end of file */ #define SWAP(a,b) {swap=(a);(a)=(b);(b)=swap;} diff -C1 -r 206b/recipes_c-ansi/recipes/cyclic.c 208/recipes_c-ansi/recipes/cyclic.c *** 206b/recipes_c-ansi/recipes/cyclic.c Sun Oct 11 03:42:52 1992 --- 208/recipes_c-ansi/recipes/cyclic.c Mon Jul 14 20:33:49 1997 *************** *** 1 **** --- 1,2 ---- + /* note #undef's at end of file */ #define NRANSI diff -C1 -r 206b/recipes_c-ansi/recipes/daub4.c 208/recipes_c-ansi/recipes/daub4.c *** 206b/recipes_c-ansi/recipes/daub4.c Fri Mar 19 01:02:53 1993 --- 208/recipes_c-ansi/recipes/daub4.c Mon Jul 14 20:33:49 1997 *************** *** 1 **** --- 1,2 ---- + /* note #undef's at end of file */ #define NRANSI diff -C1 -r 206b/recipes_c-ansi/recipes/df1dim.c 208/recipes_c-ansi/recipes/df1dim.c *** 206b/recipes_c-ansi/recipes/df1dim.c Sun Oct 11 03:42:53 1992 --- 208/recipes_c-ansi/recipes/df1dim.c Mon Jul 14 20:33:49 1997 *************** *** 1 **** --- 1,2 ---- + /* note #undef's at end of file */ #define NRANSI diff -C1 -r 206b/recipes_c-ansi/recipes/dfpmin.c 208/recipes_c-ansi/recipes/dfpmin.c *** 206b/recipes_c-ansi/recipes/dfpmin.c Sun Oct 11 03:42:54 1992 --- 208/recipes_c-ansi/recipes/dfpmin.c Mon Jul 14 20:33:49 1997 *************** *** 77,79 **** } ! if (fac*fac > EPS*sumdg*sumxi) { fac=1.0/fac; --- 77,79 ---- } ! if (fac > sqrt(EPS*sumdg*sumxi)) { fac=1.0/fac; *************** *** 82,84 **** for (i=1;i<=n;i++) { ! for (j=1;j<=n;j++) { hessin[i][j] += fac*xi[i]*xi[j] --- 82,84 ---- for (i=1;i<=n;i++) { ! for (j=i;j<=n;j++) { hessin[i][j] += fac*xi[i]*xi[j] *************** *** 85,86 **** --- 85,87 ---- -fad*hdg[i]*hdg[j]+fae*dg[i]*dg[j]; + hessin[j][i]=hessin[i][j]; } diff -C1 -r 206b/recipes_c-ansi/recipes/dlinmin.c 208/recipes_c-ansi/recipes/dlinmin.c *** 206b/recipes_c-ansi/recipes/dlinmin.c Sun Oct 11 03:42:55 1992 --- 208/recipes_c-ansi/recipes/dlinmin.c Mon Jul 14 20:33:49 1997 *************** *** 1 **** --- 1,2 ---- + /* note #undef's at end of file */ #define NRANSI diff -C1 -r 206b/recipes_c-ansi/recipes/dsvbksb.c 208/recipes_c-ansi/recipes/dsvbksb.c *** 206b/recipes_c-ansi/recipes/dsvbksb.c Sun Oct 11 03:42:56 1992 --- 208/recipes_c-ansi/recipes/dsvbksb.c Mon Jul 14 20:33:50 1997 *************** *** 1 **** --- 1,2 ---- + /* note #undef's at end of file */ #define NRANSI diff -C1 -r 206b/recipes_c-ansi/recipes/f1dim.c 208/recipes_c-ansi/recipes/f1dim.c *** 206b/recipes_c-ansi/recipes/f1dim.c Sun Oct 11 03:42:59 1992 --- 208/recipes_c-ansi/recipes/f1dim.c Mon Jul 14 20:33:51 1997 *************** *** 1 **** --- 1,2 ---- + /* note #undef's at end of file */ #define NRANSI diff -C1 -r 206b/recipes_c-ansi/recipes/fit.c 208/recipes_c-ansi/recipes/fit.c *** 206b/recipes_c-ansi/recipes/fit.c Sun Oct 11 03:43:01 1992 --- 208/recipes_c-ansi/recipes/fit.c Mon Jul 14 20:33:51 1997 *************** *** 46,47 **** --- 46,48 ---- *chi2=0.0; + *q=1.0; if (mwt == 0) { *************** *** 49,51 **** *chi2 += SQR(y[i]-(*a)-(*b)*x[i]); - *q=1.0; sigdat=sqrt((*chi2)/(ndata-2)); --- 50,51 ---- *************** *** 56,58 **** *chi2 += SQR((y[i]-(*a)-(*b)*x[i])/sig[i]); ! *q=gammq(0.5*(ndata-2),0.5*(*chi2)); } --- 56,58 ---- *chi2 += SQR((y[i]-(*a)-(*b)*x[i])/sig[i]); ! if (ndata>2) *q=gammq(0.5*(ndata-2),0.5*(*chi2)); } diff -C1 -r 206b/recipes_c-ansi/recipes/fmin.c 208/recipes_c-ansi/recipes/fmin.c *** 206b/recipes_c-ansi/recipes/fmin.c Sun Oct 11 03:43:05 1992 --- 208/recipes_c-ansi/recipes/fmin.c Mon Jul 14 20:33:51 1997 *************** *** 1 **** --- 1,2 ---- + /* note #undef's at end of file */ #define NRANSI diff -C1 -r 206b/recipes_c-ansi/recipes/fred2.c 208/recipes_c-ansi/recipes/fred2.c *** 206b/recipes_c-ansi/recipes/fred2.c Sun Oct 11 03:43:06 1992 --- 208/recipes_c-ansi/recipes/fred2.c Mon Jul 14 20:33:52 1997 *************** *** 1 **** --- 1,2 ---- + /* note #undef's at end of file */ #define NRANSI diff -C1 -r 206b/recipes_c-ansi/recipes/frprmn.c 208/recipes_c-ansi/recipes/frprmn.c *** 206b/recipes_c-ansi/recipes/frprmn.c Sun Oct 11 03:43:07 1992 --- 208/recipes_c-ansi/recipes/frprmn.c Mon Jul 14 20:33:52 1997 *************** *** 32,34 **** } ! fp=(*func)(p); (*dfunc)(p,xi); --- 32,34 ---- } ! fp= *fret; (*dfunc)(p,xi); diff -C1 -r 206b/recipes_c-ansi/recipes/gasdev.c 208/recipes_c-ansi/recipes/gasdev.c *** 206b/recipes_c-ansi/recipes/gasdev.c Sun Oct 11 03:43:09 1992 --- 208/recipes_c-ansi/recipes/gasdev.c Mon Jul 14 20:33:52 1997 *************** *** 9,10 **** --- 9,11 ---- + if (*idum < 0) iset=0; if (iset == 0) { diff -C1 -r 206b/recipes_c-ansi/recipes/hpsort.c 208/recipes_c-ansi/recipes/hpsort.c *** 206b/recipes_c-ansi/recipes/hpsort.c Sun Oct 11 03:43:11 1992 --- 208/recipes_c-ansi/recipes/hpsort.c Mon Jul 14 20:33:53 1997 *************** *** 27,29 **** j <<= 1; ! } else j=ir+1; } --- 27,29 ---- j <<= 1; ! } else break; } diff -C1 -r 206b/recipes_c-ansi/recipes/hufmak.c 208/recipes_c-ansi/recipes/hufmak.c *** 206b/recipes_c-ansi/recipes/hufmak.c Sun Oct 11 03:43:12 1992 --- 208/recipes_c-ansi/recipes/hufmak.c Mon Jul 14 20:33:53 1997 *************** *** 1 **** --- 1,2 ---- + /* note #undef's at end of file */ #define NRANSI *************** *** 39,41 **** hcode->right[k]=index[1]; ! up[index[1]] = -k; up[node]=index[1]=k; --- 40,42 ---- hcode->right[k]=index[1]; ! up[index[1]] = -(long)k; up[node]=index[1]=k; diff -C1 -r 206b/recipes_c-ansi/recipes/iindexx.c 208/recipes_c-ansi/recipes/iindexx.c *** 206b/recipes_c-ansi/recipes/iindexx.c Sun Oct 11 03:43:14 1992 --- 208/recipes_c-ansi/recipes/iindexx.c Mon Jul 14 20:33:54 1997 *************** *** 1 **** --- 1,2 ---- + /* note #undef's at end of file */ #define NRANSI diff -C1 -r 206b/recipes_c-ansi/recipes/indexx.c 208/recipes_c-ansi/recipes/indexx.c *** 206b/recipes_c-ansi/recipes/indexx.c Sun Mar 19 17:59:23 1995 --- 208/recipes_c-ansi/recipes/indexx.c Mon Jul 14 20:33:54 1997 *************** *** 1 **** --- 1,2 ---- + /* note #undef's at end of file */ #define NRANSI diff -C1 -r 206b/recipes_c-ansi/recipes/irbit1.c 208/recipes_c-ansi/recipes/irbit1.c *** 206b/recipes_c-ansi/recipes/irbit1.c Sun Oct 11 03:43:15 1992 --- 208/recipes_c-ansi/recipes/irbit1.c Mon Jul 14 20:33:54 1997 *************** *** 1,6 **** - #define IB1 1 - #define IB2 2 - #define IB5 16 - #define IB18 131072 - int irbit1(unsigned long *iseed) --- 1 ---- *************** *** 9,14 **** ! newbit = (*iseed & IB18) >> 17 ! ^ (*iseed & IB5) >> 4 ! ^ (*iseed & IB2) >> 1 ! ^ (*iseed & IB1); *iseed=(*iseed << 1) | newbit; --- 4,9 ---- ! newbit = (*iseed >> 17) & 1 ! ^ (*iseed >> 4) & 1 ! ^ (*iseed >> 1) & 1 ! ^ (*iseed & 1); *iseed=(*iseed << 1) | newbit; *************** *** 16,20 **** } - #undef IB1 - #undef IB2 - #undef IB5 - #undef IB18 --- 11 ---- diff -C1 -r 206b/recipes_c-ansi/recipes/irbit2.c 208/recipes_c-ansi/recipes/irbit2.c *** 206b/recipes_c-ansi/recipes/irbit2.c Sun Oct 11 03:43:15 1992 --- 208/recipes_c-ansi/recipes/irbit2.c Mon Jul 14 20:33:54 1997 *************** *** 1 **** --- 1,2 ---- + /* note #undef's at end of file */ #define IB1 1 diff -C1 -r 206b/recipes_c-ansi/recipes/laguer.c 208/recipes_c-ansi/recipes/laguer.c *** 206b/recipes_c-ansi/recipes/laguer.c Sun Oct 11 03:43:18 1992 --- 208/recipes_c-ansi/recipes/laguer.c Mon Jul 14 20:33:55 1997 *************** *** 40,42 **** dx=((FMAX(abp,abm) > 0.0 ? Cdiv(Complex((float) m,0.0),gp) ! : RCmul(exp(log(1+abx)),Complex(cos((float)iter),sin((float)iter))))); x1=Csub(*x,dx); --- 40,42 ---- dx=((FMAX(abp,abm) > 0.0 ? Cdiv(Complex((float) m,0.0),gp) ! : RCmul(1+abx,Complex(cos((float)iter),sin((float)iter))))); x1=Csub(*x,dx); diff -C1 -r 206b/recipes_c-ansi/recipes/lfit.c 208/recipes_c-ansi/recipes/lfit.c *** 206b/recipes_c-ansi/recipes/lfit.c Sun Oct 11 03:43:18 1992 --- 208/recipes_c-ansi/recipes/lfit.c Mon Jul 14 20:33:55 1997 *************** *** 1 **** --- 1,2 ---- + /* note #undef's at end of file */ #define NRANSI diff -C1 -r 206b/recipes_c-ansi/recipes/linmin.c 208/recipes_c-ansi/recipes/linmin.c *** 206b/recipes_c-ansi/recipes/linmin.c Sun Oct 11 03:43:19 1992 --- 208/recipes_c-ansi/recipes/linmin.c Mon Jul 14 20:33:55 1997 *************** *** 1 **** --- 1,2 ---- + /* note #undef's at end of file */ #define NRANSI diff -C1 -r 206b/recipes_c-ansi/recipes/lnsrch.c 208/recipes_c-ansi/recipes/lnsrch.c *** 206b/recipes_c-ansi/recipes/lnsrch.c Sun Oct 11 03:43:19 1992 --- 208/recipes_c-ansi/recipes/lnsrch.c Mon Jul 14 20:33:55 1997 *************** *** 10,12 **** int i; ! float a,alam,alam2,alamin,b,disc,f2,fold2,rhs1,rhs2,slope,sum,temp, test,tmplam; --- 10,12 ---- int i; ! float a,alam,alam2,alamin,b,disc,f2,rhs1,rhs2,slope,sum,temp, test,tmplam; *************** *** 20,21 **** --- 20,22 ---- slope += g[i]*p[i]; + if (slope >= 0.0) nrerror("Roundoff problem in lnsrch."); test=0.0; *************** *** 40,42 **** rhs1 = *f-fold-alam*slope; ! rhs2=f2-fold2-alam2*slope; a=(rhs1/(alam*alam)-rhs2/(alam2*alam2))/(alam-alam2); --- 41,43 ---- rhs1 = *f-fold-alam*slope; ! rhs2=f2-fold-alam2*slope; a=(rhs1/(alam*alam)-rhs2/(alam2*alam2))/(alam-alam2); *************** *** 46,51 **** disc=b*b-3.0*a*slope; ! if (disc<0.0) nrerror("Roundoff problem in lnsrch."); ! else tmplam=(-b+sqrt(disc))/(3.0*a); } ! if (tmplam>0.5*alam) tmplam=0.5*alam; --- 47,53 ---- disc=b*b-3.0*a*slope; ! if (disc < 0.0) tmplam=0.5*alam; ! else if (b <= 0.0) tmplam=(-b+sqrt(disc))/(3.0*a); ! else tmplam=-slope/(b+sqrt(disc)); } ! if (tmplam > 0.5*alam) tmplam=0.5*alam; *************** *** 55,57 **** f2 = *f; - fold2=fold; alam=FMAX(tmplam,0.1*alam); --- 57,58 ---- diff -C1 -r 206b/recipes_c-ansi/recipes/mgfas.c 208/recipes_c-ansi/recipes/mgfas.c *** 206b/recipes_c-ansi/recipes/mgfas.c Sun Oct 11 03:43:22 1992 --- 208/recipes_c-ansi/recipes/mgfas.c Mon Jul 14 20:33:55 1997 *************** *** 1 **** --- 1,2 ---- + /* note #undef's at end of file */ #define NRANSI diff -C1 -r 206b/recipes_c-ansi/recipes/mglin.c 208/recipes_c-ansi/recipes/mglin.c *** 206b/recipes_c-ansi/recipes/mglin.c Sun Oct 11 03:43:22 1992 --- 208/recipes_c-ansi/recipes/mglin.c Mon Jul 14 20:33:55 1997 *************** *** 1 **** --- 1,2 ---- + /* note #undef's at end of file */ #define NRANSI diff -C1 -r 206b/recipes_c-ansi/recipes/midinf.c 208/recipes_c-ansi/recipes/midinf.c *** 206b/recipes_c-ansi/recipes/midinf.c Sun Oct 11 03:43:22 1992 --- 208/recipes_c-ansi/recipes/midinf.c Mon Jul 14 20:33:56 1997 *************** *** 1 **** --- 1,2 ---- + /* note #undef's at end of file */ #define FUNC(x) ((*funk)(1.0/(x))/((x)*(x))) diff -C1 -r 206b/recipes_c-ansi/recipes/midpnt.c 208/recipes_c-ansi/recipes/midpnt.c *** 206b/recipes_c-ansi/recipes/midpnt.c Sun Oct 11 03:43:23 1992 --- 208/recipes_c-ansi/recipes/midpnt.c Mon Jul 14 20:33:56 1997 *************** *** 1 **** --- 1,2 ---- + /* note #undef's at end of file */ #define FUNC(x) ((*func)(x)) diff -C1 -r 206b/recipes_c-ansi/recipes/mmid.c 208/recipes_c-ansi/recipes/mmid.c *** 206b/recipes_c-ansi/recipes/mmid.c Sun Oct 11 03:43:24 1992 --- 208/recipes_c-ansi/recipes/mmid.c Mon Jul 14 20:33:56 1997 *************** *** 1 **** --- 1,2 ---- + /* note #undef's at end of file */ #define NRANSI diff -C1 -r 206b/recipes_c-ansi/recipes/mp2dfr.c 208/recipes_c-ansi/recipes/mp2dfr.c *** 206b/recipes_c-ansi/recipes/mp2dfr.c Sun Oct 11 03:43:25 1992 --- 208/recipes_c-ansi/recipes/mp2dfr.c Mon Jul 14 20:33:56 1997 *************** *** 1 **** --- 1,2 ---- + /* note #undef's at end of file */ #define IAZ 48 diff -C1 -r 206b/recipes_c-ansi/recipes/mpdiv.c 208/recipes_c-ansi/recipes/mpdiv.c *** 206b/recipes_c-ansi/recipes/mpdiv.c Sun Oct 11 03:43:25 1992 --- 208/recipes_c-ansi/recipes/mpdiv.c Mon Jul 14 20:33:56 1997 *************** *** 1 **** --- 1,2 ---- + /* note #undef's at end of file */ #define NRANSI *************** *** 2,4 **** #include "nrutil.h" ! #define MACC 3 --- 3,5 ---- #include "nrutil.h" ! #define MACC 6 *************** *** 11,12 **** --- 12,14 ---- int m); + void mpsad(unsigned char w[], unsigned char u[], int n, int iv); void mpsub(int *is, unsigned char w[], unsigned char u[], unsigned char v[], *************** *** 17,22 **** rr=cvector(1,(n+MACC)<<1); ! s=cvector(1,n+MACC); ! mpinv(s,v,n-m+MACC,m); ! mpmul(rr,s,u,n-m+MACC,n); ! mpmov(q,&rr[1],n-m+1); mpmul(rr,q,v,n-m+1,m); --- 19,25 ---- rr=cvector(1,(n+MACC)<<1); ! s=cvector(1,(n+MACC)<<1); ! mpinv(s,v,n+MACC,m); ! mpmul(rr,s,u,n+MACC,n); ! mpsad(s,rr,n+n+MACC/2,1); ! mpmov(q,&s[2],n-m+1); mpmul(rr,q,v,n-m+1,m); *************** *** 25,27 **** mpmov(r,&rr[n-m+1],m); ! free_cvector(s,1,n+MACC); free_cvector(rr,1,(n+MACC)<<1); --- 28,30 ---- mpmov(r,&rr[n-m+1],m); ! free_cvector(s,1,(n+MACC)<<1); free_cvector(rr,1,(n+MACC)<<1); diff -C1 -r 206b/recipes_c-ansi/recipes/mpinv.c 208/recipes_c-ansi/recipes/mpinv.c *** 206b/recipes_c-ansi/recipes/mpinv.c Sun Oct 11 03:43:25 1992 --- 208/recipes_c-ansi/recipes/mpinv.c Mon Jul 14 20:33:56 1997 *************** *** 1 **** --- 1,2 ---- + /* note #undef's at end of file */ #define NRANSI diff -C1 -r 206b/recipes_c-ansi/recipes/mpmul.c 208/recipes_c-ansi/recipes/mpmul.c *** 206b/recipes_c-ansi/recipes/mpmul.c Thu Feb 03 14:34:43 1994 --- 208/recipes_c-ansi/recipes/mpmul.c Mon Jul 14 20:33:56 1997 *************** *** 1 **** --- 1,2 ---- + /* note #undef's at end of file */ #define NRANSI diff -C1 -r 206b/recipes_c-ansi/recipes/mpops.c 208/recipes_c-ansi/recipes/mpops.c *** 206b/recipes_c-ansi/recipes/mpops.c Sun Oct 11 03:43:26 1992 --- 208/recipes_c-ansi/recipes/mpops.c Mon Jul 14 20:33:56 1997 *************** *** 1 **** --- 1,2 ---- + /* note #undef's at end of file */ #define LOBYTE(x) ((unsigned char) ((x) & 0xff)) diff -C1 -r 206b/recipes_c-ansi/recipes/mprove.c 208/recipes_c-ansi/recipes/mprove.c *** 206b/recipes_c-ansi/recipes/mprove.c Sun Oct 11 03:43:26 1992 --- 208/recipes_c-ansi/recipes/mprove.c Mon Jul 14 20:33:56 1997 *************** *** 1 **** --- 1,2 ---- + /* note #undef's at end of file */ #define NRANSI diff -C1 -r 206b/recipes_c-ansi/recipes/mpsqrt.c 208/recipes_c-ansi/recipes/mpsqrt.c *** 206b/recipes_c-ansi/recipes/mpsqrt.c Sun Oct 11 03:43:26 1992 --- 208/recipes_c-ansi/recipes/mpsqrt.c Mon Jul 14 20:33:57 1997 *************** *** 36,38 **** mplsh(r,n); ! mpmul(s,r,v,n,m); mplsh(s,n); --- 36,38 ---- mplsh(r,n); ! mpmul(s,r,v,n,IMIN(m,n)); mplsh(s,n); *************** *** 49,51 **** if (j del) { ! del=fabs(fptt-(*fret)); ibig=i; --- 27,30 ---- linmin(p,xit,n,fret,func); ! if (fptt-(*fret) > del) { ! del=fptt-(*fret); ibig=i; *************** *** 31,33 **** } ! if (2.0*fabs(fp-(*fret)) <= ftol*(fabs(fp)+fabs(*fret))) { free_vector(xit,1,n); --- 32,34 ---- } ! if (2.0*(fp-(*fret)) <= ftol*(fabs(fp)+fabs(*fret))+TINY) { free_vector(xit,1,n); diff -C1 -r 206b/recipes_c-ansi/recipes/predic.c 208/recipes_c-ansi/recipes/predic.c *** 206b/recipes_c-ansi/recipes/predic.c Sun Oct 11 03:43:32 1992 --- 208/recipes_c-ansi/recipes/predic.c Mon Jul 14 20:33:58 1997 *************** *** 1 **** --- 1,2 ---- + /* note #undef's at end of file */ #define NRANSI diff -C1 -r 206b/recipes_c-ansi/recipes/psdes.c 208/recipes_c-ansi/recipes/psdes.c *** 206b/recipes_c-ansi/recipes/psdes.c Sun Oct 11 03:43:32 1992 --- 208/recipes_c-ansi/recipes/psdes.c Mon Jul 14 20:33:58 1997 *************** *** 1 **** --- 1,2 ---- + /* note #undef's at end of file */ #define NITER 4 diff -C1 -r 206b/recipes_c-ansi/recipes/pwt.c 208/recipes_c-ansi/recipes/pwt.c *** 206b/recipes_c-ansi/recipes/pwt.c Sun Oct 11 03:43:32 1992 --- 208/recipes_c-ansi/recipes/pwt.c Mon Jul 14 20:33:58 1997 *************** *** 1 **** --- 1,2 ---- + /* note #undef's at end of file */ #define NRANSI diff -C1 -r 206b/recipes_c-ansi/recipes/pzextr.c 208/recipes_c-ansi/recipes/pzextr.c *** 206b/recipes_c-ansi/recipes/pzextr.c Sun Oct 11 03:43:33 1992 --- 208/recipes_c-ansi/recipes/pzextr.c Mon Jul 14 20:33:58 1997 *************** *** 1 **** --- 1,2 ---- + /* note #undef's at end of file */ #define NRANSI diff -C1 -r 206b/recipes_c-ansi/recipes/qsimp.c 208/recipes_c-ansi/recipes/qsimp.c *** 206b/recipes_c-ansi/recipes/qsimp.c Wed Feb 02 09:01:14 1994 --- 208/recipes_c-ansi/recipes/qsimp.c Mon Jul 14 20:33:59 1997 *************** *** 15,18 **** s=(4.0*st-ost)/3.0; ! if (fabs(s-os) < EPS*fabs(os)) return s; ! if (s == 0.0 && os == 0.0 && j > 6) return s; os=s; --- 15,19 ---- s=(4.0*st-ost)/3.0; ! if (j > 5) ! if (fabs(s-os) < EPS*fabs(os) || ! (s == 0.0 && os == 0.0)) return s; os=s; diff -C1 -r 206b/recipes_c-ansi/recipes/qtrap.c 208/recipes_c-ansi/recipes/qtrap.c *** 206b/recipes_c-ansi/recipes/qtrap.c Wed Feb 02 09:01:14 1994 --- 208/recipes_c-ansi/recipes/qtrap.c Mon Jul 14 20:33:59 1997 *************** *** 14,17 **** s=trapzd(func,a,b,j); ! if (fabs(s-olds) < EPS*fabs(olds)) return s; ! if (s == 0.0 && olds == 0.0 && j > 6) return s; olds=s; --- 14,18 ---- s=trapzd(func,a,b,j); ! if (j > 5) ! if (fabs(s-olds) < EPS*fabs(olds) || ! (s == 0.0 && olds == 0.0)) return s; olds=s; diff -C1 -r 206b/recipes_c-ansi/recipes/quadvl.c 208/recipes_c-ansi/recipes/quadvl.c *** 206b/recipes_c-ansi/recipes/quadvl.c Sun Oct 11 03:43:39 1992 --- 208/recipes_c-ansi/recipes/quadvl.c Mon Jul 14 20:33:59 1997 *************** *** 1 **** --- 1,2 ---- + /* note #undef's at end of file */ #define NRANSI diff -C1 -r 206b/recipes_c-ansi/recipes/ran0.c 208/recipes_c-ansi/recipes/ran0.c *** 206b/recipes_c-ansi/recipes/ran0.c Sun Oct 11 03:43:39 1992 --- 208/recipes_c-ansi/recipes/ran0.c Mon Jul 14 20:33:59 1997 *************** *** 1 **** --- 1,2 ---- + /* note #undef's at end of file */ #define IA 16807 diff -C1 -r 206b/recipes_c-ansi/recipes/ran1.c 208/recipes_c-ansi/recipes/ran1.c *** 206b/recipes_c-ansi/recipes/ran1.c Sun Oct 11 03:43:39 1992 --- 208/recipes_c-ansi/recipes/ran1.c Mon Jul 14 20:33:59 1997 *************** *** 1 **** --- 1,2 ---- + /* note #undef's at end of file */ #define IA 16807 diff -C1 -r 206b/recipes_c-ansi/recipes/ran2.c 208/recipes_c-ansi/recipes/ran2.c *** 206b/recipes_c-ansi/recipes/ran2.c Sun Oct 11 03:43:40 1992 --- 208/recipes_c-ansi/recipes/ran2.c Mon Jul 14 20:33:59 1997 *************** *** 1 **** --- 1,2 ---- + /* note #undef's at end of file */ #define IM1 2147483563 diff -C1 -r 206b/recipes_c-ansi/recipes/ran3.c 208/recipes_c-ansi/recipes/ran3.c *** 206b/recipes_c-ansi/recipes/ran3.c Sun Oct 11 03:43:40 1992 --- 208/recipes_c-ansi/recipes/ran3.c Mon Jul 14 20:33:59 1997 *************** *** 1 **** --- 1,2 ---- + #include #define MBIG 1000000000 *************** *** 15,17 **** iff=1; ! mj=MSEED-(*idum < 0 ? -*idum : *idum); mj %= MBIG; --- 16,18 ---- iff=1; ! mj=labs(MSEED-labs(*idum)); mj %= MBIG; diff -C1 -r 206b/recipes_c-ansi/recipes/rk4.c 208/recipes_c-ansi/recipes/rk4.c *** 206b/recipes_c-ansi/recipes/rk4.c Sun Oct 11 03:43:44 1992 --- 208/recipes_c-ansi/recipes/rk4.c Mon Jul 14 20:34:00 1997 *************** *** 1 **** --- 1,2 ---- + /* note #undef's at end of file */ #define NRANSI diff -C1 -r 206b/recipes_c-ansi/recipes/rkck.c 208/recipes_c-ansi/recipes/rkck.c *** 206b/recipes_c-ansi/recipes/rkck.c Mon Mar 22 20:06:08 1993 --- 208/recipes_c-ansi/recipes/rkck.c Mon Jul 14 20:34:00 1997 *************** *** 1 **** --- 1,2 ---- + /* note #undef's at end of file */ #define NRANSI diff -C1 -r 206b/recipes_c-ansi/recipes/rkdumb.c 208/recipes_c-ansi/recipes/rkdumb.c *** 206b/recipes_c-ansi/recipes/rkdumb.c Sun Oct 11 03:43:44 1992 --- 208/recipes_c-ansi/recipes/rkdumb.c Mon Jul 14 20:34:00 1997 *************** *** 1 **** --- 1,2 ---- + /* note #undef's at end of file */ #define NRANSI diff -C1 -r 206b/recipes_c-ansi/recipes/rtsafe.c 208/recipes_c-ansi/recipes/rtsafe.c *** 206b/recipes_c-ansi/recipes/rtsafe.c Sun Oct 11 03:43:47 1992 --- 208/recipes_c-ansi/recipes/rtsafe.c Mon Jul 14 20:34:01 1997 *************** *** 29,31 **** for (j=1;j<=MAXIT;j++) { ! if ((((rts-xh)*df-f)*((rts-xl)*df-f) >= 0.0) || (fabs(2.0*f) > fabs(dxold*df))) { --- 29,31 ---- for (j=1;j<=MAXIT;j++) { ! if ((((rts-xh)*df-f)*((rts-xl)*df-f) > 0.0) || (fabs(2.0*f) > fabs(dxold*df))) { diff -C1 -r 206b/recipes_c-ansi/recipes/rzextr.c 208/recipes_c-ansi/recipes/rzextr.c *** 206b/recipes_c-ansi/recipes/rzextr.c Sun Oct 11 03:43:48 1992 --- 208/recipes_c-ansi/recipes/rzextr.c Mon Jul 14 20:34:01 1997 *************** *** 1 **** --- 1,2 ---- + /* note #undef's at end of file */ #define NRANSI diff -C1 -r 206b/recipes_c-ansi/recipes/savgol.c 208/recipes_c-ansi/recipes/savgol.c *** 206b/recipes_c-ansi/recipes/savgol.c Sun Oct 11 03:43:48 1992 --- 208/recipes_c-ansi/recipes/savgol.c Mon Jul 14 20:34:01 1997 *************** *** 20,22 **** for (k=1;k<=nl;k++) sum += pow((double)-k,(double)ipj); ! mm=FMIN(ipj,2*m-ipj); for (imj = -mm;imj<=mm;imj+=2) a[1+(ipj+imj)/2][1+(ipj-imj)/2]=sum; --- 20,22 ---- for (k=1;k<=nl;k++) sum += pow((double)-k,(double)ipj); ! mm=IMIN(ipj,2*m-ipj); for (imj = -mm;imj<=mm;imj+=2) a[1+(ipj+imj)/2][1+(ipj-imj)/2]=sum; diff -C1 -r 206b/recipes_c-ansi/recipes/select.c 208/recipes_c-ansi/recipes/select.c *** 206b/recipes_c-ansi/recipes/select.c Sun Mar 19 17:59:23 1995 --- 208/recipes_c-ansi/recipes/select.c Mon Jul 14 20:34:01 1997 *************** *** 1 **** --- 1,2 ---- + /* note #undef's at end of file */ #define SWAP(a,b) temp=(a);(a)=(b);(b)=temp; diff -C1 -r 206b/recipes_c-ansi/recipes/selip.c 208/recipes_c-ansi/recipes/selip.c *** 206b/recipes_c-ansi/recipes/selip.c Sun Oct 11 03:43:49 1992 --- 208/recipes_c-ansi/recipes/selip.c Mon Jul 14 20:34:01 1997 *************** *** 1 **** --- 1,2 ---- + /* note #undef's at end of file */ #define NRANSI diff -C1 -r 206b/recipes_c-ansi/recipes/shoot.c 208/recipes_c-ansi/recipes/shoot.c *** 206b/recipes_c-ansi/recipes/shoot.c Sun Oct 11 03:43:49 1992 --- 208/recipes_c-ansi/recipes/shoot.c Mon Jul 14 20:34:01 1997 *************** *** 1 **** --- 1,2 ---- + /* note #undef's at end of file */ #define NRANSI diff -C1 -r 206b/recipes_c-ansi/recipes/shootf.c 208/recipes_c-ansi/recipes/shootf.c *** 206b/recipes_c-ansi/recipes/shootf.c Sun Oct 11 03:43:49 1992 --- 208/recipes_c-ansi/recipes/shootf.c Mon Jul 14 20:34:02 1997 *************** *** 1 **** --- 1,2 ---- + /* note #undef's at end of file */ #define NRANSI diff -C1 -r 206b/recipes_c-ansi/recipes/simp1.c 208/recipes_c-ansi/recipes/simp1.c *** 206b/recipes_c-ansi/recipes/simp1.c Sun Oct 11 03:43:50 1992 --- 208/recipes_c-ansi/recipes/simp1.c Mon Jul 14 20:34:02 1997 *************** *** 8,19 **** ! *kp=ll[1]; ! *bmax=a[mm+1][*kp+1]; ! for (k=2;k<=nll;k++) { ! if (iabf == 0) ! test=a[mm+1][ll[k]+1]-(*bmax); ! else ! test=fabs(a[mm+1][ll[k]+1])-fabs(*bmax); ! if (test > 0.0) { ! *bmax=a[mm+1][ll[k]+1]; ! *kp=ll[k]; } --- 8,23 ---- ! if (nll <= 0) ! *bmax=0.0; ! else { ! *kp=ll[1]; ! *bmax=a[mm+1][*kp+1]; ! for (k=2;k<=nll;k++) { ! if (iabf == 0) ! test=a[mm+1][ll[k]+1]-(*bmax); ! else ! test=fabs(a[mm+1][ll[k]+1])-fabs(*bmax); ! if (test > 0.0) { ! *bmax=a[mm+1][ll[k]+1]; ! *kp=ll[k]; ! } } diff -C1 -r 206b/recipes_c-ansi/recipes/simp2.c 208/recipes_c-ansi/recipes/simp2.c *** 206b/recipes_c-ansi/recipes/simp2.c Sun Mar 19 17:59:23 1995 --- 208/recipes_c-ansi/recipes/simp2.c Mon Jul 14 20:34:02 1997 *************** *** 1 **** --- 1,2 ---- + /* note #undef's at end of file */ #define EPS 1.0e-6 *************** *** 2,7 **** ! void simp2(float **a, int n, int l2[], int nl2, int *ip, int kp, float *q1) { ! int k,ii,i; ! float qp,q0,q; --- 3,8 ---- ! void simp2(float **a, int m, int n, int *ip, int kp) { ! int k,i; ! float qp,q0,q,q1; *************** *** 8,22 **** *ip=0; ! for (i=1;i<=nl2;i++) ! if (a[l2[i]+1][kp+1] < -EPS) break; ! if (i>nl2) return; ! *q1 = -a[l2[i]+1][1]/a[l2[i]+1][kp+1]; ! *ip=l2[i]; ! for (i=i+1;i<=nl2;i++) { ! ii=l2[i]; ! if (a[ii+1][kp+1] < -EPS) { ! q = -a[ii+1][1]/a[ii+1][kp+1]; ! if (q < *q1) { ! *ip=ii; ! *q1=q; ! } else if (q == *q1) { for (k=1;k<=n;k++) { --- 9,22 ---- *ip=0; ! for (i=1;i<=m;i++) ! if (a[i+1][kp+1] < -EPS) break; ! if (i>m) return; ! q1 = -a[i+1][1]/a[i+1][kp+1]; ! *ip=i; ! for (i=*ip+1;i<=m;i++) { ! if (a[i+1][kp+1] < -EPS) { ! q = -a[i+1][1]/a[i+1][kp+1]; ! if (q < q1) { ! *ip=i; ! q1=q; ! } else if (q == q1) { for (k=1;k<=n;k++) { *************** *** 23,25 **** qp = -a[*ip+1][k+1]/a[*ip+1][kp+1]; ! q0 = -a[ii+1][k+1]/a[ii+1][kp+1]; if (q0 != qp) break; --- 23,25 ---- qp = -a[*ip+1][k+1]/a[*ip+1][kp+1]; ! q0 = -a[i+1][k+1]/a[i+1][kp+1]; if (q0 != qp) break; *************** *** 26,28 **** } ! if (q0 < qp) *ip=ii; } --- 26,28 ---- } ! if (q0 < qp) *ip=i; } diff -C1 -r 206b/recipes_c-ansi/recipes/simplx.c 208/recipes_c-ansi/recipes/simplx.c *** 206b/recipes_c-ansi/recipes/simplx.c Sun Mar 19 17:59:23 1995 --- 208/recipes_c-ansi/recipes/simplx.c Mon Jul 14 20:34:02 1997 *************** *** 1 **** --- 1,2 ---- + /* note #undef's at end of file */ #define NRANSI *************** *** 3,6 **** #define EPS 1.0e-6 ! #define FREEALL free_ivector(l3,1,m);free_ivector(l2,1,m);\ ! free_ivector(l1,1,n+1); --- 4,6 ---- #define EPS 1.0e-6 ! #define FREEALL free_ivector(l3,1,m);free_ivector(l1,1,n+1); *************** *** 11,16 **** float *bmax); ! void simp2(float **a, int n, int l2[], int nl2, int *ip, int kp, float *q1); void simp3(float **a, int i1, int k1, int ip, int kp); ! int i,ip,ir,is,k,kh,kp,m12,nl1,nl2; ! int *l1,*l2,*l3; float q1,bmax; --- 11,16 ---- 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); ! int i,ip,is,k,kh,kp,nl1; ! int *l1,*l3; float q1,bmax; *************** *** 19,21 **** l1=ivector(1,n+1); - l2=ivector(1,m); l3=ivector(1,m); --- 19,20 ---- *************** *** 23,25 **** for (k=1;k<=n;k++) l1[k]=izrov[k]=k; - nl2=m; for (i=1;i<=m;i++) { --- 22,23 ---- *************** *** 26,28 **** if (a[i+1][1] < 0.0) nrerror("Bad input tableau in simplx"); - l2[i]=i; iposv[i]=n+i; --- 24,25 ---- *************** *** 29,34 **** } - for (i=1;i<=m2;i++) l3[i]=1; - ir=0; if (m2+m3) { ! ir=1; for (k=1;k<=(n+1);k++) { --- 26,29 ---- } if (m2+m3) { ! for (i=1;i<=m2;i++) l3[i]=1; for (k=1;k<=(n+1);k++) { *************** *** 38,40 **** } ! do { simp1(a,m+1,l1,nl1,0,&kp,&bmax); --- 33,35 ---- } ! for (;;) { simp1(a,m+1,l1,nl1,0,&kp,&bmax); *************** *** 44,47 **** } else if (bmax <= EPS && a[m+2][1] <= EPS) { ! m12=m1+m2+1; ! for (ip=m12;ip<=m;ip++) { if (iposv[ip] == (ip+n)) { --- 39,41 ---- } else if (bmax <= EPS && a[m+2][1] <= EPS) { ! for (ip=m1+m2+1;ip<=m;ip++) { if (iposv[ip] == (ip+n)) { *************** *** 48,50 **** simp1(a,ip,l1,nl1,1,&kp,&bmax); ! if (bmax > 0.0) goto one; --- 42,44 ---- simp1(a,ip,l1,nl1,1,&kp,&bmax); ! if (bmax > EPS) goto one; *************** *** 52,56 **** } ! ir=0; ! --m12; ! for (i=m1+1;i<=m12;i++) if (l3[i-m1] == 1) --- 46,48 ---- } ! for (i=m1+1;i<=m1+m2;i++) if (l3[i-m1] == 1) *************** *** 60,62 **** } ! simp2(a,n,l2,nl2,&ip,kp,&q1); if (ip == 0) { --- 52,54 ---- } ! simp2(a,m,n,&ip,kp); if (ip == 0) { *************** *** 71,83 **** for (is=k;is<=nl1;is++) l1[is]=l1[is+1]; - ++a[m+2][kp+1]; - for (i=1;i<=m+2;i++) a[i][kp+1] = -a[i][kp+1]; } else { ! if (iposv[ip] >= (n+m1+1)) { ! kh=iposv[ip]-m1-n; ! if (l3[kh]) { ! l3[kh]=0; ! ++a[m+2][kp+1]; ! for (i=1;i<=m+2;i++) ! a[i][kp+1] = -a[i][kp+1]; ! } } --- 63,71 ---- for (is=k;is<=nl1;is++) l1[is]=l1[is+1]; } else { ! kh=iposv[ip]-m1-n; ! if (kh >= 1 && l3[kh]) { ! l3[kh]=0; ! ++a[m+2][kp+1]; ! for (i=1;i<=m+2;i++) ! a[i][kp+1] = -a[i][kp+1]; } *************** *** 87,89 **** iposv[ip]=is; ! } while (ir); } --- 75,77 ---- iposv[ip]=is; ! } } *************** *** 91,93 **** simp1(a,0,l1,nl1,0,&kp,&bmax); ! if (bmax <= 0.0) { *icase=0; --- 79,81 ---- simp1(a,0,l1,nl1,0,&kp,&bmax); ! if (bmax <= EPS) { *icase=0; *************** *** 95,97 **** } ! simp2(a,n,l2,nl2,&ip,kp,&q1); if (ip == 0) { --- 83,85 ---- } ! simp2(a,m,n,&ip,kp); if (ip == 0) { diff -C1 -r 206b/recipes_c-ansi/recipes/simpr.c 208/recipes_c-ansi/recipes/simpr.c *** 206b/recipes_c-ansi/recipes/simpr.c Sun Oct 11 03:43:51 1992 --- 208/recipes_c-ansi/recipes/simpr.c Mon Jul 14 20:34:02 1997 *************** *** 1 **** --- 1,2 ---- + /* note #undef's at end of file */ #define NRANSI diff -C1 -r 206b/recipes_c-ansi/recipes/sobseq.c 208/recipes_c-ansi/recipes/sobseq.c *** 206b/recipes_c-ansi/recipes/sobseq.c Wed Feb 02 09:01:15 1994 --- 208/recipes_c-ansi/recipes/sobseq.c Mon Jul 14 20:34:02 1997 *************** *** 1 **** --- 1,2 ---- + /* note #undef's at end of file */ #define NRANSI diff -C1 -r 206b/recipes_c-ansi/recipes/sort.c 208/recipes_c-ansi/recipes/sort.c *** 206b/recipes_c-ansi/recipes/sort.c Sun Mar 19 17:59:23 1995 --- 208/recipes_c-ansi/recipes/sort.c Mon Jul 14 20:34:02 1997 *************** *** 1 **** --- 1,2 ---- + /* note #undef's at end of file */ #define NRANSI *************** *** 8,11 **** { ! unsigned long i,ir=n,j,k,l=1; ! int jstack=0,*istack; float a,temp; --- 9,12 ---- { ! unsigned long i,ir=n,j,k,l=1,*istack; ! int jstack=0; float a,temp; *************** *** 12,14 **** ! istack=ivector(1,NSTACK); for (;;) { --- 13,15 ---- ! istack=lvector(1,NSTACK); for (;;) { *************** *** 62,64 **** } ! free_ivector(istack,1,NSTACK); } --- 63,65 ---- } ! free_lvector(istack,1,NSTACK); } diff -C1 -r 206b/recipes_c-ansi/recipes/sort2.c 208/recipes_c-ansi/recipes/sort2.c *** 206b/recipes_c-ansi/recipes/sort2.c Sun Mar 19 17:59:23 1995 --- 208/recipes_c-ansi/recipes/sort2.c Mon Jul 14 20:34:02 1997 *************** *** 1 **** --- 1,2 ---- + /* note #undef's at end of file */ #define NRANSI *************** *** 8,11 **** { ! unsigned long i,ir=n,j,k,l=1; ! int *istack,jstack=0; float a,b,temp; --- 9,12 ---- { ! unsigned long i,ir=n,j,k,l=1,*istack; ! int jstack=0; float a,b,temp; *************** *** 12,14 **** ! istack=ivector(1,NSTACK); for (;;) { --- 13,15 ---- ! istack=lvector(1,NSTACK); for (;;) { *************** *** 27,29 **** if (!jstack) { ! free_ivector(istack,1,NSTACK); return; --- 28,30 ---- if (!jstack) { ! free_lvector(istack,1,NSTACK); return; diff -C1 -r 206b/recipes_c-ansi/recipes/sort3.c 208/recipes_c-ansi/recipes/sort3.c *** 206b/recipes_c-ansi/recipes/sort3.c Sun Oct 11 03:43:53 1992 --- 208/recipes_c-ansi/recipes/sort3.c Mon Jul 14 20:34:02 1997 *************** *** 1 **** --- 1,2 ---- + /* note #undef's at end of file */ #define NRANSI diff -C1 -r 206b/recipes_c-ansi/recipes/splin2.c 208/recipes_c-ansi/recipes/splin2.c *** 206b/recipes_c-ansi/recipes/splin2.c Fri Mar 19 01:03:35 1993 --- 208/recipes_c-ansi/recipes/splin2.c Mon Jul 14 20:34:03 1997 *************** *** 1 **** --- 1,2 ---- + /* note #undef's at end of file */ #define NRANSI diff -C1 -r 206b/recipes_c-ansi/recipes/spline.c 208/recipes_c-ansi/recipes/spline.c *** 206b/recipes_c-ansi/recipes/spline.c Sun Oct 11 03:43:55 1992 --- 208/recipes_c-ansi/recipes/spline.c Mon Jul 14 20:34:03 1997 *************** *** 1 **** --- 1,2 ---- + /* note #undef's at end of file */ #define NRANSI diff -C1 -r 206b/recipes_c-ansi/recipes/spread.c 208/recipes_c-ansi/recipes/spread.c *** 206b/recipes_c-ansi/recipes/spread.c Sun Oct 11 03:43:56 1992 --- 208/recipes_c-ansi/recipes/spread.c Mon Jul 14 20:34:03 1997 *************** *** 1 **** --- 1,2 ---- + /* note #undef's at end of file */ #define NRANSI *************** *** 6,8 **** int ihi,ilo,ix,j,nden; ! static int nfac[11]={0,1,1,2,6,24,120,720,5040,40320,362880}; float fac; --- 7,9 ---- int ihi,ilo,ix,j,nden; ! static long nfac[11]={0,1,1,2,6,24,120,720,5040,40320,362880}; float fac; diff -C1 -r 206b/recipes_c-ansi/recipes/stoerm.c 208/recipes_c-ansi/recipes/stoerm.c *** 206b/recipes_c-ansi/recipes/stoerm.c Sun Oct 11 03:43:58 1992 --- 208/recipes_c-ansi/recipes/stoerm.c Mon Jul 14 20:34:04 1997 *************** *** 1 **** --- 1,2 ---- + /* note #undef's at end of file */ #define NRANSI diff -C1 -r 206b/recipes_c-ansi/recipes/svbksb.c 208/recipes_c-ansi/recipes/svbksb.c *** 206b/recipes_c-ansi/recipes/svbksb.c Sun Oct 11 03:43:58 1992 --- 208/recipes_c-ansi/recipes/svbksb.c Mon Jul 14 20:34:04 1997 *************** *** 1 **** --- 1,2 ---- + /* note #undef's at end of file */ #define NRANSI diff -C1 -r 206b/recipes_c-ansi/recipes/svdfit.c 208/recipes_c-ansi/recipes/svdfit.c *** 206b/recipes_c-ansi/recipes/svdfit.c Sun Oct 11 03:43:59 1992 --- 208/recipes_c-ansi/recipes/svdfit.c Mon Jul 14 20:34:04 1997 *************** *** 1 **** --- 1,2 ---- + /* note #undef's at end of file */ #define NRANSI diff -C1 -r 206b/recipes_c-ansi/recipes/svdvar.c 208/recipes_c-ansi/recipes/svdvar.c *** 206b/recipes_c-ansi/recipes/svdvar.c Sun Oct 11 03:43:59 1992 --- 208/recipes_c-ansi/recipes/svdvar.c Mon Jul 14 20:34:04 1997 *************** *** 1 **** --- 1,2 ---- + /* note #undef's at end of file */ #define NRANSI diff -C1 -r 206b/recipes_c-ansi/recipes/toeplz.c 208/recipes_c-ansi/recipes/toeplz.c *** 206b/recipes_c-ansi/recipes/toeplz.c Sun Oct 11 03:43:59 1992 --- 208/recipes_c-ansi/recipes/toeplz.c Mon Jul 14 20:34:04 1997 *************** *** 1 **** --- 1,2 ---- + /* note #undef's at end of file */ #define NRANSI diff -C1 -r 206b/recipes_c-ansi/recipes/trapzd.c 208/recipes_c-ansi/recipes/trapzd.c *** 206b/recipes_c-ansi/recipes/trapzd.c Sun Oct 11 03:44:00 1992 --- 208/recipes_c-ansi/recipes/trapzd.c Mon Jul 14 20:34:04 1997 *************** *** 1 **** --- 1,2 ---- + /* note #undef's at end of file */ #define FUNC(x) ((*func)(x)) diff -C1 -r 206b/recipes_c-ansi/recipes/tridag.c 208/recipes_c-ansi/recipes/tridag.c *** 206b/recipes_c-ansi/recipes/tridag.c Sun Oct 11 03:44:01 1992 --- 208/recipes_c-ansi/recipes/tridag.c Mon Jul 14 20:34:04 1997 *************** *** 1 **** --- 1,2 ---- + /* note #undef's at end of file */ #define NRANSI diff -C1 -r 206b/recipes_c-ansi/recipes/trnspt.c 208/recipes_c-ansi/recipes/trnspt.c *** 206b/recipes_c-ansi/recipes/trnspt.c Sun Mar 19 17:59:23 1995 --- 208/recipes_c-ansi/recipes/trnspt.c Mon Jul 14 20:34:04 1997 *************** *** 1 **** --- 1,2 ---- + /* note #undef's at end of file */ #define NRANSI diff -C1 -r 206b/recipes_c-ansi/recipes/vander.c 208/recipes_c-ansi/recipes/vander.c *** 206b/recipes_c-ansi/recipes/vander.c Fri Feb 04 09:26:55 1994 --- 208/recipes_c-ansi/recipes/vander.c Mon Jul 14 20:34:05 1997 *************** *** 1 **** --- 1,2 ---- + /* note #undef's at end of file */ #define NRANSI diff -C1 -r 206b/recipes_c-ansi/recipes/voltra.c 208/recipes_c-ansi/recipes/voltra.c *** 206b/recipes_c-ansi/recipes/voltra.c Sun Oct 11 03:44:03 1992 --- 208/recipes_c-ansi/recipes/voltra.c Mon Jul 14 20:34:05 1997 *************** *** 1 **** --- 1,2 ---- + /* note #undef's at end of file */ #define NRANSI diff -C1 -r 206b/recipes_c-ansi/recipes/wtn.c 208/recipes_c-ansi/recipes/wtn.c *** 206b/recipes_c-ansi/recipes/wtn.c Sun Oct 11 03:44:03 1992 --- 208/recipes_c-ansi/recipes/wtn.c Mon Jul 14 20:34:05 1997 *************** *** 1 **** --- 1,2 ---- + /* note #undef's at end of file */ #define NRANSI diff -C1 -r 206b/recipes_c-ansi/recipes/zrhqr.c 208/recipes_c-ansi/recipes/zrhqr.c *** 206b/recipes_c-ansi/recipes/zrhqr.c Sun Oct 11 03:44:04 1992 --- 208/recipes_c-ansi/recipes/zrhqr.c Mon Jul 14 20:34:05 1997 *************** *** 1 **** --- 1,2 ---- + /* note #undef's at end of file */ #define NRANSI