Skip to content

Commit bfaea04

Browse files
CaseyCarterzygoloid
authored andcommitted
[rand.req.urng] Rework URBG requirements for clarity and simplicitly
... by removing the redundance between the new concept and the "old" requirements. Also fixup the reference in [rand.req.eng] to properly refer [rand.req.urng] instead of the requirements table. The table has been removed, and the reference should have been to the subclause in the first place to clearly incorporate the requirements outside of the table.
1 parent def8912 commit bfaea04

File tree

1 file changed

+14
-79
lines changed

1 file changed

+14
-79
lines changed

source/numerics.tex

Lines changed: 14 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -2018,82 +2018,6 @@
20182018
is often determined statistically.
20192019
\end{note}
20202020

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-
20972021
\begin{codeblock}
20982022
template<class G>
20992023
concept UniformRandomBitGenerator =
@@ -2105,8 +2029,8 @@
21052029
\end{codeblock}
21062030

21072031
\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
21102034

21112035
\begin{itemize}
21122036
\item both \tcode{G::min()} and \tcode{G::max()} are constant
@@ -2117,6 +2041,17 @@
21172041
\item \tcode{g()} has amortized constant complexity.
21182042
\end{itemize}
21192043

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+
21202055
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
21212056
% Random Number Engine requirements:
21222057

@@ -2291,7 +2226,7 @@
22912226
\state{e}{i+1} $= \mathsf{TA}($\state{e}{i}$)$
22922227
and returns
22932228
$\mathsf{GA}($\state{e}{i}$)$.
2294-
& per \tref{UniformRandomBitGenerator}
2229+
& per \ref{rand.req.urng}
22952230
\\ \rowsep
22962231
\tcode{e.discard(z)}%
22972232
\indextext{\idxcode{discard}!random number engine requirement}

0 commit comments

Comments
 (0)