| The Gaudi Framework v27r1

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

12 {
13 state += (state << 16); state ^= (state >> 13);
14 state += (state << 4); state ^= (state >> 7);
15 state += (state << 10); state ^= (state >> 5);
16 state += (state << 8); state ^= (state >> 16);
17 return state;
18 }
compareRootHistos.state
tuple state
Definition: compareRootHistos.py:348

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

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

Definition at line 20 of file QuasiRandom.cpp.

21 {
22 return mix( state + extra );
23 }
compareRootHistos.state
tuple state
Definition: compareRootHistos.py:348
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

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.

26 {
27 typedef boost::low_bits_mask_t<32> mask_t;
28 state = mix32( state , uint32_t( extra & mask_t::sig_bits_fast) );
29 return mix32( state , uint32_t((extra >> 32) & mask_t::sig_bits_fast) );
30 }
compareRootHistos.state
tuple state
Definition: compareRootHistos.py:348
uint32_t
unsigned int uint32_t
Definition: instrset.h:142
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:20

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

33 {
34 // prefix name with ' ' until the size is a multiple of 4.
35 std::string s = std::string((4 - extra.size() % 4) % 4, ' ') + extra;
36 for (size_t i=0; i < s.size() / 4; ++i) {
37 //FIXME: this might do something different on big endian vs. small endian machines...
38 uint32_t x = uint32_t(s[i * 4])
39 | uint32_t(s[i * 4 + 1]) << 8
40 | uint32_t(s[i * 4 + 2]) << 16
41 | uint32_t(s[i * 4 + 3]) << 24 ;
42 state = mix32(state , x);
43 }
44 return state;
45 }
compareRootHistos.state
tuple state
Definition: compareRootHistos.py:348
std::string
STL class.
uint32_t
unsigned int uint32_t
Definition: instrset.h:142
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:20
gaudirun.s
string s
Definition: gaudirun.py:245
ana.i
list i
Definition: ana.py:128