Ignore:
Timestamp:
Feb 9, 2022, 10:59:05 PM (3 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, ast-experimental, enum, forall-pointer-decay, master, pthread-emulation, qualifiedEnum
Children:
454b4e0
Parents:
7a15b7e
Message:

add fast PRNG code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/stdlib.cfa

    r7a15b7e r12b5e94a  
    1010// Created On       : Thu Jan 28 17:10:29 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Jan 13 21:38:30 2022
    13 // Update Count     : 593
     12// Last Modified On : Sat Jan 15 14:33:21 2022
     13// Update Count     : 595
    1414//
    1515
     
    226226
    227227uint32_t __global_random_seed;                                                  // sequential/concurrent
    228 uint32_t __global_random_state;                                         // sequential only
     228uint32_t __global_random_state;                                                 // sequential only
    229229
    230230void set_seed( PRNG & prng, uint32_t seed_ ) with( prng ) { state = seed = seed_; GENERATOR( state ); } // set seed
    231 uint32_t prng( PRNG & prng ) with( prng ) { callcnt += 1; return GENERATOR( state ); }
    232231
    233232void set_seed( uint32_t seed ) { __global_random_seed = seed; GENERATOR( __global_random_state ); }
Note: See TracChangeset for help on using the changeset viewer.