=================================================================== RCS file: /home/cvs/OpenXM/src/hgm/mh/src/rk.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -p -r1.6 -r1.7 --- OpenXM/src/hgm/mh/src/rk.c 2013/03/01 05:26:25 1.6 +++ OpenXM/src/hgm/mh/src/rk.c 2013/03/07 03:00:43 1.7 @@ -1,8 +1,8 @@ /* -License: LGPL -Ref: Copied from this11/misc-2011/A1/wishart/Prog -$OpenXM: OpenXM/src/hgm/mh/src/rk.c,v 1.5 2013/02/23 06:01:15 takayama Exp $ - */ + License: LGPL + Ref: Copied from this11/misc-2011/A1/wishart/Prog + $OpenXM: OpenXM/src/hgm/mh/src/rk.c,v 1.6 2013/03/01 05:26:25 takayama Exp $ +*/ #include #include #include @@ -40,15 +40,15 @@ int mh_gopen_file() { fprintf(stderr,"MH_Dfname=%s\n",MH_Dfname); } if (MH_RANK != mypower(2,MH_Mg)) { - fprintf(stderr,"rk.c MH_RANK=%d is not equal to 2^MH_Mg=%d. input_data_file is broken.\n",MH_RANK,mypower(2,MH_Mg)); - mh_usage(); - mh_exit(-1); + fprintf(stderr,"rk.c MH_RANK=%d is not equal to 2^MH_Mg=%d. input_data_file is broken.\n",MH_RANK,mypower(2,MH_Mg)); + mh_usage(); + mh_exit(-1); } if (MH_Dfname != NULL) { if (!MH_RawName) { sprintf(&(MH_Dfname[strlen(MH_Dfname)]),"-m%d-n%lf-x0%lf-b",MH_Mg,*MH_Ng,MH_X0g); for (i=0; i0?(xxn)); x += h) { - if (Df) show_v(x,y, MH_RANK); - if (Gf) { - sprintf(swork,"%lf %le\n",x,y[0]); - mh_fputs(swork,Gf); - } - /* Output 95% point */ - if (MH_P95) { - if ((MH_P95==1) && (y[0] >= 0.95)) { - printf("x=%le, y[0]=%lf\n",x,y[0]); - MH_P95=2; - }else if ((MH_P95==2) && (y[0] >=0.9500000001)) { - printf("x=%le, y[0]=%lf\n",x,y[0]); - MH_P95=0; - } - } + if (Df) show_v(x,y, MH_RANK); + if (Gf) { + sprintf(swork,"%lf %le\n",x,y[0]); + mh_fputs(swork,Gf); + } + /* Output 95% point */ + if (MH_P95) { + if ((MH_P95==1) && (y[0] >= 0.95)) { + printf("x=%le, y[0]=%lf\n",x,y[0]); + MH_P95=2; + }else if ((MH_P95==2) && (y[0] >=0.9500000001)) { + printf("x=%le, y[0]=%lf\n",x,y[0]); + MH_P95=0; + } + } mh_rf(x, y, MH_RANK, temp, MH_RANK); for (i = 0; i < MH_RANK; i++) k1[i] = h * temp[i];