Skip to content

Commit 315e73b

Browse files
committed
[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 267d58e commit 315e73b

File tree

1 file changed

+14
-79
lines changed

1 file changed

+14
-79
lines changed

Diff for: source/numerics.tex

+14-79
Original file line numberDiff line numberDiff line change
@@ -1927,82 +1927,6 @@
19271927
is often determined statistically.
19281928
\end{note}
19291929

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-
20061930
\begin{codeblock}
20071931
template <class G>
20081932
concept UniformRandomBitGenerator =
@@ -2014,8 +1938,8 @@
20141938
\end{codeblock}
20151939

20161940
\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
20191943

20201944
\begin{itemize}
20211945
\item Both \tcode{G::min()} and \tcode{G::max()} are constant
@@ -2026,6 +1950,17 @@
20261950
\item \tcode{g()} has amortized constant complexity.
20271951
\end{itemize}
20281952

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+
20291964
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
20301965
% Random Number Engine requirements:
20311966

@@ -2200,7 +2135,7 @@
22002135
\state{e}{i+1} $= \mathsf{TA}($\state{e}{i}$)$
22012136
and returns
22022137
$\mathsf{GA}($\state{e}{i}$)$.
2203-
& per \tref{UniformRandomBitGenerator}
2138+
& per \ref{rand.req.urng}
22042139
\\ \rowsep
22052140
\tcode{e.discard(z)}%
22062141
\indextext{\idxcode{discard}!random number engine requirement}

0 commit comments

Comments
 (0)