Changeset 63929


Ignore:
Timestamp:
Jul 12, 2010, 8:57:38 PM (8 years ago)
Author:
murilov
Message:

round_power_2.hpp renamed to round_pow2
Fixed documentation
Fixed bits_and_ints.hpp forwarder
Changed the round_pow2.hpp's functions

Location:
sandbox/SOC/2010/bits_and_ints
Files:
1 added
1 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • sandbox/SOC/2010/bits_and_ints/boost/integer/bits_and_ints.hpp

    r63775 r63929  
    2323#include <boost/integer/static_same_sign.hpp>
    2424#include <boost/integer/pop_count.hpp>
     25#include <boost/integer/static_pop_count.hpp>
    2526#include <boost/integer/interleave.hpp>
    2627#include <boost/integer/count_trailing_zeros.hpp>
     28#include <boost/integer/static_count_trailing_zeros.hpp>
    2729#include <boost/integer/clear_least_bit_set.hpp>
     30#include <boost/integer/static_clear_least_bit_set.hpp>
    2831#include <boost/integer/swap.hpp>
    2932#include <boost/integer/safe_avg.hpp>
    30 #include <boost/integer/round_power_2.hpp>
     33#include <boost/integer/static_safe_avg.hpp>
     34#include <boost/integer/round_pow2.hpp>
     35#include <boost/integer/isign.hpp>
     36#include <boost/integer/static_isign.hpp>
    3137#include <boost/integer/is_integral_constant.hpp>
    3238#include <boost/integer/static_abs.hpp>
    3339#include <boost/integer/static_gcd.hpp>
    3440#include <boost/integer/static_lcm.hpp>
    35 
    3641#endif
  • sandbox/SOC/2010/bits_and_ints/libs/integer/doc/bits_and_ints.qbk

    r63881 r63929  
    476476
    477477[section Round to Power of 2 functions]
    478 This function rounds up and down integral values to the next power of 2.
     478This function rounds up and down positive integral values to the next power of 2.
    479479The `ceil_pow2` function rounds up and `floor_pow2` function rounds down.
    480 These functions are defined on [@../../../../boost/integer/round_power_2.hpp <boost/integer/round_power_2.hpp>]
     480These functions are defined on [@../../../../boost/integer/round_pow2.hpp <boost/integer/round_pow2.hpp>]
    481481
    482482[section Synopsis]
     
    487487[endsect]
    488488
    489 *[*Requires: ] `T` must be convertible to `uint8_t` or  `uint16_t` or `uint32_t` or `uint64_t`.
     489*[*Requires: ] `T` must be an integral type and `value` must be positive. If `value` is negative, the result is
     490undefined.
    490491
    491492*[*Returns: ]
     
    592593[endsect]
    593594
    594 [section:bin_utils Binary Utilities]
    595 The header [@../../../../boost/integer/bin_utils.hpp <boost/integer/bin_utils.hpp>] cotains some metafunctions to handle binary data.
     595[section:bit_utils Binary Utilities]
     596The header [@../../../../boost/integer/bit_utils.hpp <boost/integer/bit_utils.hpp>] cotains some metafunctions to handle binary data.
    596597All the metafunctions have an member varible named `value` where will be the result.
    597598
     
    600601        namespace boost
    601602        {
     603       
     604        // Compile-time version
    602605               
    603606        // Sets the bit `pos' in data
     
    632635       
    633636        } // mpl
     637       
     638        // Runtime version
     639        template <typename T>
     640        inline T set_bit(T data, unsigned char pos);
     641
     642        template <typename T>
     643        inline T clear_bit(T data, unsigned char pos);
     644
     645        template <typename T>
     646        inline T flip_bit(T data, unsigned char pos);
     647               
     648        template <typename T>
     649        inline bool test_bit(T data, unsigned char pos);
    634650               
    635651        } // boost
     
    710726
    711727[endsect]
    712 [endsect]
    713 
    714 [endsect]
     728
     729[section Runtime version]
     730
     731For all runtime functions, all remarks and requirement are equals to the `static_`-prefixed version.
     732
     733[endsect]
     734
     735[endsect]
     736
     737[endsect]
  • sandbox/SOC/2010/bits_and_ints/libs/integer/doc/html/boost_integer/bits_and_ints.html

    r63881 r63929  
    5151<dt><span class="section"><a href="bits_and_ints.html#boost_integer.bits_and_ints.mpl_greatest_common_divisor_">MPL
    5252      Greatest Common Divisor </a></span></dt>
    53 <dt><span class="section"><a href="bits_and_ints.html#boost_integer.bits_and_ints.bin_utils"> Binary Utilities</a></span></dt>
     53<dt><span class="section"><a href="bits_and_ints.html#boost_integer.bits_and_ints.bit_utils"> Binary Utilities</a></span></dt>
    5454</dl></div>
    5555<div class="section" title="Overview">
     
    11091109<div class="toc"><dl><dt><span class="section"><a href="bits_and_ints.html#boost_integer.bits_and_ints.round_to_power_of_2_functions.synopsis">Synopsis</a></span></dt></dl></div>
    11101110<p>
    1111         This function rounds up and down integral values to the next power of 2.
    1112         The <code class="computeroutput"><span class="identifier">ceil_pow2</span></code> function rounds
    1113         up and <code class="computeroutput"><span class="identifier">floor_pow2</span></code> function
    1114         rounds down. These functions are defined on <a href="../../../../../boost/integer/round_power_2.hpp" target="_top">&lt;boost/integer/round_power_2.hpp&gt;</a>
     1111        This function rounds up and down positive integral values to the next power
     1112        of 2. The <code class="computeroutput"><span class="identifier">ceil_pow2</span></code> function
     1113        rounds up and <code class="computeroutput"><span class="identifier">floor_pow2</span></code>
     1114        function rounds down. These functions are defined on <a href="../../../../../boost/integer/round_pow2.hpp" target="_top">&lt;boost/integer/round_pow2.hpp&gt;</a>
    11151115      </p>
    11161116<div class="section" title="Synopsis">
     
    11251125<li class="listitem">
    11261126<span class="bold"><strong>Requires: </strong></span><code class="computeroutput"><span class="identifier">T</span></code>
    1127           must be convertible to <code class="computeroutput"><span class="identifier">uint8_t</span></code>
    1128           or <code class="computeroutput"><span class="identifier">uint16_t</span></code> or <code class="computeroutput"><span class="identifier">uint32_t</span></code> or <code class="computeroutput"><span class="identifier">uint64_t</span></code>.
     1127          must be an integral type and <code class="computeroutput"><span class="identifier">value</span></code>
     1128          must be positive. If <code class="computeroutput"><span class="identifier">value</span></code>
     1129          is negative, the result is undefined.
    11291130        </li>
    11301131<li class="listitem">
     
    13211322<div class="section" title="Binary Utilities">
    13221323<div class="titlepage"><div><div><h3 class="title">
    1323 <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>
     1324<a name="boost_integer.bits_and_ints.bit_utils"></a><a class="link" href="bits_and_ints.html#boost_integer.bits_and_ints.bit_utils" title="Binary Utilities"> Binary Utilities</a>
    13241325</h3></div></div></div>
    13251326<div class="toc"><dl>
    1326 <dt><span class="section"><a href="bits_and_ints.html#boost_integer.bits_and_ints.bin_utils.synopsis">Synopsis</a></span></dt>
    1327 <dt><span class="section"><a href="bits_and_ints.html#boost_integer.bits_and_ints.bin_utils.template_class__static_set_bit____and__mpl__set_bit_">Template
     1327<dt><span class="section"><a href="bits_and_ints.html#boost_integer.bits_and_ints.bit_utils.synopsis">Synopsis</a></span></dt>
     1328<dt><span class="section"><a href="bits_and_ints.html#boost_integer.bits_and_ints.bit_utils.template_class__static_set_bit____and__mpl__set_bit_">Template
    13281329        Class <code class="computeroutput"><span class="identifier">static_set_bit</span><span class="special">&lt;&gt;</span></code>
    13291330        and <code class="computeroutput"><span class="identifier">mpl</span><span class="special">::</span><span class="identifier">set_bit</span></code></a></span></dt>
    1330 <dt><span class="section"><a href="bits_and_ints.html#boost_integer.bits_and_ints.bin_utils.template_class__mpl__clear_bit____and__static_clear_bit___">Template
     1331<dt><span class="section"><a href="bits_and_ints.html#boost_integer.bits_and_ints.bit_utils.template_class__mpl__clear_bit____and__static_clear_bit___">Template
    13311332        Class <code class="computeroutput"><span class="identifier">mpl</span><span class="special">::</span><span class="identifier">clear_bit</span><span class="special">&lt;&gt;</span></code>
    13321333        and <code class="computeroutput"><span class="identifier">static_clear_bit</span><span class="special">&lt;&gt;</span></code></a></span></dt>
    1333 <dt><span class="section"><a href="bits_and_ints.html#boost_integer.bits_and_ints.bin_utils.template_class__mpl__test_bit__and__static_test_bit___">Template
     1334<dt><span class="section"><a href="bits_and_ints.html#boost_integer.bits_and_ints.bit_utils.template_class__mpl__test_bit__and__static_test_bit___">Template
    13341335        Class <code class="computeroutput"><span class="identifier">mpl</span><span class="special">::</span><span class="identifier">test_bit</span></code> and <code class="computeroutput"><span class="identifier">static_test_bit</span><span class="special">&lt;&gt;</span></code></a></span></dt>
    1335 <dt><span class="section"><a href="bits_and_ints.html#boost_integer.bits_and_ints.bin_utils.template_class__mpl__flip_bit____and__static_flip_bit___">Template
     1336<dt><span class="section"><a href="bits_and_ints.html#boost_integer.bits_and_ints.bit_utils.template_class__mpl__flip_bit____and__static_flip_bit___">Template
    13361337        Class <code class="computeroutput"><span class="identifier">mpl</span><span class="special">::</span><span class="identifier">flip_bit</span><span class="special">&lt;&gt;</span></code>
    13371338        and <code class="computeroutput"><span class="identifier">static_flip_bit</span><span class="special">&lt;&gt;</span></code></a></span></dt>
     1339<dt><span class="section"><a href="bits_and_ints.html#boost_integer.bits_and_ints.bit_utils.runtime_version">Runtime
     1340        version</a></span></dt>
    13381341</dl></div>
    13391342<p>
    1340         The header <a href="../../../../../boost/integer/bin_utils.hpp" target="_top">&lt;boost/integer/bin_utils.hpp&gt;</a>
     1343        The header <a href="../../../../../boost/integer/bit_utils.hpp" target="_top">&lt;boost/integer/bit_utils.hpp&gt;</a>
    13411344        cotains some metafunctions to handle binary data. All the metafunctions have
    13421345        an member varible named <code class="computeroutput"><span class="identifier">value</span></code>
     
    13451348<div class="section" title="Synopsis">
    13461349<div class="titlepage"><div><div><h4 class="title">
    1347 <a name="boost_integer.bits_and_ints.bin_utils.synopsis"></a><a class="link" href="bits_and_ints.html#boost_integer.bits_and_ints.bin_utils.synopsis" title="Synopsis">Synopsis</a>
     1350<a name="boost_integer.bits_and_ints.bit_utils.synopsis"></a><a class="link" href="bits_and_ints.html#boost_integer.bits_and_ints.bit_utils.synopsis" title="Synopsis">Synopsis</a>
    13481351</h4></div></div></div>
    13491352<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span>
    13501353<span class="special">{</span>
    1351        
     1354
     1355<span class="comment">// Compile-time version
     1356</span>
    13521357<span class="comment">// Sets the bit `pos' in data
    13531358</span><span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">,</span> <span class="identifier">T</span> <span class="identifier">data</span><span class="special">,</span> <span class="keyword">unsigned</span> <span class="keyword">char</span> <span class="identifier">pos</span><span class="special">&gt;</span>
     
    13811386
    13821387<span class="special">}</span> <span class="comment">// mpl
    1383 </span>
     1388</span>
     1389<span class="comment">// Runtime verion
     1390</span><span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">&gt;</span>
     1391<span class="keyword">inline</span> <span class="identifier">T</span> <span class="identifier">set_bit</span><span class="special">(</span><span class="identifier">T</span> <span class="identifier">data</span><span class="special">,</span> <span class="keyword">unsigned</span> <span class="keyword">char</span> <span class="identifier">pos</span><span class="special">);</span>
     1392
     1393<span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">&gt;</span>
     1394<span class="keyword">inline</span> <span class="identifier">T</span> <span class="identifier">clear_bit</span><span class="special">(</span><span class="identifier">T</span> <span class="identifier">data</span><span class="special">,</span> <span class="keyword">unsigned</span> <span class="keyword">char</span> <span class="identifier">pos</span><span class="special">);</span>
     1395
     1396<span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">&gt;</span>
     1397<span class="keyword">inline</span> <span class="identifier">T</span> <span class="identifier">flip_bit</span><span class="special">(</span><span class="identifier">T</span> <span class="identifier">data</span><span class="special">,</span> <span class="keyword">unsigned</span> <span class="keyword">char</span> <span class="identifier">pos</span><span class="special">);</span>
     1398       
     1399<span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">&gt;</span>
     1400<span class="keyword">inline</span> <span class="keyword">bool</span> <span class="identifier">test_bit</span><span class="special">(</span><span class="identifier">T</span> <span class="identifier">data</span><span class="special">,</span> <span class="keyword">unsigned</span> <span class="keyword">char</span> <span class="identifier">pos</span><span class="special">);</span>
     1401       
    13841402<span class="special">}</span> <span class="comment">// boost
    13851403</span></pre>
     
    13871405<div class="section" title="Template Class static_set_bit&lt;&gt; and mpl::set_bit">
    13881406<div class="titlepage"><div><div><h4 class="title">
    1389 <a name="boost_integer.bits_and_ints.bin_utils.template_class__static_set_bit____and__mpl__set_bit_"></a><a class="link" href="bits_and_ints.html#boost_integer.bits_and_ints.bin_utils.template_class__static_set_bit____and__mpl__set_bit_" title="Template Class static_set_bit&lt;&gt; and mpl::set_bit">Template
     1407<a name="boost_integer.bits_and_ints.bit_utils.template_class__static_set_bit____and__mpl__set_bit_"></a><a class="link" href="bits_and_ints.html#boost_integer.bits_and_ints.bit_utils.template_class__static_set_bit____and__mpl__set_bit_" title="Template Class static_set_bit&lt;&gt; and mpl::set_bit">Template
    13901408        Class <code class="computeroutput"><span class="identifier">static_set_bit</span><span class="special">&lt;&gt;</span></code>
    13911409        and <code class="computeroutput"><span class="identifier">mpl</span><span class="special">::</span><span class="identifier">set_bit</span></code></a>
     
    14241442<div class="section" title="Template Class mpl::clear_bit&lt;&gt; and static_clear_bit&lt;&gt;">
    14251443<div class="titlepage"><div><div><h4 class="title">
    1426 <a name="boost_integer.bits_and_ints.bin_utils.template_class__mpl__clear_bit____and__static_clear_bit___"></a><a class="link" href="bits_and_ints.html#boost_integer.bits_and_ints.bin_utils.template_class__mpl__clear_bit____and__static_clear_bit___" title="Template Class mpl::clear_bit&lt;&gt; and static_clear_bit&lt;&gt;">Template
     1444<a name="boost_integer.bits_and_ints.bit_utils.template_class__mpl__clear_bit____and__static_clear_bit___"></a><a class="link" href="bits_and_ints.html#boost_integer.bits_and_ints.bit_utils.template_class__mpl__clear_bit____and__static_clear_bit___" title="Template Class mpl::clear_bit&lt;&gt; and static_clear_bit&lt;&gt;">Template
    14271445        Class <code class="computeroutput"><span class="identifier">mpl</span><span class="special">::</span><span class="identifier">clear_bit</span><span class="special">&lt;&gt;</span></code>
    14281446        and <code class="computeroutput"><span class="identifier">static_clear_bit</span><span class="special">&lt;&gt;</span></code></a>
     
    14611479<div class="section" title="Template Class mpl::test_bit and static_test_bit&lt;&gt;">
    14621480<div class="titlepage"><div><div><h4 class="title">
    1463 <a name="boost_integer.bits_and_ints.bin_utils.template_class__mpl__test_bit__and__static_test_bit___"></a><a class="link" href="bits_and_ints.html#boost_integer.bits_and_ints.bin_utils.template_class__mpl__test_bit__and__static_test_bit___" title="Template Class mpl::test_bit and static_test_bit&lt;&gt;">Template
     1481<a name="boost_integer.bits_and_ints.bit_utils.template_class__mpl__test_bit__and__static_test_bit___"></a><a class="link" href="bits_and_ints.html#boost_integer.bits_and_ints.bit_utils.template_class__mpl__test_bit__and__static_test_bit___" title="Template Class mpl::test_bit and static_test_bit&lt;&gt;">Template
    14641482        Class <code class="computeroutput"><span class="identifier">mpl</span><span class="special">::</span><span class="identifier">test_bit</span></code> and <code class="computeroutput"><span class="identifier">static_test_bit</span><span class="special">&lt;&gt;</span></code></a>
    14651483</h4></div></div></div>
     
    14971515<div class="section" title="Template Class mpl::flip_bit&lt;&gt; and static_flip_bit&lt;&gt;">
    14981516<div class="titlepage"><div><div><h4 class="title">
    1499 <a name="boost_integer.bits_and_ints.bin_utils.template_class__mpl__flip_bit____and__static_flip_bit___"></a><a class="link" href="bits_and_ints.html#boost_integer.bits_and_ints.bin_utils.template_class__mpl__flip_bit____and__static_flip_bit___" title="Template Class mpl::flip_bit&lt;&gt; and static_flip_bit&lt;&gt;">Template
     1517<a name="boost_integer.bits_and_ints.bit_utils.template_class__mpl__flip_bit____and__static_flip_bit___"></a><a class="link" href="bits_and_ints.html#boost_integer.bits_and_ints.bit_utils.template_class__mpl__flip_bit____and__static_flip_bit___" title="Template Class mpl::flip_bit&lt;&gt; and static_flip_bit&lt;&gt;">Template
    15001518        Class <code class="computeroutput"><span class="identifier">mpl</span><span class="special">::</span><span class="identifier">flip_bit</span><span class="special">&lt;&gt;</span></code>
    15011519        and <code class="computeroutput"><span class="identifier">static_flip_bit</span><span class="special">&lt;&gt;</span></code></a>
     
    15311549</span><span class="keyword">bool</span> <span class="identifier">new_value</span> <span class="special">=</span> <span class="identifier">flip_bit</span><span class="special">&lt;</span><span class="keyword">int</span><span class="special">,</span> <span class="number">10</span><span class="special">,</span> <span class="number">2</span><span class="special">&gt;::</span><span class="identifier">value</span><span class="special">;</span>
    15321550</pre>
     1551</div>
     1552<div class="section" title="Runtime version">
     1553<div class="titlepage"><div><div><h4 class="title">
     1554<a name="boost_integer.bits_and_ints.bit_utils.runtime_version"></a><a class="link" href="bits_and_ints.html#boost_integer.bits_and_ints.bit_utils.runtime_version" title="Runtime version">Runtime
     1555        version</a>
     1556</h4></div></div></div>
     1557<p>
     1558          For all runtime functions, all remarks and requirement are equals to the
     1559          <code class="computeroutput"><span class="identifier">static_</span></code>-prefixed version.
     1560        </p>
    15331561</div>
    15341562</div>
  • sandbox/SOC/2010/bits_and_ints/libs/integer/doc/html/boost_integer/history.html

    r63881 r63929  
    2727</h2></div></div></div>
    2828<a name="boost_integer.history.1_42_0"></a><h5>
    29 <a name="id36200325"></a>
     29<a name="id36200658"></a>
    3030      <a class="link" href="history.html#boost_integer.history.1_42_0">1.42.0</a>
    3131    </h5>
     
    5656</ul></div>
    5757<a name="boost_integer.history.1_32_0"></a><h5>
    58 <a name="id36200445"></a>
     58<a name="id36200778"></a>
    5959      <a class="link" href="history.html#boost_integer.history.1_32_0">1.32.0</a>
    6060    </h5>
  • sandbox/SOC/2010/bits_and_ints/libs/integer/doc/html/index.html

    r63881 r63929  
    256256</div>
    257257<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
    258 <td align="left"><p><small>Last revised: July 11, 2010 at 17:24:10 GMT</small></p></td>
     258<td align="left"><p><small>Last revised: July 12, 2010 at 20:50:00 GMT</small></p></td>
    259259<td align="right"><div class="copyright-footer"></div></td>
    260260</tr></table>
Note: See TracChangeset for help on using the changeset viewer.