Cloudy
Spectral Synthesis Code for Astrophysics
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
t_ran Class Reference

#include <ran.h>

Collaboration diagram for t_ran:

Public Member Functions

int8 i7 ()
 
uint8 u8 ()
 
int16 i15 ()
 
uint16 u16 ()
 
int32 i31 ()
 
uint32 u32 ()
 
int64 i63 ()
 
uint64 u64 ()
 
double dbl ()
 
realnum rnm ()
 
double normal ()
 
void init ()
 
void init (uint64 s, int nRANK)
 
void new_rank (int nRANK)
 
uint64 get_seed () const
 
string print_seed () const
 
 t_ran (algo_prng algo)
 
 t_ran (const t_ran &)=delete
 
t_ranoperator= (const t_ran &)=delete
 
 ~t_ran ()
 

Private Member Functions

void p_init (uint64 s, int nRANK)
 
void p_seed (uint64 s, int nRANK)
 
uint64 p_generate_random_seed ()
 
uint64 p_random_seed ()
 
void p_xoroshiro128plus (uint64 *pool, size_t size)
 
void p_xoshiro256starstar (uint64 *pool, size_t size)
 
double p_ZigTailNormal (bool lgNegative)
 
void p_u64 (void *pool, size_t size)
 
void p_dbl (void *pool, size_t size)
 
void p_flt (void *pool, size_t size)
 
void p_zig (void *pool, size_t size)
 

Private Attributes

bool p_lgInitialized
 
algo_prng p_algo
 
size_t p_sq
 
size_t p_npack
 
size_t p_ns
 
uint64 p_s
 
uint64 * p_state
 
const double * p_zigxd
 
const double * p_zigrd
 
const double * p_zige2d
 
ran_pool< uint8 > p_pc
 
ran_pool< uint16 > p_ps
 
ran_pool< uint32 > p_pi
 
ran_pool< uint64 > p_pl
 
ran_pool< double > p_pd
 
ran_pool< sys_floatp_pf
 
ran_pool< double > p_zd
 

Static Private Attributes

static const size_t ND = 2048
 
static const size_t SQ_XOROSHIRO128 = 2
 
static const size_t SQ_XOSHIRO256 = 4
 

Constructor & Destructor Documentation

t_ran::t_ran ( algo_prng  algo)
explicit
t_ran::t_ran ( const t_ran )
delete
t_ran::~t_ran ( )
inline

References p_state, and posix_memalign_free().

Here is the call graph for this function:

Member Function Documentation

double t_ran::dbl ( )
inline

References ran_pool< T >::next(), and p_pd.

Referenced by mc_escape(), normal(), and p_ZigTailNormal().

Here is the call graph for this function:

uint64 t_ran::get_seed ( ) const
inline

References p_s.

Referenced by main().

int16 t_ran::i15 ( )
inline

References ran_pool< T >::next(), and p_ps.

Here is the call graph for this function:

int32 t_ran::i31 ( )
inline

References ran_pool< T >::next(), and p_pi.

Here is the call graph for this function:

int64 t_ran::i63 ( )
inline

References ran_pool< T >::next(), and p_pl.

Referenced by load_balance::init().

Here is the call graph for this function:

int8 t_ran::i7 ( )
inline

References ran_pool< T >::next(), and p_pc.

Here is the call graph for this function:

void t_ran::init ( void  )
inline

References p_generate_random_seed(), and p_init().

Referenced by cdInit(), and main().

Here is the call graph for this function:

void t_ran::init ( uint64  s,
int  nRANK 
)
inline

References p_init().

Here is the call graph for this function:

void t_ran::new_rank ( int  nRANK)
inline

References ASSERT, p_lgInitialized, p_s, and p_seed().

Referenced by load_balance::init(), optimize_phymir(), and phymir_state< X, Y, NP, NSTR >::p_execute_job().

Here is the call graph for this function:

double t_ran::normal ( )
inline

References dbl(), e2(), LIKELY, ran_pool< T >::next(), p_zd, p_zige2d, p_zigrd, p_ZigTailNormal(), p_zigxd, pow2(), u8(), and UNLIKELY.

Referenced by Badnell_rec_init(), diatomics::init(), mc_escape(), and TruncatedNormal().

Here is the call graph for this function:

t_ran& t_ran::operator= ( const t_ran )
delete
void t_ran::p_dbl ( void *  pool,
size_t  size 
)
private

References convert_double(), DEBUG_ENTRY, and p_u64().

Referenced by p_init().

Here is the call graph for this function:

void t_ran::p_flt ( void *  pool,
size_t  size 
)
private

References convert_float(), DEBUG_ENTRY, and p_u64().

Referenced by p_init().

Here is the call graph for this function:

uint64 t_ran::p_generate_random_seed ( )
private

References DEBUG_ENTRY, MD5string(), mode_rb, and ran.

Referenced by init().

Here is the call graph for this function:

