Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r63202 - in sandbox/SOC/2010/bits_and_ints: boost/integer libs/integer/doc/html libs/integer/doc/html/boost_integer
From: muriloufg_at_[hidden]
Date: 2010-06-21 16:56:19


Author: murilov
Date: 2010-06-21 16:56:18 EDT (Mon, 21 Jun 2010)
New Revision: 63202
URL: http://svn.boost.org/trac/boost/changeset/63202

Log:
Documenting
Text files modified:
   sandbox/SOC/2010/bits_and_ints/boost/integer/clear_least_bit_set.hpp | 9 ++
   sandbox/SOC/2010/bits_and_ints/boost/integer/interleave.hpp | 2
   sandbox/SOC/2010/bits_and_ints/libs/integer/doc/html/boost_integer/bits_and_ints.html | 168 +++++++++++++++++++++++++++++++++++++++
   sandbox/SOC/2010/bits_and_ints/libs/integer/doc/html/boost_integer/history.html | 4
   sandbox/SOC/2010/bits_and_ints/libs/integer/doc/html/index.html | 2
   5 files changed, 179 insertions(+), 6 deletions(-)

Modified: sandbox/SOC/2010/bits_and_ints/boost/integer/clear_least_bit_set.hpp
==============================================================================
--- sandbox/SOC/2010/bits_and_ints/boost/integer/clear_least_bit_set.hpp (original)
+++ sandbox/SOC/2010/bits_and_ints/boost/integer/clear_least_bit_set.hpp 2010-06-21 16:56:18 EDT (Mon, 21 Jun 2010)
@@ -10,6 +10,15 @@
 #ifndef BOOST_CLEAR_LEAST_BIT_SET
 #define BOOST_CLEAR_LEAST_BIT_SET
 
+/*
+ * Clears last 1 bit in `value'.
+ * For example:
+ *
+ * int value = 0xFA; // 0000 0000 1111 1010
+ * int x = clear_least_bit_set(value);
+ * So x will be 0xF8 (0000 0000 1111 1000)
+ */
+
 namespace boost {
 
 template <typename T>

Modified: sandbox/SOC/2010/bits_and_ints/boost/integer/interleave.hpp
==============================================================================
--- sandbox/SOC/2010/bits_and_ints/boost/integer/interleave.hpp (original)
+++ sandbox/SOC/2010/bits_and_ints/boost/integer/interleave.hpp 2010-06-21 16:56:18 EDT (Mon, 21 Jun 2010)
@@ -115,7 +115,7 @@
 template <int Bits>
 inline typename enable_if_c<Bits == 16 || Bits == 32 || Bits == 64,
         std::pair<typename uint_t<Bits/2>::exact, typename uint_t<Bits/2>::exact> >::type
-uninterleave(const typename uint_t<Bits>::exact& number)
+uninterleave(typename uint_t<Bits>::exact number)
 {
         typename uint_t<Bits/2>::exact a, b;
         

Modified: sandbox/SOC/2010/bits_and_ints/libs/integer/doc/html/boost_integer/bits_and_ints.html
==============================================================================
--- sandbox/SOC/2010/bits_and_ints/libs/integer/doc/html/boost_integer/bits_and_ints.html (original)
+++ sandbox/SOC/2010/bits_and_ints/libs/integer/doc/html/boost_integer/bits_and_ints.html 2010-06-21 16:56:18 EDT (Mon, 21 Jun 2010)
@@ -32,6 +32,13 @@
 <dt><span class="section"> Bit Reversal</span></dt>
 <dt><span class="section"> Same Sign</span></dt>
 <dt><span class="section"> Sign function</span></dt>
+<dt><span class="section">Bit Iterleaving</span></dt>
+<dt><span class="section"><a href="bits_and_ints.html#boost_integer.bits_and_ints.population_count__count_bits_set_">Population
+ Count (count bits set)</a></span></dt>
+<dt><span class="section"><a href="bits_and_ints.html#boost_integer.bits_and_ints.clear_least_bit_set">Clear
+ Least Bit Set</a></span></dt>
+<dt><span class="section"><a href="bits_and_ints.html#boost_integer.bits_and_ints.count_trailing_zeros">Count
+ Trailing Zeros</a></span></dt>
 <dt><span class="section"> Binary Utilities</span></dt>
 </dl></div>
 <div class="section" title="Overview">
@@ -629,8 +636,8 @@
 <dt><span class="section">Examples</span></dt>
 </dl></div>
 <p>
- The <code class="computeroutput"><span class="identifier">sign</span></code> function check the
- signal of integrals.
+ The <code class="computeroutput"><span class="identifier">sign</span></code> function checks
+ the sign of integrals.
       </p>
 <div class="section" title="Non-Member Function sign">
 <div class="titlepage"><div><div><h4 class="title">
@@ -768,6 +775,163 @@
         </p>
 </div>
 </div>
+<div class="section" title="Bit Iterleaving">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost_integer.bits_and_ints.bit_iterleaving"></a><a class="link" href="bits_and_ints.html#boost_integer.bits_and_ints.bit_iterleaving" title="Bit Iterleaving">Bit Iterleaving</a>
+</h3></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section">Synopsis</span></dt>
+<dt><span class="section">Examples</span></dt>
+</dl></div>
+<p>
+ Interleaved bits (aka Morton numbers) http://en.wikipedia.org/wiki/Morton_number_(number_theory)
+ are useful for linearizing 2D integer coordinates, so x and y are combined
+ into a single number that can be compared easily and has the property that
+ a number is usually close to another if their x and y values are close. These
+ functions are defined in the header <boost/integer/interleave.hpp>.
+ </p>
+<div class="section" title="Synopsis">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_integer.bits_and_ints.bit_iterleaving.synopsis"></a><a class="link" href="bits_and_ints.html#boost_integer.bits_and_ints.bit_iterleaving.synopsis" title="Synopsis">Synopsis</a>
+</h4></div></div></div>
+<p>
+
+</p>
+<pre class="programlisting"><span class="identifier">T2</span> <span class="identifier">interleave</span><span class="special">(</span><span class="identifier">T1</span> <span class="identifier">x</span><span class="special">,</span> <span class="identifier">T1</span> <span class="identifier">y</span><span class="special">);</span>
+
+<span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special">&lt;</span><span class="identifier">T1</span><span class="special">,</span> <span class="identifier">T1</span><span class="special">&gt;</span> <span class="identifier">uninterleave</span><span class="special">(</span><span class="identifier">T2</span> <span class="identifier">number</span><span class="special">);</span>
+</pre>
+<p>
+ </p>
+</div>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem">
+<span class="bold"><strong>Remarks: </strong></span><code class="computeroutput"><span class="identifier">T1</span></code>
+ and <code class="computeroutput"><span class="identifier">T2</span></code> must be integral
+ types. Additionally, <code class="computeroutput"><span class="identifier">T1</span></code>
+ must have 8, 16 or 32 bits and <code class="computeroutput"><span class="identifier">T2</span></code>
+ must have 16, 32 or 64 bits. For these functions <code class="computeroutput"><span class="identifier">T2</span></code>
+ have the double of bits wich <code class="computeroutput"><span class="identifier">T1</span></code>
+ have.
+ </li></ul></div>
+<p>
+ <span class="bold"><strong>Returns: </strong></span> <code class="computeroutput"><span class="identifier">interleave</span></code>
+ function returns <code class="computeroutput"><span class="identifier">x</span></code> and <code class="computeroutput"><span class="identifier">y</span></code> interleaved. <code class="computeroutput"><span class="identifier">x</span></code>
+ will be in the even bits and <code class="computeroutput"><span class="identifier">y</span></code>
+ will be on odd positions, so the return type have the double of bits than
+ the paramter's type.
+ </p>
+<p>
+ <code class="computeroutput"><span class="identifier">uninterleave</span></code> returns an pair
+ where in the member <code class="computeroutput"><span class="identifier">first</span></code>
+ will be the integral represented in the even positions of <code class="computeroutput"><span class="identifier">number</span></code>
+ and in the <code class="computeroutput"><span class="identifier">second</span></code> member
+ will be the integral represented in the odd positions of <code class="computeroutput"><span class="identifier">number</span></code>.
+ </p>
+<div class="section" title="Examples">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_integer.bits_and_ints.bit_iterleaving.examples"></a><a class="link" href="bits_and_ints.html#boost_integer.bits_and_ints.bit_iterleaving.examples" title="Examples">Examples</a>
+</h4></div></div></div>
+<p>
+
+</p>
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">integer</span><span class="special">/</span><span class="identifier">interleave</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">utility</span><span class="special">&gt;</span>
+<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">iostream</span><span class="special">&gt;</span>
+
+<span class="keyword">using</span> <span class="keyword">namespace</span> <span class="identifier">std</span><span class="special">;</span>
+<span class="keyword">using</span> <span class="keyword">namespace</span> <span class="identifier">boost</span><span class="special">;</span>
+
+<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span>
+<span class="special">{</span>
+ <span class="identifier">uint_t</span><span class="special">&lt;</span><span class="number">64</span><span class="special">&gt;::</span><span class="identifier">exact</span> <span class="identifier">inter</span> <span class="special">=</span> <span class="identifier">interleave</span><span class="special">&lt;</span><span class="number">32</span><span class="special">&gt;(</span><span class="number">0x10</span><span class="special">,</span> <span class="number">0x0e</span><span class="special">);</span>
+
+ <span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"interleaved number: "</span><span class="special">;</span>
+ <span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="identifier">hex</span> <span class="special">&lt;&lt;</span> <span class="identifier">inter</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span>
+
+ <span class="identifier">pair</span><span class="special">&lt;</span><span class="identifier">uint8_t</span><span class="special">,</span> <span class="identifier">uint8_t</span><span class="special">&gt;</span> <span class="identifier">uninter</span> <span class="special">=</span> <span class="identifier">uninterleave</span><span class="special">&lt;</span><span class="number">16</span><span class="special">&gt;(</span><span class="identifier">inter</span><span class="special">);</span>
+
+ <span class="identifier">uint8_t</span> <span class="identifier">a</span> <span class="special">=</span> <span class="identifier">uninter</span><span class="special">.</span><span class="identifier">first</span><span class="special">,</span> <span class="identifier">b</span> <span class="special">=</span> <span class="identifier">uninter</span><span class="special">.</span><span class="identifier">second</span><span class="special">;</span>
+
+ <span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"uninterleaved number: "</span><span class="special">;</span>
+ <span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="identifier">hex</span> <span class="special">&lt;&lt;</span> <span class="keyword">unsigned</span><span class="special">(</span><span class="identifier">a</span><span class="special">)</span> <span class="special">&lt;&lt;</span> <span class="string">" "</span> <span class="special">&lt;&lt;</span> <span class="keyword">unsigned</span><span class="special">(</span><span class="identifier">b</span><span class="special">)</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span>
+<span class="special">}</span>
+</pre>
+<p>
+ </p>
+</div>
+</div>
+<div class="section" title="Population Count (count bits set)">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost_integer.bits_and_ints.population_count__count_bits_set_"></a><a class="link" href="bits_and_ints.html#boost_integer.bits_and_ints.population_count__count_bits_set_" title="Population Count (count bits set)">Population
+ Count (count bits set)</a>
+</h3></div></div></div>
+<div class="toc"><dl><dt><span class="section">Synopsis</span></dt></dl></div>
+<p>
+ Population Count (pop count) is the number of active bits in an integral.
+ The <code class="computeroutput"><span class="identifier">pop_count</span><span class="special">()</span></code>
+ function is defined under the header <boost/integer/pop_count.hpp>.
+ </p>
+<div class="section" title="Synopsis">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_integer.bits_and_ints.population_count__count_bits_set_.synopsis"></a><a class="link" href="bits_and_ints.html#boost_integer.bits_and_ints.population_count__count_bits_set_.synopsis" title="Synopsis">Synopsis</a>
+</h4></div></div></div>
+<pre class="programlisting"><span class="keyword">int</span> <span class="identifier">pop_count</span><span class="special">(</span><span class="identifier">uintmax_t</span> <span class="identifier">value</span><span class="special">);</span>
+</pre>
+</div>
+<p>
+ <span class="bold"><strong>Returns: </strong></span> The number of bits set in <code class="computeroutput"><span class="identifier">value</span></code>.
+ </p>
+</div>
+<div class="section" title="Clear Least Bit Set">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost_integer.bits_and_ints.clear_least_bit_set"></a><a class="link" href="bits_and_ints.html#boost_integer.bits_and_ints.clear_least_bit_set" title="Clear Least Bit Set">Clear
+ Least Bit Set</a>
+</h3></div></div></div>
+<div class="toc"><dl><dt><span class="section">Synopsis</span></dt></dl></div>
+<p>
+ Clears least significant 1 bit in an integral. The <code class="computeroutput"><span class="identifier">clear_least_bit_set</span><span class="special">()</span></code> function is defined on <boost/integer/clear_least_bit_set.hpp>.
+ </p>
+<div class="section" title="Synopsis">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_integer.bits_and_ints.clear_least_bit_set.synopsis"></a><a class="link" href="bits_and_ints.html#boost_integer.bits_and_ints.clear_least_bit_set.synopsis" title="Synopsis">Synopsis</a>
+</h4></div></div></div>
+<pre class="programlisting"><span class="identifier">T</span> <span class="identifier">clear_least_bit_set</span><span class="special">(</span><span class="identifier">T</span> <span class="identifier">value</span><span class="special">);</span>
+</pre>
+</div>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem">
+<span class="bold"><strong>Remarks: </strong></span><code class="computeroutput"><span class="identifier">T</span></code>
+ must be an integral type.
+ </li>
+<li class="listitem">
+<span class="bold"><strong>Returns: </strong></span><code class="computeroutput"><span class="identifier">value</span></code>
+ with it's least significant active bit disactivated.
+ </li>
+</ul></div>
+</div>
+<div class="section" title="Count Trailing Zeros">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost_integer.bits_and_ints.count_trailing_zeros"></a><a class="link" href="bits_and_ints.html#boost_integer.bits_and_ints.count_trailing_zeros" title="Count Trailing Zeros">Count
+ Trailing Zeros</a>
+</h3></div></div></div>
+<div class="toc"><dl><dt><span class="section">Synopsis</span></dt></dl></div>
+<p>
+ The <code class="computeroutput"><span class="identifier">count_trailing_zeros</span><span class="special">()</span></code> function counts the number of consecutive
+ 0's from the least significant bit of an integral value. This function is
+ defined on <boost/integer/count_trailing_zeros.hpp>
+ </p>
+<div class="section" title="Synopsis">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_integer.bits_and_ints.count_trailing_zeros.synopsis"></a><a class="link" href="bits_and_ints.html#boost_integer.bits_and_ints.count_trailing_zeros.synopsis" title="Synopsis">Synopsis</a>
+</h4></div></div></div>
+<pre class="programlisting"><span class="keyword">int</span> <span class="identifier">count_trailing_zeros</span><span class="special">(</span><span class="identifier">uintmax_t</span> <span class="identifier">value</span><span class="special">);</span>
+</pre>
+</div>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem">
+<span class="bold"><strong>Returns: </strong></span> The number of consecutive zeros
+ from the least significant bit.
+ </li></ul></div>
+</div>
 <div class="section" title="Binary Utilities">
 <div class="titlepage"><div><div><h3 class="title">
 <a name="boost_integer.bits_and_ints.bin_utils"></a><a class="link" href="bits_and_ints.html#boost_integer.bits_and_ints.bin_utils" title="Binary Utilities"> Binary Utilities</a>

Modified: sandbox/SOC/2010/bits_and_ints/libs/integer/doc/html/boost_integer/history.html
==============================================================================
--- sandbox/SOC/2010/bits_and_ints/libs/integer/doc/html/boost_integer/history.html (original)
+++ sandbox/SOC/2010/bits_and_ints/libs/integer/doc/html/boost_integer/history.html 2010-06-21 16:56:18 EDT (Mon, 21 Jun 2010)
@@ -26,7 +26,7 @@
 <a name="boost_integer.history"></a><a class="link" href="history.html" title="History"> History</a>
 </h2></div></div></div>
 <a name="boost_integer.history.1_42_0"></a><h5>
-<a name="id36194512"></a>
+<a name="id36195663"></a>
       <a class="link" href="history.html#boost_integer.history.1_42_0">1.42.0</a>
     </h5>
 <div class="itemizedlist"><ul class="itemizedlist" type="disc">
@@ -55,7 +55,7 @@
       </li>
 </ul></div>
 <a name="boost_integer.history.1_32_0"></a><h5>
-<a name="id36194621"></a>
+<a name="id36195783"></a>
       <a class="link" href="history.html#boost_integer.history.1_32_0">1.32.0</a>
     </h5>
 <div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem">

Modified: sandbox/SOC/2010/bits_and_ints/libs/integer/doc/html/index.html
==============================================================================
--- sandbox/SOC/2010/bits_and_ints/libs/integer/doc/html/index.html (original)
+++ sandbox/SOC/2010/bits_and_ints/libs/integer/doc/html/index.html 2010-06-21 16:56:18 EDT (Mon, 21 Jun 2010)
@@ -255,7 +255,7 @@
 </div>
 </div>
 <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
-<td align="left"><p><small>Last revised: June 13, 2010 at 18:19:49 GMT</small></p></td>
+<td align="left"><p><small>Last revised: June 21, 2010 at 20:43:18 GMT</small></p></td>
 <td align="right"><div class="copyright-footer"></div></td>
 </tr></table>
 <hr>


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk