version 1.22, 2015/03/24 05:59:43 |
version 1.24, 2015/04/02 01:11:13 |
|
|
/* |
/* |
$OpenXM: OpenXM/src/hgm/mh/src/wmain.c,v 1.21 2014/03/20 10:58:37 takayama Exp $ |
$OpenXM: OpenXM/src/hgm/mh/src/wmain.c,v 1.23 2015/03/24 07:49:06 takayama Exp $ |
License: LGPL |
License: LGPL |
*/ |
*/ |
#include <stdio.h> |
#include <stdio.h> |
Line 85 static int mypower(int x,int n) { |
|
Line 85 static int mypower(int x,int n) { |
|
return(a); |
return(a); |
} |
} |
#ifdef STANDALONE2 |
#ifdef STANDALONE2 |
main(int argc,char *argv[]) { |
int main(int argc,char *argv[]) { |
int strategy=STRATEGY_DEFAULT; |
int strategy=STRATEGY_DEFAULT; |
double err[2]={-1.0,-1.0}; |
double err[2]={-1.0,-1.0}; |
int i; |
int i; |
Line 213 int mh_usage() { |
|
Line 213 int mh_usage() { |
|
oxprintfe(" gnuplot -persist <test-g-gp.txt\n"); |
oxprintfe(" gnuplot -persist <test-g-gp.txt\n"); |
oxprintfe(" tmp-idata3.txt is a sample input data distributed with this file.\n"); |
oxprintfe(" tmp-idata3.txt is a sample input data distributed with this file.\n"); |
oxprintfe(" test-g-gp.txt is an input file of the gnuplot\n"); |
oxprintfe(" test-g-gp.txt is an input file of the gnuplot\n"); |
oxprintfe(" test-g is the table of x and the values of Pr({y | y<x}).\n"); |
oxprintfe(" test-g is the table of x and the values of Pr({y | y<x}).\n"); return(0); |
} |
} |
|
|
static int setParamTest() { |
static int setParamTest() { |
Line 234 static int setParamTest() { |
|
Line 234 static int setParamTest() { |
|
MH_X0g = 0.3; |
MH_X0g = 0.3; |
MH_Hg = 0.001; |
MH_Hg = 0.001; |
MH_Dp = 1; |
MH_Dp = 1; |
Xng = 10.0; |
Xng = 10.0; return(0); |
} |
} |
static int setParamDefault() { |
static int setParamDefault() { |
int rank; |
int rank; |
Line 252 static int setParamDefault() { |
|
Line 252 static int setParamDefault() { |
|
MH_X0g = 0.3; |
MH_X0g = 0.3; |
MH_Hg = 0.001; |
MH_Hg = 0.001; |
MH_Dp = 1; |
MH_Dp = 1; |
Xng = 10.0; |
Xng = 10.0; return(0); |
} |
} |
|
|
static int next(struct SFILE *sfp,char *s,char *msg) { |
static int next(struct SFILE *sfp,char *s,char *msg) { |
Line 263 static int next(struct SFILE *sfp,char *s,char *msg) { |
|
Line 263 static int next(struct SFILE *sfp,char *s,char *msg) { |
|
mh_exit(-1); |
mh_exit(-1); |
} |
} |
if (s[0] != '%') return(0); |
if (s[0] != '%') return(0); |
} |
} return(0); |
} |
} |
static int setParam(char *fname) { |
static int setParam(char *fname) { |
int rank; |
int rank; |
Line 359 static int setParam(char *fname) { |
|
Line 359 static int setParam(char *fname) { |
|
oxprintfe("Unknown ID at %s\n",s); mh_exit(-1); |
oxprintfe("Unknown ID at %s\n",s); mh_exit(-1); |
} |
} |
|
|
mh_fclose(fp); |
mh_fclose(fp); return(0); |
} |
} |
|
|
static int showParam() { |
static int showParam() { |
Line 385 static int showParam() { |
|
Line 385 static int showParam() { |
|
oxprintf("%%abserr=%lg, %%relerr=%lg\n",MH_abserr,MH_relerr); |
oxprintf("%%abserr=%lg, %%relerr=%lg\n",MH_abserr,MH_relerr); |
oxprintf("#MH_success=%d\n",MH_success); |
oxprintf("#MH_success=%d\n",MH_success); |
oxprintf("#MH_coeff_max=%lg\n",MH_coeff_max); |
oxprintf("#MH_coeff_max=%lg\n",MH_coeff_max); |
oxprintf("#MH_estimated_start_step=%lg\n",MH_estimated_start_step); |
oxprintf("#MH_estimated_start_step=%lg\n",MH_estimated_start_step); return(0); |
} |
} |
|
|
static double estimateHg(int m, double beta[],double x0) { |
static double estimateHg(int m, double beta[],double x0) { |