123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826 |
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
- <title>Erasure</title>
- <link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
- <meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
- <link rel="home" href="../../index.html" title="Chapter 1. Boost.Icl">
- <link rel="up" href="../function_reference.html" title="Function Reference">
- <link rel="prev" href="insertion.html" title="Insertion">
- <link rel="next" href="intersection.html" title="Intersection">
- </head>
- <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
- <table cellpadding="2" width="100%"><tr>
- <td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
- <td align="center"><a href="../../../../../../index.html">Home</a></td>
- <td align="center"><a href="../../../../../libraries.htm">Libraries</a></td>
- <td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
- <td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
- <td align="center"><a href="../../../../../../more/index.htm">More</a></td>
- </tr></table>
- <hr>
- <div class="spirit-nav">
- <a accesskey="p" href="insertion.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../function_reference.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="intersection.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
- </div>
- <div class="section">
- <div class="titlepage"><div><div><h3 class="title">
- <a name="boost_icl.function_reference.erasure"></a><a class="link" href="erasure.html" title="Erasure">Erasure</a>
- </h3></div></div></div>
- <div class="toc"><dl class="toc">
- <dt><span class="section"><a href="erasure.html#boost_icl.function_reference.erasure.synopsis">Synopsis</a></span></dt>
- <dt><span class="section"><a href="erasure.html#boost_icl.function_reference.erasure.erasure_of_objects">Erasure
- of Objects</a></span></dt>
- <dt><span class="section"><a href="erasure.html#boost_icl.function_reference.erasure.erasure_by_iterators">Erasure
- by Iterators</a></span></dt>
- </dl></div>
- <div class="section">
- <div class="titlepage"><div><div><h4 class="title">
- <a name="boost_icl.function_reference.erasure.synopsis"></a><a class="link" href="erasure.html#boost_icl.function_reference.erasure.synopsis" title="Synopsis">Synopsis</a>
- </h4></div></div></div>
- <div class="informaltable"><table class="table">
- <colgroup>
- <col>
- <col>
- <col>
- <col>
- <col>
- </colgroup>
- <thead><tr>
- <th>
- <p>
- <span class="emphasis"><em><span class="bold"><strong>Erasure</strong></span></em></span>
- </p>
- </th>
- <th>
- <p>
- interval<br> sets
- </p>
- </th>
- <th>
- <p>
- interval<br> maps
- </p>
- </th>
- <th>
- <p>
- element<br> sets
- </p>
- </th>
- <th>
- <p>
- element<br> maps
- </p>
- </th>
- </tr></thead>
- <tbody>
- <tr>
- <td>
- <p>
- <code class="computeroutput"><span class="identifier">T</span><span class="special">&</span>
- <span class="identifier">T</span><span class="special">::</span><span class="identifier">erase</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">P</span><span class="special">&)</span></code>
- </p>
- </td>
- <td>
- <p>
- <a class="link" href="../interface/function_synopsis.html#element_type"><span class="bold"><strong>e</strong></span></a>
- <a class="link" href="../interface/function_synopsis.html#interval_type"><span class="bold"><strong>i</strong></span></a>
- </p>
- </td>
- <td>
- <p>
- <a class="link" href="../interface/function_synopsis.html#element_type"><span class="bold"><strong>e</strong></span></a>
- <a class="link" href="../interface/function_synopsis.html#interval_type"><span class="bold"><strong>i</strong></span></a>
- <a class="link" href="../interface/function_synopsis.html#element_mapping_type"><span class="bold"><strong>b</strong></span></a>
- <a class="link" href="../interface/function_synopsis.html#interval_mapping_type"><span class="bold"><strong>p</strong></span></a>
- </p>
- </td>
- <td>
- <p>
- <a class="link" href="../interface/function_synopsis.html#element_type"><span class="bold"><strong>e</strong></span></a>
- </p>
- </td>
- <td>
- <p>
- <a class="link" href="../interface/function_synopsis.html#element_mapping_type"><span class="bold"><strong>b</strong></span></a>
- <a class="link" href="../interface/function_synopsis.html#interval_mapping_type"><span class="bold"><strong>p</strong></span></a>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <p>
- <code class="computeroutput"><span class="identifier">T</span><span class="special">&</span>
- <span class="identifier">erase</span><span class="special">(</span><span class="identifier">T</span><span class="special">&,</span>
- <span class="keyword">const</span> <span class="identifier">P</span><span class="special">&)</span></code>
- </p>
- </td>
- <td>
- <p>
- <a class="link" href="../interface/function_synopsis.html#element_type"><span class="bold"><strong>e</strong></span></a>
- <a class="link" href="../interface/function_synopsis.html#interval_type"><span class="bold"><strong>i</strong></span></a>
- <a class="link" href="../interface/function_synopsis.html#interval_set_types"><span class="bold"><strong>S</strong></span></a>
- </p>
- </td>
- <td>
- <p>
- <a class="link" href="../interface/function_synopsis.html#element_type"><span class="bold"><strong>e</strong></span></a>
- <a class="link" href="../interface/function_synopsis.html#interval_type"><span class="bold"><strong>i</strong></span></a>
- <a class="link" href="../interface/function_synopsis.html#interval_set_types"><span class="bold"><strong>S</strong></span></a>
- <a class="link" href="../interface/function_synopsis.html#element_mapping_type"><span class="bold"><strong>b</strong></span></a>
- <a class="link" href="../interface/function_synopsis.html#interval_mapping_type"><span class="bold"><strong>p</strong></span></a>
- <a class="link" href="../interface/function_synopsis.html#interval_map_types"><span class="bold"><strong>M</strong></span></a>
- </p>
- </td>
- <td>
- <p>
- <a class="link" href="../interface/function_synopsis.html#element_type"><span class="bold"><strong>e</strong></span></a>
- <a class="link" href="../interface/function_synopsis.html#itl_set_type"><span class="bold"><strong>s</strong></span></a>
- </p>
- </td>
- <td>
- <p>
- <a class="link" href="../interface/function_synopsis.html#element_mapping_type"><span class="bold"><strong>b</strong></span></a>
- <a class="link" href="../interface/function_synopsis.html#itl_map_type"><span class="bold"><strong>m</strong></span></a>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <p>
- <code class="computeroutput"><span class="keyword">void</span> <span class="identifier">T</span><span class="special">::</span><span class="identifier">erase</span><span class="special">(</span><span class="identifier">iterator</span><span class="special">)</span></code>
- </p>
- </td>
- <td>
- <p>
- 1
- </p>
- </td>
- <td>
- <p>
- 1
- </p>
- </td>
- <td>
- <p>
- 1
- </p>
- </td>
- <td>
- <p>
- 1
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <p>
- <code class="computeroutput"><span class="keyword">void</span> <span class="identifier">T</span><span class="special">::</span><span class="identifier">erase</span><span class="special">(</span><span class="identifier">iterator</span><span class="special">,</span><span class="identifier">iterator</span><span class="special">)</span></code>
- </p>
- </td>
- <td>
- <p>
- 1
- </p>
- </td>
- <td>
- <p>
- 1
- </p>
- </td>
- <td>
- <p>
- 1
- </p>
- </td>
- <td>
- <p>
- 1
- </p>
- </td>
- </tr>
- </tbody>
- </table></div>
- <h6>
- <a name="boost_icl.function_reference.erasure.synopsis.h0"></a>
- <span class="phrase"><a name="boost_icl.function_reference.erasure.synopsis.erasure"></a></span><a class="link" href="erasure.html#boost_icl.function_reference.erasure.synopsis.erasure">Erasure</a>
- </h6>
- <p>
- The effects of <span class="emphasis"><em><span class="bold"><strong>erasure</strong></span></em></span>
- implemented by <code class="computeroutput"><span class="identifier">erase</span></code> and
- <span class="emphasis"><em><span class="bold"><strong>subtraction</strong></span></em></span> implemented
- by <code class="computeroutput"><span class="identifier">subtract</span></code> and <code class="computeroutput"><span class="keyword">operator</span> <span class="special">-=</span></code>
- are identical for all Set-types of the <span class="bold"><strong>icl</strong></span>.
- </p>
- <p>
- For Map-types, <code class="computeroutput"><span class="identifier">erase</span></code> provides
- the <span class="bold"><strong>stl</strong></span> semantics of erasure in contrast
- to <code class="computeroutput"><span class="identifier">subtract</span></code> and <code class="computeroutput"><span class="keyword">operator</span> <span class="special">-=</span></code>,
- that implement a generalized subtraction, that performs inverse aggregations
- if key values collide or key intervals overlap.
- </p>
- <p>
- Using iterators it is possible to erase objects or ranges of objects the
- iterator is pointing at from icl Sets and Maps.
- </p>
- </div>
- <div class="section">
- <div class="titlepage"><div><div><h4 class="title">
- <a name="boost_icl.function_reference.erasure.erasure_of_objects"></a><a class="link" href="erasure.html#boost_icl.function_reference.erasure.erasure_of_objects" title="Erasure of Objects">Erasure
- of Objects</a>
- </h4></div></div></div>
- <p>
- </p>
- <pre class="programlisting"><span class="comment">/* overload table for */</span> <span class="identifier">T</span><span class="special">\</span><span class="identifier">P</span><span class="special">|</span> <span class="identifier">e</span> <span class="identifier">i</span> <span class="identifier">b</span> <span class="identifier">p</span>
- <span class="identifier">T</span><span class="special">&</span> <span class="identifier">T</span><span class="special">::</span><span class="identifier">erase</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">P</span><span class="special">&)</span> <span class="special">---+--------</span>
- <span class="identifier">T</span><span class="special">&</span> <span class="identifier">erase</span><span class="special">(</span><span class="identifier">T</span><span class="special">&,</span> <span class="keyword">const</span> <span class="identifier">P</span><span class="special">&)</span> <span class="identifier">s</span> <span class="special">|</span> <span class="identifier">s</span>
- <span class="identifier">m</span> <span class="special">|</span> <span class="identifier">m</span>
- <span class="identifier">S</span> <span class="special">|</span> <span class="identifier">S</span> <span class="identifier">S</span>
- <span class="identifier">M</span> <span class="special">|</span> <span class="identifier">M</span> <span class="identifier">M</span>
- </pre>
- <p>
- </p>
- <p>
- The next table contains complexity characteristics for the <code class="computeroutput"><span class="identifier">erase</span></code> function on elements and segments.
- </p>
- <div class="table">
- <a name="boost_icl.function_reference.erasure.erasure_of_objects.t0"></a><p class="title"><b>Table 1.31. Time Complexity for erasure of elements and segments on icl containers</b></p>
- <div class="table-contents"><table class="table" summary="Time Complexity for erasure of elements and segments on icl containers">
- <colgroup>
- <col>
- <col>
- <col>
- <col>
- <col>
- </colgroup>
- <thead><tr>
- <th>
- <p>
- <code class="computeroutput"><span class="identifier">T</span><span class="special">&</span>
- <span class="identifier">T</span><span class="special">::</span><span class="identifier">erase</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">P</span><span class="special">&)</span></code><br> <code class="computeroutput"><span class="identifier">T</span><span class="special">&</span> <span class="identifier">erase</span><span class="special">(</span><span class="identifier">T</span><span class="special">&,</span> <span class="keyword">const</span>
- <span class="identifier">P</span><span class="special">&)</span></code>
- </p>
- </th>
- <th>
- <p>
- domain<br> type
- </p>
- </th>
- <th>
- <p>
- interval<br> type
- </p>
- </th>
- <th>
- <p>
- domain<br> mapping<br> type
- </p>
- </th>
- <th>
- <p>
- interval<br> mapping<br> type
- </p>
- </th>
- </tr></thead>
- <tbody>
- <tr>
- <td>
- <p>
- <a href="http://www.cplusplus.com/reference/stl/set/" target="_top"><code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">set</span></code> </a>
- </p>
- </td>
- <td>
- <p>
- <span class="emphasis"><em>O(log n)</em></span>
- </p>
- </td>
- <td>
- </td>
- <td>
- </td>
- <td>
- </td>
- </tr>
- <tr>
- <td>
- <p>
- <code class="computeroutput"><a class="link" href="../../boost/icl/map.html" title="Class template map">icl::map</a></code>
- </p>
- </td>
- <td>
- <p>
- <span class="emphasis"><em>O(log n)</em></span>
- </p>
- </td>
- <td>
- </td>
- <td>
- <p>
- <span class="emphasis"><em>O(log n)</em></span>
- </p>
- </td>
- <td>
- </td>
- </tr>
- <tr>
- <td>
- <p>
- <code class="computeroutput"><a class="link" href="../../boost/icl/interval_set.html" title="Class template interval_set">interval_sets</a></code>
- </p>
- </td>
- <td>
- <p>
- <span class="emphasis"><em>O(log n)</em></span>
- </p>
- </td>
- <td>
- <p>
- <span class="emphasis"><em>amortized<br> O(log n)</em></span>
- </p>
- </td>
- <td>
- </td>
- <td>
- </td>
- </tr>
- <tr>
- <td>
- <p>
- <code class="computeroutput"><a class="link" href="../../boost/icl/interval_map.html" title="Class template interval_map">interval_maps</a></code>
- </p>
- </td>
- <td>
- <p>
- <span class="emphasis"><em>O(log n)</em></span>
- </p>
- </td>
- <td>
- <p>
- <span class="emphasis"><em>O(n)</em></span>
- </p>
- </td>
- <td>
- <p>
- <span class="emphasis"><em>O(log n)</em></span>
- </p>
- </td>
- <td>
- <p>
- <span class="emphasis"><em>O(n)</em></span>
- </p>
- </td>
- </tr>
- </tbody>
- </table></div>
- </div>
- <br class="table-break"><p>
- As presented in the overload tables for inplace function <code class="computeroutput"><span class="identifier">erase</span></code> below, more type combinations are
- available for <span class="emphasis"><em>erasure</em></span> than for <span class="emphasis"><em>insertion</em></span>.
- </p>
- <p>
- </p>
- <pre class="programlisting"><span class="comment">// overload tables for function element containers: interval containers: </span>
- <span class="identifier">T</span><span class="special">&</span> <span class="identifier">erase</span><span class="special">(</span><span class="identifier">T</span><span class="special">&,</span> <span class="keyword">const</span> <span class="identifier">P</span><span class="special">&)</span> <span class="identifier">T</span><span class="special">\</span><span class="identifier">P</span><span class="special">|</span> <span class="identifier">e</span> <span class="identifier">b</span> <span class="identifier">s</span> <span class="identifier">m</span> <span class="identifier">T</span><span class="special">\</span><span class="identifier">P</span><span class="special">|</span> <span class="identifier">e</span> <span class="identifier">i</span> <span class="identifier">b</span> <span class="identifier">p</span> <span class="identifier">S</span> <span class="identifier">M</span>
- <span class="special">---+--------</span> <span class="special">---+------------</span>
- <span class="identifier">s</span> <span class="special">|</span> <span class="identifier">s</span> <span class="identifier">s</span> <span class="identifier">S</span> <span class="special">|</span> <span class="identifier">S</span> <span class="identifier">S</span> <span class="identifier">S</span>
- <span class="identifier">m</span> <span class="special">|</span> <span class="identifier">m</span> <span class="identifier">m</span> <span class="identifier">m</span> <span class="identifier">m</span> <span class="identifier">M</span> <span class="special">|</span> <span class="identifier">M</span> <span class="identifier">M</span> <span class="identifier">M</span> <span class="identifier">M</span> <span class="identifier">M</span> <span class="identifier">M</span>
- </pre>
- <p>
- We can split up these overloads in two groups. The first group can be called
- <span class="emphasis"><em>reverse insertion</em></span>.
- </p>
- <pre class="programlisting"><span class="comment">/* (1) Reverse insertion */</span> <span class="identifier">T</span><span class="special">\</span><span class="identifier">P</span><span class="special">|</span> <span class="identifier">e</span> <span class="identifier">b</span> <span class="identifier">s</span> <span class="identifier">m</span> <span class="identifier">T</span><span class="special">\</span><span class="identifier">P</span><span class="special">|</span> <span class="identifier">e</span> <span class="identifier">i</span> <span class="identifier">b</span> <span class="identifier">p</span> <span class="identifier">S</span> <span class="identifier">M</span>
- <span class="special">---+--------</span> <span class="special">---+------------</span>
- <span class="identifier">s</span> <span class="special">|</span> <span class="identifier">s</span> <span class="identifier">s</span> <span class="identifier">S</span> <span class="special">|</span> <span class="identifier">S</span> <span class="identifier">S</span> <span class="identifier">S</span>
- <span class="identifier">m</span> <span class="special">|</span> <span class="identifier">m</span> <span class="identifier">m</span> <span class="identifier">M</span> <span class="special">|</span> <span class="identifier">M</span> <span class="identifier">M</span> <span class="identifier">M</span>
- </pre>
- <p>
- The second group can be viewed as an <span class="emphasis"><em>erasure by key objects</em></span>
- </p>
- <pre class="programlisting"><span class="comment">/* (2) Erasure by key objects */</span> <span class="identifier">T</span><span class="special">\</span><span class="identifier">P</span><span class="special">|</span> <span class="identifier">e</span> <span class="identifier">b</span> <span class="identifier">s</span> <span class="identifier">m</span> <span class="identifier">T</span><span class="special">\</span><span class="identifier">P</span><span class="special">|</span> <span class="identifier">e</span> <span class="identifier">i</span> <span class="identifier">b</span> <span class="identifier">p</span> <span class="identifier">S</span> <span class="identifier">M</span>
- <span class="special">---+--------</span> <span class="special">---+------------</span>
- <span class="identifier">s</span> <span class="special">|</span> <span class="identifier">s</span> <span class="identifier">s</span> <span class="identifier">S</span> <span class="special">|</span> <span class="identifier">S</span> <span class="identifier">S</span> <span class="identifier">S</span>
- <span class="identifier">m</span> <span class="special">|</span> <span class="identifier">m</span> <span class="identifier">m</span> <span class="identifier">M</span> <span class="special">|</span> <span class="identifier">M</span> <span class="identifier">M</span> <span class="identifier">M</span>
- </pre>
- <p>
- </p>
- <p>
- On Maps <span class="emphasis"><em><span class="bold"><strong>reverse insertion (1)</strong></span></em></span>
- is different from <span class="bold"><strong>stl's</strong></span> erase semantics,
- because value pairs are deleted only, if key <span class="emphasis"><em><span class="bold"><strong>and</strong></span></em></span>
- data values are found. Only <span class="emphasis"><em><span class="bold"><strong>erasure by
- key objects (2)</strong></span></em></span> works like the erase function on
- <span class="bold"><strong>stl's</strong></span> std::maps, that passes a <span class="emphasis"><em><span class="bold"><strong>key value</strong></span></em></span> as argument.
- </p>
- <p>
- On Sets both function groups fall together as <span class="emphasis"><em><span class="bold"><strong>set
- difference</strong></span></em></span>.
- </p>
- <p>
- Complexity characteristics for inplace erasure operations are given by
- the next tables where
- </p>
- <pre class="programlisting"><span class="identifier">n</span> <span class="special">=</span> <span class="identifier">iterative_size</span><span class="special">(</span><span class="identifier">y</span><span class="special">);</span>
- <span class="identifier">m</span> <span class="special">=</span> <span class="identifier">iterative_size</span><span class="special">(</span><span class="identifier">x</span><span class="special">);</span> <span class="comment">//if P is a container type</span>
- </pre>
- <p>
- </p>
- <div class="table">
- <a name="boost_icl.function_reference.erasure.erasure_of_objects.t1"></a><p class="title"><b>Table 1.32. Time Complexity for inplace erasure on element containers</b></p>
- <div class="table-contents"><table class="table" summary="Time Complexity for inplace erasure on element containers">
- <colgroup>
- <col>
- <col>
- <col>
- <col>
- <col>
- </colgroup>
- <thead><tr>
- <th>
- <p>
- <code class="computeroutput"><span class="identifier">T</span><span class="special">&</span>
- <span class="identifier">erase</span><span class="special">(</span><span class="identifier">T</span><span class="special">&</span>
- <span class="identifier">y</span><span class="special">,</span>
- <span class="keyword">const</span> <span class="identifier">P</span><span class="special">&</span> <span class="identifier">x</span><span class="special">)</span></code>
- </p>
- </th>
- <th>
- <p>
- domain<br> type
- </p>
- </th>
- <th>
- <p>
- domain<br> mapping<br> type
- </p>
- </th>
- <th>
- <p>
- std::set
- </p>
- </th>
- <th>
- <p>
- icl::map
- </p>
- </th>
- </tr></thead>
- <tbody>
- <tr>
- <td>
- <p>
- <a href="http://www.cplusplus.com/reference/stl/set/" target="_top"><code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">set</span></code> </a>
- </p>
- </td>
- <td>
- <p>
- <span class="emphasis"><em>O(log n)</em></span>
- </p>
- </td>
- <td>
- </td>
- <td>
- <p>
- <span class="emphasis"><em>O(m log n)</em></span>
- </p>
- </td>
- <td>
- </td>
- </tr>
- <tr>
- <td>
- <p>
- <code class="computeroutput"><a class="link" href="../../boost/icl/map.html" title="Class template map">icl::map</a></code>
- </p>
- </td>
- <td>
- <p>
- <span class="emphasis"><em>O(log n)</em></span>
- </p>
- </td>
- <td>
- <p>
- <span class="emphasis"><em>O(log n)</em></span>
- </p>
- </td>
- <td>
- <p>
- <span class="emphasis"><em>O(m log n)</em></span>
- </p>
- </td>
- <td>
- <p>
- <span class="emphasis"><em>O(m log n)</em></span>
- </p>
- </td>
- </tr>
- </tbody>
- </table></div>
- </div>
- <br class="table-break"><div class="table">
- <a name="boost_icl.function_reference.erasure.erasure_of_objects.t2"></a><p class="title"><b>Table 1.33. Time Complexity for inplace erasure on interval containers</b></p>
- <div class="table-contents"><table class="table" summary="Time Complexity for inplace erasure on interval containers">
- <colgroup>
- <col>
- <col>
- <col>
- <col>
- <col>
- <col>
- <col>
- </colgroup>
- <thead><tr>
- <th>
- <p>
- <code class="computeroutput"><span class="identifier">T</span><span class="special">&</span>
- <span class="identifier">erase</span><span class="special">(</span><span class="identifier">T</span><span class="special">&</span>
- <span class="identifier">y</span><span class="special">,</span>
- <span class="keyword">const</span> <span class="identifier">P</span><span class="special">&</span> <span class="identifier">x</span><span class="special">)</span></code>
- </p>
- </th>
- <th>
- <p>
- domain<br> type
- </p>
- </th>
- <th>
- <p>
- interval<br> type
- </p>
- </th>
- <th>
- <p>
- domain<br> mapping<br> type
- </p>
- </th>
- <th>
- <p>
- interval<br> mapping<br> type
- </p>
- </th>
- <th>
- <p>
- interval<br> sets
- </p>
- </th>
- <th>
- <p>
- interval<br> maps
- </p>
- </th>
- </tr></thead>
- <tbody>
- <tr>
- <td>
- <p>
- interval_sets
- </p>
- </td>
- <td>
- <p>
- <span class="emphasis"><em>O(log n)</em></span>
- </p>
- </td>
- <td>
- <p>
- <span class="emphasis"><em>amortized<br> O(log n)</em></span>
- </p>
- </td>
- <td>
- </td>
- <td>
- </td>
- <td>
- <p>
- <span class="emphasis"><em>O(m log(n+m))</em></span>
- </p>
- </td>
- <td>
- </td>
- </tr>
- <tr>
- <td>
- <p>
- interval_maps
- </p>
- </td>
- <td>
- <p>
- <span class="emphasis"><em>O(log n)</em></span>
- </p>
- </td>
- <td>
- <p>
- <span class="emphasis"><em>amortized<br> O(log n)</em></span>
- </p>
- </td>
- <td>
- <p>
- <span class="emphasis"><em>O(log n)</em></span>
- </p>
- </td>
- <td>
- <p>
- <span class="emphasis"><em>O(n)</em></span>
- </p>
- </td>
- <td>
- <p>
- <span class="emphasis"><em>O(m log(n+m))</em></span>
- </p>
- </td>
- <td>
- <p>
- <span class="emphasis"><em>O(m log(n+m))</em></span>
- </p>
- </td>
- </tr>
- </tbody>
- </table></div>
- </div>
- <br class="table-break">
- </div>
- <div class="section">
- <div class="titlepage"><div><div><h4 class="title">
- <a name="boost_icl.function_reference.erasure.erasure_by_iterators"></a><a class="link" href="erasure.html#boost_icl.function_reference.erasure.erasure_by_iterators" title="Erasure by Iterators">Erasure
- by Iterators</a>
- </h4></div></div></div>
- <p>
- The next table shows the <span class="bold"><strong>icl</strong></span> containers
- that erasure with iterators is available for. Erase on iterators erases
- always one <code class="computeroutput"><span class="identifier">value</span></code> of <code class="computeroutput"><span class="identifier">value_type</span></code> for an iterator pointing to
- it. So we erase
- </p>
- <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
- <li class="listitem">
- elements from <a href="http://www.cplusplus.com/reference/stl/set/" target="_top"><code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">sets</span></code></a>
- </li>
- <li class="listitem">
- element-value pairs from <code class="computeroutput"><a class="link" href="../../boost/icl/map.html" title="Class template map">icl::maps</a></code>
- </li>
- <li class="listitem">
- intervals from <code class="computeroutput"><a class="link" href="../../boost/icl/interval_set.html" title="Class template interval_set">interval_sets</a></code>
- and
- </li>
- <li class="listitem">
- interval-value-pairs from <code class="computeroutput"><a class="link" href="../../boost/icl/interval_map.html" title="Class template interval_map">interval_maps</a></code>
- </li>
- </ul></div>
- <div class="informaltable"><table class="table">
- <colgroup>
- <col>
- <col>
- <col>
- <col>
- <col>
- </colgroup>
- <thead><tr>
- <th>
- <p>
- <span class="emphasis"><em><span class="bold"><strong>Erasure by iterators</strong></span></em></span>
- </p>
- </th>
- <th>
- <p>
- interval<br> sets
- </p>
- </th>
- <th>
- <p>
- interval<br> maps
- </p>
- </th>
- <th>
- <p>
- element<br> sets
- </p>
- </th>
- <th>
- <p>
- element<br> maps
- </p>
- </th>
- </tr></thead>
- <tbody>
- <tr>
- <td>
- <p>
- <code class="computeroutput"><span class="keyword">void</span> <span class="identifier">T</span><span class="special">::</span><span class="identifier">erase</span><span class="special">(</span><span class="identifier">iterator</span>
- <span class="identifier">pos</span><span class="special">)</span></code>
- </p>
- </td>
- <td>
- <p>
- <span class="emphasis"><em>amortized O(1)</em></span>
- </p>
- </td>
- <td>
- <p>
- <span class="emphasis"><em>amortized O(1)</em></span>
- </p>
- </td>
- <td>
- <p>
- <span class="emphasis"><em>amortized O(1)</em></span>
- </p>
- </td>
- <td>
- <p>
- <span class="emphasis"><em>amortized O(1)</em></span>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <p>
- <code class="computeroutput"><span class="keyword">void</span> <span class="identifier">T</span><span class="special">::</span><span class="identifier">erase</span><span class="special">(</span><span class="identifier">iterator</span>
- <span class="identifier">first</span><span class="special">,</span>
- <span class="identifier">iterator</span> <span class="identifier">past</span><span class="special">)</span></code>
- </p>
- </td>
- <td>
- <p>
- <span class="emphasis"><em>O(k)</em></span>
- </p>
- </td>
- <td>
- <p>
- <span class="emphasis"><em>O(k)</em></span>
- </p>
- </td>
- <td>
- <p>
- <span class="emphasis"><em>O(k)</em></span>
- </p>
- </td>
- <td>
- <p>
- <span class="emphasis"><em>O(k)</em></span>
- </p>
- </td>
- </tr>
- </tbody>
- </table></div>
- <p>
- Erasing by a single iterator need only <span class="emphasis"><em><span class="bold"><strong>amortized
- constant time</strong></span></em></span>. Erasing via a range of iterators
- <code class="computeroutput"><span class="special">[</span><span class="identifier">first</span><span class="special">,</span> <span class="identifier">past</span><span class="special">)</span></code> is of <span class="emphasis"><em><span class="bold"><strong>linear
- time</strong></span></em></span> in the number <code class="computeroutput"><span class="identifier">k</span></code>
- of iterators in range <code class="computeroutput"><span class="special">[</span><span class="identifier">first</span><span class="special">,</span> <span class="identifier">past</span><span class="special">)</span></code>.
- </p>
- </div>
- <p>
- <span class="emphasis"><em><span class="bold"><strong>See also . . .</strong></span></em></span>
- </p>
- <div class="informaltable"><table class="table">
- <colgroup><col></colgroup>
- <thead><tr></tr></thead>
- <tbody>
- <tr><td>
- <p>
- <a class="link" href="insertion.html" title="Insertion"><span class="emphasis"><em><span class="bold"><strong>Insertion</strong></span></em></span></a>
- </p>
- </td></tr>
- <tr><td>
- <p>
- <a class="link" href="subtraction.html" title="Subtraction"><span class="emphasis"><em><span class="bold"><strong>Subtraction</strong></span></em></span></a>
- </p>
- </td></tr>
- </tbody>
- </table></div>
- <p>
- <span class="emphasis"><em><span class="bold"><strong>Back to section . . .</strong></span></em></span>
- </p>
- <div class="informaltable"><table class="table">
- <colgroup><col></colgroup>
- <thead><tr></tr></thead>
- <tbody>
- <tr><td>
- <p>
- <a class="link" href="../interface/function_synopsis.html#function_synopsis_table"><span class="emphasis"><em><span class="bold"><strong>Function
- Synopsis</strong></span></em></span></a>
- </p>
- </td></tr>
- <tr><td>
- <p>
- <a class="link" href="../interface.html" title="Interface"><span class="emphasis"><em><span class="bold"><strong>Interface</strong></span></em></span></a>
- </p>
- </td></tr>
- </tbody>
- </table></div>
- </div>
- <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
- <td align="left"></td>
- <td align="right"><div class="copyright-footer">Copyright © 2007-2010 Joachim
- Faulhaber<br>Copyright © 1999-2006 Cortex Software
- GmbH<p>
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
- </p>
- </div></td>
- </tr></table>
- <hr>
- <div class="spirit-nav">
- <a accesskey="p" href="insertion.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../function_reference.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="intersection.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
- </div>
- </body>
- </html>
|