Skip to content

Commit 68ccece

Browse files
committed
Rework URBG requirements for clarity and simplicitly
... by removing the redundance between the URBG concept and the URBG requirements.
1 parent af59154 commit 68ccece

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
@@ -1869,82 +1869,6 @@
18691869
is often determined statistically.
18701870
\end{note}
18711871

1872-
\pnum
1873-
A class \tcode{G}
1874-
satisfies the requirements
1875-
of a \term{uniform random bit generator}
1876-
if the expressions shown
1877-
in \tref{UniformRandomBitGenerator}
1878-
are valid and have the indicated semantics,
1879-
and if \tcode{G} also satisfies all other requirements
1880-
of this subclause \ref{rand.req.urng}.
1881-
In that Table and throughout this subclause:
1882-
\begin{enumeratea}
1883-
\item
1884-
\tcode{T} is the type named by
1885-
\tcode{G}'s associated \tcode{result_type},
1886-
and
1887-
\item
1888-
\tcode{g} is a value of \tcode{G}.
1889-
\end{enumeratea}
1890-
1891-
\begin{libreqtab4d}
1892-
{Uniform random bit generator requirements}
1893-
{tab:UniformRandomBitGenerator}
1894-
\\ \topline
1895-
\lhdr{Expression}
1896-
& \chdr{Return type}
1897-
& \chdr{Pre/post-condition}
1898-
& \rhdr{Complexity}
1899-
\\ \capsep
1900-
\endfirsthead
1901-
\hline
1902-
\lhdr{Expression}
1903-
& \chdr{Return type}
1904-
& \chdr{Pre/post-condition}
1905-
& \rhdr{Complexity}
1906-
\\ \capsep
1907-
\endhead
1908-
\indextext{\idxcode{result_type}!uniform random bit generator requirement}%
1909-
\tcode{G::result_type}
1910-
& \tcode{T}
1911-
& \tcode{T} is an unsigned integer type\iref{basic.fundamental}.
1912-
& compile-time
1913-
\\ \rowsep
1914-
\tcode{g()}%
1915-
\indextext{\idxcode{operator()}!uniform random bit generator requirement}
1916-
& \tcode{T}
1917-
& Returns a value in the closed interval
1918-
$[$\tcode{G::min()}, \tcode{G::max()}$]$.
1919-
& amortized constant
1920-
\\ \rowsep
1921-
\tcode{G::min()}%
1922-
\indextext{\idxcode{min}!uniform random bit generator requirement}
1923-
& \tcode{T}
1924-
& Denotes the least value potentially returned
1925-
by \tcode{operator()}.
1926-
& compile-time
1927-
\\ \rowsep
1928-
\tcode{G::max()}
1929-
\indextext{\idxcode{max}!uniform random bit generator requirement}
1930-
& \tcode{T}
1931-
& Denotes the greatest value potentially returned
1932-
by \tcode{operator()}.
1933-
& compile-time
1934-
\\
1935-
\end{libreqtab4d}
1936-
1937-
\pnum
1938-
The following relation shall hold:
1939-
\tcode{G::min() < G::max()}.
1940-
\indextext{requirements!uniform random bit generator|)}%
1941-
\indextext{uniform random bit generator!requirements|)}
1942-
1943-
\pnum
1944-
The \libconcept{UniformRandomBitGenerator} concept is a slight relaxation of the
1945-
uniform random bit generator requirements, in that it does not require a nested
1946-
\grammarterm{typedef-name} \tcode{result_type}.
1947-
19481872
\begin{codeblock}
19491873
template <class G>
19501874
concept UniformRandomBitGenerator =
@@ -1956,8 +1880,8 @@
19561880
\end{codeblock}
19571881

19581882
\pnum
1959-
Let \tcode{g} be an object of type \tcode{G}.
1960-
\tcode{UniformRandomBitGenerator<G>} is satisfied only if
1883+
Let \tcode{g} be an object of type \tcode{G}. \tcode{G} models
1884+
\libconcept{UniformRandomBitGenerator} only if
19611885

19621886
\begin{itemize}
19631887
\item Both \tcode{G::min()} and \tcode{G::max()} are constant
@@ -1968,6 +1892,17 @@
19681892
\item \tcode{g()} has amortized constant complexity.
19691893
\end{itemize}
19701894

1895+
\indextext{requirements!uniform random bit generator|)}%
1896+
\indextext{uniform random bit generator!requirements|)}%
1897+
\pnum
1898+
A class \tcode{G} meets the \term{uniform random bit generator} requirements if
1899+
\tcode{G} models \libconcept{UniformRandomBitGenerator},
1900+
\tcode{invoke_result_t<G\&>} is an unsigned integer type\iref{basic.fundamental},
1901+
and
1902+
\tcode{G} provides a nested \grammarterm{typedef-name} \tcode{result_type}
1903+
that denotes the same type as \tcode{invoke_result_t<G\&>}.
1904+
1905+
19711906
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
19721907
% Random Number Engine requirements:
19731908

@@ -2142,7 +2077,7 @@
21422077
\state{e}{i+1} $= \mathsf{TA}($\state{e}{i}$)$
21432078
and returns
21442079
$\mathsf{GA}($\state{e}{i}$)$.
2145-
& per \tref{UniformRandomBitGenerator}
2080+
& per \ref{rand.req.urng}
21462081
\\ \rowsep
21472082
\tcode{e.discard(z)}%
21482083
\indextext{\idxcode{discard}!random number engine requirement}

0 commit comments

Comments
 (0)