diff --git a/source/numerics.tex b/source/numerics.tex index 559d5ec913..bee954157b 100644 --- a/source/numerics.tex +++ b/source/numerics.tex @@ -173,7 +173,7 @@ \end{note} \pnum -A separate floating-point environment shall be maintained for each thread. Each function +A separate floating-point environment is maintained for each thread. Each function accesses the environment corresponding to its calling thread. \xrefc{7.6} @@ -201,15 +201,15 @@ \pnum If \tcode{z} is an lvalue of type \cv{} \tcode{complex} then: \begin{itemize} -\item the expression \tcode{reinterpret_cast<\cv{} T(\&)[2]>(z)} shall be well-formed, -\item \tcode{reinterpret_cast<\cv{} T(\&)[2]>(z)[0]} shall designate the real part of \tcode{z}, and -\item \tcode{reinterpret_cast<\cv{} T(\&)[2]>(z)[1]} shall designate the imaginary part of \tcode{z}. +\item the expression \tcode{reinterpret_cast<\cv{} T(\&)[2]>(z)} is well-formed, +\item \tcode{reinterpret_cast<\cv{} T(\&)[2]>(z)[0]} designates the real part of \tcode{z}, and +\item \tcode{reinterpret_cast<\cv{} T(\&)[2]>(z)[1]} designates the imaginary part of \tcode{z}. \end{itemize} Moreover, if \tcode{a} is an expression of type \cv{}~\tcode{complex*} and the expression \tcode{a[i]} is well-defined for an integer expression \tcode{i}, then: \begin{itemize} -\item \tcode{reinterpret_cast<\cv{} T*>(a)[2*i]} shall designate the real part of \tcode{a[i]}, and -\item \tcode{reinterpret_cast<\cv{} T*>(a)[2*i + 1]} shall designate the imaginary part of \tcode{a[i]}. +\item \tcode{reinterpret_cast<\cv{} T*>(a)[2*i]} designates the real part of \tcode{a[i]}, and +\item \tcode{reinterpret_cast<\cv{} T*>(a)[2*i + 1]} designates the imaginary part of \tcode{a[i]}. \end{itemize} \rSec2[complex.syn]{Header \tcode{} synopsis} @@ -449,14 +449,10 @@ \end{itemdecl} \begin{itemdescr} -\pnum -\effects -Constructs an object of class -\tcode{complex}. \pnum \ensures -\tcode{real() == re \&\& imag() == im}. +\tcode{real() == re \&\& imag() == im} is \tcode{true}. \end{itemdescr} \indexlibrarymember{real}{complex}% @@ -663,9 +659,6 @@ \returns \tcode{complex(lhs)}. -\pnum -\remarks -unary operator. \end{itemdescr} \begin{itemdecl} @@ -691,8 +684,6 @@ \tcode{complex(-lhs.real(),-lhs.imag())}. \pnum -\remarks -unary operator. \end{itemdescr} \indexlibrarymember{operator-}{complex}% @@ -762,8 +753,8 @@ \begin{itemdescr} \pnum -\requires -The input values shall be convertible to +\expects +The input values are convertible to \tcode{T}. \pnum @@ -919,8 +910,8 @@ \begin{itemdescr} \pnum -\requires -\tcode{rho} shall be non-negative and non-NaN\@. \tcode{theta} shall be finite. +\expects +\tcode{rho} is non-negative and non-NaN\@. \tcode{theta} is finite. \pnum \returns @@ -1342,6 +1333,14 @@ \end{itemdecl} \begin{itemdescr} +\pnum +\constraints +\begin{itemize} +\item \tcode{sizeof(To) == sizeof(From)} is \tcode{true}; +\item \tcode{is_trivially_copyable_v} is \tcode{true}; and +\item \tcode{is_trivially_copyable_v} is \tcode{true}. +\end{itemize} + \pnum \returns An object of type \tcode{To}. @@ -1354,13 +1353,7 @@ \pnum \remarks -This function shall not participate in overload resolution unless: -\begin{itemize} -\item \tcode{sizeof(To) == sizeof(From)} is \tcode{true}; -\item \tcode{is_trivially_copyable_v} is \tcode{true}; and -\item \tcode{is_trivially_copyable_v} is \tcode{true}. -\end{itemize} -This function shall be \tcode{constexpr} if and only if +This function is \tcode{constexpr} if and only if \tcode{To}, \tcode{From}, and the types of all subobjects of \tcode{To} and \tcode{From} are types \tcode{T} such that: \begin{itemize} @@ -1381,15 +1374,15 @@ \end{itemdecl} \begin{itemdescr} +\pnum +\constraints +\tcode{T} is an unsigned integer type\iref{basic.fundamental}. + \pnum \returns \tcode{true} if \tcode{x} is an integral power of two; \tcode{false} otherwise. -\pnum -\remarks -This function shall not participate in overload resolution -unless \tcode{T} is an unsigned integer type\iref{basic.fundamental}. \end{itemdescr} \indexlibraryglobal{ceil2}% @@ -1432,16 +1425,16 @@ \end{itemdecl} \begin{itemdescr} +\pnum +\constraints +\tcode{T} is an unsigned integer type\iref{basic.fundamental}. + \pnum \returns If \tcode{x == 0}, \tcode{0}; otherwise the maximal value \tcode{y} such that \tcode{ispow2(y)} is \tcode{true} and \tcode{y <= x}. -\pnum -\remarks -This function shall not participate in overload resolution -unless \tcode{T} is an unsigned integer type\iref{basic.fundamental}. \end{itemdescr} \indexlibraryglobal{log2p1}% @@ -1451,16 +1444,16 @@ \end{itemdecl} \begin{itemdescr} +\pnum +\constraints +\tcode{T} is an unsigned integer type\iref{basic.fundamental}. + \pnum \returns If \tcode{x == 0}, \tcode{0}; otherwise one plus the base-2 logarithm of \tcode{x}, with any fractional part discarded. -\pnum -\remarks -This function shall not participate in overload resolution -unless \tcode{T} is an unsigned integer type\iref{basic.fundamental}. \end{itemdescr} \rSec2[bit.rotate]{Rotating} @@ -2132,7 +2125,6 @@ \indextext{seed sequence!requirements|)}% - %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Uniform Random Number Generator requirements: @@ -2436,7 +2428,7 @@ provided that there have been no intervening invocations of \tcode{x} or of \tcode{v}. - \requires + \expects \tcode{is} provides a textual representation that was previously written using an output stream @@ -2511,7 +2503,6 @@ Otherwise returns \tcode{false}. \end{itemdescr} - \begin{itemdecl} A::A(result_type s); \end{itemdecl} @@ -2523,7 +2514,6 @@ with \tcode{s}. \end{itemdescr} - \begin{itemdecl} template A::A(Sseq& q); \end{itemdecl} @@ -2825,7 +2815,8 @@ calls \tcode{is.setstate(ios::failbit)} (which may throw \tcode{ios::failure}\iref{iostate.flags}). - \requires \tcode{is} provides a textual representation + \expects + \tcode{is} provides a textual representation that was previously written using an \tcode{os} whose imbued locale and whose type's template specialization arguments @@ -3071,7 +3062,6 @@ \begin{itemdescr} \pnum \effects -Constructs a \tcode{linear_congruential_engine} object. If $c \bmod m$ is $0$ and $\tcode{s} \bmod m$ is $0$, sets the engine's state to $1$, otherwise sets the engine's state to $\tcode{s} \bmod m$. @@ -3085,7 +3075,6 @@ \begin{itemdescr} \pnum \effects -Constructs a \tcode{linear_congruential_engine} object. With $k = \left\lceil \frac{\log_2 m}{32} \right\rceil$ and $a$ an array (or equivalent) @@ -3245,7 +3234,6 @@ \begin{itemdescr} \pnum \effects -Constructs a \tcode{mersenne_twister_engine} object. Sets $X_{-n}$ to $\tcode{value} \bmod 2^w$. Then, iteratively for $i = 1 - n, \dotsc, -1$, sets $X_i$ to \[% @@ -3270,7 +3258,6 @@ \begin{itemdescr} \pnum \effects -Constructs a \tcode{mersenne_twister_engine} object. With $k = \left\lceil w / 32 \right\rceil$ and $a$ an array (or equivalent) @@ -3393,7 +3380,6 @@ $X_{i-r}, \dotsc, X_{i-1}$, in that order, followed by $c$. - \indexlibraryctor{subtract_with_carry_engine}% \begin{itemdecl} explicit subtract_with_carry_engine(result_type value); @@ -3402,7 +3388,6 @@ \begin{itemdescr} \pnum \effects -Constructs a \tcode{subtract_with_carry_engine} object. Sets the values of $X_{-r}, \dotsc, X_{-1}$, in that order, as specified below. @@ -3429,8 +3414,6 @@ of \tcode{e}. \end{itemdescr} - - \indexlibraryctor{subtract_with_carry_engine}% \begin{itemdecl} template explicit subtract_with_carry_engine(Sseq& q); @@ -3439,7 +3422,6 @@ \begin{itemdescr} \pnum \effects -Constructs a \tcode{subtract_with_carry_engine} object. With $k = \left\lceil w / 32 \right\rceil$ and $a$ an array (or equivalent) @@ -3747,8 +3729,7 @@ The textual representation% \indextext{\idxcode{independent_bits_engine}!textual representation}% \indextext{textual representation!\idxcode{independent_bits_engine}} -consists of - the textual representation of \tcode{e}. +consists of the textual representation of \tcode{e}. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -3894,7 +3875,7 @@ The $10000^\text{th}$ consecutive invocation of a default-constructed object of type \tcode{minstd_rand0} - shall produce the value $1043618065$. + produces the value $1043618065$. \end{itemdescr} \indexlibraryglobal{minstd_rand}% @@ -3910,7 +3891,7 @@ The $10000^\text{th}$ consecutive invocation of a default-constructed object of type \tcode{minstd_rand} - shall produce the value $399268537$. + produces the value $399268537$. \end{itemdescr} \indexlibraryglobal{mt19937}% @@ -3927,7 +3908,7 @@ The $10000^\text{th}$ consecutive invocation of a default-constructed object of type \tcode{mt19937} - shall produce the value $4123659995$. + produces the value $4123659995$. \end{itemdescr} \indexlibraryglobal{mt19937_64}% @@ -3945,7 +3926,7 @@ The $10000^\text{th}$ consecutive invocation of a default-constructed object of type \tcode{mt19937_64} - shall produce the value $9981545732273789042$. + produces the value $9981545732273789042$. \end{itemdescr} \indexlibraryglobal{ranlux24_base}% @@ -3961,7 +3942,7 @@ The $10000^\text{th}$ consecutive invocation of a default-constructed object of type \tcode{ran\-lux24_base} - shall produce the value + produces the value $7937952$. \end{itemdescr} @@ -3978,7 +3959,7 @@ The $10000^\text{th}$ consecutive invocation of a default-constructed object of type \tcode{ran\-lux48_base} - shall produce the value + produces the value $61839128582725$. \end{itemdescr} @@ -3994,7 +3975,7 @@ The $10000^\text{th}$ consecutive invocation of a default-constructed object of type \tcode{ranlux24} - shall produce the value + produces the value $9901578$. \end{itemdescr} @@ -4010,7 +3991,7 @@ The $10000^\text{th}$ consecutive invocation of a default-constructed object of type \tcode{ranlux48} - shall produce the value + produces the value $249142670248501$. \end{itemdescr} @@ -4026,7 +4007,7 @@ The $10000^\text{th}$ consecutive invocation of a default-constructed object of type \tcode{knuth_b} - shall produce the value $1112339016$. + produces the value $1112339016$. \end{itemdescr}% \indexlibraryglobal{default_random_engine}% @@ -4120,16 +4101,13 @@ \begin{itemdescr} \pnum -\effects -Constructs a \tcode{random_device} - nondeterministic uniform random bit generator object. +\remarks The semantics of the \tcode{token} parameter and the token value used by the default constructor are \impldef{semantics of \tcode{token} parameter and default token value used by \tcode{random_device} constructors}.% \footnote{The parameter is intended to allow an implementation to differentiate - between different sources of randomness. - } + between different sources of randomness.} \pnum \throws @@ -4230,7 +4208,7 @@ private: vector v; // \expos }; -\end{codeblock}% +\end{codeblock} \indexlibraryctor{seed_seq}% @@ -4240,9 +4218,8 @@ \begin{itemdescr} \pnum -\effects -Constructs a \tcode{seed_seq} object - as if by default-constructing its member \tcode{v}. +\ensures +\tcode{v.empty()} is \tcode{true}. \pnum \throws @@ -4258,7 +4235,8 @@ \begin{itemdescr} \pnum -\requires \tcode{T} shall be an integer type. +\mandates +\tcode{T} is an integer type. \pnum \effects @@ -4274,17 +4252,19 @@ \begin{itemdescr} \pnum -\requires - \tcode{InputIterator} shall meet the - \oldconcept{InputIterator} requirements\iref{input.iterators}. - Moreover, +\mandates \tcode{iterator_traits::value_type} - shall denote an integer type. + is an integer type. + +\pnum +\expects + \tcode{InputIterator} meets the + \oldconcept{InputIterator} requirements\iref{input.iterators}. \pnum \effects -Constructs a \tcode{seed_seq} object - by the following algorithm: +Initializes \tcode{v} +by the following algorithm: \begin{codeblock} for (InputIterator s = begin; s != end; ++s) v.push_back((*s)@$\bmod 2^{32}$@); @@ -4299,14 +4279,15 @@ \begin{itemdescr} \pnum -\requires \tcode{RandomAccessIterator} - shall meet the +\mandates + \tcode{iterator_traits::\brk{}value_type} + is an unsigned integer type capable of accommodating 32-bit quantities. + +\pnum +\expects + \tcode{RandomAccessIterator} meets the \oldconcept{RandomAccessIterator} requirements\iref{random.access.iterators} and the requirements of a mutable iterator. - Moreover, - \tcode{iterator_traits::\brk{}value_type} - shall denote an unsigned integer type - capable of accommodating 32-bit quantities. \pnum \effects @@ -4413,13 +4394,13 @@ \begin{itemdescr} \pnum -\requires - \tcode{OutputIterator} shall meet the +\mandates + Values of type \tcode{result_type} are writable\iref{iterator.requirements.general} to \tcode{dest}. + +\pnum +\expects + \tcode{OutputIterator} meets the \oldconcept{OutputIterator} requirements\iref{output.iterators}. - Moreover, - the expression - \tcode{*dest = rt} - shall be valid for a value \tcode{rt} of type \tcode{result_type}. \pnum \effects @@ -4624,12 +4605,11 @@ \begin{itemdescr} \pnum -\requires - $\tcode{a} \leq \tcode{b}$. +\expects +$\tcode{a} \leq \tcode{b}$. \pnum -\effects -Constructs a \tcode{uniform_int_distribution} object; +\remarks \tcode{a} and \tcode{b} correspond to the respective parameters of the distribution. \end{itemdescr} @@ -4718,14 +4698,13 @@ \begin{itemdescr} \pnum -\requires - $\tcode{a} \leq \tcode{b}$ - and - $\tcode{b} - \tcode{a} \leq \tcode{numeric_limits::max()}$. +\expects +$\tcode{a} \leq \tcode{b}$ +and +$\tcode{b} - \tcode{a} \leq \tcode{numeric_limits::max()}$. \pnum -\effects -Constructs a \tcode{uniform_real_distribution} object; +\remarks \tcode{a} and \tcode{b} correspond to the respective parameters of the distribution. \end{itemdescr} @@ -4825,12 +4804,11 @@ \begin{itemdescr} \pnum -\requires - $0 \leq \tcode{p} \leq 1$. +\expects +$0 \leq \tcode{p} \leq 1$. \pnum -\effects -Constructs a \tcode{bernoulli_distribution} object; +\remarks \tcode{p} corresponds to the parameter of the distribution. \end{itemdescr} @@ -4903,12 +4881,11 @@ \begin{itemdescr} \pnum -\requires - $0 \leq \tcode{p} \leq 1$ and $0 \leq \tcode{t} $. +\expects +$0 \leq \tcode{p} \leq 1$ and $0 \leq \tcode{t} $. \pnum -\effects -Constructs a \tcode{binomial_distribution} object; +\remarks \tcode{t} and \tcode{p} correspond to the respective parameters of the distribution. \end{itemdescr} @@ -4991,12 +4968,11 @@ \begin{itemdescr} \pnum -\requires - $0 < \tcode{p} < 1$. +\expects +$0 < \tcode{p} < 1$. \pnum -\effects -Constructs a \tcode{geometric_distribution} object; +\remarks \tcode{p} corresponds to the parameter of the distribution. \end{itemdescr} @@ -5073,13 +5049,12 @@ \begin{itemdescr} \pnum -\requires - $0 < \tcode{p} \leq 1$ - and $0 < \tcode{k} $. +\expects +$0 < \tcode{p} \leq 1$ +and $0 < \tcode{k} $. \pnum -\effects -Constructs a \tcode{negative_binomial_distribution} object; +\remarks \tcode{k} and \tcode{p} correspond to the respective parameters of the distribution. \end{itemdescr} @@ -5181,11 +5156,11 @@ \begin{itemdescr} \pnum -\requires $0 < \tcode{mean}$. +\expects +$0 < \tcode{mean}$. \pnum -\effects -Constructs a \tcode{poisson_distribution} object; +\remarks \tcode{mean} corresponds to the parameter of the distribution. \end{itemdescr} @@ -5256,11 +5231,11 @@ \begin{itemdescr} \pnum -\requires $0 < \tcode{lambda}$. +\expects +$0 < \tcode{lambda}$. \pnum -\effects -Constructs an \tcode{exponential_distribution} object; +\remarks \tcode{lambda} corresponds to the parameter of the distribution. \end{itemdescr} @@ -5334,11 +5309,11 @@ \begin{itemdescr} \pnum -\requires $0 < \tcode{alpha}$ and $0 < \tcode{beta}$. +\expects +$0 < \tcode{alpha}$ and $0 < \tcode{beta}$. \pnum -\effects -Constructs a \tcode{gamma_distribution} object; +\remarks \tcode{alpha} and \tcode{beta} correspond to the parameters of the distribution. \end{itemdescr} @@ -5426,11 +5401,11 @@ \begin{itemdescr} \pnum -\requires $0 < \tcode{a}$ and $0 < \tcode{b}$. +\expects +$0 < \tcode{a}$ and $0 < \tcode{b}$. \pnum -\effects -Constructs a \tcode{weibull_distribution} object; +\remarks \tcode{a} and \tcode{b} correspond to the respective parameters of the distribution. \end{itemdescr} @@ -5525,11 +5500,11 @@ \begin{itemdescr} \pnum -\requires $0 < \tcode{b}$. +\expects +$0 < \tcode{b}$. \pnum -\effects -Constructs an \tcode{extreme_value_distribution} object; +\remarks \tcode{a} and \tcode{b} correspond to the respective parameters of the distribution. \end{itemdescr} @@ -5645,11 +5620,11 @@ \begin{itemdescr} \pnum -\requires $0 < \tcode{stddev}$. +\expects +$0 < \tcode{stddev}$. \pnum -\effects -Constructs a \tcode{normal_distribution} object; +\remarks \tcode{mean} and \tcode{stddev} correspond to the respective parameters of the distribution. \end{itemdescr} @@ -5737,11 +5712,11 @@ \begin{itemdescr} \pnum -\requires $0 < \tcode{s}$. +\expects +$0 < \tcode{s}$. \pnum -\effects -Constructs a \tcode{lognormal_distribution} object; +\remarks \tcode{m} and \tcode{s} correspond to the respective parameters of the distribution. \end{itemdescr} @@ -5826,11 +5801,11 @@ \begin{itemdescr} \pnum -\requires $0 < \tcode{n}$. +\expects +$0 < \tcode{n}$. \pnum -\effects -Constructs a \tcode{chi_squared_distribution} object; +\remarks \tcode{n} corresponds to the parameter of the distribution. \end{itemdescr} @@ -5903,11 +5878,11 @@ \begin{itemdescr} \pnum -\requires $0 < \tcode{b}$. +\expects +$0 < \tcode{b}$. \pnum -\effects -Constructs a \tcode{cauchy_distribution} object; +\remarks \tcode{a} and \tcode{b} correspond to the respective parameters of the distribution. \end{itemdescr} @@ -5997,11 +5972,11 @@ \begin{itemdescr} \pnum -\requires $0 < \tcode{m}$ and $0 < \tcode{n}$. +\expects +$0 < \tcode{m}$ and $0 < \tcode{n}$. \pnum -\effects -Constructs a \tcode{fisher_f_distribution} object; +\remarks \tcode{m} and \tcode{n} correspond to the respective parameters of the distribution. \end{itemdescr} @@ -6089,11 +6064,11 @@ \begin{itemdescr} \pnum -\requires $0 < \tcode{n}$. +\expects +$0 < \tcode{n}$. \pnum -\effects -Constructs a \tcode{student_t_distribution} object; +\remarks \tcode{n} corresponds to the parameter of the distribution. \end{itemdescr} @@ -6211,17 +6186,19 @@ \begin{itemdescr} \pnum -\requires - \tcode{InputIterator} shall meet the +\mandates +\tcode{is_convertible_v::value_type, +double>} is \tcode{true}. + +\pnum +\expects + \tcode{InputIterator} meets the \oldconcept{InputIterator} requirements\iref{input.iterators}. - Moreover, - \tcode{iterator_traits::value_type} - shall denote a type that is convertible to \tcode{double}. If \tcode{firstW == lastW}, let $n = 1$ and $w_0 = 1$. Otherwise, $\bigl[\tcode{firstW}, \tcode{lastW}\bigr)$ - shall form a sequence $w$ of length $n > 0$. + forms a sequence $w$ of length $n > 0$. \pnum \effects @@ -6249,17 +6226,15 @@ \begin{itemdescr} \pnum -\requires - Each instance of type \tcode{UnaryOperation} - shall be a function object\iref{function.objects} - whose return type shall be convertible to \tcode{double}. - Moreover, - \tcode{double} shall be convertible - to the type of \tcode{UnaryOperation}'s sole parameter. +\mandates +\tcode{is_invocable_r_v} is \tcode{true}. + +\pnum +\expects If $\tcode{nw} = 0$, let $n = 1$, otherwise let $n = \tcode{nw}$. The relation $0 < \delta = (\tcode{xmax} - \tcode{xmin}) / n$ - shall hold. + holds. \pnum \effects @@ -6274,7 +6249,7 @@ \pnum \complexity - The number of invocations of \tcode{fw} shall not exceed $n$. +The number of invocations of \tcode{fw} does not exceed $n$. \end{itemdescr} \indexlibrarymember{probabilities}{discrete_distribution}% @@ -6395,15 +6370,19 @@ \begin{itemdescr} \pnum -\requires +\mandates +Both of +\begin{itemize} +\item{\tcode{is_convertible_v::value_type, double>}} +\item{\tcode{is_convertible_v::value_type, double>}} +\end{itemize} +are \tcode{true}. + +\pnum +\expects \tcode{InputIteratorB} and \tcode{InputIteratorW} - shall each meet the + each meet the \oldconcept{InputIterator} requirements\iref{input.iterators}. - Moreover, - the \grammarterm{id-expression}s - \tcode{iterator_traits::value_type} and - \tcode{iterator_traits::value_type} - shall each denote a type that is convertible to \tcode{double}. If \tcode{firstB == lastB} or \tcode{++firstB == lastB}, let $n = 1$, @@ -6412,10 +6391,10 @@ and $b_1 = 1$. Otherwise, $\bigl[\tcode{firstB}, \tcode{lastB}\bigr)$ - shall form a sequence $b$ of length $n+1$, + forms a sequence $b$ of length $n+1$, the length of the sequence $w$ starting from \tcode{firstW} - shall be at least $n$, - and any $w_k$ for $k \geq n$ shall be ignored by the distribution. + is at least $n$, + and any $w_k$ for $k \geq n$ are ignored by the distribution. \pnum \effects @@ -6432,13 +6411,8 @@ \begin{itemdescr} \pnum -\requires - Each instance of type \tcode{UnaryOperation} - shall be a function object\iref{function.objects} - whose return type shall be convertible to \tcode{double}. - Moreover, - \tcode{double} shall be convertible - to the type of \tcode{UnaryOperation}'s sole parameter. +\mandates +\tcode{is_invocable_r_v} is \tcode{true}. \pnum \effects @@ -6459,7 +6433,7 @@ \pnum \complexity - The number of invocations of \tcode{fw} shall not exceed $n$. +The number of invocations of \tcode{fw} does not exceed $n$. \end{itemdescr} @@ -6471,16 +6445,14 @@ \begin{itemdescr} \pnum -\requires - Each instance of type \tcode{UnaryOperation} - shall be a function object\iref{function.objects} - whose return type shall be convertible to \tcode{double}. - Moreover, - \tcode{double} shall be convertible - to the type of \tcode{UnaryOperation}'s sole parameter. +\mandates +\tcode{is_invocable_r_v} is \tcode{true}. + +\pnum +\expects If $\tcode{nw} = 0$, let $n = 1$, otherwise let $n = \tcode{nw}$. The relation $0 < \delta = (\tcode{xmax} - \tcode{xmin}) / n$ - shall hold. + holds. \pnum \effects @@ -6492,7 +6464,7 @@ \pnum \complexity - The number of invocations of \tcode{fw} shall not exceed $n$. +The number of invocations of \tcode{fw} does not exceed $n$. \end{itemdescr} \indexlibrarymember{intervals}{piecewise_constant_distribution}% @@ -6624,15 +6596,14 @@ \begin{itemdescr} \pnum -\requires +\mandates +\tcode{is_invocable_r_v} is \tcode{true}. + +\pnum +\expects \tcode{InputIteratorB} and \tcode{InputIteratorW} - shall each meet the + each meet the \oldconcept{InputIterator} requirements\iref{input.iterators}. - Moreover, - the \grammarterm{id-expression}s - \tcode{iterator_traits::value_type} and - \tcode{iterator_traits::value_type} - shall each denote a type that is convertible to \tcode{double}. If \tcode{firstB == lastB} or \tcode{++firstB == lastB}, let $n = 1$, @@ -6641,10 +6612,10 @@ and $b_1 = 1$. Otherwise, $\bigl[\tcode{firstB}, \tcode{lastB}\bigr)$ - shall form a sequence $b$ of length $n+1$, + forms a sequence $b$ of length $n+1$, the length of the sequence $w$ starting from \tcode{firstW} - shall be at least $n+1$, - and any $w_k$ for $k \geq n + 1$ shall be ignored by the distribution. + is at least $n+1$, + and any $w_k$ for $k \geq n + 1$ are ignored by the distribution. \pnum \effects @@ -6661,13 +6632,8 @@ \begin{itemdescr} \pnum -\requires - Each instance of type \tcode{UnaryOperation} - shall be a function object\iref{function.objects} - whose return type shall be convertible to \tcode{double}. - Moreover, - \tcode{double} shall be convertible - to the type of \tcode{UnaryOperation}'s sole parameter. +\mandates +\tcode{is_invocable_r_v} is \tcode{true}. \pnum \effects @@ -6688,7 +6654,7 @@ \pnum \complexity - The number of invocations of \tcode{fw} shall not exceed $n+1$. +The number of invocations of \tcode{fw} does not exceed $n+1$. \end{itemdescr} @@ -6700,16 +6666,14 @@ \begin{itemdescr} \pnum -\requires - Each instance of type \tcode{UnaryOperation} - shall be a function object\iref{function.objects} - whose return type shall be convertible to \tcode{double}. - Moreover, - \tcode{double} shall be convertible - to the type of \tcode{UnaryOperation}'s sole parameter. +\mandates +\tcode{is_invocable_r_v} is \tcode{true}. + +\pnum +\expects If $\tcode{nw} = 0$, let $n = 1$, otherwise let $n = \tcode{nw}$. The relation $0 < \delta = (\tcode{xmax} - \tcode{xmin}) / n$ - shall hold. + holds. \pnum \effects @@ -6721,7 +6685,7 @@ \pnum \complexity - The number of invocations of \tcode{fw} shall not exceed $n+1$. +The number of invocations of \tcode{fw} does not exceed $n+1$. \end{itemdescr} \indexlibrarymember{intervals}{piecewise_linear_distribution}% @@ -7203,10 +7167,10 @@ \end{itemdecl} \begin{itemdescr} + \pnum -\requires -\tcode{p} points to an array\iref{dcl.array} of at least -\tcode{n} elements. +\expects +\range{p}{p + n} is a valid range. \effects Constructs a \tcode{valarray} that has length \tcode{n}. @@ -7375,7 +7339,8 @@ \begin{itemdescr} \pnum -\requires The length of the array to which the argument refers equals \tcode{size()}. +\expects +The length of the array to which the argument refers equals \tcode{size()}. The value of an element in the left-hand side of a \tcode{valarray} assignment operator does not depend on the value of another element in that left-hand side. @@ -7395,8 +7360,8 @@ \begin{itemdescr} \pnum -\requires -\tcode{n < size()}. +\expects +\tcode{n < size()} is \tcode{true}. \pnum \returns @@ -7631,10 +7596,9 @@ \begin{itemdescr} \pnum -\requires -Each of these operators may only be instantiated for a type \tcode{T} -to which the indicated operator can be applied and for which the indicated -operator returns a value which is of type \tcode{T} (\tcode{bool} for +\mandates +The indicated operator can be applied to operands of type \tcode{T} +and returns a value of type \tcode{T} (\tcode{bool} for \tcode{operator!}) or which may be unambiguously implicitly converted to type \tcode{T} (\tcode{bool} for \tcode{operator!}). @@ -7672,10 +7636,13 @@ \begin{itemdescr} \pnum -\requires -\tcode{size() == v.size()}. -Each of these operators may only be instantiated for a type \tcode{T} -if the indicated operator can be applied to two operands of type \tcode{T}. +\mandates +The indicated operator can be applied to two operands of type \tcode{T}. + +\pnum +\expects +\tcode{size() == v.size()} is \tcode{true}. + The value of an element in the left-hand side of a valarray compound assignment operator does not depend on the value of another element in that left hand side. @@ -7721,9 +7688,8 @@ \begin{itemdescr} \pnum -\requires -Each of these operators may only be instantiated for a type \tcode{T} -if the indicated operator can be applied to two operands of type \tcode{T}. +\mandates +The indicated operator can be applied to two operands of type \tcode{T}. \pnum \effects @@ -7781,11 +7747,12 @@ \begin{itemdescr} \pnum -\requires -\tcode{size() > 0}. -This function may only be instantiated for a type \tcode{T} to which -\tcode{operator+=} -can be applied. +\mandates +\tcode{operator+=} can be applied to operands of type \tcode{T}. + +\pnum +\expects +\tcode{size() > 0} is \tcode{true}. \pnum \returns @@ -7804,8 +7771,8 @@ \begin{itemdescr} \pnum -\requires -\tcode{size() > 0} +\expects +\tcode{size() > 0} is \tcode{true}. \pnum \returns @@ -7823,8 +7790,8 @@ \begin{itemdescr} \pnum -\requires -\tcode{size() > 0}. +\expects +\tcode{size() > 0} is \tcode{true}. \pnum \returns @@ -7935,11 +7902,13 @@ \begin{itemdescr} \pnum -\requires -Each of these operators may only be instantiated for a type \tcode{T} -to which the indicated operator can be applied and for which the indicated -operator returns a value which is of type \tcode{T} or which -can be unambiguously implicitly converted to type \tcode{T}. +\mandates +The indicated operator can be applied to operands of type \tcode{T} and returns +a value of type \tcode{T} or which can be unambiguously +implicitly converted to \tcode{T}. + +\pnum +\expects The argument arrays have the same length. \pnum @@ -8006,11 +7975,10 @@ \begin{itemdescr} \pnum -\requires -Each of these operators may only be instantiated for a type \tcode{T} -to which the indicated operator can be applied and for which -the indicated operator returns a value which is of type \tcode{T} -or which can be unambiguously implicitly converted to type \tcode{T}. +\mandates +The indicated operator can be applied to operands of type \tcode{T} and returns +a value of type \tcode{T} or which can be unambiguously +implicitly converted to \tcode{T}. \pnum \returns @@ -8044,11 +8012,13 @@ \begin{itemdescr} \pnum -\requires -Each of these operators may only be instantiated for a type \tcode{T} -to which the indicated operator can be applied and for which -the indicated operator returns a value which is of type \tcode{bool} -or which can be unambiguously implicitly converted to type \tcode{bool}. +\mandates +The indicated operator can be applied to operands of type \tcode{T} and returns +a value of type \tcode{bool} or which can be unambiguously +implicitly converted to \tcode{bool}. + +\pnum +\expects The two array arguments have the same length. \indextext{undefined} @@ -8106,11 +8076,10 @@ \begin{itemdescr} \pnum -\requires -Each of these operators may only be instantiated for a type \tcode{T} -to which the indicated operator can be applied and for which -the indicated operator returns a value which is of type \tcode{bool} -or which can be unambiguously implicitly converted to type \tcode{bool}. +\mandates +The indicated operator can be applied to operands of type \tcode{T} and returns +a value of type \tcode{bool} or which can be unambiguously +implicitly converted to \tcode{bool}. \pnum \returns @@ -8164,11 +8133,12 @@ \begin{itemdescr} \pnum -\requires -Each of these functions may only be instantiated for a type \tcode{T} -to which a unique function with the indicated name can be applied (unqualified). -This function shall return a value which is of type \tcode{T} +\mandates +A unique function with the indicated name can be applied (unqualified) +to an operand of type \tcode{T}. +This function returns a value of type \tcode{T} or which can be unambiguously implicitly converted to type \tcode{T}. + \end{itemdescr} \rSec3[valarray.special]{Specialized algorithms}