| The Gaudi Framework v32r1 (f65d50dc)

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

## ◆ mix()

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 11 of file QuasiRandom.cpp.

11 {
12 state += ( state << 16 );
13 state ^= ( state >> 13 );
14 state += ( state << 4 );
15 state ^= ( state >> 7 );
16 state += ( state << 10 );
17 state ^= ( state >> 5 );
18 state += ( state << 8 );
19 state ^= ( state >> 16 );
20 return state;
21 }
compareRootHistos.state
def state
Definition: compareRootHistos.py:455

## ◆ mix32()

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

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

Definition at line 23 of file QuasiRandom.cpp.

23 { return mix( state + extra ); }
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:11
compareRootHistos.state
def state
Definition: compareRootHistos.py:455

## ◆ mix64()

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

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

Definition at line 25 of file QuasiRandom.cpp.

25 {
26 typedef boost::low_bits_mask_t<32> mask_t;
27 state = mix32( state, uint32_t( extra & mask_t::sig_bits_fast ) );
28 return mix32( state, uint32_t( ( extra >> 32 ) & mask_t::sig_bits_fast ) );
29 }
compareRootHistos.state
def state
Definition: compareRootHistos.py:455
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 'extra' entropy into 'state' and return result
Definition: QuasiRandom.cpp:23

## ◆ mixString()

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 31 of file QuasiRandom.cpp.

31 {
32 // prefix name with ' ' until the size is a multiple of 4.
33 std::string s = std::string( ( 4 - extra.size() % 4 ) % 4, ' ' ) + extra;
34 for ( size_t i = 0; i < s.size() / 4; ++i ) {
35 // FIXME: this might do something different on big endian vs. small endian machines...
36 uint32_t x = uint32_t( s[i * 4] ) | uint32_t( s[i * 4 + 1] ) << 8 | uint32_t( s[i * 4 + 2] ) << 16 |
37 uint32_t( s[i * 4 + 3] ) << 24;
38 state = mix32( state, x );
39 }
40 return state;
41 }
std::string
STL class.
compareRootHistos.state
def state
Definition: compareRootHistos.py:455
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 'extra' entropy into 'state' and return result
Definition: QuasiRandom.cpp:23
gaudirun.s
string s
Definition: gaudirun.py:316