openjij
Framework for the Ising model and QUBO.
Loading...
Searching...
No Matches
openjij::utility::Xorshift Class Reference

xorshift random generator for c++11 random More...

#include <random.hpp>

Public Types

using result_type = uint_fast32_t

Public Member Functions

unsigned operator() ()
 generate random number
 Xorshift ()
 Xorshift constructor.
 Xorshift (unsigned s)
 Xorshift constructor with seed.

Static Public Member Functions

static constexpr unsigned min ()
 returns minimum value
static constexpr unsigned max ()
 returns maximum value

Private Attributes

unsigned x = 123456789u
unsigned y = 362436069u
unsigned z = 521288629u
unsigned w

Detailed Description

xorshift random generator for c++11 random

Member Typedef Documentation

◆ result_type

Constructor & Destructor Documentation

◆ Xorshift() [1/2]

openjij::utility::Xorshift::Xorshift ( )
inline

Xorshift constructor.

References w.

◆ Xorshift() [2/2]

openjij::utility::Xorshift::Xorshift ( unsigned s)
inline

Xorshift constructor with seed.

Parameters
sseed

References w.

Member Function Documentation

◆ max()

constexpr unsigned openjij::utility::Xorshift::max ( )
inlinestaticconstexpr

returns maximum value

Returns
maximum value

◆ min()

constexpr unsigned openjij::utility::Xorshift::min ( )
inlinestaticconstexpr

returns minimum value

Returns
minimum value

◆ operator()()

unsigned openjij::utility::Xorshift::operator() ( )
inline

generate random number

Returns
random number

References w, x, y, and z.

Member Data Documentation

◆ w

unsigned openjij::utility::Xorshift::w
private

Referenced by operator()(), Xorshift(), and Xorshift().

◆ x

unsigned openjij::utility::Xorshift::x = 123456789u
private

Referenced by operator()().

◆ y

unsigned openjij::utility::Xorshift::y = 362436069u
private

Referenced by operator()().

◆ z

unsigned openjij::utility::Xorshift::z = 521288629u
private

Referenced by operator()().


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