random_device::entropy
임의성의 소스를 예측합니다.
double entropy() const;
설명
비트 멤버 함수 추정의 임의성의 소스를 반환 합니다.(최악의 경우에 임의의 소스는 엔트로피 0입니다.)
예제
// std_tr1__random__random_device_entropy.cpp
// compile with: /EHsc
#include <random>
#include <iostream>
typedef std::random_device Myceng;
int main()
{
Myceng ceng;
Myceng::result_type compval = ceng();
compval = compval; // to quiet "unused" warnings
std::cout << "entropy == " << ceng.entropy() << std::endl;
std::cout << "min == " << ceng.min() << std::endl;
std::cout << "max == " << ceng.max() << std::endl;
std::cout << "a random value == " << ceng() << std::endl;
std::cout << "a random value == " << ceng() << std::endl;
std::cout << "a random value == " << ceng() << std::endl;
return (0);
}
요구 사항
헤더: <random>
네임 스페이스: std