LINE Solver (C++)
Templated C++ port of the LINE queueing solver
Loading...
Searching...
No Matches
line::opt::de::NumpyRandomState Class Reference

#include <line/opt/de/numpy_random_state.h>

Public Member Functions

 NumpyRandomState (std::uint64_t seed)
MT19937generator ()
const MT19937generator () const
double random_sample ()
 NumPy random_sample(): one 53-bit double from two generator words.
std::vector< double > random_sample (std::size_t n)
double uniform (double low=0.0, double high=1.0)
std::vector< double > uniform (double low, double high, std::size_t n)
std::uint64_t randint (std::uint64_t low, std::uint64_t high)
std::uint64_t randint (std::uint64_t high)
std::uint64_t random_interval (std::uint64_t max_value)
template<class T>
void shuffle (std::vector< T > &values)
std::vector< std::size_t > permutation (std::size_t n)

Detailed Description

Definition at line 31 of file numpy_random_state.h.

Constructor & Destructor Documentation

◆ NumpyRandomState()

line::opt::de::NumpyRandomState::NumpyRandomState ( std::uint64_t seed)
inlineexplicit

Definition at line 33 of file numpy_random_state.h.

Member Function Documentation

◆ generator() [1/2]

MT19937 & line::opt::de::NumpyRandomState::generator ( )
inline

Definition at line 35 of file numpy_random_state.h.

◆ generator() [2/2]

const MT19937 & line::opt::de::NumpyRandomState::generator ( ) const
inline

Definition at line 36 of file numpy_random_state.h.

◆ permutation()

std::vector< std::size_t > line::opt::de::NumpyRandomState::permutation ( std::size_t n)
inline

Definition at line 97 of file numpy_random_state.h.

References shuffle().

◆ randint() [1/2]

std::uint64_t line::opt::de::NumpyRandomState::randint ( std::uint64_t high)
inline

Definition at line 76 of file numpy_random_state.h.

References randint().

Referenced by randint().

◆ randint() [2/2]

std::uint64_t line::opt::de::NumpyRandomState::randint ( std::uint64_t low,
std::uint64_t high )
inline

Definition at line 62 of file numpy_random_state.h.

References line::InputError::InputError().

◆ random_interval()

std::uint64_t line::opt::de::NumpyRandomState::random_interval ( std::uint64_t max_value)
inline

Definition at line 78 of file numpy_random_state.h.

References line::InputError::InputError().

Referenced by shuffle().

◆ random_sample() [1/2]

double line::opt::de::NumpyRandomState::random_sample ( )
inline

NumPy random_sample(): one 53-bit double from two generator words.

Definition at line 39 of file numpy_random_state.h.

Referenced by random_sample(), uniform(), and uniform().

◆ random_sample() [2/2]

std::vector< double > line::opt::de::NumpyRandomState::random_sample ( std::size_t n)
inline

Definition at line 46 of file numpy_random_state.h.

References random_sample().

◆ shuffle()

template<class T>
void line::opt::de::NumpyRandomState::shuffle ( std::vector< T > & values)
inline

Definition at line 90 of file numpy_random_state.h.

References random_interval().

Referenced by permutation().

◆ uniform() [1/2]

std::vector< double > line::opt::de::NumpyRandomState::uniform ( double low,
double high,
std::size_t n )
inline

Definition at line 56 of file numpy_random_state.h.

References random_sample().

◆ uniform() [2/2]

double line::opt::de::NumpyRandomState::uniform ( double low = 0.0,
double high = 1.0 )
inline

Definition at line 52 of file numpy_random_state.h.

References random_sample().


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