icl/doc/html/boost_icl/function_reference/containedness.html

730 lines
34 KiB
HTML

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Containedness</title>
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.74.0">
<link rel="home" href="../../index.html" title="Chapter&#160;1.&#160;Boost.Icl">
<link rel="up" href="../function_reference.html" title="Function Reference">
<link rel="prev" href="construct__copy__destruct.html" title="Construct, copy, destruct">
<link rel="next" href="equivalences_and_orderings.html" title="Equivalences and Orderings">
</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="construct__copy__destruct.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="equivalences_and_orderings.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="section boost_icl_function_reference_containedness" lang="en">
<div class="titlepage"><div><div><h3 class="title">
<a name="boost_icl.function_reference.containedness"></a><a class="link" href="containedness.html" title="Containedness">Containedness</a>
</h3></div></div></div>
<div class="informaltable"><table class="table">
<colgroup>
<col>
<col>
<col>
<col>
<col>
<col>
</colgroup>
<thead><tr>
<th>
<p>
<span class="emphasis"><em><span class="bold"><strong>Containedness</strong></span></em></span>
</p>
</th>
<th>
<p>
intervals
</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">bool</span> <span class="identifier">T</span><span class="special">::</span><span class="identifier">empty</span><span class="special">()</span><span class="keyword">const</span></code>
</p>
</td>
<td>
<p>
</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">bool</span> <span class="identifier">is_empty</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;)</span></code>
</p>
</td>
<td>
<p>
1
</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">bool</span> <span class="identifier">contains</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;,</span>
<span class="keyword">const</span> <span class="identifier">P</span><span class="special">&amp;)</span></code><br> <code class="computeroutput"><span class="keyword">bool</span>
<span class="identifier">within</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">P</span><span class="special">&amp;,</span> <span class="keyword">const</span>
<span class="identifier">T</span><span class="special">&amp;)</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#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>
</tbody>
</table></div>
<p>
This group of functions refers to <span class="emphasis"><em><span class="bold"><strong>contain</strong></span></em></span>edness
which should be fundamental to <span class="emphasis"><em><span class="bold"><strong>contain</strong></span></em></span>ers.
The function <code class="computeroutput"><span class="identifier">contains</span></code> is
overloaded. It covers different kinds of containedness: Containedness of
elements, segments, and sub containers.
</p>
<div class="informaltable"><table class="table">
<colgroup>
<col>
<col>
<col>
</colgroup>
<thead><tr>
<th>
<p>
<span class="emphasis"><em><span class="bold"><strong>Containedness</strong></span></em></span>
</p>
</th>
<th>
<p>
<span class="emphasis"><em>O(...)</em></span>
</p>
</th>
<th>
<p>
Description
</p>
</th>
</tr></thead>
<tbody>
<tr>
<td>
<p>
<code class="computeroutput"><span class="keyword">bool</span> <span class="identifier">T</span><span class="special">::</span><span class="identifier">empty</span><span class="special">()</span><span class="keyword">const</span></code><br>
<code class="computeroutput"><span class="keyword">bool</span> <span class="identifier">is_empty</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;)</span></code>
</p>
</td>
<td>
<p>
<span class="emphasis"><em>O(1)</em></span>
</p>
</td>
<td>
<p>
Returns <code class="computeroutput"><span class="keyword">true</span></code>, if the
container is empty, <code class="computeroutput"><span class="keyword">false</span></code>
otherwise.
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="keyword">bool</span> <span class="identifier">contains</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;,</span>
<span class="keyword">const</span> <span class="identifier">P</span><span class="special">&amp;)</span></code><br> <code class="computeroutput"><span class="keyword">bool</span>
<span class="identifier">within</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">P</span><span class="special">&amp;,</span> <span class="keyword">const</span>
<span class="identifier">T</span><span class="special">&amp;)</span></code>
</p>
</td>
<td>
<p>
<a class="link" href="containedness.html#complexities_contains"><span class="emphasis"><em>see below</em></span></a>
</p>
</td>
<td>
<p>
Returns <code class="computeroutput"><span class="keyword">true</span></code>, if <code class="computeroutput"><span class="identifier">super</span></code> container contains object
<code class="computeroutput"><span class="identifier">sub</span></code>.
</p>
</td>
</tr>
<tr>
<td>
<p>
</p>
</td>
<td>
<p>
where
</p>
</td>
<td>
<p>
<span class="emphasis"><em>n</em></span><code class="computeroutput"> <span class="special">=</span> <span class="identifier">iterative_size</span><span class="special">(</span><span class="identifier">sub</span><span class="special">)</span></code>
</p>
</td>
</tr>
<tr>
<td>
<p>
</p>
</td>
<td>
<p>
</p>
</td>
<td>
<p>
<span class="emphasis"><em>m</em></span><code class="computeroutput"> <span class="special">=</span> <span class="identifier">iterative_size</span><span class="special">(</span><span class="identifier">super</span><span class="special">)</span></code>
</p>
</td>
</tr>
</tbody>
</table></div>
<p>
</p>
<pre class="programlisting"><span class="comment">// overload tables for
</span><span class="keyword">bool</span> <span class="identifier">contains</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;</span> <span class="identifier">super</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">P</span><span class="special">&amp;</span> <span class="identifier">sub</span><span class="special">)</span>
<span class="keyword">bool</span> <span class="identifier">within</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">P</span><span class="special">&amp;</span> <span class="identifier">sub</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;</span> <span class="identifier">super</span><span class="special">)</span>
<span class="identifier">element</span> <span class="identifier">containers</span><span class="special">:</span> <span class="identifier">interval</span> <span class="identifier">containers</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="number">1</span> <span class="number">1</span> <span class="identifier">S</span> <span class="special">|</span> <span class="number">1</span> <span class="number">1</span> <span class="number">1</span>
<span class="identifier">m</span> <span class="special">|</span> <span class="number">1</span> <span class="number">1</span> <span class="number">1</span> <span class="number">1</span> <span class="identifier">M</span> <span class="special">|</span> <span class="number">1</span> <span class="number">1</span> <span class="number">1</span> <span class="number">1</span> <span class="number">1</span> <span class="number">1</span>
</pre>
<p>
</p>
<p>
The overloads of <code class="computeroutput"><span class="keyword">bool</span> <span class="identifier">contains</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;</span> <span class="identifier">super</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">P</span><span class="special">&amp;</span> <span class="identifier">sup</span><span class="special">)</span></code> cover various kinds of containedness. We
can group them into a part (1) that checks if an element, a segment or a
container <span class="emphasis"><em>of same kinds</em></span> is contained in an element or
interval container
</p>
<p>
</p>
<pre class="programlisting"><span class="comment">// (1) containedness of elements, segments or containers of same kind
</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="number">1</span> <span class="number">1</span> <span class="identifier">S</span> <span class="special">|</span> <span class="number">1</span> <span class="number">1</span> <span class="number">1</span>
<span class="identifier">m</span> <span class="special">|</span> <span class="number">1</span> <span class="number">1</span> <span class="identifier">M</span> <span class="special">|</span> <span class="number">1</span> <span class="number">1</span> <span class="number">1</span>
</pre>
<p>
</p>
<p>
and another part (2) that checks the containedness of <span class="emphasis"><em>key objects</em></span>,
which can be <span class="emphasis"><em>elements</em></span> an <span class="emphasis"><em>intervals</em></span>
or a <span class="emphasis"><em>sets</em></span>.
</p>
<p>
</p>
<pre class="programlisting"><span class="comment">// (2) containedness of 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="number">1</span> <span class="number">1</span> <span class="identifier">S</span> <span class="special">|</span> <span class="number">1</span> <span class="number">1</span> <span class="number">1</span>
<span class="identifier">m</span> <span class="special">|</span> <span class="number">1</span> <span class="number">1</span> <span class="identifier">M</span> <span class="special">|</span> <span class="number">1</span> <span class="number">1</span> <span class="number">1</span>
</pre>
<p>
</p>
<p>
For type <span class="bold"><strong>m</strong></span> = <code class="computeroutput"><a class="link" href="../../boost/icl/map.html" title="Class template map">icl::map</a></code>,
a key element (<span class="bold"><strong>m</strong></span><code class="computeroutput"><span class="special">::</span><span class="identifier">domain_type</span></code>) and an <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> (<span class="bold"><strong>m</strong></span><code class="computeroutput"><span class="special">::</span><span class="identifier">set_type</span></code>) can be a <span class="emphasis"><em><span class="bold"><strong>key object</strong></span></em></span>.
</p>
<p>
For an interval map type <span class="bold"><strong>M</strong></span>, a key element
(<span class="bold"><strong>M</strong></span><code class="computeroutput"><span class="special">::</span><span class="identifier">domain_type</span></code>), an interval (<span class="bold"><strong>M</strong></span><code class="computeroutput"><span class="special">::</span><span class="identifier">interval_type</span></code>)
and an <span class="emphasis"><em><span class="bold"><strong>interval set</strong></span></em></span>,
can be <span class="emphasis"><em><span class="bold"><strong>key objects</strong></span></em></span>.
</p>
<a name="complexities_contains"></a><p>
Complexity characteristics for function <code class="computeroutput"><span class="keyword">bool</span>
<span class="identifier">contains</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;</span> <span class="identifier">super</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">P</span><span class="special">&amp;</span> <span class="identifier">sub</span><span class="special">)</span><span class="keyword">const</span></code> 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">super</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">sub</span><span class="special">);</span> <span class="comment">//if P is a container type
</span></pre>
<p>
</p>
<div class="table">
<a name="id1142930"></a><p class="title"><b>Table&#160;1.19.&#160;Time Complexity for function contains on element
containers</b></p>
<div class="table-contents"><table class="table" summary="Time Complexity for function contains on element
containers">
<colgroup>
<col>
<col>
<col>
<col>
<col>
</colgroup>
<thead><tr>
<th>
<p>
<code class="computeroutput"><span class="keyword">bool</span> <span class="identifier">contains</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;</span>
<span class="identifier">super</span><span class="special">,</span>
<span class="keyword">const</span> <span class="identifier">P</span><span class="special">&amp;</span> <span class="identifier">sub</span><span class="special">)</span></code><br> <code class="computeroutput"><span class="keyword">bool</span>
<span class="identifier">within</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">P</span><span class="special">&amp;</span> <span class="identifier">sub</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;</span>
<span class="identifier">super</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>
<p>
</p>
</td>
<td>
<p>
<span class="emphasis"><em>O(m log n)</em></span>
</p>
</td>
<td>
<p>
</p>
</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="id1143771"></a><p class="title"><b>Table&#160;1.20.&#160;Time Complexity for functions contains
and within on interval containers</b></p>
<div class="table-contents"><table class="table" summary="Time Complexity for functions contains
and within on interval containers">
<colgroup>
<col>
<col>
<col>
<col>
<col>
<col>
<col>
<col>
</colgroup>
<thead><tr>
<th>
<p>
<code class="computeroutput"><span class="keyword">bool</span> <span class="identifier">contains</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;</span>
<span class="identifier">super</span><span class="special">,</span>
<span class="keyword">const</span> <span class="identifier">P</span><span class="special">&amp;</span> <span class="identifier">sub</span><span class="special">)</span></code><br> <code class="computeroutput"><span class="keyword">bool</span>
<span class="identifier">within</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">P</span><span class="special">&amp;</span> <span class="identifier">sub</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;</span>
<span class="identifier">super</span><span class="special">)</span></code>
</p>
</th>
<th>
<p>
</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>
<code class="computeroutput"><a class="link" href="../../boost/icl/interval_set.html" title="Class template interval_set">interval_set</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>
</p>
</td>
<td>
<p>
</p>
</td>
<td>
<p>
<span class="emphasis"><em>O(m log n)</em></span>
</p>
</td>
<td>
<p>
</p>
</td>
</tr>
<tr>
<td>
<p>
</p>
</td>
<td>
<p>
<code class="computeroutput"><a class="link" href="../../boost/icl/separate_interval_set.html" title="Class template separate_interval_set">separate_interval_set</a></code><br>
<code class="computeroutput"><a class="link" href="../../boost/icl/split_interval_set.html" title="Class template split_interval_set">split_interval_set</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>
</p>
</td>
<td>
<p>
</p>
</td>
<td>
<p>
<span class="emphasis"><em>O(m log n)</em></span>
</p>
</td>
<td>
<p>
</p>
</td>
</tr>
<tr>
<td>
<p>
interval_maps
</p>
</td>
<td>
<p>
<code class="computeroutput"><a class="link" href="../../boost/icl/interval_map.html" title="Class template interval_map">interval_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(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>
<tr>
<td>
<p>
</p>
</td>
<td>
<p>
<code class="computeroutput"><a class="link" href="../../boost/icl/split_interval_map.html" title="Class template split_interval_map">split_interval_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(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)</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"><p>
All overloads of containedness of containers in containers
</p>
<pre class="programlisting"><span class="keyword">bool</span> <span class="identifier">contains</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;</span> <span class="identifier">super</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">P</span><span class="special">&amp;</span> <span class="identifier">sub</span><span class="special">)</span>
<span class="keyword">bool</span> <span class="identifier">within</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">P</span><span class="special">&amp;</span> <span class="identifier">sub</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;</span> <span class="identifier">super</span><span class="special">)</span>
</pre>
<p>
are of <span class="emphasis"><em><span class="bold"><strong>loglinear</strong></span></em></span> time:
<span class="emphasis"><em>O(m log n)</em></span>. If both containers have same iterative_sizes
so that <span class="emphasis"><em>m = n</em></span> we have the worst case ( <span class="emphasis"><em>O(n
log n)</em></span> ). There is an alternative implementation that has a <span class="emphasis"><em><span class="bold"><strong>linear</strong></span></em></span> complexity of <span class="emphasis"><em>O(n+m)</em></span>.
The loglinear implementation has been chosen, because it can be faster, if
the container argument is small. In this case the loglinear implementation
approaches logarithmic behavior, whereas the linear implementation stays
linear.
</p>
<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 &#169; 2007 -2010 Joachim Faulhaber<br>Copyright &#169; 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="construct__copy__destruct.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="equivalences_and_orderings.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>