1 #ifndef _lfg_h 2 #define _lfg_h 3 4 extern "C" { 5 class LFG : public Sprng 6 { 7 public: 8 9 LFG(); 10 int init_rng (int, int, int, int); 11 ~LFG(); 12 LFG (const LFG &); 13 LFG & operator= (const LFG &); 14 15 int get_rn_int(); 16 float get_rn_flt (); 17 double get_rn_dbl (); 18 int spawn_rng (int nspawned, Sprng ***); 19 int get_seed_rng (); 20 int free_rng (); 21 int pack_rng (char **); 22 int unpack_rng (char *); 23 int print_rng (); 24 25 /* data members public for static linkage */ 26 27 int rng_type; 28 char *gentype; 29 unsigned *si; /* sets next branch seed */ 30 unsigned *r0; /* pointer to the even generator */ 31 unsigned *r1; /* pointer to the odd generator */ 32 int stream_number; 33 int hptr; /* integer pointer into fill */ 34 int seed; 35 int init_seed; 36 int lval, kval; 37 int param; 38 39 private: 40 int get_hptr_rng(); 41 int * get_fill_rng(); 42 int * get_next_index_rng(); 43 int * get_node_index_rng(); 44 }; 45 } 46 47 #endif 48 49 50 /*********************************************************************************** 51 * SPRNG (c) 2014 by Florida State University * 52 * * 53 * SPRNG is licensed under a * 54 * Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. * 55 * * 56 * You should have received a copy of the license along with this * 57 * work. If not, see <http://creativecommons.org/licenses/by-nc-sa/4.0/>. * 58 ************************************************************************************/ 59