Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[algorithms, numerics] Replace "exactly" with "at most" in Complexity #7364

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 43 additions & 43 deletions source/algorithms.tex
Original file line number Diff line number Diff line change
Expand Up @@ -3647,7 +3647,7 @@

\pnum
\complexity
Applies \tcode{f} exactly \tcode{last - first} times.
Applies \tcode{f} at most \tcode{last - first} times.

\pnum
\remarks
Expand Down Expand Up @@ -3678,7 +3678,7 @@

\pnum
\complexity
Applies \tcode{f} exactly \tcode{last - first} times.
Applies \tcode{f} at most \tcode{last - first} times.

\pnum
\remarks
Expand Down Expand Up @@ -3723,7 +3723,7 @@

\pnum
\complexity
Applies \tcode{f} and \tcode{proj} exactly \tcode{last - first} times.
Applies \tcode{f} and \tcode{proj} at most \tcode{last - first} times.

\pnum
\remarks
Expand Down Expand Up @@ -4188,7 +4188,7 @@
\pnum
\complexity
For the overloads with no \tcode{ExecutionPolicy},
exactly \[ \min(\tcode{(i - first) + 1}, \ \tcode{(last - first) - 1}) \]
at most \[ \min(\tcode{(i - first) + 1}, \ \tcode{(last - first) - 1}) \]
applications of the corresponding predicate,
where \tcode{i} is \tcode{adjacent_find}'s return value.
For the overloads with an \tcode{ExecutionPolicy},
Expand Down Expand Up @@ -4262,7 +4262,7 @@

\pnum
\complexity
Exactly \tcode{last - first} applications
At most \tcode{last - first} applications
of the corresponding predicate and any projection.
\end{itemdescr}

Expand Down Expand Up @@ -4536,7 +4536,7 @@
if \tcode{ForwardIterator1} and \tcode{Forward\-Iter\-ator2}
meet the requirements of random access iterators and
\tcode{last1 - first1 != last2 - first2}.
Otherwise, exactly \tcode{last1 - first1} applications
Otherwise, at most \tcode{last1 - first1} applications
of the corresponding predicate
if \tcode{equal(first1, last1, first2, last2, pred)} would return \tcode{true};
otherwise, at worst \bigoh{N^2}, where $N$ has the value \tcode{last1 - first1}.
Expand Down Expand Up @@ -4586,7 +4586,7 @@
\tcode{R1} and \tcode{R2} each model \libconcept{sized_range}, and
\tcode{ranges::distance(r1) != ranges::distance(r2)}.
\end{itemize}
Otherwise, exactly \tcode{last1 - first1} applications
Otherwise, at most \tcode{last1 - first1} applications
of the corresponding predicate and projections
if \tcode{ranges::equal(\brk{}first1, last1, first2, last2, pred, proj1, proj2)}
would return \tcode{true};
Expand Down Expand Up @@ -5072,7 +5072,7 @@

\pnum
\complexity
Exactly $N$ assignments.
At most $N$ assignments.
\end{itemdescr}

\indexlibraryglobal{copy}%
Expand Down Expand Up @@ -5102,7 +5102,7 @@

\pnum
\complexity
Exactly \tcode{last - first} assignments.
At most \tcode{last - first} assignments.
\end{itemdescr}

\indexlibraryglobal{copy_n}%
Expand Down Expand Up @@ -5148,7 +5148,7 @@

\pnum
\complexity
Exactly $N$ assignments.
At most $N$ assignments.
\end{itemdescr}

\indexlibraryglobal{copy_if}%
Expand Down Expand Up @@ -5218,7 +5218,7 @@

\pnum
\complexity
Exactly \tcode{last - first} applications
At most \tcode{last - first} applications
of the corresponding predicate and any projection.

\pnum
Expand Down Expand Up @@ -5277,7 +5277,7 @@

\pnum
\complexity
Exactly $N$ assignments.
At most $N$ assignments.
\end{itemdescr}

\rSec2[alg.move]{Move}
Expand Down Expand Up @@ -5335,7 +5335,7 @@

\pnum
\complexity
Exactly $N$ assignments.
At most $N$ assignments.
\end{itemdescr}

