version 1.30, 2016/02/13 05:55:09 |
version 1.35, 2016/06/04 07:52:14 |
|
|
/* |
/* |
$OpenXM: OpenXM/src/hgm/mh/src/wmain.c,v 1.29 2016/02/13 02:34:20 takayama Exp $ |
$OpenXM: OpenXM/src/hgm/mh/src/wmain.c,v 1.34 2016/03/02 00:27:02 takayama Exp $ |
License: LGPL |
License: LGPL |
*/ |
*/ |
#include <stdio.h> |
#include <stdio.h> |
Line 179 struct MH_RESULT *mh_main(int argc,char *argv[]) { |
|
Line 179 struct MH_RESULT *mh_main(int argc,char *argv[]) { |
|
if (MH_strategy) { |
if (MH_strategy) { |
if (MH_abserr > SIGDIGIT_DEFAULT*myabs(y0[0])) { |
if (MH_abserr > SIGDIGIT_DEFAULT*myabs(y0[0])) { |
MH_success = 0; |
MH_success = 0; |
oxprintfe("%%%%Warning, abserr seems not to be small enough, abserr=%lg, y[0]=%lg\n",MH_abserr,y0[0]); |
oxprintfe("%%%%Warning, abserr seems not to be small enough, abserr=%lg, y[0]=%lg. Increasing the starting point (q0 or X0g(standalone case)) may or making abserr (err[1] or abserror(standalone case)) smaller will help, e.g., err=c(1e-20,1e-10)\n",MH_abserr,y0[0]); |
}else{ |
}else{ |
MH_success = 1; |
MH_success = 1; |
} |
} |
Line 242 static int setParamDefault() { |
|
Line 242 static int setParamDefault() { |
|
Ef = 0.01034957388338225707; |
Ef = 0.01034957388338225707; |
MH_X0g = 0.3; |
MH_X0g = 0.3; |
MH_Hg = 0.001; |
MH_Hg = 0.001; |
MH_Dp = 1; |
MH_Dp = 1000; |
Xng = 10.0; return(0); |
Xng = 10.0; return(0); |
} |
} |
|
#ifdef STANDALONE |
|
/* may remove */ |
static int next_old1(struct SFILE *sfp,char *s,char *msg) { |
static int next_old1(struct SFILE *sfp,char *s,char *msg) { |
s[0] = '%'; |
s[0] = '%'; |
while (s[0] == '%') { |
while (s[0] == '%') { |
Line 256 static int next_old1(struct SFILE *sfp,char *s,char *m |
|
Line 257 static int next_old1(struct SFILE *sfp,char *s,char *m |
|
if (s[0] != '%') return(0); |
if (s[0] != '%') return(0); |
} return(0); |
} return(0); |
} |
} |
|
#endif |
static int next(struct SFILE *sfp,char *s,char *msg) { |
static int next(struct SFILE *sfp,char *s,char *msg) { |
static int check=1; |
static int check=1; |
char *ng="%%Ng="; |
char *ng="%%Ng="; |
Line 314 static int setParam(char *fname) { |
|
Line 316 static int setParam(char *fname) { |
|
Ef=1.0; /* exponential factor */ |
Ef=1.0; /* exponential factor */ |
MH_Ef_type=1; |
MH_Ef_type=1; |
MH_Hg=0.01; /* step size for RK */ |
MH_Hg=0.01; /* step size for RK */ |
MH_Dp = 1; /* sampling rate */ |
MH_Dp = -1; /* sampling rate */ |
Xng = 10.0; /* terminal point for RK */ |
Xng = 10.0; /* terminal point for RK */ |
|
|
/* Parser for the old style (version <2.0) input */ |
/* Parser for the old style (version <2.0) input */ |
Line 592 static int setParam(char *fname) { |
|
Line 594 static int setParam(char *fname) { |
|
} |
} |
if ((MH_M < 0) || (MH_A_pFq==NULL)) { |
if ((MH_M < 0) || (MH_A_pFq==NULL)) { |
oxprintfe("MH_M and p_pFq, q_pFq are compulsory parameters.\n"); mh_exit(-1); |
oxprintfe("MH_M and p_pFq, q_pFq are compulsory parameters.\n"); mh_exit(-1); |
|
} |
|
if (MH_Dp < 0) MH_Dp = (int) floor(1/MH_Hg); |
|
if (MH_P95 && (MH_Dp*MH_Hg < 2.0)) { |
|
oxprintfe("%%%%Warning, the resolution to find 95 percent point is less than 2.0. Decrease Dp\n"); |
} |
} |
|
|
mh_fclose(fp); return(0); |
mh_fclose(fp); return(0); |