From: hackbard Date: Wed, 16 Jun 2004 15:24:16 +0000 (+0000) Subject: some more work getting random reject method to work X-Git-Url: https://hackdaworld.org/gitweb/?a=commitdiff_plain;ds=inline;h=f74b482d7bd66fe861621276c6564c55e394f209;p=physik%2Fnlsop.git some more work getting random reject method to work --- diff --git a/nlsop.c b/nlsop.c index 58f19f7..10a3f2f 100644 --- a/nlsop.c +++ b/nlsop.c @@ -694,13 +694,15 @@ int get_c_ratio(double *c_ratio,char *pfile,info *my_info,d3_lattice *d3_l) return 1; } -int get_reject_graph(info *my_info,d3_lattice *d3_l,char *file,u32 *graph) { +u32 get_reject_graph(info *my_info,d3_lattice *d3_l,char *file,u32 *graph) { double a,b; int i,j,k; int fd; char buf[32],*p; unsigned char *flag; + u32 max; + max=0; if((fd=open(file,O_RDONLY))<0) { puts("cannot open file to calculate rejection graph"); @@ -738,18 +740,21 @@ int get_reject_graph(info *my_info,d3_lattice *d3_l,char *file,u32 *graph) { } /* do (linear) interpolation here! */ i=0; + a=0; while(imax_z) { - a=0; - - // WEITER HIER !! - + /* graph[0] is 0! */ + j=i; + i++; + while(flag[i]==0&&imax_z) i++; + printf("debug: i = %d j = %d\n",i,j); + for(k=j+1;kmax) max=graph[i]; } - printf("%s graph:\n",file); - for(i=0;imax_z;i++) printf("%02d | %d\n",i,graph[i]); + free(flag); - return 1; + return max; } int main(int argc,char **argv) @@ -829,6 +834,7 @@ int main(int argc,char **argv) convert=0; strcpy(r_file,""); mode=0; + u32 ne_max; for(i=1;i