|
2018 | 2018 | is often determined statistically.
|
2019 | 2019 | \end{note}
|
2020 | 2020 |
|
2021 |
| -\pnum |
2022 |
| -A class \tcode{G} |
2023 |
| -satisfies the requirements |
2024 |
| -of a \term{uniform random bit generator} |
2025 |
| -if the expressions shown |
2026 |
| -in \tref{UniformRandomBitGenerator} |
2027 |
| -are valid and have the indicated semantics, |
2028 |
| -and if \tcode{G} also satisfies all other requirements |
2029 |
| -of this subclause \ref{rand.req.urng}. |
2030 |
| -In that Table and throughout this subclause: |
2031 |
| -\begin{enumeratea} |
2032 |
| - \item |
2033 |
| - \tcode{T} is the type named by |
2034 |
| - \tcode{G}'s associated \tcode{result_type}, |
2035 |
| - and |
2036 |
| - \item |
2037 |
| - \tcode{g} is a value of \tcode{G}. |
2038 |
| -\end{enumeratea} |
2039 |
| - |
2040 |
| -\begin{libreqtab4d} |
2041 |
| - {Uniform random bit generator requirements} |
2042 |
| - {tab:UniformRandomBitGenerator} |
2043 |
| -\\ \topline |
2044 |
| -\lhdr{Expression} |
2045 |
| - & \chdr{Return type} |
2046 |
| - & \chdr{Pre/post-condition} |
2047 |
| - & \rhdr{Complexity} |
2048 |
| - \\ \capsep |
2049 |
| -\endfirsthead |
2050 |
| -\hline |
2051 |
| -\lhdr{Expression} |
2052 |
| - & \chdr{Return type} |
2053 |
| - & \chdr{Pre/post-condition} |
2054 |
| - & \rhdr{Complexity} |
2055 |
| - \\ \capsep |
2056 |
| -\endhead |
2057 |
| -\indextext{\idxcode{result_type}!uniform random bit generator requirement}% |
2058 |
| -\tcode{G::result_type} |
2059 |
| - & \tcode{T} |
2060 |
| - & \tcode{T} is an unsigned integer type\iref{basic.fundamental}. |
2061 |
| - & compile-time |
2062 |
| - \\ \rowsep |
2063 |
| -\tcode{g()}% |
2064 |
| -\indextext{\idxcode{operator()}!uniform random bit generator requirement} |
2065 |
| - & \tcode{T} |
2066 |
| - & Returns a value in the closed interval |
2067 |
| - $[$\tcode{G::min()}, \tcode{G::max()}$]$. |
2068 |
| - & amortized constant |
2069 |
| - \\ \rowsep |
2070 |
| -\tcode{G::min()}% |
2071 |
| -\indextext{\idxcode{min}!uniform random bit generator requirement} |
2072 |
| - & \tcode{T} |
2073 |
| - & Denotes the least value potentially returned |
2074 |
| - by \tcode{operator()}. |
2075 |
| - & compile-time |
2076 |
| - \\ \rowsep |
2077 |
| -\tcode{G::max()} |
2078 |
| -\indextext{\idxcode{max}!uniform random bit generator requirement} |
2079 |
| - & \tcode{T} |
2080 |
| - & Denotes the greatest value potentially returned |
2081 |
| - by \tcode{operator()}. |
2082 |
| - & compile-time |
2083 |
| - \\ |
2084 |
| -\end{libreqtab4d} |
2085 |
| - |
2086 |
| -\pnum |
2087 |
| -The following relation shall hold: |
2088 |
| -\tcode{G::min() < G::max()}. |
2089 |
| -\indextext{requirements!uniform random bit generator|)}% |
2090 |
| -\indextext{uniform random bit generator!requirements|)} |
2091 |
| - |
2092 |
| -\pnum |
2093 |
| -The \libconcept{UniformRandomBitGenerator} concept is a slight relaxation of the |
2094 |
| -uniform random bit generator requirements, in that it does not require a nested |
2095 |
| -\grammarterm{typedef-name} \tcode{result_type}. |
2096 |
| - |
2097 | 2021 | \begin{codeblock}
|
2098 | 2022 | template<class G>
|
2099 | 2023 | concept UniformRandomBitGenerator =
|
|
2105 | 2029 | \end{codeblock}
|
2106 | 2030 |
|
2107 | 2031 | \pnum
|
2108 |
| -Let \tcode{g} be an object of type \tcode{G}. |
2109 |
| -\tcode{\libconcept{UniformRandomBitGenerator}<G>} is satisfied only if |
| 2032 | +Let \tcode{g} be an object of type \tcode{G}. \tcode{G} models |
| 2033 | +\libconcept{UniformRandomBitGenerator} only if |
2110 | 2034 |
|
2111 | 2035 | \begin{itemize}
|
2112 | 2036 | \item both \tcode{G::min()} and \tcode{G::max()} are constant
|
|
2117 | 2041 | \item \tcode{g()} has amortized constant complexity.
|
2118 | 2042 | \end{itemize}
|
2119 | 2043 |
|
| 2044 | +\indextext{requirements!uniform random bit generator|)}% |
| 2045 | +\indextext{uniform random bit generator!requirements|)}% |
| 2046 | +\pnum |
| 2047 | +A class \tcode{G} meets the \term{uniform random bit generator} requirements if |
| 2048 | +\tcode{G} models \libconcept{UniformRandomBitGenerator}, |
| 2049 | +\tcode{invoke_result_t<G\&>} is an unsigned integer type\iref{basic.fundamental}, |
| 2050 | +and |
| 2051 | +\tcode{G} provides a nested \grammarterm{typedef-name} \tcode{result_type} |
| 2052 | +that denotes the same type as \tcode{invoke_result_t<G\&>}. |
| 2053 | + |
| 2054 | + |
2120 | 2055 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
2121 | 2056 | % Random Number Engine requirements:
|
2122 | 2057 |
|
|
2291 | 2226 | \state{e}{i+1} $= \mathsf{TA}($\state{e}{i}$)$
|
2292 | 2227 | and returns
|
2293 | 2228 | $\mathsf{GA}($\state{e}{i}$)$.
|
2294 |
| - & per \tref{UniformRandomBitGenerator} |
| 2229 | + & per \ref{rand.req.urng} |
2295 | 2230 | \\ \rowsep
|
2296 | 2231 | \tcode{e.discard(z)}%
|
2297 | 2232 | \indextext{\idxcode{discard}!random number engine requirement}
|
|
0 commit comments