Skip to content

Commit 9b3a28f

Browse files
committed
[{ex,in}clusive.scan, transform.{ex,in}clusive.scan]: Rephase 'for each *j' in terms of indexes
Addresses cplusplus#693 for this part, but is also clearer.
1 parent 546a162 commit 9b3a28f

File tree

1 file changed

+23
-18
lines changed

1 file changed

+23
-18
lines changed

source/numerics.tex

+23-18
Original file line numberDiff line numberDiff line change
@@ -9155,11 +9155,12 @@
91559155

91569156
\pnum
91579157
\effects
9158-
Assigns through each iterator \tcode{i} in \range{result}{result + (last - first)} the value of
9158+
For each integer \tcode{K} in \range{0}{last - first}
9159+
assigns through \tcode{result + K} the value of:
91599160
\begin{codeblock}
9160-
@\placeholder{GENERALIZED_NONCOMMUTATIVE_SUM}@(binary_op, init, *j, ...)
9161+
@\placeholdernc{GENERALIZED_NONCOMMUTATIVE_SUM}@(
9162+
binary_op, init, *(first + 0), *(first + 1), ..., *(first + K - 1))
91619163
\end{codeblock}
9162-
for every \tcode{j} in \range{first}{first + (i - result)}.
91639164

91649165
\pnum
91659166
\returns
@@ -9248,15 +9249,15 @@
92489249

92499250
\pnum
92509251
\effects
9251-
Assigns through each iterator \tcode{i} in \range{result}{result + (last - first)} the value of
9252+
For each integer \tcode{K} in \range{0}{last - first}
9253+
assigns through \tcode{result + K} the value of
92529254
\begin{itemize}
92539255
\item
9254-
\tcode{\textit{GENERALIZED_NONCOMMUTATIVE_SUM}(binary_op, init, *j, ...)}
9255-
for every \tcode{j} in \range{first}{first + (i - result + 1)}
9256-
if \tcode{init} is provided, or
9256+
\tcode{\placeholdernc{GENERALIZED_NONCOMMUTATIVE_SUM}(\\\phantom{\tcode{\ \ \ \ }}binary_op,
9257+
init, *(first + 0), *(first + 1), ..., *(first + K))}\\if \tcode{init} is provided, or
92579258
\item
9258-
\tcode{\textit{GENERALIZED_NONCOMMUTATIVE_SUM}(binary_op, *j, ...)}
9259-
for every \tcode{j} in \range{first}{first + (i - result + 1)} otherwise.
9259+
\tcode{\placeholdernc{GENERALIZED_NONCOMMUTATIVE_SUM}(\\\phantom{\tcode{\ \ \ \ }}binary_op,
9260+
*(first + 0), *(first + 1), ..., *(first + K))}\\otherwise.
92609261
\end{itemize}
92619262

92629263
\pnum
@@ -9310,9 +9311,13 @@
93109311

93119312
\pnum
93129313
\effects
9313-
Assigns through each iterator \tcode{i} in \range{result}{result + (last - first)} the value of
9314-
\tcode{\textit{GENERALIZED_NONCOMMUTATIVE_SUM}(binary_op, init, unary_op(*j), ...)}
9315-
for every \tcode{j} in \range{first}{first + (i - result)}.
9314+
For each integer \tcode{K} in \range{0}{last - first}
9315+
assigns through \tcode{result + K} the value of:
9316+
\begin{codeblock}
9317+
@\placeholdernc{GENERALIZED_NONCOMMUTATIVE_SUM}@(
9318+
binary_op, init,
9319+
unary_op(*(first + 0)), unary_op(*(first + 1)), ..., unary_op(*(first + K - 1)))
9320+
\end{codeblock}
93169321

93179322
\pnum
93189323
\returns
@@ -9383,15 +9388,15 @@
93839388

93849389
\pnum
93859390
\effects
9386-
Assigns through each iterator \tcode{i} in \range{result}{result + (last - first)} the value of
9391+
For each integer \tcode{K} in \range{0}{last - first}
9392+
assigns through \tcode{result + K} the value of
93879393
\begin{itemize}
93889394
\item
9389-
\tcode{\textit{GENERALIZED_NONCOMMUTATIVE_SUM}(binary_op, init, unary_op(*j), ...)}
9390-
for every \tcode{j} in \range{first}{first + (i - result + 1)}
9391-
if \tcode{init} is provided, or
9395+
\tcode{\placeholdernc{GENERALIZED_NONCOMMUTATIVE_SUM}(\\\phantom{\tcode{\ \ \ \ }}binary_op, init,\\\phantom{\tcode{\ \ \ \ }}unary_op(*(first + 0)), unary_op(*(first + 1)), ..., unary_op(*(first + K)))}\\
9396+
if \tcode{init} is provided, or
93929397
\item
9393-
\tcode{\textit{GENERALIZED_NONCOMMUTATIVE_SUM}(binary_op, unary_op(*j), ...)}
9394-
for every \tcode{j} in \range{first}{first + (i - result + 1)} otherwise.
9398+
\tcode{\placeholdernc{GENERALIZED_NONCOMMUTATIVE_SUM}(\\\phantom{\tcode{\ \ \ \ }}binary_op,\\\phantom{\tcode{\ \ \ \ }}unary_op(*(first + 0)), unary_op(*(first + 1)), ..., unary_op(*(first + K)))}\\
9399+
otherwise.
93959400
\end{itemize}
93969401

93979402
\pnum

0 commit comments

Comments
 (0)