\indexlibrary{\idxcode{move}!algorithm}%
Expand Down Expand Up @@ -5368,7 +5368,7 @@

\pnum
\complexity
Exactly $N$ assignments.
At most $N$ assignments.
\end{itemdescr}

\indexlibraryglobal{move_backward}%
Expand Down Expand Up @@ -5430,7 +5430,7 @@

\pnum
\complexity
Exactly $N$ assignments.
At most $N$ assignments.
\end{itemdescr}

\rSec2[alg.swap]{Swap}
Expand Down Expand Up @@ -5500,7 +5500,7 @@

\pnum
\complexity
Exactly $M$ swaps.
At most $M$ swaps.
\end{itemdescr}

\indexlibraryglobal{iter_swap}%
Expand Down Expand Up @@ -5642,7 +5642,7 @@

\pnum
\complexity
Exactly $N$ applications of \tcode{op} or \tcode{binary_op}, and
At most $N$ applications of \tcode{op} or \tcode{binary_op}, and
any projections.
This requirement also applies to the overload with an \tcode{ExecutionPolicy}.

Expand Down Expand Up @@ -5726,7 +5726,7 @@

\pnum
\complexity
Exactly \tcode{last - first} applications
At most \tcode{last - first} applications
of the corresponding predicate and any projection.
\end{itemdescr}

Expand Down Expand Up @@ -5837,7 +5837,7 @@

\pnum
\complexity
Exactly \tcode{last - first} applications
At most \tcode{last - first} applications
of the corresponding predicate and any projection.
\end{itemdescr}

Expand Down Expand Up @@ -5894,7 +5894,7 @@

\pnum
\complexity
Exactly $N$ assignments.
At most $N$ assignments.
\end{itemdescr}

\rSec2[alg.generate]{Generate}
Expand Down Expand Up @@ -5948,7 +5948,7 @@

\pnum
\complexity
Exactly $N$ evaluations of \tcode{gen()} and assignments.
At most $N$ evaluations of \tcode{gen()} and assignments.
\end{itemdescr}

\rSec2[alg.remove]{Remove}
Expand Down Expand Up @@ -6024,7 +6024,7 @@

\pnum
\complexity
Exactly \tcode{last - first} applications
At most \tcode{last - first} applications
of the corresponding predicate and any projection.

\pnum
Expand Down Expand Up @@ -6134,7 +6134,7 @@

\pnum
\complexity
Exactly \tcode{last - first} applications
At most \tcode{last - first} applications
of the corresponding predicate and any projection.

\pnum
Expand Down Expand Up @@ -6209,7 +6209,7 @@

\pnum
\complexity
For nonempty ranges, exactly \tcode{(last - first) - 1} applications
For nonempty ranges, at most \tcode{(last - first) - 1} applications
of the corresponding predicate and
no more than twice as many applications of any projection.
\end{itemdescr}
Expand Down Expand Up @@ -6324,7 +6324,7 @@

\pnum
\complexity
Exactly \tcode{last - first - 1} applications
At most \tcode{last - first - 1} applications
of the corresponding predicate
and no more than twice as many applications of any projection.
\end{itemdescr}
Expand Down Expand Up @@ -6367,7 +6367,7 @@

\pnum
\complexity
Exactly \tcode{(last - first)/2} swaps.
At most \tcode{(last - first)/2} swaps.
\end{itemdescr}

\indexlibraryglobal{reverse_copy}%
Expand Down Expand Up @@ -6419,7 +6419,7 @@

\pnum
\complexity
Exactly $N$ assignments.
At most $N$ assignments.
\end{itemdescr}

\rSec2[alg.rotate]{Rotate}
Expand Down Expand Up @@ -6533,7 +6533,7 @@

\pnum
\complexity
Exactly $N$ assignments.
At most $N$ assignments.
\end{itemdescr}

\begin{itemdecl}
Expand Down Expand Up @@ -6680,7 +6680,7 @@

\pnum
\complexity
Exactly \tcode{(last - first) - 1} swaps.
At most \tcode{(last - first) - 1} swaps.

