AntHocNet 2.0.0
Paper-faithful ant-colony ad hoc routing: the shared core and its adapters
Loading...
Searching...
No Matches
ahn_web::SplitMix64 Class Reference

SplitMix64: tiny, portable, and bit-identical on every platform (integer arithmetic only; the double is an exact 53-bit scaling). More...

#include <ahn_web/sim.h>

Public Member Functions

 SplitMix64 (std::uint64_t seed)
 A stream starting from seed (every seed is valid).
 
std::uint64_t next ()
 Next raw 64-bit value.
 
double uniform ()
 Uniform double in [0, 1), from the top 53 bits.
 
double uniform (double lo, double hi)
 Uniform double in [lo, hi).
 
int uniformInt (int n)
 Uniform integer in [0, n); 0 when n <= 0.
 

Detailed Description

SplitMix64: tiny, portable, and bit-identical on every platform (integer arithmetic only; the double is an exact 53-bit scaling).

Definition at line 42 of file sim.h.

Constructor & Destructor Documentation

◆ SplitMix64()

ahn_web::SplitMix64::SplitMix64 ( std::uint64_t  seed)
inlineexplicit

A stream starting from seed (every seed is valid).

Definition at line 45 of file sim.h.

Member Function Documentation

◆ next()

std::uint64_t ahn_web::SplitMix64::next ( )

Next raw 64-bit value.

◆ uniform() [1/2]

double ahn_web::SplitMix64::uniform ( )

Uniform double in [0, 1), from the top 53 bits.

Referenced by ahn_web::Node::uniform().

◆ uniform() [2/2]

double ahn_web::SplitMix64::uniform ( double  lo,
double  hi 
)
inline

Uniform double in [lo, hi).

Definition at line 51 of file sim.h.

References uniform().

Referenced by uniform().

◆ uniformInt()

int ahn_web::SplitMix64::uniformInt ( int  n)

Uniform integer in [0, n); 0 when n <= 0.

Referenced by ahn_web::Node::uniformInt().


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