|
1927 | 1927 | is often determined statistically.
|
1928 | 1928 | \end{note}
|
1929 | 1929 |
|
1930 |
| -\pnum |
1931 |
| -A class \tcode{G} |
1932 |
| -satisfies the requirements |
1933 |
| -of a \term{uniform random bit generator} |
1934 |
| -if the expressions shown |
1935 |
| -in \tref{UniformRandomBitGenerator} |
1936 |
| -are valid and have the indicated semantics, |
1937 |
| -and if \tcode{G} also satisfies all other requirements |
1938 |
| -of this subclause \ref{rand.req.urng}. |
1939 |
| -In that Table and throughout this subclause: |
1940 |
| -\begin{enumeratea} |
1941 |
| - \item |
1942 |
| - \tcode{T} is the type named by |
1943 |
| - \tcode{G}'s associated \tcode{result_type}, |
1944 |
| - and |
1945 |
| - \item |
1946 |
| - \tcode{g} is a value of \tcode{G}. |
1947 |
| -\end{enumeratea} |
1948 |
| - |
1949 |
| -\begin{libreqtab4d} |
1950 |
| - {Uniform random bit generator requirements} |
1951 |
| - {tab:UniformRandomBitGenerator} |
1952 |
| -\\ \topline |
1953 |
| -\lhdr{Expression} |
1954 |
| - & \chdr{Return type} |
1955 |
| - & \chdr{Pre/post-condition} |
1956 |
| - & \rhdr{Complexity} |
1957 |
| - \\ \capsep |
1958 |
| -\endfirsthead |
1959 |
| -\hline |
1960 |
| -\lhdr{Expression} |
1961 |
| - & \chdr{Return type} |
1962 |
| - & \chdr{Pre/post-condition} |
1963 |
| - & \rhdr{Complexity} |
1964 |
| - \\ \capsep |
1965 |
| -\endhead |
1966 |
| -\indextext{\idxcode{result_type}!uniform random bit generator requirement}% |
1967 |
| -\tcode{G::result_type} |
1968 |
| - & \tcode{T} |
1969 |
| - & \tcode{T} is an unsigned integer type\iref{basic.fundamental}. |
1970 |
| - & compile-time |
1971 |
| - \\ \rowsep |
1972 |
| -\tcode{g()}% |
1973 |
| -\indextext{\idxcode{operator()}!uniform random bit generator requirement} |
1974 |
| - & \tcode{T} |
1975 |
| - & Returns a value in the closed interval |
1976 |
| - $[$\tcode{G::min()}, \tcode{G::max()}$]$. |
1977 |
| - & amortized constant |
1978 |
| - \\ \rowsep |
1979 |
| -\tcode{G::min()}% |
1980 |
| -\indextext{\idxcode{min}!uniform random bit generator requirement} |
1981 |
| - & \tcode{T} |
1982 |
| - & Denotes the least value potentially returned |
1983 |
| - by \tcode{operator()}. |
1984 |
| - & compile-time |
1985 |
| - \\ \rowsep |
1986 |
| -\tcode{G::max()} |
1987 |
| -\indextext{\idxcode{max}!uniform random bit generator requirement} |
1988 |
| - & \tcode{T} |
1989 |
| - & Denotes the greatest value potentially returned |
1990 |
| - by \tcode{operator()}. |
1991 |
| - & compile-time |
1992 |
| - \\ |
1993 |
| -\end{libreqtab4d} |
1994 |
| - |
1995 |
| -\pnum |
1996 |
| -The following relation shall hold: |
1997 |
| -\tcode{G::min() < G::max()}. |
1998 |
| -\indextext{requirements!uniform random bit generator|)}% |
1999 |
| -\indextext{uniform random bit generator!requirements|)} |
2000 |
| - |
2001 |
| -\pnum |
2002 |
| -The \libconcept{UniformRandomBitGenerator} concept is a slight relaxation of the |
2003 |
| -uniform random bit generator requirements, in that it does not require a nested |
2004 |
| -\grammarterm{typedef-name} \tcode{result_type}. |
2005 |
| - |
2006 | 1930 | \begin{codeblock}
|
2007 | 1931 | template <class G>
|
2008 | 1932 | concept UniformRandomBitGenerator =
|
|
2014 | 1938 | \end{codeblock}
|
2015 | 1939 |
|
2016 | 1940 | \pnum
|
2017 |
| -Let \tcode{g} be an object of type \tcode{G}. |
2018 |
| -\tcode{\libconcept{UniformRandomBitGenerator}<G>} is satisfied only if |
| 1941 | +Let \tcode{g} be an object of type \tcode{G}. \tcode{G} models |
| 1942 | +\libconcept{UniformRandomBitGenerator} only if |
2019 | 1943 |
|
2020 | 1944 | \begin{itemize}
|
2021 | 1945 | \item Both \tcode{G::min()} and \tcode{G::max()} are constant
|
|
2026 | 1950 | \item \tcode{g()} has amortized constant complexity.
|
2027 | 1951 | \end{itemize}
|
2028 | 1952 |
|
| 1953 | +\indextext{requirements!uniform random bit generator|)}% |
| 1954 | +\indextext{uniform random bit generator!requirements|)}% |
| 1955 | +\pnum |
| 1956 | +A class \tcode{G} meets the \term{uniform random bit generator} requirements if |
| 1957 | +\tcode{G} models \libconcept{UniformRandomBitGenerator}, |
| 1958 | +\tcode{invoke_result_t<G\&>} is an unsigned integer type\iref{basic.fundamental}, |
| 1959 | +and |
| 1960 | +\tcode{G} provides a nested \grammarterm{typedef-name} \tcode{result_type} |
| 1961 | +that denotes the same type as \tcode{invoke_result_t<G\&>}. |
| 1962 | + |
| 1963 | + |
2029 | 1964 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
2030 | 1965 | % Random Number Engine requirements:
|
2031 | 1966 |
|
|
2200 | 2135 | \state{e}{i+1} $= \mathsf{TA}($\state{e}{i}$)$
|
2201 | 2136 | and returns
|
2202 | 2137 | $\mathsf{GA}($\state{e}{i}$)$.
|
2203 |
| - & per \tref{UniformRandomBitGenerator} |
| 2138 | + & per \ref{rand.req.urng} |
2204 | 2139 | \\ \rowsep
|
2205 | 2140 | \tcode{e.discard(z)}%
|
2206 | 2141 | \indextext{\idxcode{discard}!random number engine requirement}
|
|
0 commit comments