operator<<(std::uniform_int_distribution), operator>>(std::uniform_int_distribution)

来自cppreference.com

 
 
Numerics的图书馆
常见的数学函数
浮点环境
复数
数字阵列
伪随机数生成
编译时合理的算法 (C++11)
通用的数值运算
Original:
Generic numeric operations
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
iota(C++11)
accumulate
inner_product
adjacent_difference
partial_sum
 
伪随机数生成
发动机和引擎适配器
Original:
Engines and engine adaptors
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
linear_congruential_engine(C++11)
mersenne_twister_engine(C++11)
subtract_with_carry_engine(C++11)
discard_block_engine(C++11)
independent_bits_engine(C++11)
shuffle_order_engine(C++11)
发电机
Original:
Generators
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
random_device(C++11)
分布
Original:
Distributions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
均匀分布
Original:
Uniform distributions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
uniform_int_distribution(C++11)
uniform_real_distribution(C++11)
generate_canonical(C++11)
伯努里分布
Original:
Bernoulli distributions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
bernoulli_distribution(C++11)
binomial_distribution(C++11)
negative_binomial_distribution(C++11)
geometric_distribution(C++11)
泊松分布
Original:
Poisson distributions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
poisson_distribution(C++11)
exponential_distribution(C++11)
gamma_distribution(C++11)
weibull_distribution(C++11)
extreme_value_distribution(C++11)
正态分布
Original:
Normal distributions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
normal_distribution(C++11)
lognormal_distribution(C++11)
chi_squared_distribution(C++11)
cauchy_distribution(C++11)
fisher_f_distribution(C++11)
student_t_distribution(C++11)
抽样分布
Original:
Sampling distributions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
discrete_distribution(C++11)
piecewise_constant_distribution(C++11)
piecewise_linear_distribution(C++11)
种子序列
Original:
Seed Sequences
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
seed_seq(C++11)
C库
Original:
C library
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
rand
srand
RAND_MAX
 
std::uniform_int_distribution
成员函数
Original:
Member functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
uniform_int_distribution::uniform_int_distribution
uniform_int_distribution::reset
Original:
Generation
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
uniform_int_distribution::operator()
特性
Original:
Characteristics
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
uniform_int_distribution::a
uniform_int_distribution::b
uniform_int_distribution::param
uniform_int_distribution::min
uniform_int_distribution::max
非成员函数
Original:
Non-member functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
operator==
operator!=
operator<<
operator>>
 
template< class CharT, class Traits, class ResultType >

std::basic_ostream<CharT,Traits>& operator<<( std::basic_ostream<CharT,Traits>& ost,

                                              const uniform_int_distribution& d );
(1)
template< class CharT, class Traits, class ResultType >

std::basic_istream<CharT,Traits>& operator>>( std::basic_istream<CharT,Traits>& ist,

                                              uniform_int_distribution& d );
(2)
执行流输入和输出操作的伪随机数分布d.
Original:
Performs stream input and output operations on pseudo-random number distribution d.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
1)
ost的文字表述写入一个文本表示的分布参数和内部状态。格式化标志和填充字符的ost是不变的.
Original:
Writes a textual representation of the distribution parameters and internal state to ost as textual representation. The formatting flags and fill character of ost are unchanged.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
2)
的分布参数和内部状态恢复的数据读取istist是不变的格式化标志。已写入的数据必须使用流具有相同的区域,CharTTraits模板参数,否则该行为是未定义的。如果遇到错误的输入,ist.setstate(std::ios::failbit)被调用,它可能会引发std::ios_base::failured在这种情况下,是不变的.
Original:
Restores the distribution parameters and internal state with data read from ist. The formatting flags of ist are unchanged. The data must have been written using a stream with the same locale, CharT and Traits template parameters, otherwise the behavior is undefined. If bad input is encountered, ist.setstate(std::ios::failbit) is called, which may throw std::ios_base::failure. d is unchanged in that case.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[编辑] 参数

ost -
将数据插入到输出流
Original:
output stream to insert the data to
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
ist -
输入的数据流中提取
Original:
input stream to extract the data from
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
d -
分布的伪随机数
Original:
pseudo-random number distribution
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[编辑] 返回值

1) ost

2) ist

[编辑] 例外

1)
(无)
Original:
(none)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
2)
可能会引发std::ios_base::failure上的糟糕输入.
Original:
may throw std::ios_base::failure on bad input.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.