| The Gaudi Framework v30r0 (c919700c)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Namespace List
- Namespace Members

Functions
Gaudi::Utils::QuasiRandom Namespace Reference

## Functions
uint32_t | mix (uint32_t state)
| Create a hash with a large avalanche effect from a 32 bit integer. More...
uint32_t | mix32 (uint32_t state, uint32_t extra)
| mix some 'extra' entropy into 'state' and return result More...
uint32_t | mix64 (uint32_t state, uint64_t extra)
| mix some 'extra' entropy into 'state' and return result More...
uint32_t | mixString (uint32_t state, const std::string &extra)
| mix some 'extra' entropy into 'state' and return result More...

## Function Documentation

uint32_t Gaudi::Utils::QuasiRandom::mix | ( | uint32_t | state | ) |

Create a hash with a large avalanche effect from a 32 bit integer.

Definition at line 14 of file QuasiRandom.cpp.

15 {
16 state += ( state << 16 );
17 state ^= ( state >> 13 );
18 state += ( state << 4 );
19 state ^= ( state >> 7 );
20 state += ( state << 10 );
21 state ^= ( state >> 5 );
22 state += ( state << 8 );
23 state ^= ( state >> 16 );
24 return state;
25 }
compareRootHistos.state
state
Definition: compareRootHistos.py:424

uint32_t Gaudi::Utils::QuasiRandom::mix32 | ( | uint32_t | state,
|  | uint32_t | extra
| ) |  |

mix some 'extra' entropy into 'state' and return result

Definition at line 27 of file QuasiRandom.cpp.

27 { return mix( state + extra ); }
compareRootHistos.state
state
Definition: compareRootHistos.py:424
Gaudi::Utils::QuasiRandom::mix
uint32_t mix(uint32_t state)
Create a hash with a large avalanche effect from a 32 bit integer.
Definition: QuasiRandom.cpp:14

uint32_t Gaudi::Utils::QuasiRandom::mix64 | ( | uint32_t | state,
|  | uint64_t | extra
| ) |  |

mix some 'extra' entropy into 'state' and return result

Definition at line 29 of file QuasiRandom.cpp.

30 {
31 typedef boost::low_bits_mask_t<32> mask_t;
32 state = mix32( state, uint32_t( extra & mask_t::sig_bits_fast ) );
33 return mix32( state, uint32_t( ( extra >> 32 ) & mask_t::sig_bits_fast ) );
34 }
compareRootHistos.state
state
Definition: compareRootHistos.py:424
uint32_t
unsigned int uint32_t
Definition: instrset.h:141
Gaudi::Utils::QuasiRandom::mix32
uint32_t mix32(uint32_t state, uint32_t extra)
mix some &#39;extra&#39; entropy into &#39;state&#39; and return result
Definition: QuasiRandom.cpp:27

uint32_t Gaudi::Utils::QuasiRandom::mixString | ( | uint32_t | state,
|  | const std::string & | extra
| ) |  |

mix some 'extra' entropy into 'state' and return result

Definition at line 36 of file QuasiRandom.cpp.

37 {
38 // prefix name with ' ' until the size is a multiple of 4.
39 std::string s = std::string( ( 4 - extra.size() % 4 ) % 4, ' ' ) + extra;
40 for ( size_t i = 0; i < s.size() / 4; ++i ) {
41 // FIXME: this might do something different on big endian vs. small endian machines...
42 uint32_t x = uint32_t( s[i * 4] ) | uint32_t( s[i * 4 + 1] ) << 8 | uint32_t( s[i * 4 + 2] ) << 16 |
43 uint32_t( s[i * 4 + 3] ) << 24;
44 state = mix32( state, x );
45 }
46 return state;
47 }
compareRootHistos.state
state
Definition: compareRootHistos.py:424
std::string
STL class.
uint32_t
unsigned int uint32_t
Definition: instrset.h:141
std::string::size
T size(T...args)
Gaudi::Utils::QuasiRandom::mix32
uint32_t mix32(uint32_t state, uint32_t extra)
mix some &#39;extra&#39; entropy into &#39;state&#39; and return result
Definition: QuasiRandom.cpp:27
gaudirun.s
string s
Definition: gaudirun.py:253