void t_ran::p_init ( uint64  s,
int  nRANK 
)
private

References DEBUG_ENTRY, ran_pool< T >::init(), ND, p_dbl(), p_flt(), p_lgInitialized, p_pc, p_pd, p_pf, p_pi, p_pl, p_ps, p_seed(), p_u64(), p_zd, p_zig(), p_zige2d, p_zigrd, p_zigxd, ZigEX2, ZigRN, and ZigXN.

Referenced by init().

Here is the call graph for this function:

uint64 t_ran::p_random_seed ( )
private
void t_ran::p_seed ( uint64  s,
int  nRANK 
)
private

References DEBUG_ENTRY, init_seed(), p_algo, p_npack, p_ns, p_pc, p_pd, p_pf, p_pi, p_pl, p_ps, p_s, p_state, p_zd, and ran_pool< T >::reset().

Referenced by new_rank(), and p_init().

Here is the call graph for this function:

void t_ran::p_u64 ( void *  pool,
size_t  size 
)
private

References DEBUG_ENTRY, p_algo, p_xoroshiro128plus(), p_xoshiro256starstar(), PRNG_XOROSHIRO128PLUS, PRNG_XOSHIRO256STARSTAR, and TotalInsanity().

Referenced by p_dbl(), p_flt(), p_init(), and p_zig().

Here is the call graph for this function:

void t_ran::p_xoroshiro128plus ( uint64 *  pool,
size_t  size 
)
private

References p_ns, p_state, and xoroshiro128plus().

Referenced by p_u64().

Here is the call graph for this function:

void t_ran::p_xoshiro256starstar ( uint64 *  pool,
size_t  size 
)
private

References p_ns, p_state, and xoshiro256starstar().

Referenced by p_u64().

Here is the call graph for this function:

void t_ran::p_zig ( void *  pool,
size_t  size 
)
private

References convert_zig(), DEBUG_ENTRY, and p_u64().

Referenced by p_init().

Here is the call graph for this function:

double t_ran::p_ZigTailNormal ( bool  lgNegative)
private

References dbl(), DEBUG_ENTRY, and pow2().

Referenced by normal().

Here is the call graph for this function:

string t_ran::print_seed ( ) const
inline

References p_s.

Referenced by ParseCommands(), t_cpu_i::PrintBacktrace(), and ShowMe().

realnum t_ran::rnm ( )
inline

References ran_pool< T >::next(), p_pd, and p_pf.

Referenced by mc_escape().

Here is the call graph for this function:

uint16 t_ran::u16 ( )
inline

References ran_pool< T >::next(), and p_ps.

Here is the call graph for this function:

uint32 t_ran::u32 ( )
inline

References ran_pool< T >::next(), and p_pi.

Here is the call graph for this function:

uint64 t_ran::u64 ( )
inline

References ran_pool< T >::next(), and p_pl.

Here is the call graph for this function:

uint8 t_ran::u8 ( )
inline

References ran_pool< T >::next(), and p_pc.

Referenced by normal(), and RandomCrash().

Here is the call graph for this function:

Member Data Documentation

const size_t t_ran::ND = 2048
staticprivate

Referenced by p_init().

algo_prng t_ran::p_algo
private

Referenced by p_seed(), p_u64(), and t_ran().

bool t_ran::p_lgInitialized
private

Referenced by new_rank(), p_init(), and t_ran().

size_t t_ran::p_npack
private

Referenced by p_seed(), and t_ran().

size_t t_ran::p_ns
private
ran_pool<uint8> t_ran::p_pc
private

Referenced by i7(), p_init(), p_seed(), and u8().

ran_pool<double> t_ran::p_pd
private

Referenced by dbl(), p_init(), p_seed(), and rnm().

ran_pool<sys_float> t_ran::p_pf
private

Referenced by p_init(), p_seed(), and rnm().

ran_pool<uint32> t_ran::p_pi
private

Referenced by i31(), p_init(), p_seed(), and u32().

ran_pool<uint64> t_ran::p_pl
private

Referenced by i63(), p_init(), p_seed(), and u64().

ran_pool<uint16> t_ran::p_ps
private

Referenced by i15(), p_init(), p_seed(), and u16().

uint64 t_ran::p_s
private
size_t t_ran::p_sq
private

Referenced by t_ran().

uint64* t_ran::p_state
private
ran_pool<double> t_ran::p_zd
private

Referenced by normal(), p_init(), and p_seed().

const double* t_ran::p_zige2d
private

Referenced by normal(), and p_init().

const double* t_ran::p_zigrd
private

Referenced by normal(), and p_init().

const double* t_ran::p_zigxd
private

Referenced by normal(), and p_init().

const size_t t_ran::SQ_XOROSHIRO128 = 2
staticprivate

Referenced by t_ran().

const size_t t_ran::SQ_XOSHIRO256 = 4
staticprivate

Referenced by t_ran().


The documentation for this class was generated from the following files: