=================================================================== RCS file: /home/cvs/OpenXM/src/hgm/mh/src/jack-n.c,v retrieving revision 1.32 retrieving revision 1.39 diff -u -p -r1.32 -r1.39 --- OpenXM/src/hgm/mh/src/jack-n.c 2015/04/02 01:11:13 1.32 +++ OpenXM/src/hgm/mh/src/jack-n.c 2016/02/04 02:52:19 1.39 @@ -5,7 +5,7 @@ #include #include "sfile.h" /* - $OpenXM: OpenXM/src/hgm/mh/src/jack-n.c,v 1.31 2015/04/02 00:11:32 takayama Exp $ + $OpenXM: OpenXM/src/hgm/mh/src/jack-n.c,v 1.38 2016/02/01 07:05:25 takayama Exp $ Ref: copied from this11/misc-2011/A1/wishart/Prog jack-n.c, translated from mh.rr or tk_jack.rr in the asir-contrib. License: LGPL Koev-Edelman for higher order derivatives. @@ -15,6 +15,8 @@ 2. Use the recurrence to obtain beta(). 3. Easier input data file format for mh-n.c Changelog: + 2016.02.01 ifdef C_2F1 ... + 2016.01.12 2F1 2014.03.15 http://fe.math.kobe-u.ac.jp/Movies/oxvh/2014-03-11-jack-n-c-automatic see also hgm/doc/ref.html, @s/2014/03/15-my-note-jack-automatic-order-F_A-casta.pdf. 2014.03.14, --automatic option. Output estimation data. 2012.02.21, porting to OpenXM/src/hgm @@ -55,8 +57,24 @@ static double Ef2; #define M_n0 3 /* used for tests. Must be equal to M_n */ #define M_m_MAX 200 #define M_nmx M_m_MAX /* maximal of M_n */ +#ifdef C_2F1 +#define A_LEN 2 /* (a_1) , (a_1, ..., a_p)*/ +#define B_LEN 1 /* (b_1) */ +static int P_pFq=2; +static int Q_pFq=1; +#else #define A_LEN 1 /* (a_1) , (a_1, ..., a_p)*/ #define B_LEN 1 /* (b_1) */ +static int P_pFq=1; +static int Q_pFq=1; +#endif +static double A_pFq[A_LEN]; +static double B_pFq[B_LEN]; +#ifndef C_2F1 +static int Orig_1F1=1; +#else +static int Orig_1F1=0; +#endif static int Debug = 0; static int Alpha = 2; /* 2 implies the zonal polynomial */ static int *Darray = NULL; @@ -446,9 +464,9 @@ static int hdk(int K[],int I,int J) { */ static double jjk(int K[]) { extern int Alpha; - int A,L,I,J; + int L,I,J; double V; - A=Alpha; + V=1; L=plength(K); for (I=0; I Q) { + for (I=0; I= M_kap[From], ..., M_kap[To], |(M_kap[From],...,M_kap[To])|<=M, */ static int pListPartition2(int Less,int From,int To, int M) { - int I,R; + int I; mh_check_intr(100); if (To < From) { (*M_pExec)(); return(0); } for (I=1; (I<=Less) && (I<=M) ; I++) { M_kap[From-1] = I; - R = pListPartition2(I,From+1,To,M-I); + pListPartition2(I,From+1,To,M-I); } return(1); } /* - partition に対してやる仕事をこちらへ書く. + Commands to do for each partition are given here. */ static void pExec_0() { if (Debug) { @@ -1504,7 +1532,7 @@ struct MH_RESULT *jk_main2(int argc,char *argv[],int a // double ef; int i,j; // int i,j,rank; - double a[1]; double b[1]; + double a[A_LEN]; double b[B_LEN]; extern double M_x[]; extern double *Beta; extern int M_2n; @@ -1572,7 +1600,7 @@ struct MH_RESULT *jk_main2(int argc,char *argv[],int a if (M_n > Mapprox) Mapprox=M_n; } /* Output by a file=stdout */ - ofp = mh_fopen("oxstdout","w",JK_byFile); + ofp = mh_fopen("stdout","w",JK_byFile); sprintf(swork,"%%%%Use --help option to see the help.\n"); mh_fputs(swork,ofp); sprintf(swork,"%%%%Mapprox=%d\n",Mapprox); mh_fputs(swork,ofp); @@ -1595,9 +1623,19 @@ struct MH_RESULT *jk_main2(int argc,char *argv[],int a } } - a[0] = ((double)Mg+1.0)/2.0; - b[0] = ((double)Mg+1.0)/2.0 + ((double) (*Ng))/2.0; /* bug, double check */ - if (Debug) oxprintf("Calling mh_t with ([%lf],[%lf],%d,%d)\n",a[0],b[0],M_n,Mapprox); + if ((P_pFq != A_LEN) || (Q_pFq != B_LEN)) { + oxprintfe("It must be P_pFq == A_LEN and Q_pFq == B_LEN in this version. %s\n",""); + mh_exit(-1); + } + oxprintfe("%%%%(stderr) Orig_1F1=%d\n",Orig_1F1); + if ((P_pFq == 1) && (Q_pFq == 1) && (Orig_1F1)) { + A_pFq[0] = a[0] = ((double)Mg+1.0)/2.0; + B_pFq[0] = b[0] = ((double)Mg+1.0)/2.0 + ((double) (*Ng))/2.0; /* bug, double check */ + if (Debug) oxprintf("Calling mh_t with ([%lf],[%lf],%d,%d)\n",a[0],b[0],M_n,Mapprox); + }else{ + for (i=0; i