首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

std::shuffle_order_engine

Defined in header <random>

?

?

template< class Engine, std::size_t K > class shuffle_order_engine;

?

(since C++11)

shuffle_order_engine是一个随机数引擎适配器,它对基引擎生成的随机数进行改组。它有一个大小的表K并在请求时从该表中传递随机选择的数字,并将其替换为由基引擎生成的数字。

下面的ty胡枝子定义了具有一个常用参数集的随机数引擎:

在标头中定义<random>

*。

类型定义

库思[医]b性病::洗牌[医]命令[医]引擎<std::minstd[医]256>

模板参数

Engine

-

the type of the wrapped engine

K

-

the size of the internal table. Must be greater than 0

类型要求

发动机必须符合RandomNumberEngine的要求。

成员类型

Member type

Definition

result_type

Engine::result_type

成员函数

(constructor)

constructs the engine adaptor (public member function)

seed

sets the state of the underlying engine (public member function)

base

returns the underlying engine (public member function)

世代

运算符%28%29提升基础引擎的状态,并返回生成值%28公共成员函数%29

丢弃将适配器%27s状态提升指定数量%28公共成员函数%29。

特征

敏静态获取基础引擎输出范围中的最小值。%28公共静态成员功能%29

马克斯静态获取基础引擎输出范围中的最大可能值。%28公共静态成员功能%29

非会员职能

operator==operator!=

compares the internal states of the adaptors and underlying engines (function)

operator<<operator>>

performs stream input and output on pseudo-random number engine adaptor (function)

成员对象

constexpr size_t table_size static

the size of the internal table, K (public static member constant)

代码语言:txt
复制
 ? cppreference.com

在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。

扫码关注腾讯云开发者

领取腾讯云代金券

http://www.vxiaotou.com