<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Wording for CH 10: Complexity of parallel algorithms</title>
<style type="text/css">
ins { background-color: #DFD; }
del { background-color: #FDD; }
</style>
</head>
<body>
<table>
  <tr>
    <td align="left">Project:</td>
    <td align="left">Programming Language C++</td>
  </tr>
  <tr>
    <td align="left">Document Number:</td>
    <td align="left">WG21/P0523r0</td>
  </tr>
  <tr>
    <td align="left">Date:</td>
    <td align="left">2016-11-11</td>
  </tr>
  <tr>
    <td align="left">Author:</td>
    <td align="left">Detlef Vollmann, <a href="mailto:dv@vollmann.ch">dv@vollmann.ch</a></td>
  </tr>
  <tr>
    <td align="left">Target audience:</td>
    <td align="left">SG1, LWG</td>
  </tr>
</table>

<h1>P0523r0: Wording for CH 10: Complexity of parallel algorithms</h1>

<h2>Proposed wording</h2>
<p>
In 25.2.5 [algorithms.parallel.overloads] add another paragraph after p2:<br/>
<blockquote>
<ins>Unless otherwise specified, the complexity requirements
of <tt>ExecutionPolicy</tt> algorithm overloads are relaxed from the
complexity requirements of the overloads without as follows:<br/>
<ins>When the guarantee
says "At most <i>expr</i>" or "Exactly <i>expr</i>" and doesn't
specify the number of assignments or swaps, and <i>expr</i> isn't
already an O-Notation,
the complexity of the algorithm shall be "O(<i>expr</i>)".</ins>
</blockquote>
</p>

<p>
In 25.4.4p4 [alg.transform], change:
<blockquote>
<i>Complexity</i>:
Exactly <tt>last1 - first1</tt> applications of <tt>op</tt> or <tt>binary_op</tt>.
<ins>This requirement also applies to the overload with an
<tt>ExecutionPolicy</tt>.</ins>
</blockquote>
</p>

<p>
In 25.5.4p8 [alg.merge], change:
<blockquote>
<i>Complexity</i>:
When enough additional memory is available,
<tt>(last - first) - 1</tt> comparisons.
<ins>For the overloads with an <tt>ExecutionPolicy</tt> the complexity
is <tt>O(last - first)</tt></ins>.
If no additional memory is available, an algorithm with complexity
<tt>N log(N)</tt> may be used, where <tt>N = last - first</tt>.

</blockquote>
</p>

<h2>Acknowledgments</h2>
Thanks to Pete Becker for help with the wording.
</body>
</html>
