CRI ADX  Last Updated: 2024-07-17 10:48 p
CriAtomExRngInterfaceTag结构体 参考

Random Number Generator interface 更多...

#include <cri_le_atom_ex.h>

成员变量

CriSint32(* CalculateWorkSize )(void)
 Calculate the work buffer size 更多...
 
CriAtomExRngHn(* Create )(void *work, CriSint32 work_size)
 Create a Random Number Generator 更多...
 
void(* Destroy )(CriAtomExRngHn rng)
 Destroy a Random Number Generator 更多...
 
CriSint32(* Generate )(CriAtomExRngHn rng, CriSint32 min, CriSint32 max)
 Generate a random number 更多...
 
void(* SetSeed )(CriAtomExRngHn rng, CriUint32 seed)
 Set a random seed 更多...
 

详细描述

Random Number Generator interface

结构体成员变量说明

◆ CalculateWorkSize

CriSint32(* CalculateWorkSize) (void)

Calculate the work buffer size

返回
CriSint32 work buffer size
Description:
Calculates the size of the work buffer required to create a Random Number Generator.

◆ Create

CriAtomExRngHn(* Create) (void *work, CriSint32 work_size)

Create a Random Number Generator

参数
[in]workwork buffer
[in]work_sizework buffer size
返回
CriAtomExRngHn Random Number Generator handle
Description:
Creates a Random Number Generator.
If this function fails to create a Random Number Generator, it returns NULL.

◆ Destroy

void(* Destroy) (CriAtomExRngHn rng)

Destroy a Random Number Generator

参数
[in]rngRandom Number Generator handle
Description:
Destroys a Random Number Generator.

◆ Generate

CriSint32(* Generate) (CriAtomExRngHn rng, CriSint32 min, CriSint32 max)

Generate a random number

参数
[in]rngRandom Number Generator handle
[in]minminimum value
[in]maxmaximum value
返回
CriSint32 random number
Description:
Generates a new random number.
The generated number will be between min and max (both included).

◆ SetSeed

void(* SetSeed) (CriAtomExRngHn rng, CriUint32 seed)

Set a random seed

参数
[in]rngRandom Number Generator handle
[in]seedrandom seed
Description:
Sets the random seed used to generate a random number.

该结构体的文档由以下文件生成: