3 <meta http-equiv=
"Content-Type" content=
"text/html; charset=US-ASCII">
5 <link rel=
"stylesheet" href=
"../../../../../../doc/src/boostbook.css" type=
"text/css">
6 <meta name=
"generator" content=
"DocBook XSL Stylesheets V1.74.0">
7 <link rel=
"home" href=
"../../index.html" title=
"Chapter 1. Boost.Icl">
8 <link rel=
"up" href=
"../function_reference.html" title=
"Function Reference">
9 <link rel=
"prev" href=
"size.html" title=
"Size">
10 <link rel=
"next" href=
"selection.html" title=
"Selection">
12 <body bgcolor=
"white" text=
"black" link=
"#0000FF" vlink=
"#840084" alink=
"#0000FF">
13 <table cellpadding=
"2" width=
"100%"><tr>
14 <td valign=
"top"><img alt=
"Boost C++ Libraries" width=
"277" height=
"86" src=
"../../../../../../boost.png"></td>
15 <td align=
"center"><a href=
"../../../../../../index.html">Home
</a></td>
16 <td align=
"center"><a href=
"../../../../../libraries.htm">Libraries
</a></td>
17 <td align=
"center"><a href=
"http://www.boost.org/users/people.html">People
</a></td>
18 <td align=
"center"><a href=
"http://www.boost.org/users/faq.html">FAQ
</a></td>
19 <td align=
"center"><a href=
"../../../../../../more/index.htm">More
</a></td>
22 <div class=
"spirit-nav">
23 <a accesskey=
"p" href=
"size.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=
"selection.html"><img src=
"../../../../../../doc/src/images/next.png" alt=
"Next"></a>
25 <div class=
"section boost_icl_function_reference_range" lang=
"en">
26 <div class=
"titlepage"><div><div><h3 class=
"title">
27 <a name=
"boost_icl.function_reference.range"></a><a class=
"link" href=
"range.html" title=
"Range">Range
</a>
28 </h3></div></div></div>
29 <div class=
"informaltable"><table class=
"table">
40 <span class=
"emphasis"><em><span class=
"bold"><strong>Range
</strong></span></em></span>
68 <code class=
"computeroutput"><span class=
"identifier">interval_type
</span> <span class=
"identifier">hull
</span><span class=
"special">(
</span><span class=
"keyword">const
</span> <span class=
"identifier">T
</span><span class=
"special">&)
</span></code>
77 <span class=
"emphasis"><em>O(
1)
</em></span>
82 <span class=
"emphasis"><em>O(
1)
</em></span>
93 <code class=
"computeroutput"><span class=
"identifier">T
</span> <span class=
"identifier">hull
</span><span class=
"special">(
</span><span class=
"keyword">const
</span> <span class=
"identifier">T
</span><span class=
"special">&,
</span>
94 <span class=
"keyword">const
</span> <span class=
"identifier">T
</span><span class=
"special">&)
</span></code>
99 <span class=
"emphasis"><em>O(
1)
</em></span>
118 <code class=
"computeroutput"><span class=
"identifier">domain_type
</span> <span class=
"identifier">lower
</span><span class=
"special">(
</span><span class=
"keyword">const
</span> <span class=
"identifier">T
</span><span class=
"special">&)
</span></code>
123 <span class=
"emphasis"><em>O(
1)
</em></span>
128 <span class=
"emphasis"><em>O(
1)
</em></span>
133 <span class=
"emphasis"><em>O(
1)
</em></span>
144 <code class=
"computeroutput"><span class=
"identifier">domain_type
</span> <span class=
"identifier">upper
</span><span class=
"special">(
</span><span class=
"keyword">const
</span> <span class=
"identifier">T
</span><span class=
"special">&)
</span></code>
149 <span class=
"emphasis"><em>O(
1)
</em></span>
154 <span class=
"emphasis"><em>O(
1)
</em></span>
159 <span class=
"emphasis"><em>O(
1)
</em></span>
170 <code class=
"computeroutput"><span class=
"identifier">domain_type
</span> <span class=
"identifier">first
</span><span class=
"special">(
</span><span class=
"keyword">const
</span> <span class=
"identifier">T
</span><span class=
"special">&)
</span></code>
175 <span class=
"emphasis"><em>O(
1)
</em></span>
180 <span class=
"emphasis"><em>O(
1)
</em></span>
185 <span class=
"emphasis"><em>O(
1)
</em></span>
190 <code class=
"computeroutput"><span class=
"identifier">is_discrete
</span><span class=
"special"><</span><span class=
"identifier">domain_type
</span><span class=
"special">>::
</span><span class=
"identifier">value
</span></code>
197 <code class=
"computeroutput"><span class=
"identifier">domain_type
</span> <span class=
"identifier">last
</span><span class=
"special">(
</span><span class=
"keyword">const
</span> <span class=
"identifier">T
</span><span class=
"special">&)
</span></code>
202 <span class=
"emphasis"><em>O(
1)
</em></span>
207 <span class=
"emphasis"><em>O(
1)
</em></span>
212 <span class=
"emphasis"><em>O(
1)
</em></span>
217 <code class=
"computeroutput"><span class=
"identifier">is_discrete
</span><span class=
"special"><</span><span class=
"identifier">domain_type
</span><span class=
"special">>::
</span><span class=
"identifier">value
</span></code>
224 The table above shows the availability of functions
<code class=
"computeroutput"><span class=
"identifier">hull
</span></code>,
225 <code class=
"computeroutput"><span class=
"identifier">lower
</span></code>,
<code class=
"computeroutput"><span class=
"identifier">upper
</span></code>,
226 <code class=
"computeroutput"><span class=
"identifier">first
</span></code> and
<code class=
"computeroutput"><span class=
"identifier">last
</span></code>
227 on intervals and interval containers that are all of
<span class=
"emphasis"><em><span class=
"bold"><strong>constant time complexity
</strong></span></em></span>. Find the functions
228 description and some simple properties below.
230 <div class=
"informaltable"><table class=
"table">
239 <span class=
"emphasis"><em><span class=
"bold"><strong>Range
</strong></span></em></span>
257 <code class=
"computeroutput"><span class=
"identifier">interval_type
</span> <span class=
"identifier">hull
</span><span class=
"special">(
</span><span class=
"keyword">const
</span> <span class=
"identifier">T
</span><span class=
"special">&)
</span></code>
262 <a class=
"link" href=
"../interface/function_synopsis.html#interval_set_types"><span class=
"bold"><strong>S
</strong></span></a>
263 <a class=
"link" href=
"../interface/function_synopsis.html#interval_map_types"><span class=
"bold"><strong>M
</strong></span></a>
268 <code class=
"computeroutput"><span class=
"identifier">hull
</span><span class=
"special">(
</span><span class=
"identifier">x
</span><span class=
"special">)
</span></code>
269 returns the smallest interval that contains all intervals of an interval
270 container
<code class=
"computeroutput"><span class=
"identifier">x
</span></code>.
277 <code class=
"computeroutput"><span class=
"identifier">T
</span> <span class=
"identifier">hull
</span><span class=
"special">(
</span><span class=
"keyword">const
</span> <span class=
"identifier">T
</span><span class=
"special">&,
</span>
278 <span class=
"keyword">const
</span> <span class=
"identifier">T
</span><span class=
"special">&)
</span></code>
283 <a class=
"link" href=
"../interface/function_synopsis.html#interval_set_types"><span class=
"bold"><strong>S
</strong></span></a>
284 <a class=
"link" href=
"../interface/function_synopsis.html#interval_map_types"><span class=
"bold"><strong>M
</strong></span></a>
289 <code class=
"computeroutput"><span class=
"identifier">hull
</span><span class=
"special">(
</span><span class=
"identifier">i
</span><span class=
"special">,
</span><span class=
"identifier">j
</span><span class=
"special">)
</span></code>
290 returns the smallest interval that contains intervals
<code class=
"computeroutput"><span class=
"identifier">i
</span></code> abd 'j'.
297 <code class=
"computeroutput"><span class=
"identifier">domain_type
</span> <span class=
"identifier">lower
</span><span class=
"special">(
</span><span class=
"keyword">const
</span> <span class=
"identifier">T
</span><span class=
"special">&)
</span></code>
302 <a class=
"link" href=
"../interface/function_synopsis.html#interval_type"><span class=
"bold"><strong>i
</strong></span></a>
303 <a class=
"link" href=
"../interface/function_synopsis.html#interval_set_types"><span class=
"bold"><strong>S
</strong></span></a>
304 <a class=
"link" href=
"../interface/function_synopsis.html#interval_map_types"><span class=
"bold"><strong>M
</strong></span></a>
309 <code class=
"computeroutput"><span class=
"identifier">lower
</span><span class=
"special">(
</span><span class=
"identifier">x
</span><span class=
"special">)
</span></code>
310 returns the lower bound of an interval or interval container
<code class=
"computeroutput"><span class=
"identifier">x
</span></code>.
317 <code class=
"computeroutput"><span class=
"identifier">domain_type
</span> <span class=
"identifier">upper
</span><span class=
"special">(
</span><span class=
"keyword">const
</span> <span class=
"identifier">T
</span><span class=
"special">&)
</span></code>
322 <a class=
"link" href=
"../interface/function_synopsis.html#interval_type"><span class=
"bold"><strong>i
</strong></span></a>
323 <a class=
"link" href=
"../interface/function_synopsis.html#interval_set_types"><span class=
"bold"><strong>S
</strong></span></a>
324 <a class=
"link" href=
"../interface/function_synopsis.html#interval_map_types"><span class=
"bold"><strong>M
</strong></span></a>
329 <code class=
"computeroutput"><span class=
"identifier">upper
</span><span class=
"special">(
</span><span class=
"identifier">x
</span><span class=
"special">)
</span></code>
330 returns the upper bound of an interval or interval container
<code class=
"computeroutput"><span class=
"identifier">x
</span></code>.
337 <code class=
"computeroutput"><span class=
"identifier">domain_type
</span> <span class=
"identifier">first
</span><span class=
"special">(
</span><span class=
"keyword">const
</span> <span class=
"identifier">T
</span><span class=
"special">&)
</span></code>
342 <a class=
"link" href=
"../interface/function_synopsis.html#interval_type"><span class=
"bold"><strong>i
</strong></span></a>
343 <a class=
"link" href=
"../interface/function_synopsis.html#interval_set_types"><span class=
"bold"><strong>S
</strong></span></a>
344 <a class=
"link" href=
"../interface/function_synopsis.html#interval_map_types"><span class=
"bold"><strong>M
</strong></span></a>
349 <code class=
"computeroutput"><span class=
"identifier">first
</span><span class=
"special">(
</span><span class=
"identifier">x
</span><span class=
"special">)
</span></code>
350 returns the first element of an interval or interval container
<code class=
"computeroutput"><span class=
"identifier">x
</span></code>.
<code class=
"computeroutput"><span class=
"identifier">first
</span><span class=
"special">(
</span><span class=
"keyword">const
</span> <span class=
"identifier">T
</span><span class=
"special">&)
</span></code>
351 is defined for a discrete
<code class=
"computeroutput"><span class=
"identifier">domain_type
</span></code>
359 <code class=
"computeroutput"><span class=
"identifier">domain_type
</span> <span class=
"identifier">last
</span><span class=
"special">(
</span><span class=
"keyword">const
</span> <span class=
"identifier">T
</span><span class=
"special">&)
</span></code>
364 <a class=
"link" href=
"../interface/function_synopsis.html#interval_type"><span class=
"bold"><strong>i
</strong></span></a>
365 <a class=
"link" href=
"../interface/function_synopsis.html#interval_set_types"><span class=
"bold"><strong>S
</strong></span></a>
366 <a class=
"link" href=
"../interface/function_synopsis.html#interval_map_types"><span class=
"bold"><strong>M
</strong></span></a>
371 <code class=
"computeroutput"><span class=
"identifier">last
</span><span class=
"special">(
</span><span class=
"identifier">x
</span><span class=
"special">)
</span></code>
372 returns the last element of an interval or interval container
<code class=
"computeroutput"><span class=
"identifier">x
</span></code>.
<code class=
"computeroutput"><span class=
"identifier">last
</span><span class=
"special">(
</span><span class=
"keyword">const
</span> <span class=
"identifier">T
</span><span class=
"special">&)
</span></code>
373 is defined for a discrete
<code class=
"computeroutput"><span class=
"identifier">domain_type
</span></code>
383 <pre class=
"programlisting"><span class=
"comment">// for interval_containers x:
384 </span><span class=
"identifier">lower
</span><span class=
"special">(
</span><span class=
"identifier">hull
</span><span class=
"special">(
</span><span class=
"identifier">x
</span><span class=
"special">))
</span> <span class=
"special">==
</span> <span class=
"identifier">lower
</span><span class=
"special">(
</span><span class=
"identifier">x
</span><span class=
"special">)
</span>
385 <span class=
"identifier">upper
</span><span class=
"special">(
</span><span class=
"identifier">hull
</span><span class=
"special">(
</span><span class=
"identifier">x
</span><span class=
"special">))
</span> <span class=
"special">==
</span> <span class=
"identifier">upper
</span><span class=
"special">(
</span><span class=
"identifier">x
</span><span class=
"special">)
</span>
386 <span class=
"identifier">first
</span><span class=
"special">(
</span><span class=
"identifier">hull
</span><span class=
"special">(
</span><span class=
"identifier">x
</span><span class=
"special">))
</span> <span class=
"special">==
</span> <span class=
"identifier">first
</span><span class=
"special">(
</span><span class=
"identifier">x
</span><span class=
"special">)
</span>
387 <span class=
"identifier">last
</span><span class=
"special">(
</span><span class=
"identifier">hull
</span><span class=
"special">(
</span><span class=
"identifier">x
</span><span class=
"special">))
</span> <span class=
"special">==
</span> <span class=
"identifier">last
</span><span class=
"special">(
</span><span class=
"identifier">x
</span><span class=
"special">)
</span>
392 <span class=
"emphasis"><em><span class=
"bold"><strong>Back to section . . .
</strong></span></em></span>
394 <div class=
"informaltable"><table class=
"table">
395 <colgroup><col></colgroup>
396 <thead><tr></tr></thead>
400 <a class=
"link" href=
"../interface/function_synopsis.html#function_synopsis_table"><span class=
"emphasis"><em><span class=
"bold"><strong>Function
401 Synopsis
</strong></span></em></span></a>
406 <a class=
"link" href=
"../interface.html" title=
"Interface"><span class=
"emphasis"><em><span class=
"bold"><strong>Interface
</strong></span></em></span></a>
412 <table xmlns:
rev=
"http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width=
"100%"><tr>
413 <td align=
"left"></td>
414 <td align=
"right"><div class=
"copyright-footer">Copyright
© 2007 -
2010 Joachim Faulhaber
<br>Copyright
© 1999 -
2006 Cortex Software GmbH
<p>
415 Distributed under the Boost Software License, Version
1.0. (See accompanying
416 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>)
421 <div class=
"spirit-nav">
422 <a accesskey=
"p" href=
"size.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=
"selection.html"><img src=
"../../../../../../doc/src/images/next.png" alt=
"Next"></a>