/* deqsy.c CCMATH mathematics library source code. * * Copyright (C) 2000 Daniel A. Atkinson All rights reserved. * This code may be redistributed under the terms of the GNU library * public license (LGPL). ( See the lgpl.license file for details.) * ------------------------------------------------------------------------ */ #include #include deqsy(double *y,int n,double a,double b,int nd,double te, int (*fsys)()) { double h,x,ht,st,*dp,*fp,*fq,*ap,*p,*q,*pt; int m,j,k; fp=(double *)calloc(13*n,sizeof(double)); fq=fp+n; dp=fq+n; ap=dp+n; h=(b-a)/nd; for(m=0; m>=0 ;){ ++m; (*fsys)(x=a,y,dp); for(j=0,p=fp,q=fq,pt=dp; p1){ for(k=0,p=fp,q=dp; pte*fabs(*p++)){ k=1; break;} } if(k==0) break; if(m==10) m= -m; } } for(p=y,q=fp; q