/************************************************************************/ /*File: prandom.h */ /*Date created: June 14, 1999 */ /*Current Date: June 23, 1999 */ /*Description: Prototypes for functions defined in the file, prandom.c */ /************************************************************************/ /* CVS info */ /* $Date: 2005/01/10 20:57:47 $ */ /* $Revision: 1.2 $ */ /* $RCSfile: prandom.h,v $ */ /* $Name: rel_5 $ */ #ifndef PRANDOM_H #define PRANDOM_H /*Definitions of constants used by functions in prandom.c If conditions */ /*change, altering the value of the constants here will affect all */ /*associated functions in the file prandom.c. In order to match the */ /*amount of precision in the FORTRAN generated numbers, the state and */ /*output arrays for floating point numbers need to be declared as doubles*/ /*Also, for all datatypes, the user's nseqs must be greater than npes in */ /*order to avoid dividing by zero in the bookkeeping routine get_penum. */ /*Furthermore, npes*chnksize <= lendata and penum must be between zero */ /*and (npes-1).*/ #define L 158 #define k 128 #define s 63 #define mbits 23 #define min(A, B) ((A) < (B) ? (A) : (B)) /*************************INITIALIZATION FUNCITONS***********************/ void initiran(int,int,int[2][2][L]); void initfran(int, int, double[2][L]); /***************************GENERATION FUNCTIONS*************************/ void irand(int,int[2][2][L],int[]); void frand(int, double[2][L], double[]); void brand64(int,int[2][2][L],long int[]); /***************************BOOKKEEPING FUNCTIONS************************/ /*In get_penum, the nseqs must be greater than npes to avoid dividing*/ /*by zero.*/ void get_penum(int seqnum, int npes, int nseqs, int *penum); void get_seq_num(int penum, int npes, int nseqs, int *seqfirst, int *seqlast); void get_seq_bounds(int seqnum, int nseqs, int lendata, int chnksize, int *datafirst, int *datalast); /*****************************USER'S INTERFACE***************************/ void get_my_idata(int, int, int, int, int, int, int[], int*, int*); /*Output stream array is a double to match FORTRAN's precision. Also, */ /*declares state to be a two dimensional double array. */ void get_my_fdata(int, int, int, int, int, int, double[], int*, int*); void get_my_bdata64(int, int, int, int, int, int, long int[], int*, int*); /******************************OTHER FUNCTIONS***************************/ void check_maxlen(int, int, int, int, int*); void tausinit(int,int,int*,int*); void taus32(int*,int); #endif /************************************************************************/ /*************************END OF FILE: prandom.h*************************/ /************************************************************************/