=================================================================== RCS file: /home/cvs/OpenXM_contrib2/asir2000/engine/gfs.c,v retrieving revision 1.2 retrieving revision 1.4 diff -u -p -r1.2 -r1.4 --- OpenXM_contrib2/asir2000/engine/gfs.c 2001/03/14 06:04:53 1.2 +++ OpenXM_contrib2/asir2000/engine/gfs.c 2001/03/29 09:49:58 1.4 @@ -45,7 +45,7 @@ * DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE, * PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE. * - * $OpenXM: OpenXM_contrib2/asir2000/engine/gfs.c,v 1.1 2001/03/13 01:10:25 noro Exp $ + * $OpenXM: OpenXM_contrib2/asir2000/engine/gfs.c,v 1.3 2001/03/14 06:27:57 noro Exp $ */ #include "ca.h" @@ -229,7 +229,7 @@ GFS *b; else if ( OID(a) == O_N && NID(a) == N_M ) mqtogfs(a,b); else if ( OID(a) == O_N && NID(a) == N_Q ) { - ptomp(current_gfs_q,(P)a,&t); mqtogfs(t,b); + ptomp(current_gfs_p,(P)a,&t); mqtogfs(t,b); } else error("ntogfs : invalid argument"); } @@ -398,4 +398,21 @@ GFS a,b; else return 0; } +} + +void randomgfs(r) +GFS *r; +{ + unsigned int t; + + if ( !current_gfs_q1 ) + error("addgfs : current_gfs_q is not set"); + t = mt_genrand()%current_gfs_q; + if ( !t ) + *r = 0; + else { + if ( t == current_gfs_q1 ) + t = 0; + MKGFS(t,*r); + } }