std::independent_bits_engine<Engine,W,UIntType>:: seed
From cppreference.net
<
cpp
|
numeric
|
random
|
independent bits engine
C++
Numerics library
| Common mathematical functions | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Mathematical special functions (C++17) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Mathematical constants (C++20) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Basic linear algebra algorithms (C++26) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Data-parallel types (SIMD) (C++26) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Floating-point environment (C++11) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Complex numbers | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Numeric array (
valarray
)
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Pseudo-random number generation | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Bit manipulation (C++20) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Saturation arithmetic (C++26) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Factor operations | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Interpolations | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Generic numeric operations | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| C-style checked integer arithmetic | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Pseudo-random number generation
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
std::independent_bits_engine
| Member functions | ||||
|
independent_bits_engine::seed
|
||||
| Generation | ||||
| Characteristics | ||||
| Non-member functions | ||||
|
(C++11)
(C++11)
(until C++20)
|
||||
|
(C++11)
(C++11)
|
|
void
seed
(
)
;
|
(1) | (自 C++11 起) |
|
void
seed
(
result_type value
)
;
|
(2) | (自 C++11 起) |
|
template
<
class
SeedSeq
>
void seed ( SeedSeq & seq ) ; |
(3) | (自 C++11 起) |
使用新的种子值重新初始化底层引擎的内部状态。
1)
使用默认种子值初始化底层引擎。等效于调用
e.
seed
(
)
,其中
e
指代底层引擎。
2)
使用种子值
value
为底层引擎提供种子。实际调用
e.
seed
(
value
)
,其中
e
指代底层引擎。
3)
使用种子序列
seq
为底层引擎提供种子。实际调用
e.
seed
(
seq
)
,其中
e
指代底层引擎。
参数
| value | - | 用于初始化底层引擎内部状态的种子值 |
| seq | - | 用于初始化底层引擎内部状态的种子序列 |
异常
缺陷报告
以下行为变更缺陷报告被追溯应用于先前发布的C++标准。
| 缺陷报告 | 应用于 | 发布时的行为 | 正确行为 |
|---|---|---|---|
| LWG 2181 | C++11 |
重载
(
3
)
即使
seq.generate
调用抛出异常也不会抛出
|
传播该异常 |