\pnum
\remarks
Expand Down Expand Up @@ -7759,7 +7759,7 @@
\begin{itemize}
\item
For the overload with no \tcode{ExecutionPolicy},
exactly $N$ applications of the predicate and projection.
at most $N$ applications of the predicate and projection.
At most $N / 2$ swaps if the type of \tcode{first} meets
the \oldconcept{BidirectionalIterator} requirements
for the overloads in namespace \tcode{std} or
Expand Down Expand Up @@ -7835,7 +7835,7 @@
\item
For the overloads with no \tcode{ExecutionPolicy}, at most $N \log_2 N$ swaps,
but only \bigoh{N} swaps if there is enough extra memory.
Exactly $N$ applications of the predicate and projection.
At most $N$ applications of the predicate and projection.
\item
For the overload with an \tcode{ExecutionPolicy},
\bigoh{N \log N} swaps and \bigoh{N} applications of the predicate.
Expand Down Expand Up @@ -7912,7 +7912,7 @@

\pnum
\complexity
Exactly \tcode{last - first} applications of \tcode{pred} and \tcode{proj}.
At most \tcode{last - first} applications of \tcode{pred} and \tcode{proj}.
\end{itemdescr}

\indexlibraryglobal{partition_point}%
Expand Down Expand Up @@ -8117,7 +8117,7 @@
\begin{itemize}
\item
For the overloads with no \tcode{ExecutionPolicy}, and
if enough additional memory is available, exactly $N - 1$ comparisons.
if enough additional memory is available, at most $N - 1$ comparisons.
\item
Otherwise, \bigoh{N \log N} comparisons.
\end{itemize}
Expand Down Expand Up @@ -8998,7 +8998,7 @@

\pnum
\complexity
Exactly one comparison and two applications of the projection, if any.
At most one comparison and two applications of the projection, if any.

\pnum
\remarks
Expand Down Expand Up @@ -9041,7 +9041,7 @@

\pnum
\complexity
Exactly \tcode{ranges::distance(r) - 1} comparisons
At most \tcode{ranges::distance(r) - 1} comparisons
and twice as many applications of the projection, if any.

\pnum
Expand Down Expand Up @@ -9076,7 +9076,7 @@

\pnum
\complexity
Exactly one comparison and two applications of the projection, if any.
At most one comparison and two applications of the projection, if any.

\pnum
\remarks
Expand Down Expand Up @@ -9119,7 +9119,7 @@

\pnum
\complexity
Exactly \tcode{ranges::distance(r) - 1} comparisons
At most \tcode{ranges::distance(r) - 1} comparisons
and twice as many applications of the projection, if any.

\pnum
Expand Down Expand Up @@ -9156,7 +9156,7 @@

\pnum
\complexity
Exactly one comparison and two applications of the projection, if any.
At most one comparison and two applications of the projection, if any.

\pnum
\remarks
Expand Down Expand Up @@ -9256,7 +9256,7 @@

\pnum
\complexity
Exactly $\max(\tcode{last - first - 1}, 0)$ comparisons and
At most $\max(\tcode{last - first - 1}, 0)$ comparisons and
twice as many projections.
\end{itemdescr}

Expand Down Expand Up @@ -9303,7 +9303,7 @@

\pnum
\complexity
Exactly $\max(\tcode{last - first - 1}, 0)$ comparisons and
At most $\max(\tcode{last - first - 1}, 0)$ comparisons and
twice as many projections.
\end{itemdescr}

Expand Down Expand Up @@ -10334,7 +10334,7 @@

\pnum
\complexity
Exactly \tcode{(last - first) - 1} applications of the binary operation.
At most \tcode{(last - first) - 1} applications of the binary operation.

\pnum
\remarks
Expand Down Expand Up @@ -10846,7 +10846,7 @@

\pnum
\complexity
Exactly \tcode{(last - first) - 1} applications of the binary operation.
At most \tcode{(last - first) - 1} applications of the binary operation.

\pnum
\remarks
Expand Down Expand Up @@ -10881,7 +10881,7 @@

\pnum
\complexity
Exactly \tcode{last - first} increments and assignments.
At most \tcode{last - first} increments and assignments.
\end{itemdescr}

\indexlibraryglobal{iota}%
Expand Down
Loading
Loading