4a04618b4e
Fix for ticket #6924: Now using insert with hint. ........ Fixed ticket #6924 (reporter: John Reid). Improvements of icl/functors.hpp. ........ Documentation tweaks. Ticket #6967, fixed broken links. ........ Added doxygen generated html to complete broken links. ........ [SVN r79220]
248 lines
16 KiB
HTML
248 lines
16 KiB
HTML
<html>
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
|
|
<title>Segmentational Fineness</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 1. Boost.Icl">
|
|
<link rel="up" href="../function_reference.html" title="Function Reference">
|
|
<link rel="prev" href="../function_reference.html" title="Function Reference">
|
|
<link rel="next" href="key_types.html" title="Key Types">
|
|
</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="../function_reference.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="key_types.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
|
</div>
|
|
<div class="section boost_icl_function_reference_segmentational_fineness" lang="en">
|
|
<div class="titlepage"><div><div><h3 class="title">
|
|
<a name="boost_icl.function_reference.segmentational_fineness"></a><a class="link" href="segmentational_fineness.html" title="Segmentational Fineness">Segmentational
|
|
Fineness</a>
|
|
</h3></div></div></div>
|
|
<p>
|
|
For overloading tables on infix operators, we need to break down <code class="computeroutput"><a class="link" href="../../boost/icl/interval_set.html" title="Class template interval_set">interval_sets</a></code> and <code class="computeroutput"><a class="link" href="../../boost/icl/interval_map.html" title="Class template interval_map">interval_maps</a></code>
|
|
to the specific class templates
|
|
</p>
|
|
<a name="ph_def_S1"></a><a name="ph_def_S2"></a><a name="ph_def_S3"></a><a name="ph_def_M1"></a><a name="ph_def_M3"></a><div class="informaltable"><table class="table">
|
|
<colgroup>
|
|
<col>
|
|
<col>
|
|
<col>
|
|
<col>
|
|
<col>
|
|
<col>
|
|
</colgroup>
|
|
<thead><tr>
|
|
<th>
|
|
<p>
|
|
</p>
|
|
</th>
|
|
<th>
|
|
<p>
|
|
</p>
|
|
</th>
|
|
<th>
|
|
<p>
|
|
</p>
|
|
</th>
|
|
<th>
|
|
<p>
|
|
</p>
|
|
</th>
|
|
<th>
|
|
<p>
|
|
</p>
|
|
</th>
|
|
<th>
|
|
<p>
|
|
</p>
|
|
</th>
|
|
</tr></thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>
|
|
<p>
|
|
<span class="bold"><strong>S1</strong></span>
|
|
</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="bold"><strong>S2</strong></span>
|
|
</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>
|
|
</p>
|
|
</td>
|
|
<td>
|
|
<p>
|
|
<span class="bold"><strong>S3</strong></span>
|
|
</p>
|
|
</td>
|
|
<td>
|
|
<p>
|
|
<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>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
<p>
|
|
<span class="bold"><strong>M1</strong></span>
|
|
</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>
|
|
</p>
|
|
</td>
|
|
<td>
|
|
<p>
|
|
</p>
|
|
</td>
|
|
<td>
|
|
<p>
|
|
<span class="bold"><strong>M3</strong></span>
|
|
</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>
|
|
</tr>
|
|
</tbody>
|
|
</table></div>
|
|
<p>
|
|
choosing <span class="bold"><strong>Si</strong></span> and <span class="bold"><strong>Mi</strong></span>
|
|
as placeholders.
|
|
</p>
|
|
<p>
|
|
The indices <span class="bold"><strong>i</strong></span> of <span class="bold"><strong>Si</strong></span>
|
|
and <span class="bold"><strong>Mi</strong></span> represent a property called <span class="emphasis"><em><span class="bold"><strong>segmentational fineness</strong></span></em></span> or short <span class="emphasis"><em><span class="bold"><strong>fineness</strong></span></em></span>, which is a <span class="emphasis"><em><span class="bold"><strong>type trait</strong></span></em></span> on interval containers.
|
|
</p>
|
|
<div class="informaltable"><table class="table">
|
|
<colgroup><col></colgroup>
|
|
<thead><tr><th>
|
|
<p>
|
|
</p>
|
|
</th></tr></thead>
|
|
<tbody>
|
|
<tr><td>
|
|
<p>
|
|
<code class="computeroutput"><span class="identifier">segmentational_fineness</span><span class="special"><</span></code><span class="bold"><strong>Si</strong></span><code class="computeroutput"><span class="special">>::</span><span class="identifier">value</span></code>
|
|
== <span class="bold"><strong>i</strong></span>
|
|
</p>
|
|
</td></tr>
|
|
<tr><td>
|
|
<p>
|
|
<code class="computeroutput"><span class="identifier">segmentational_fineness</span><span class="special"><</span></code><span class="bold"><strong>Mi</strong></span><code class="computeroutput"><span class="special">>::</span><span class="identifier">value</span></code>
|
|
== <span class="bold"><strong>i</strong></span>
|
|
</p>
|
|
</td></tr>
|
|
</tbody>
|
|
</table></div>
|
|
<p>
|
|
Segmentational fineness represents the fact, that for interval containers
|
|
holding the same elements, a splitting interval container may contain more
|
|
segments as a separating container which in turn may contain more segments
|
|
than a joining one. So for an
|
|
</p>
|
|
<pre class="programlisting"><span class="keyword">operator</span> <span class="special">></span>
|
|
</pre>
|
|
<p>
|
|
where
|
|
</p>
|
|
<pre class="programlisting"><span class="identifier">x</span> <span class="special">></span> <span class="identifier">y</span> <span class="comment">// means that
|
|
</span><span class="identifier">x</span> <span class="identifier">is_finer_than</span> <span class="identifier">y</span>
|
|
|
|
<span class="comment">// we have
|
|
</span>
|
|
<span class="identifier">finer</span> <span class="identifier">coarser</span>
|
|
<span class="identifier">split_interval_set</span> <span class="identifier">interval_set</span>
|
|
<span class="special">></span> <span class="identifier">separate_interval_set</span> <span class="special">></span>
|
|
<span class="identifier">split_interval_map</span> <span class="identifier">interval_map</span>
|
|
</pre>
|
|
<p>
|
|
</p>
|
|
<p>
|
|
This relation is needed to resolve the instantiation of infix operators e.g.
|
|
<code class="computeroutput"><span class="identifier">T</span> <span class="keyword">operator</span>
|
|
<span class="special">+</span> <span class="special">(</span><span class="identifier">P</span><span class="special">,</span> <span class="identifier">Q</span><span class="special">)</span></code> for two interval container types <code class="computeroutput"><span class="identifier">P</span></code> and <code class="computeroutput"><span class="identifier">Q</span></code>.
|
|
If both <code class="computeroutput"><span class="identifier">P</span></code> and <code class="computeroutput"><span class="identifier">Q</span></code> are candidates for the result type <code class="computeroutput"><span class="identifier">T</span></code>, one of them must be chosen by the compiler.
|
|
We choose the type that is segmentational finer as result type <code class="computeroutput"><span class="identifier">T</span></code>. This way we do not loose the <span class="emphasis"><em><span class="bold"><strong>segment information</strong></span></em></span> that is stored in the
|
|
<span class="emphasis"><em><span class="bold"><strong>finer</strong></span></em></span> one of the container
|
|
types <code class="computeroutput"><span class="identifier">P</span></code> and <code class="computeroutput"><span class="identifier">Q</span></code>.
|
|
</p>
|
|
<p>
|
|
|
|
</p>
|
|
<pre class="programlisting"><span class="comment">// overload tables for
|
|
</span><span class="identifier">T</span> <span class="keyword">operator</span> <span class="special">+</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="keyword">operator</span> <span class="special">+</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">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="special">+</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="special">+</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">S1</span> <span class="identifier">S2</span> <span class="identifier">S3</span> <span class="identifier">M1</span> <span class="identifier">M3</span>
|
|
<span class="special">---+--------</span> <span class="special">---+---------------------------</span>
|
|
<span class="identifier">e</span> <span class="special">|</span> <span class="identifier">s</span> <span class="identifier">e</span> <span class="special">|</span> <span class="identifier">S1</span> <span class="identifier">S2</span> <span class="identifier">S3</span>
|
|
<span class="identifier">b</span> <span class="special">|</span> <span class="identifier">m</span> <span class="identifier">i</span> <span class="special">|</span> <span class="identifier">S1</span> <span class="identifier">S2</span> <span class="identifier">S3</span>
|
|
<span class="identifier">s</span> <span class="special">|</span> <span class="identifier">s</span> <span class="identifier">s</span> <span class="identifier">b</span> <span class="special">|</span> <span class="identifier">M1</span> <span class="identifier">M3</span>
|
|
<span class="identifier">m</span> <span class="special">|</span> <span class="identifier">m</span> <span class="identifier">m</span> <span class="identifier">p</span> <span class="special">|</span> <span class="identifier">M1</span> <span class="identifier">M3</span>
|
|
<span class="identifier">S1</span> <span class="special">|</span> <span class="identifier">S1</span> <span class="identifier">S1</span> <span class="identifier">S1</span> <span class="identifier">S2</span> <span class="identifier">S3</span>
|
|
<span class="identifier">S2</span> <span class="special">|</span> <span class="identifier">S2</span> <span class="identifier">S2</span> <span class="identifier">S2</span> <span class="identifier">S2</span> <span class="identifier">S3</span>
|
|
<span class="identifier">S3</span> <span class="special">|</span> <span class="identifier">S3</span> <span class="identifier">S3</span> <span class="identifier">S3</span> <span class="identifier">S3</span> <span class="identifier">S3</span>
|
|
<span class="identifier">M1</span> <span class="special">|</span> <span class="identifier">M1</span> <span class="identifier">M1</span> <span class="identifier">M1</span> <span class="identifier">M3</span>
|
|
<span class="identifier">M3</span> <span class="special">|</span> <span class="identifier">M3</span> <span class="identifier">M3</span> <span class="identifier">M3</span> <span class="identifier">M3</span>
|
|
</pre>
|
|
<p>
|
|
</p>
|
|
<p>
|
|
So looking up a type combination for e.g. <code class="computeroutput"><span class="identifier">T</span>
|
|
<span class="keyword">operator</span> <span class="special">+</span>
|
|
<span class="special">(</span><span class="identifier">interval_map</span><span class="special">,</span> <span class="identifier">split_interval_map</span><span class="special">)</span></code> which is equivalent to <code class="computeroutput"><span class="identifier">T</span>
|
|
<span class="keyword">operator</span> <span class="special">+</span>
|
|
<span class="special">(</span><span class="identifier">M1</span><span class="special">,</span> <span class="identifier">M3</span><span class="special">)</span></code>
|
|
we find for row type <code class="computeroutput"><span class="identifier">M1</span></code> and
|
|
column type <code class="computeroutput"><span class="identifier">M3</span></code> that <code class="computeroutput"><span class="identifier">M3</span></code> will be assigned as result type, because
|
|
<code class="computeroutput"><span class="identifier">M3</span></code> is finer than <code class="computeroutput"><span class="identifier">M1</span></code>. So this type combination will result
|
|
in choosing this
|
|
</p>
|
|
<pre class="programlisting"><span class="identifier">split_interval_map</span> <span class="keyword">operator</span> <span class="special">+</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">interval_map</span><span class="special">&,</span> <span class="identifier">split_interval_map</span><span class="special">)</span>
|
|
</pre>
|
|
<p>
|
|
implementation by the compiler.
|
|
</p>
|
|
</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="../function_reference.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="key_types.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
|
</div>
|
|
</body>
|
|
</html>
|