A high-performance general-purpose compute library

C++ Interface - Random Number Generation Engine Class. More...

#include <random.h>

Public Member Functions

 randomEngine (randomEngineType typeIn=AF_RANDOM_ENGINE_DEFAULT, unsigned long long seedIn=0)
 C++ Interface to create a af::randomEngine object with a af::randomEngineType and a seed.
 
 randomEngine (const randomEngine &other)
 C++ Interface copy constructor for a af::randomEngine.
 
 randomEngine (af_random_engine engine)
 C++ Interface to create a copy of the random engine object from a af_random_engine handle.
 
 ~randomEngine ()
 C++ Interface destructor for a af::randomEngine.
 
randomEngineoperator= (const randomEngine &other)
 C++ Interface to assign the internal state of randome engine.
 
void setType (const randomEngineType type)
 C++ Interface to set the random type of the random engine.
 
randomEngineType getType (void)
 C++ Interface to get the random type of the random engine.
 
void setSeed (const unsigned long long seed)
 C++ Interface to set the seed of the random engine.
 
unsigned long long getSeed (void) const
 C++ Interface to return the seed of the random engine.
 
af_random_engine get (void) const
 C++ Interface to return the af_random_engine handle of this object.
 

Detailed Description

C++ Interface - Random Number Generation Engine Class.

The af::randomEngine class is used to set the type and seed of random number generation engine based on af::randomEngineType.

Definition at line 34 of file random.h.

Constructor & Destructor Documentation

◆ randomEngine() [1/3]

C++ Interface to create a af::randomEngine object with a af::randomEngineType and a seed.

// create a random engine of default type with seed = 1
C++ Interface - Random Number Generation Engine Class.
Definition random.h:34
@ AF_RANDOM_ENGINE_DEFAULT
Definition defines.h:446
AFAPI array sum(const array &in, const int dim=-1)
C++ Interface to sum array elements over a given dimension.

◆ randomEngine() [2/3]

C++ Interface copy constructor for a af::randomEngine.

Parameters
[in]otherinput random engine object

◆ randomEngine() [3/3]

C++ Interface to create a copy of the random engine object from a af_random_engine handle.

Parameters
[in]engineThe input random engine object

◆ ~randomEngine()

C++ Interface destructor for a af::randomEngine.

Member Function Documentation

◆ get()

af_random_engine get ( void ) const

C++ Interface to return the af_random_engine handle of this object.

Returns
handle to the af_random_engine associated with this random engine

◆ getSeed()

unsigned long long getSeed ( void ) const

C++ Interface to return the seed of the random engine.

Returns
seed associated with random engine

◆ getType()

randomEngineType getType ( void )

C++ Interface to get the random type of the random engine.

Returns
af::randomEngineType associated with random engine

◆ operator=()

C++ Interface to assign the internal state of randome engine.

Parameters
[in]otherobject to be assigned to the random engine
Returns
the reference to this

◆ setSeed()

void setSeed ( const unsigned long long seed)

C++ Interface to set the seed of the random engine.

Parameters
[in]seedinitializing seed of the random number generator

◆ setType()

void setType ( const randomEngineType type)

C++ Interface to set the random type of the random engine.

Parameters
[in]typetype of the random number generator

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