SAT Solver Template
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
sat::RNG Class Reference

Random number generator singleton class. More...

#include <random.hpp>

Public Member Functions

 RNG (const RNG &)=delete
 
RNGoperator= (const RNG &)=delete
 
 RNG (RNG &&)=delete
 
RNGoperator= (RNG &&)=delete
 
void setSeed (unsigned seed)
 
template<std::integral T>
random_int (T min, T max)
 
template<std::floating_point T>
random_float (T min, T max)
 

Static Public Member Functions

static RNGget ()
 

Detailed Description

Random number generator singleton class.

Member Function Documentation

◆ get()

RNG & sat::RNG::get ( )
static

Get the instance of the random number generator

Returns
instance of the random number generator

◆ random_float()

template<std::floating_point T>
T sat::RNG::random_float ( min,
max 
)
inline

Generates a random float value in [min, max)

Template Parameters
Tfloating point type of value
Parameters
minlower bound
maxupper bound
Returns
random value

◆ random_int()

template<std::integral T>
T sat::RNG::random_int ( min,
max 
)
inline

Generates a random integer value in [min, max]

Template Parameters
Tintegral type of value
Parameters
minlower bound
maxupper bound
Returns
random value

◆ setSeed()

void sat::RNG::setSeed ( unsigned  seed)

Sets the random seed

Parameters
seedthe desired seed

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