A high-performance general-purpose compute library

Functions to create, modify, use, and destroy randomEngine objects. More...

Functions

AFAPI af_err af_create_random_engine (af_random_engine *engine, af_random_engine_type rtype, unsigned long long seed)
 C Interface to create a random engine. More...
 
AFAPI af_err af_retain_random_engine (af_random_engine *out, const af_random_engine engine)
 C Interface to retain a random engine. More...
 
AFAPI af_err af_random_engine_set_type (af_random_engine *engine, const af_random_engine_type rtype)
 C Interface to change random engine type. More...
 
AFAPI af_err af_random_engine_get_type (af_random_engine_type *rtype, const af_random_engine engine)
 C Interface to get random engine type. More...
 
AFAPI af_err af_random_engine_set_seed (af_random_engine *engine, const unsigned long long seed)
 C Interface to set the seed of a random engine. More...
 
AFAPI af_err af_random_engine_get_seed (unsigned long long *const seed, af_random_engine engine)
 C Interface to get the seed of a random engine. More...
 
AFAPI af_err af_release_random_engine (af_random_engine engine)
 C Interface to release a random engine. More...
 

Detailed Description

Functions to create, modify, use, and destroy randomEngine objects.

A af::randomEngine object can be used to generate psuedo random numbers using various types of random number generation algorithms defined by af::randomEngineType.


Function Documentation

◆ af_create_random_engine()

AFAPI af_err af_create_random_engine ( af_random_engine engine,
af_random_engine_type  rtype,
unsigned long long  seed 
)

C Interface to create a random engine.

Parameters
[out]enginepointer to the returned random engine object
[in]rtypetype of the random number generator
[in]seedinitializing seed of the random number generator
Returns
AF_SUCCESS, if function returns successfully, else an af_err code is given

◆ af_random_engine_get_seed()

AFAPI af_err af_random_engine_get_seed ( unsigned long long *const  seed,
af_random_engine  engine 
)

C Interface to get the seed of a random engine.

Parameters
[out]seedpointer to the returned seed
[in]enginerandom engine object
Returns
AF_SUCCESS, if function returns successfully, else an af_err code is given

◆ af_random_engine_get_type()

AFAPI af_err af_random_engine_get_type ( af_random_engine_type rtype,
const af_random_engine  engine 
)

C Interface to get random engine type.

Parameters
[out]rtypetype of the random number generator
[in]enginerandom engine object
Returns
AF_SUCCESS, if function returns successfully, else an af_err code is given

◆ af_random_engine_set_seed()

AFAPI af_err af_random_engine_set_seed ( af_random_engine engine,
const unsigned long long  seed 
)

C Interface to set the seed of a random engine.

Parameters
[out]enginepointer to the returned random engine object
[in]seedinitializing seed of the random number generator
Returns
AF_SUCCESS, if function returns successfully, else an af_err code is given

◆ af_random_engine_set_type()

AFAPI af_err af_random_engine_set_type ( af_random_engine engine,
const af_random_engine_type  rtype 
)

C Interface to change random engine type.

Parameters
[in]enginerandom engine object
[in]rtypetype of the random number generator
Returns
AF_SUCCESS, if function returns successfully, else an af_err code is given

◆ af_release_random_engine()

AFAPI af_err af_release_random_engine ( af_random_engine  engine)

C Interface to release a random engine.

Parameters
[in]enginerandom engine object
Returns
AF_SUCCESS, if function returns successfully, else an af_err code is given

◆ af_retain_random_engine()

AFAPI af_err af_retain_random_engine ( af_random_engine out,
const af_random_engine  engine 
)

C Interface to retain a random engine.

Parameters
[out]outpointer to the returned random engine object
[in]enginerandom engine object
Returns
AF_SUCCESS, if function returns successfully, else an af_err code is given