From a04f85207ca9c68e39c6e2f1b0f29eeb062451bd Mon Sep 17 00:00:00 2001 From: hackbard Date: Thu, 17 Jun 2004 06:30:33 +0000 Subject: [PATCH] finished random reject method --- .cvsignore | 1 - nlsop.c | 28 +++++++++++++++++++--------- random_parse.sh | 2 +- 3 files changed, 20 insertions(+), 11 deletions(-) diff --git a/.cvsignore b/.cvsignore index 2e9473b..259d33b 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1,4 +1,3 @@ *data* -Makefile nlsop conv_fg_tif diff --git a/nlsop.c b/nlsop.c index 10a3f2f..11f81f5 100644 --- a/nlsop.c +++ b/nlsop.c @@ -118,7 +118,7 @@ int process_cell(d3_lattice *d3_l,u32 x,u32 y,u32 z,info *my_info) return 1; } -int distrib_c(d3_lattice *d3_l,info *my_info,int step,double c_ratio) +int distrib_c(d3_lattice *d3_l,info *my_info,int step,double c_ratio,u32 rj_m,u32 *rj_g) { u32 x,y,z; int i,j,k,c; @@ -131,8 +131,9 @@ int distrib_c(d3_lattice *d3_l,info *my_info,int step,double c_ratio) x=get_rand(d3_l->max_x); y=get_rand(d3_l->max_y); // printf("nd: %d %d\n",x,y); - z=get_rand_lgp(d3_l->max_z,my_info->a_cd,my_info->b_cd); - // printf("ld: %d\n",z); + // z=get_rand_lgp(d3_l->max_z,my_info->a_cd,my_info->b_cd); + z=get_rand_reject(d3_l->max_z,rj_m,rj_g); + // printf("%d\n",z); *(d3_l->extra+x+y*d3_l->max_x+z*d3_l->max_x*d3_l->max_y)+=1; (my_info->cc)++; } @@ -747,13 +748,15 @@ u32 get_reject_graph(info *my_info,d3_lattice *d3_l,char *file,u32 *graph) { 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]; } free(flag); + // printf("debug: (interpolated c profile)\n"); + // for(i=0;imax_z;i++) printf("%d %d\n",i,graph[i]); + return max; } @@ -800,6 +803,7 @@ int main(int argc,char **argv) #endif u32 *c_profile; u32 *n_e_loss; + u32 ne_max,ip_max; d3_l.max_x=X; d3_l.max_y=Y; @@ -834,7 +838,8 @@ int main(int argc,char **argv) convert=0; strcpy(r_file,""); mode=0; - u32 ne_max; + ne_max=0; + ip_max=0; for(i=1;i