version 1.7, 2013/02/23 06:01:15 |
version 1.8, 2013/03/01 05:26:25 |
|
|
/* |
/* |
$OpenXM: OpenXM/src/hgm/mh/src/wmain.c,v 1.6 2013/02/21 07:30:56 takayama Exp $ |
$OpenXM: OpenXM/src/hgm/mh/src/wmain.c,v 1.7 2013/02/23 06:01:15 takayama Exp $ |
License: LGPL |
License: LGPL |
*/ |
*/ |
#include <stdio.h> |
#include <stdio.h> |
Line 56 void mh_freeWorkArea(void) { |
|
Line 56 void mh_freeWorkArea(void) { |
|
mh_rf(0.0, NULL, 0, NULL, 0); |
mh_rf(0.0, NULL, 0, NULL, 0); |
MH_deallocate=0; /* switch to the normal mode. */ |
MH_deallocate=0; /* switch to the normal mode. */ |
} |
} |
static mypower(int x,int n) { |
static int mypower(int x,int n) { |
int a,i; |
int a,i; |
a = 1; |
a = 1; |
for (i=0; i<n; i++) a = a*x; |
for (i=0; i<n; i++) a = a*x; |
Line 133 struct MH_RESULT *mh_main(int argc,char *argv[]) { |
|
Line 133 struct MH_RESULT *mh_main(int argc,char *argv[]) { |
|
return(rp); |
return(rp); |
} |
} |
|
|
mh_usage() { |
int mh_usage() { |
fprintf(stderr,"Usages:\n"); |
fprintf(stderr,"Usages:\n"); |
fprintf(stderr,"w-m [--idata input_data_file --gnuplotf gnuplot_file_name\n"); |
fprintf(stderr,"w-m [--idata input_data_file --gnuplotf gnuplot_file_name\n"); |
fprintf(stderr," --dataf output_data_file --raw --xmax xmax --test m --step h]\n"); |
fprintf(stderr," --dataf output_data_file --raw --xmax xmax --test m --step h]\n"); |
|
|
fprintf(stderr," tmp-graph is the table of x and the values of Pr({y | y<x}).\n"); |
fprintf(stderr," tmp-graph is the table of x and the values of Pr({y | y<x}).\n"); |
} |
} |
|
|
static setParamTest() { |
static int setParamTest() { |
int rank; |
int rank; |
int i; |
int i; |
extern int Testrank; |
extern int Testrank; |
Line 183 static setParamTest() { |
|
Line 183 static setParamTest() { |
|
MH_Dp = 1; |
MH_Dp = 1; |
Xng = 10.0; |
Xng = 10.0; |
} |
} |
static setParamDefault() { |
static int setParamDefault() { |
int rank; |
int rank; |
MH_M=MH_Mg = 2 ; |
MH_M=MH_Mg = 2 ; |
MH_RANK=rank = mypower(2,MH_Mg); |
MH_RANK=rank = mypower(2,MH_Mg); |
Line 202 static setParamDefault() { |
|
Line 202 static setParamDefault() { |
|
Xng = 10.0; |
Xng = 10.0; |
} |
} |
|
|
static next(struct SFILE *sfp,char *s,char *msg) { |
static int next(struct SFILE *sfp,char *s,char *msg) { |
s[0] = '%'; |
s[0] = '%'; |
while (s[0] == '%') { |
while (s[0] == '%') { |
if (!mh_fgets(s,SMAX,sfp)) { |
if (!mh_fgets(s,SMAX,sfp)) { |
Line 212 static next(struct SFILE *sfp,char *s,char *msg) { |
|
Line 212 static next(struct SFILE *sfp,char *s,char *msg) { |
|
if (s[0] != '%') return(0); |
if (s[0] != '%') return(0); |
} |
} |
} |
} |
static setParam(char *fname) { |
static int setParam(char *fname) { |
int rank; |
int rank; |
char s[SMAX]; |
char s[SMAX]; |
struct SFILE *fp; |
struct SFILE *fp; |
Line 268 static setParam(char *fname) { |
|
Line 268 static setParam(char *fname) { |
|
mh_fclose(fp); |
mh_fclose(fp); |
} |
} |
|
|
showParam() { |
int showParam() { |
int rank,i; |
int rank,i; |
rank = mypower(2,MH_Mg); |
rank = mypower(2,MH_Mg); |
printf("%%MH_Mg=\n%d\n",MH_Mg); |
printf("%%MH_Mg=\n%d\n",MH_Mg); |