Skip to content

Commit

Permalink
[algorithms] Use math \min when computing complexities. (#2531)
Browse files Browse the repository at this point in the history
\tcode{min} is only appropriate when referring to the C++ function std::min.
  • Loading branch information
jensmaurer authored and tkoeppe committed Dec 1, 2018
1 parent 89f5b1d commit a643e43
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions source/algorithms.tex
Original file line number Diff line number Diff line change
Expand Up @@ -3390,7 +3390,7 @@
\pnum
\complexity
For the overloads with no \tcode{ExecutionPolicy}, exactly
\tcode{min((i - first) + 1, (last - first) - 1)}
\[ \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 @@ -3552,12 +3552,12 @@
\returns
\tcode{\{ first1 + n, first2 + n \}}, where \tcode{n} is the smallest integer
such that $E$ holds,
or \tcode{min(last1 - first1, last2 - first2)} if no such integer exists.
or $\min(\tcode{last1 - first1}, \ \tcode{last2 - first2})$ if no such integer exists.

\pnum
\complexity
At most
\tcode{min(last1 - first1, last2 - first2)}
$\min(\tcode{last1 - first1}, \ \tcode{last2 - first2})$
applications of the corresponding predicate and any projections.
\end{itemdescr}

Expand Down Expand Up @@ -3666,12 +3666,12 @@
\item
For the overloads with no \tcode{ExecutionPolicy},
at most
$\min(\tcode{last1 - first1}, \tcode{last2 - first2})$
$\min(\tcode{last1 - first1}, \ \tcode{last2 - first2})$
applications of the corresponding predicate and any projections.

\item
For the overloads with an \tcode{ExecutionPolicy},
\bigoh{\min(\tcode{last1 - first1}, \tcode{last2 - first2})} applications
\bigoh{\min(\tcode{last1 - first1}, \ \tcode{last2 - first2})} applications
of the corresponding predicate.
\end{itemize}
\end{itemdescr}
Expand Down Expand Up @@ -4399,7 +4399,7 @@
\begin{itemize}
\item \tcode{last2} be \tcode{first2 + (last1 - first1)} for the overloads with
no parameter named \tcode{last2}, and
\item $M$ be $\min(\tcode{last1 - first1}, \tcode{last2 - first2})$.
\item $M$ be $\min(\tcode{last1 - first1}, \ \tcode{last2 - first2})$.
\end{itemize}

\pnum
Expand Down Expand Up @@ -4520,7 +4520,7 @@
\item \tcode{last2} be \tcode{first2 + (last1 - first1)} for the overloads with
parameter \tcode{first2} but no parameter \tcode{last2},
\item $N$ be \tcode{last1 - first1} for unary transforms, or
$\min(\tcode{last1 - first1}, \tcode{last2 - first2})$ for binary transforms, and
$\min(\tcode{last1 - first1}, \ \tcode{last2 - first2})$ for binary transforms, and
\item $E$ be
\begin{itemize}
\item \tcode{op(*(first1 + (i - result)))} for unary transforms defined in
Expand Down Expand Up @@ -5561,7 +5561,7 @@

\pnum
\effects
Copies \tcode{min(last - first, n)} elements (the \defn{sample})
Copies $\min(\tcode{last - first}, \ \tcode{n})$ elements (the \defn{sample})
from \range{first}{last} (the \defn{population}) to \tcode{out}
such that each possible sample has equal probability of appearance.
\begin{note}
Expand Down Expand Up @@ -6137,7 +6137,7 @@

\begin{itemdescr}
\pnum
Let $N$ be \tcode{min(last - first, result_last - result_first)}.
Let $N$ be $\min(\tcode{last - first}, \ \tcode{result_last - result_first})$.
Let \tcode{comp} be \tcode{less\{\}}, and
\tcode{proj1} and \tcode{proj2} be \tcode{identity\{\}}
for the overloads with no parameters by those names.
Expand Down

0 comments on commit a643e43

Please sign in to comment.