|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r77605 - in sandbox/big_number/libs/multiprecision/doc: . html html/boost_multiprecision html/boost_multiprecision/map html/boost_multiprecision/perf html/boost_multiprecision/ref html/boost_multiprecision/tut
From: john_at_[hidden]
Date: 2012-03-28 13:26:23
Author: johnmaddock
Date: 2012-03-28 13:26:20 EDT (Wed, 28 Mar 2012)
New Revision: 77605
URL: http://svn.boost.org/trac/boost/changeset/77605
Log:
Fix typos / issue spotted by Paul Bristow.
Text files modified:
sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/intro.html | 27 ++++-
sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/map/todo.html | 6
sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/perf/float_performance.html | 2
sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/perf/int_real_world.html | 128 ++++++++++++++++++++++++++-
sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/perf/integer_performance.html | 2
sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/perf/rational_performance.html | 2
sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/perf/realworld.html | 2
sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/ref/backendconc.html | 182 +++++++++++++++++++++++++++++----------
sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/ref/mp_number.html | 8
sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/tut.html | 2
sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/tut/ints.html | 22 ++--
sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/tut/primetest.html | 13 +-
sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/tut/rational.html | 26 ++--
sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/tut/reals.html | 21 ++--
sandbox/big_number/libs/multiprecision/doc/html/index.html | 2
sandbox/big_number/libs/multiprecision/doc/multiprecision.qbk | 124 ++++++++++++++------------
16 files changed, 398 insertions(+), 171 deletions(-)
Modified: sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/intro.html
==============================================================================
--- sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/intro.html (original)
+++ sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/intro.html 2012-03-28 13:26:20 EDT (Wed, 28 Mar 2012)
@@ -18,21 +18,36 @@
<a name="boost_multiprecision.intro"></a><a class="link" href="intro.html" title="Introduction">Introduction</a>
</h2></div></div></div>
<p>
+ The Multiprecision Library provides <span class="emphasis"><em>User-defined</em></span> integer,
+ rational and floating-point C++ types which try to emulate as closely as practicable
+ the C++ built-in types, but provide for more range and precision. Depending
+ upon the number type, precision may be arbitrarily large (limited only by available
+ memory), fixed at compile time values, for example 50 decimal digits, or a
+ variable controlled at run-time by member functions. The types are expression-template-enabled
+ for better performance than naive user-defined types.
+ </p>
+<p>
The Multiprecision library comes in two distinct parts:
</p>
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
<li class="listitem">
- An expression-template-enabled front end <code class="computeroutput"><span class="identifier">mp_number</span></code>
+ An expression-template-enabled front-end <code class="computeroutput"><span class="identifier">mp_number</span></code>
that handles all the operator overloading, expression evaluation optimization,
and code reduction.
</li>
<li class="listitem">
- A selection of backends that implement the actual arithmetic operations,
- and need conform only to the reduced interface requirements of the front
- end.
+ A selection of back-ends that implement the actual arithmetic operations,
+ and need conform only to the reduced interface requirements of the front-end.
</li>
</ul></div>
<p>
+ Separation of front-end and back-end allows use of highly refined, but restricted
+ license libraries where possible, but provides Boost license alternatives for
+ users who must have a portable unconstrained license. Which is to say some
+ back-ends rely on 3rd party libraries, but a header-only Boost license version
+ is always available (if somewhat slower).
+ </p>
+<p>
The library is often used via one of the predefined typedefs: for example if
you wanted an arbitrary precision integer type using GMP
as the underlying implementation then you could use:
@@ -44,7 +59,7 @@
<p>
Alternatively, you can compose your own multiprecision type, by combining
<code class="computeroutput"><span class="identifier">mp_number</span></code> with one of the predefined
- backend types. For example, suppose you wanted a 300 decimal digit floating-point
+ back-end types. For example, suppose you wanted a 300 decimal digit floating-point
type based on the MPFR library. In
this case, there's no predefined typedef with that level of precision, so instead
we compose our own:
@@ -161,7 +176,7 @@
tend to be slower to compile than their simpler cousins, they're also harder
to debug (should you actually want to step through our code!), and rely on
compiler optimizations being turned on to give really good performance. Also,
- since the return type from expressions involving <code class="computeroutput"><span class="identifier">mp_number</span></code>'s
+ since the return type from expressions involving <code class="computeroutput"><span class="identifier">mp_number</span></code>s
is an "unmentionable implementation detail", you have to be careful
to cast the result of an expression to the actual number type when passing
an expression to a template function. For example, given:
Modified: sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/map/todo.html
==============================================================================
--- sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/map/todo.html (original)
+++ sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/map/todo.html 2012-03-28 13:26:20 EDT (Wed, 28 Mar 2012)
@@ -22,13 +22,13 @@
</p>
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
<li class="listitem">
- Add backend support for libdecNumber.
+ Add back-end support for libdecNumber.
</li>
<li class="listitem">
- Add an adapter backend for complex number types.
+ Add an adapter back-end for complex number types.
</li>
<li class="listitem">
- Add a backend for MPFR interval arithmetic.
+ Add a back-end for MPFR interval arithmetic.
</li>
<li class="listitem">
Add better multiplication routines (Karatsuba, FFT etc) to cpp_int_backend.
Modified: sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/perf/float_performance.html
==============================================================================
--- sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/perf/float_performance.html (original)
+++ sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/perf/float_performance.html 2012-03-28 13:26:20 EDT (Wed, 28 Mar 2012)
@@ -21,7 +21,7 @@
<p>
Note that these tests are carefully designed to test performance of the underlying
algorithms and not memory allocation or variable copying. As usual, performance
- results should be taken with a healthy dose of scepticsm, and real-world
+ results should be taken with a healthy dose of scepticism, and real-world
peformance may vary widely depending upon the specifics of the program. In
each table relative times are given first, with the best performer given
a score of 1. Total actual times are given in brackets, measured in seconds
Modified: sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/perf/int_real_world.html
==============================================================================
--- sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/perf/int_real_world.html (original)
+++ sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/perf/int_real_world.html 2012-03-28 13:26:20 EDT (Wed, 28 Mar 2012)
@@ -70,17 +70,129 @@
</p>
</td>
</tr>
+<tr>
+<td>
+ <p>
+ cpp_int
+ </p>
+ </td>
+<td>
+ <p>
+ 1.3612(0.465547s)
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ cpp_int (no Expression templates)
+ </p>
+ </td>
+<td>
+ <p>
+ 1.33286(0.455854s)
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ cpp_int (64-bit cache)
+ </p>
+ </td>
+<td>
+ <p>
+ 1.33134(0.455333s)
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ cpp_int (256-bit cache)
+ </p>
+ </td>
+<td>
+ <p>
+ 1.29367(0.442451s)
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ cpp_int (512-bit cache)
+ </p>
+ </td>
+<td>
+ <p>
+ 1.08821(0.37218s)
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ cpp_int (1024-bit cache)
+ </p>
+ </td>
+<td>
+ <p>
+ 1.07902(0.369037s)
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ mp_int1024_t
+ </p>
+ </td>
+<td>
+ <p>
+ 1.02616(0.35096s)
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ mp_int1024_t (no Expression templates)
+ </p>
+ </td>
+<td>
+ <p>
+ 1(0.342011s)
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ tom_int
+ </p>
+ </td>
+<td>
+ <p>
+ 3.74233(1.27992s)
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ tom_int (no Expression templates)
+ </p>
+ </td>
+<td>
+ <p>
+ 3.97646(1.35999s)
+ </p>
+ </td>
+</tr>
</tbody>
</table></div>
<p>
- [[cpp_int][1.3612(0.465547s)]] [[cpp_int (no Expression templates)][1.33286(0.455854s)]]
- [[cpp_int (64-bit cache)][1.33134(0.455333s)]] [[cpp_int (256-bit cache)][1.29367(0.442451s)]]
- [[cpp_int (512-bit cache)][1.08821(0.37218s)]] [[cpp_int (1024-bit cache)][1.07902(0.369037s)]]
- [[mp_int1024_t][1.02616(0.35096s)]] [[mp_int1024_t (no Expression templates)][1(0.342011s)]]
- [[tom_int][3.74233(1.27992s)]] [[tom_int (no Expression templates)][3.97646(1.35999s)]]
- ]
- </p>
-<p>
It's interesting to note that expression templates have little effect here
- perhaps because the actual expressions involved are relatively trivial
in this case - so the time taken for multiplication and division tends to
Modified: sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/perf/integer_performance.html
==============================================================================
--- sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/perf/integer_performance.html (original)
+++ sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/perf/integer_performance.html 2012-03-28 13:26:20 EDT (Wed, 28 Mar 2012)
@@ -21,7 +21,7 @@
<p>
Note that these tests are carefully designed to test performance of the underlying
algorithms and not memory allocation or variable copying. As usual, performance
- results should be taken with a healthy dose of scepticsm, and real-world
+ results should be taken with a healthy dose of scepticism, and real-world
peformance may vary widely depending upon the specifics of the program. In
each table relative times are given first, with the best performer given
a score of 1. Total actual times are given in brackets, measured in seconds
Modified: sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/perf/rational_performance.html
==============================================================================
--- sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/perf/rational_performance.html (original)
+++ sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/perf/rational_performance.html 2012-03-28 13:26:20 EDT (Wed, 28 Mar 2012)
@@ -21,7 +21,7 @@
<p>
Note that these tests are carefully designed to test performance of the underlying
algorithms and not memory allocation or variable copying. As usual, performance
- results should be taken with a healthy dose of scepticsm, and real-world
+ results should be taken with a healthy dose of scepticism, and real-world
peformance may vary widely depending upon the specifics of the program. In
each table relative times are given first, with the best performer given
a score of 1. Total actual times are given in brackets, measured in seconds
Modified: sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/perf/realworld.html
==============================================================================
--- sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/perf/realworld.html (original)
+++ sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/perf/realworld.html 2012-03-28 13:26:20 EDT (Wed, 28 Mar 2012)
@@ -23,7 +23,7 @@
cases for these functions. In each case the best performing library gets
a relative score of 1, with the total execution time given in brackets. The
first three libraries listed are the various floating point types provided
- by this library, while for comparison, two popular C++ frontends to MPFR ( mpfr_class
+ by this library, while for comparison, two popular C++ front-ends to MPFR ( mpfr_class
and mpreal) are
also shown.
</p>
Modified: sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/ref/backendconc.html
==============================================================================
--- sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/ref/backendconc.html (original)
+++ sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/ref/backendconc.html 2012-03-28 13:26:20 EDT (Wed, 28 Mar 2012)
@@ -740,7 +740,7 @@
</td>
<td>
<p>
- Copy constructor from a different backend type.
+ Copy constructor from a different back-end type.
</p>
</td>
</tr>
@@ -758,7 +758,7 @@
</td>
<td>
<p>
- Assignment operator from a different backend type.
+ Assignment operator from a different back-end type.
</p>
</td>
</tr>
@@ -2128,52 +2128,138 @@
</td>
<td>
<p>
- Returns the index of the least significant bit that is set.<code class="computeroutput">
- <span class="identifier">Only</span> <span class="identifier">required</span>
- <span class="identifier">when</span> </code>B<code class="computeroutput"> <span class="identifier">is</span> <span class="identifier">an</span>
- <span class="identifier">integer</span> <span class="identifier">type</span><span class="special">.]]</span> <span class="special">[[</span></code>eval_bit_test(cb,
- ui)<code class="computeroutput"><span class="special">][</span></code>bool<code class="computeroutput"><span class="special">][</span><span class="identifier">Returns</span>
- <span class="keyword">true</span> <span class="keyword">if</span>
- </code>cb<code class="computeroutput"> <span class="identifier">has</span> <span class="identifier">bit</span> </code>ui<code class="computeroutput"> <span class="identifier">set</span><span class="special">.</span> <span class="identifier">Only</span>
- <span class="identifier">required</span> <span class="identifier">when</span>
- </code>B<code class="computeroutput"> <span class="identifier">is</span> <span class="identifier">an</span>
- <span class="identifier">integer</span> <span class="identifier">type</span><span class="special">.]]</span> <span class="special">[[</span></code>eval_bit_set(b,
- ui)<code class="computeroutput"><span class="special">][</span></code>void<code class="computeroutput"><span class="special">][</span><span class="identifier">Sets</span>
- <span class="identifier">the</span> <span class="identifier">bit</span>
- <span class="identifier">at</span> <span class="identifier">index</span>
- </code>ui<code class="computeroutput"> <span class="identifier">in</span> </code>b<code class="computeroutput"><span class="special">.</span> <span class="identifier">Only</span>
- <span class="identifier">required</span> <span class="identifier">when</span>
- </code>B<code class="computeroutput"> <span class="identifier">is</span> <span class="identifier">an</span>
- <span class="identifier">integer</span> <span class="identifier">type</span><span class="special">.]]</span> <span class="special">[[</span></code>eval_bit_unset(b,
- ui)<code class="computeroutput"><span class="special">][</span></code>void<code class="computeroutput"><span class="special">][</span><span class="identifier">Unsets</span>
- <span class="identifier">the</span> <span class="identifier">bit</span>
- <span class="identifier">at</span> <span class="identifier">index</span>
- </code>ui<code class="computeroutput"> <span class="identifier">in</span> </code>b<code class="computeroutput"><span class="special">.</span> <span class="identifier">Only</span>
- <span class="identifier">required</span> <span class="identifier">when</span>
- </code>B<code class="computeroutput"> <span class="identifier">is</span> <span class="identifier">an</span>
- <span class="identifier">integer</span> <span class="identifier">type</span><span class="special">.]]</span> <span class="special">[[</span></code>eval_bit_flip(b,
- ui)<code class="computeroutput"><span class="special">][</span></code>void<code class="computeroutput"><span class="special">][</span><span class="identifier">Flips</span>
- <span class="identifier">the</span> <span class="identifier">bit</span>
- <span class="identifier">at</span> <span class="identifier">index</span>
- </code>ui<code class="computeroutput"> <span class="identifier">in</span> </code>b<code class="computeroutput"><span class="special">.</span> <span class="identifier">Only</span>
- <span class="identifier">required</span> <span class="identifier">when</span>
- </code>B<code class="computeroutput"> <span class="identifier">is</span> <span class="identifier">an</span>
- <span class="identifier">integer</span> <span class="identifier">type</span><span class="special">.]]</span> <span class="special">[[</span></code>eval_gcd(b,
- cb, cb2)<code class="computeroutput"><span class="special">][</span></code>void<code class="computeroutput"><span class="special">][</span><span class="identifier">Sets</span>
- </code>b<code class="computeroutput"> <span class="identifier">to</span> <span class="identifier">the</span>
- <span class="identifier">greatest</span> <span class="identifier">common</span>
- <span class="identifier">divisor</span> <span class="identifier">of</span>
- </code>cb<code class="computeroutput"> <span class="keyword">and</span> </code>cb2<code class="computeroutput"><span class="special">.</span> <span class="identifier">Only</span>
- <span class="identifier">required</span> <span class="identifier">when</span>
- </code>B<code class="computeroutput"> <span class="identifier">is</span> <span class="identifier">an</span>
- <span class="identifier">integer</span> <span class="identifier">type</span><span class="special">.]]</span> <span class="special">[[</span></code>eval_lcm(b,
- cb, cb2)<code class="computeroutput"><span class="special">][</span></code>void<code class="computeroutput"><span class="special">][</span><span class="identifier">Sets</span>
- </code>b<code class="computeroutput"> <span class="identifier">to</span> <span class="identifier">the</span>
- <span class="identifier">least</span> <span class="identifier">common</span>
- <span class="identifier">multiple</span> <span class="identifier">of</span>
- </code>cb<code class="computeroutput"> <span class="keyword">and</span> </code>cb2<code class="computeroutput"><span class="special">.</span> <span class="identifier">Only</span>
- <span class="identifier">required</span> <span class="identifier">when</span>
- </code>B` is an integer type.
+ Returns the index of the least significant bit that is set. Only
+ required when <code class="computeroutput"><span class="identifier">B</span></code>
+ is an integer type.
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">eval_bit_test</span><span class="special">(</span><span class="identifier">cb</span><span class="special">,</span>
+ <span class="identifier">ui</span><span class="special">)</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="computeroutput"><span class="keyword">bool</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ Returns true if <code class="computeroutput"><span class="identifier">cb</span></code>
+ has bit <code class="computeroutput"><span class="identifier">ui</span></code> set.
+ Only required when <code class="computeroutput"><span class="identifier">B</span></code>
+ is an integer type.
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">eval_bit_set</span><span class="special">(</span><span class="identifier">b</span><span class="special">,</span>
+ <span class="identifier">ui</span><span class="special">)</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="computeroutput"><span class="keyword">void</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ Sets the bit at index <code class="computeroutput"><span class="identifier">ui</span></code>
+ in <code class="computeroutput"><span class="identifier">b</span></code>. Only required
+ when <code class="computeroutput"><span class="identifier">B</span></code> is an integer
+ type.
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">eval_bit_unset</span><span class="special">(</span><span class="identifier">b</span><span class="special">,</span> <span class="identifier">ui</span><span class="special">)</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="computeroutput"><span class="keyword">void</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ Unsets the bit at index <code class="computeroutput"><span class="identifier">ui</span></code>
+ in <code class="computeroutput"><span class="identifier">b</span></code>. Only required
+ when <code class="computeroutput"><span class="identifier">B</span></code> is an integer
+ type.
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">eval_bit_flip</span><span class="special">(</span><span class="identifier">b</span><span class="special">,</span>
+ <span class="identifier">ui</span><span class="special">)</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="computeroutput"><span class="keyword">void</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ Flips the bit at index <code class="computeroutput"><span class="identifier">ui</span></code>
+ in <code class="computeroutput"><span class="identifier">b</span></code>. Only required
+ when <code class="computeroutput"><span class="identifier">B</span></code> is an integer
+ type.
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">eval_gcd</span><span class="special">(</span><span class="identifier">b</span><span class="special">,</span>
+ <span class="identifier">cb</span><span class="special">,</span>
+ <span class="identifier">cb2</span><span class="special">)</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="computeroutput"><span class="keyword">void</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ Sets <code class="computeroutput"><span class="identifier">b</span></code> to the greatest
+ common divisor of <code class="computeroutput"><span class="identifier">cb</span></code>
+ and <code class="computeroutput"><span class="identifier">cb2</span></code>. Only required
+ when <code class="computeroutput"><span class="identifier">B</span></code> is an integer
+ type.
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">eval_lcm</span><span class="special">(</span><span class="identifier">b</span><span class="special">,</span>
+ <span class="identifier">cb</span><span class="special">,</span>
+ <span class="identifier">cb2</span><span class="special">)</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="computeroutput"><span class="keyword">void</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ Sets <code class="computeroutput"><span class="identifier">b</span></code> to the least
+ common multiple of <code class="computeroutput"><span class="identifier">cb</span></code>
+ and <code class="computeroutput"><span class="identifier">cb2</span></code>. Only required
+ when <code class="computeroutput"><span class="identifier">B</span></code> is an integer
+ type.
</p>
</td>
</tr>
Modified: sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/ref/mp_number.html
==============================================================================
--- sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/ref/mp_number.html (original)
+++ sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/ref/mp_number.html 2012-03-28 13:26:20 EDT (Wed, 28 Mar 2012)
@@ -206,7 +206,7 @@
<dl>
<dt><span class="term">Backend</span></dt>
<dd><p>
- The actual arithmetic backend that does all the work.
+ The actual arithmetic back-end that does all the work.
</p></dd>
<dt><span class="term">ExpressionTemplates</span></dt>
<dd><p>
@@ -373,7 +373,7 @@
<span class="keyword">const</span> <span class="identifier">Backend</span><span class="special">&</span> <span class="identifier">backend</span><span class="special">()</span><span class="keyword">const</span><span class="special">;</span>
</pre>
<p>
- Returns the underlying backend instance used by <code class="computeroutput"><span class="special">*</span><span class="keyword">this</span></code>.
+ Returns the underlying back-end instance used by <code class="computeroutput"><span class="special">*</span><span class="keyword">this</span></code>.
</p>
<h5>
<a name="boost_multiprecision.ref.mp_number.h2"></a>
@@ -470,8 +470,8 @@
derived from them.
</p>
<p>
- It's down to the backend type to actually implement string conversion. However,
- the backends provided with this library support all of the iostream formatting
+ It's down to the back-end type to actually implement string conversion. However,
+ the back-ends provided with this library support all of the iostream formatting
flags, field width and precision settings.
</p>
<h5>
Modified: sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/tut.html
==============================================================================
--- sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/tut.html (original)
+++ sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/tut.html 2012-03-28 13:26:20 EDT (Wed, 28 Mar 2012)
@@ -26,7 +26,7 @@
</dl></div>
<p>
In order to use this library you need to make two choices: what kind of number
- do I want, and which backend do I want to perform the actual arithmetic?
+ do I want, and which back-end do I want to perform the actual arithmetic?
</p>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
Modified: sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/tut/ints.html
==============================================================================
--- sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/tut/ints.html (original)
+++ sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/tut/ints.html 2012-03-28 13:26:20 EDT (Wed, 28 Mar 2012)
@@ -18,7 +18,7 @@
<a name="boost_multiprecision.tut.ints"></a><a class="link" href="ints.html" title="Integer Types">Integer Types</a>
</h3></div></div></div>
<p>
- The following backends provide integer arithmetic:
+ The following back-ends provide integer arithmetic:
</p>
<div class="informaltable"><table class="table">
<colgroup>
@@ -119,7 +119,7 @@
</td>
<td>
<p>
- Very fast and efficient backend.
+ Very fast and efficient back-end.
</p>
</td>
<td>
@@ -152,7 +152,7 @@
</td>
<td>
<p>
- Public domain backend with no licence restrictions.
+ Public domain back-end with no licence restrictions.
</p>
</td>
<td>
@@ -200,9 +200,9 @@
<code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">multiprecision</span><span class="special">::</span><span class="identifier">mp_int256_t</span></code> or <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">multiprecision</span><span class="special">::</span><span class="identifier">mp_int512_t</span></code>.
</p>
<p>
- This backend is the "Swiss Army Knife" of integer types as it can
- represent both fixed and arbitrary precision integer types, and both signed
- and unsigned types. There are three template arguments:
+ This back-end is the "Swiss Army Knife" of integer types as it
+ can represent both fixed and arbitrary precision integer types, and both
+ signed and unsigned types. There are three template arguments:
</p>
<div class="variablelist">
<p class="title"><b></b></p>
@@ -237,7 +237,7 @@
</p>
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
<li class="listitem">
- Default constructed <code class="computeroutput"><span class="identifier">cpp_int_backend</span></code>'s
+ Default constructed <code class="computeroutput"><span class="identifier">cpp_int_backend</span></code>s
have the value zero.
</li>
<li class="listitem">
@@ -317,7 +317,7 @@
<span class="special">}}</span> <span class="comment">// namespaces</span>
</pre>
<p>
- The <code class="computeroutput"><span class="identifier">gmp_int</span></code> backend is used
+ The <code class="computeroutput"><span class="identifier">gmp_int</span></code> back-end is used
via the typedef <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">multiprecision</span><span class="special">::</span><span class="identifier">mpz_int</span></code>. It acts as a thin wrapper around
the GMP <code class="computeroutput"><span class="identifier">mpz_t</span></code>
to provide an integer type that is a drop-in replacement for the native C++
@@ -352,7 +352,7 @@
safely mix this type with existing code that uses GMP.
</li>
<li class="listitem">
- Default constructed <code class="computeroutput"><span class="identifier">gmp_int</span></code>'s
+ Default constructed <code class="computeroutput"><span class="identifier">gmp_int</span></code>s
have the value zero (this is GMP's default behavior).
</li>
<li class="listitem">
@@ -411,8 +411,8 @@
<span class="special">}}</span> <span class="comment">// namespaces</span>
</pre>
<p>
- The <code class="computeroutput"><span class="identifier">tommath_int</span></code> backend is
- used via the typedef <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">multiprecision</span><span class="special">::</span><span class="identifier">tom_int</span></code>.
+ The <code class="computeroutput"><span class="identifier">tommath_int</span></code> back-end
+ is used via the typedef <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">multiprecision</span><span class="special">::</span><span class="identifier">tom_int</span></code>.
It acts as a thin wrapper around the libtommath
<code class="computeroutput"><span class="identifier">tom_int</span></code> to provide an integer
type that is a drop-in replacement for the native C++ integer types, but
Modified: sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/tut/primetest.html
==============================================================================
--- sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/tut/primetest.html (original)
+++ sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/tut/primetest.html 2012-03-28 13:26:20 EDT (Wed, 28 Mar 2012)
@@ -33,17 +33,18 @@
These functions perform a Miller-Rabin test for primality, if the result
is <code class="computeroutput"><span class="keyword">false</span></code> then <span class="emphasis"><em>n</em></span>
is definitely composite, while if the result is <code class="computeroutput"><span class="keyword">true</span></code>
- then <span class="emphasis"><em>n</em></span> is prime with probability 0.25^trials. The algorithm
- used is straight out of Knuth Vol 2, which recomends 25 trials for a pretty
- strong likelyhood that <span class="emphasis"><em>n</em></span> is prime.
+ then <span class="emphasis"><em>n</em></span> is prime with probability <span class="emphasis"><em>0.25^trials</em></span>.
+ The algorithm used is straight out of Knuth Vol 2, which recomends 25 trials
+ for a pretty strong likelyhood that <span class="emphasis"><em>n</em></span> is prime.
</p>
<p>
The third optional argument is for a Uniform Random Number Generator from
Boost.Random. When not provided the <code class="computeroutput"><span class="identifier">mt19937</span></code>
generator is used. Note that when producing random primes then you should
- probably use a different random number generator to produce possible primes,
- than used internally for testing whether the value is prime. It also helps
- of course to seed the generators with some source of randomness.
+ probably use a different random number generator to produce candidate prime
+ numbers for testing, than is used internally by <code class="computeroutput"><span class="identifier">miller_rabin_test</span></code>
+ for determining whether the value is prime. It also helps of course to seed
+ the generators with some source of randomness.
</p>
<p>
The following example searches for a prime <code class="computeroutput"><span class="identifier">p</span></code>
Modified: sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/tut/rational.html
==============================================================================
--- sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/tut/rational.html (original)
+++ sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/tut/rational.html 2012-03-28 13:26:20 EDT (Wed, 28 Mar 2012)
@@ -18,7 +18,7 @@
<a name="boost_multiprecision.tut.rational"></a><a class="link" href="rational.html" title="Rational Number Types">Rational Number Types</a>
</h3></div></div></div>
<p>
- The following backends provide rational number arithmetic:
+ The following back-ends provide rational number arithmetic:
</p>
<div class="informaltable"><table class="table">
<colgroup>
@@ -85,7 +85,7 @@
</td>
<td>
<p>
- Very fast and efficient backend.
+ Very fast and efficient back-end.
</p>
</td>
<td>
@@ -182,13 +182,13 @@
</td>
<td>
<p>
- All C++ adapter that allows any inetger backend type to be used
+ All C++ adapter that allows any inetger back-end type to be used
as a rational type.
</p>
</td>
<td>
<p>
- Requires an underlying integer backend type.
+ Requires an underlying integer back-end type.
</p>
</td>
</tr>
@@ -241,7 +241,7 @@
<span class="special">}}</span> <span class="comment">// namespaces</span>
</pre>
<p>
- The <code class="computeroutput"><span class="identifier">gmp_rational</span></code> backend
+ The <code class="computeroutput"><span class="identifier">gmp_rational</span></code> back-end
is used via the typedef <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">multiprecision</span><span class="special">::</span><span class="identifier">mpq_rational</span></code>.
It acts as a thin wrapper around the GMP
<code class="computeroutput"><span class="identifier">mpq_t</span></code> to provide a rational
@@ -284,7 +284,7 @@
</p>
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
<li class="listitem">
- Default constructed <code class="computeroutput"><span class="identifier">mpq_rational</span></code>'s
+ Default constructed <code class="computeroutput"><span class="identifier">mpq_rational</span></code>s
have the value zero (this is the GMP
default behavior).
</li>
@@ -373,7 +373,7 @@
</p>
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
<li class="listitem">
- Default constructed <code class="computeroutput"><span class="identifier">cpp_rational</span></code>'s
+ Default constructed <code class="computeroutput"><span class="identifier">cpp_rational</span></code>s
have the value zero.
</li>
<li class="listitem">
@@ -419,7 +419,7 @@
<span class="special">}}</span> <span class="comment">// namespaces</span>
</pre>
<p>
- The <code class="computeroutput"><span class="identifier">tommath_rational</span></code> backend
+ The <code class="computeroutput"><span class="identifier">tommath_rational</span></code> back-end
is used via the typedef <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">multiprecision</span><span class="special">::</span><span class="identifier">tom_rational</span></code>.
It acts as a thin wrapper around <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">rational</span><span class="special"><</span><span class="identifier">tom_int</span><span class="special">></span></code> to provide a rational number type that
is a drop-in replacement for the native C++ number types, but with unlimited
@@ -443,7 +443,7 @@
</p>
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
<li class="listitem">
- Default constructed <code class="computeroutput"><span class="identifier">tom_rational</span></code>'s
+ Default constructed <code class="computeroutput"><span class="identifier">tom_rational</span></code>s
have the value zero (this the inherited Boost.Rational behavior).
</li>
<li class="listitem">
@@ -494,7 +494,7 @@
Boost.Rational</a>
</h5>
<p>
- All of the inetger types in this library can be used as template arguments
+ All of the integer types in this library can be used as template arguments
to <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">rational</span><span class="special"><</span><span class="identifier">IntType</span><span class="special">></span></code>.
</p>
<p>
@@ -514,11 +514,11 @@
</pre>
<p>
The class template <code class="computeroutput"><span class="identifier">rational_adapter</span></code>
- is a backend for <code class="computeroutput"><span class="identifier">mp_number</span></code>
- which converts any existing integer backend into a rational-number backend.
+ is a back-end for <code class="computeroutput"><span class="identifier">mp_number</span></code>
+ which converts any existing integer back-end into a rational-number back-end.
</p>
<p>
- So for example, given an integer backend type <code class="computeroutput"><span class="identifier">MyIntegerBackend</span></code>,
+ So for example, given an integer back-end type <code class="computeroutput"><span class="identifier">MyIntegerBackend</span></code>,
the use would be something like:
</p>
<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">mp_number</span><span class="special"><</span><span class="identifier">MyIntegerBackend</span><span class="special">></span> <span class="identifier">MyInt</span><span class="special">;</span>
Modified: sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/tut/reals.html
==============================================================================
--- sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/tut/reals.html (original)
+++ sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/tut/reals.html 2012-03-28 13:26:20 EDT (Wed, 28 Mar 2012)
@@ -18,7 +18,7 @@
<a name="boost_multiprecision.tut.reals"></a><a class="link" href="reals.html" title="Floating Point Numbers">Floating Point Numbers</a>
</h3></div></div></div>
<p>
- The following backends provide floating point arithmetic:
+ The following back-ends provide floating point arithmetic:
</p>
<div class="informaltable"><table class="table">
<colgroup>
@@ -85,7 +85,7 @@
</td>
<td>
<p>
- Very fast and efficient backend.
+ Very fast and efficient back-end.
</p>
</td>
<td>
@@ -118,7 +118,7 @@
</td>
<td>
<p>
- Very fast and efficient backend, with its own standard library
+ Very fast and efficient back-end, with its own standard library
implementation.
</p>
</td>
@@ -182,7 +182,7 @@
<span class="special">}}</span> <span class="comment">// namespaces</span>
</pre>
<p>
- The <code class="computeroutput"><span class="identifier">gmp_float</span></code> backend is
+ The <code class="computeroutput"><span class="identifier">gmp_float</span></code> back-end is
used in conjunction with <code class="computeroutput"><span class="identifier">mp_number</span></code>
: it acts as a thin wrapper around the GMP
<code class="computeroutput"><span class="identifier">mpf_t</span></code> to provide an real-number
@@ -196,7 +196,7 @@
to zero. The typedefs mpf_float_50, mpf_float_100, mpf_float_500, mpf_float_1000
provide arithmetic types at 50, 100, 500 and 1000 decimal digits precision
respectively. The typedef mpf_float provides a variable precision type whose
- precision can be controlled via the <code class="computeroutput"><span class="identifier">mp_number</span></code>'s
+ precision can be controlled via the <code class="computeroutput"><span class="identifier">mp_number</span></code>s
member functions.
</p>
<div class="note"><table border="0" summary="Note">
@@ -236,7 +236,7 @@
</p>
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
<li class="listitem">
- Default constructed <code class="computeroutput"><span class="identifier">gmp_float</span></code>'s
+ Default constructed <code class="computeroutput"><span class="identifier">gmp_float</span></code>s
have the value zero (this is the GMP
library's default behavior).
</li>
@@ -327,7 +327,7 @@
to zero. The typedefs mpfr_float_50, mpfr_float_100, mpfr_float_500, mpfr_float_1000
provide arithmetic types at 50, 100, 500 and 1000 decimal digits precision
respectively. The typedef mpfr_float provides a variable precision type whose
- precision can be controlled via the <code class="computeroutput"><span class="identifier">mp_number</span></code>'s
+ precision can be controlled via the <code class="computeroutput"><span class="identifier">mp_number</span></code>s
member functions.
</p>
<div class="note"><table border="0" summary="Note">
@@ -431,7 +431,7 @@
<span class="special">}}</span> <span class="comment">// namespaces</span>
</pre>
<p>
- The <code class="computeroutput"><span class="identifier">cpp_dec_float</span></code> backend
+ The <code class="computeroutput"><span class="identifier">cpp_dec_float</span></code> back-end
is used in conjunction with <code class="computeroutput"><span class="identifier">mp_number</span></code>:
It acts as an entirely C++ (header only and dependency free) real-number
type that is a drop-in replacement for the native C++ floating-point types,
@@ -440,7 +440,8 @@
<p>
Type <code class="computeroutput"><span class="identifier">cpp_dec_float</span></code> can be
used at fixed precision by specifying a non-zero <code class="computeroutput"><span class="identifier">Digits10</span></code>
- template parameter. The typedefs cpp_dec_float_50 and cpp_dec_float_100 provide
+ template parameter. The typedefs <code class="computeroutput"><span class="identifier">cpp_dec_float_50</span></code>
+ and <code class="computeroutput"><span class="identifier">cpp_dec_float_100</span></code> provide
arithmetic types at 50 and 100 decimal digits precision respectively.
</p>
<p>
@@ -452,7 +453,7 @@
</p>
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
<li class="listitem">
- Default constructed <code class="computeroutput"><span class="identifier">cpp_dec_float</span></code>'s
+ Default constructed <code class="computeroutput"><span class="identifier">cpp_dec_float</span></code>s
have a value of zero.
</li>
<li class="listitem">
Modified: sandbox/big_number/libs/multiprecision/doc/html/index.html
==============================================================================
--- sandbox/big_number/libs/multiprecision/doc/html/index.html (original)
+++ sandbox/big_number/libs/multiprecision/doc/html/index.html 2012-03-28 13:26:20 EDT (Wed, 28 Mar 2012)
@@ -66,7 +66,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: March 26, 2012 at 17:54:45 GMT</small></p></td>
+<td align="left"><p><small>Last revised: March 28, 2012 at 17:05:42 GMT</small></p></td>
<td align="right"><div class="copyright-footer"></div></td>
</tr></table>
<hr>
Modified: sandbox/big_number/libs/multiprecision/doc/multiprecision.qbk
==============================================================================
--- sandbox/big_number/libs/multiprecision/doc/multiprecision.qbk (original)
+++ sandbox/big_number/libs/multiprecision/doc/multiprecision.qbk 2012-03-28 13:26:20 EDT (Wed, 28 Mar 2012)
@@ -37,12 +37,24 @@
[section:intro Introduction]
+The Multiprecision Library provides ['User-defined] integer, rational and floating-point C++ types which
+try to emulate as closely as practicable the C++ built-in types, but provide for more range and
+precision. Depending upon the number type, precision may be arbitrarily large (limited only by available memory),
+fixed at compile time values, for example 50 decimal
+digits, or a variable controlled at run-time by member functions. The types are
+expression-template-enabled for better performance than naive user-defined types.
+
The Multiprecision library comes in two distinct parts:
-* An expression-template-enabled front end `mp_number`
+* An expression-template-enabled front-end `mp_number`
that handles all the operator overloading, expression evaluation optimization, and code reduction.
-* A selection of backends that implement the actual arithmetic operations, and need conform only to the
-reduced interface requirements of the front end.
+* A selection of back-ends that implement the actual arithmetic operations, and need conform only to the
+reduced interface requirements of the front-end.
+
+Separation of front-end and back-end allows use of highly refined, but restricted license libraries
+where possible, but provides Boost license alternatives for users who must have a portable
+unconstrained license. Which is to say some back-ends rely on 3rd party libraries, but a header-only Boost license version is always
+available (if somewhat slower).
The library is often used via one of the predefined typedefs: for example if you wanted an arbitrary precision
integer type using [gmp] as the underlying implementation then you could use:
@@ -52,7 +64,7 @@
boost::multiprecision::mpz_int myint; // Arbitrary precision integer type.
Alternatively, you can compose your own multiprecision type, by combining `mp_number` with one of the
-predefined backend types. For example, suppose you wanted a 300 decimal digit floating-point type
+predefined back-end types. For example, suppose you wanted a 300 decimal digit floating-point type
based on the [mpfr] library. In this case, there's no predefined typedef with that level of precision,
so instead we compose our own:
@@ -135,7 +147,7 @@
sadly though, all tricks like this have their downsides. For one thing, expression template libraries
like this one, tend to be slower to compile than their simpler cousins, they're also harder to debug
(should you actually want to step through our code!), and rely on compiler optimizations being turned
-on to give really good performance. Also, since the return type from expressions involving `mp_number`'s
+on to give really good performance. Also, since the return type from expressions involving `mp_number`s
is an "unmentionable implementation detail", you have to be careful to cast the result of an expression
to the actual number type when passing an expression to a template function. For example, given:
@@ -217,18 +229,18 @@
[section:tut Tutorial]
In order to use this library you need to make two choices: what kind of number do I want, and
-which backend do I want to perform the actual arithmetic?
+which back-end do I want to perform the actual arithmetic?
[section:ints Integer Types]
-The following backends provide integer arithmetic:
+The following back-ends provide integer arithmetic:
[table
[[Backend Type][Header][Radix][Dependencies][Pros][Cons]]
[[`cpp_int`][boost/multiprecision/cpp_int.hpp][2][None]
[Very versatile, Boost licenced, all C++ integer type which support both arbitrary precision and fixed precision integer types.][Slower than [gmp], though typically not as slow as [tommath]]]
-[[`gmp_int`][boost/multiprecision/gmp.hpp][2][[gmp]][Very fast and efficient backend.][Dependency on GNU licenced [gmp] library.]]
-[[`tom_int`][boost/multiprecision/tommath.hpp][2][[tommath]][Public domain backend with no licence restrictions.][Slower than [gmp].]]
+[[`gmp_int`][boost/multiprecision/gmp.hpp][2][[gmp]][Very fast and efficient back-end.][Dependency on GNU licenced [gmp] library.]]
+[[`tom_int`][boost/multiprecision/tommath.hpp][2][[tommath]][Public domain back-end with no licence restrictions.][Slower than [gmp].]]
]
[h4 cpp_int]
@@ -263,7 +275,7 @@
`boost::multiprecision::mp_uint512_t`, `boost::multiprecision::mp_int128_t`, `boost::multiprecision::mp_int256_t`
or `boost::multiprecision::mp_int512_t`.
-This backend is the "Swiss Army Knife" of integer types as it can represent both fixed and arbitrary precision
+This back-end is the "Swiss Army Knife" of integer types as it can represent both fixed and arbitrary precision
integer types, and both signed and unsigned types. There are three template arguments:
[variablelist
@@ -281,7 +293,7 @@
Things you should know when using this type:
-* Default constructed `cpp_int_backend`'s have the value zero.
+* Default constructed `cpp_int_backend`s have the value zero.
* Division by zero results in a `std::runtime_error` being thrown.
* Construction from a string that contains invalid non-numeric characters results in a `std::runtime_error` being thrown.
* Since the precision of `cpp_int_backend` is necessarily limited when the allocator parameter is void,
@@ -313,7 +325,7 @@
}} // namespaces
-The `gmp_int` backend is used via the typedef `boost::multiprecision::mpz_int`. It acts as a thin wrapper around the [gmp] `mpz_t`
+The `gmp_int` back-end is used via the typedef `boost::multiprecision::mpz_int`. It acts as a thin wrapper around the [gmp] `mpz_t`
to provide an integer type that is a drop-in replacement for the native C++ integer types, but with unlimited precision.
As well as the usual conversions from arithmetic and string types, type `mpz_int` is copy constructible and assignable from:
@@ -327,7 +339,7 @@
* No changes are made to the GMP library's global settings - so you can safely mix this type with
existing code that uses [gmp].
-* Default constructed `gmp_int`'s have the value zero (this is GMP's default behavior).
+* Default constructed `gmp_int`s have the value zero (this is GMP's default behavior).
* Formatted IO for this type does not support octal or hexadecimal notation for negative values,
as a result performing formatted output on this type when the argument is negative and either of the flags
`std::ios_base::oct` or `std::ios_base::hex` are set, will result in a `std::runtime_error` will be thrown.
@@ -349,7 +361,7 @@
}} // namespaces
-The `tommath_int` backend is used via the typedef `boost::multiprecision::tom_int`. It acts as a thin wrapper around the [tommath] `tom_int`
+The `tommath_int` back-end is used via the typedef `boost::multiprecision::tom_int`. It acts as a thin wrapper around the [tommath] `tom_int`
to provide an integer type that is a drop-in replacement for the native C++ integer types, but with unlimited precision.
Things you should know when using this type:
@@ -372,12 +384,12 @@
[section:reals Floating Point Numbers]
-The following backends provide floating point arithmetic:
+The following back-ends provide floating point arithmetic:
[table
[[Backend Type][Header][Radix][Dependencies][Pros][Cons]]
-[[`mpf_float<N>`][boost/multiprecision/gmp.hpp][2][[gmp]][Very fast and efficient backend.][Dependency on GNU licenced [gmp] library.]]
-[[`mpfr_float<N>`][boost/multiprecision/mpfr.hpp][2][[gmp] and [mpfr]][Very fast and efficient backend, with its own standard library implementation.][Dependency on GNU licenced [gmp] and [mpfr] libraries.]]
+[[`mpf_float<N>`][boost/multiprecision/gmp.hpp][2][[gmp]][Very fast and efficient back-end.][Dependency on GNU licenced [gmp] library.]]
+[[`mpfr_float<N>`][boost/multiprecision/mpfr.hpp][2][[gmp] and [mpfr]][Very fast and efficient back-end, with its own standard library implementation.][Dependency on GNU licenced [gmp] and [mpfr] libraries.]]
[[`cpp_dec_float<N>`][boost/multiprecision/cpp_dec_float.hpp][10][None][Header only, all C++ implementation. Boost licence.][Approximately 2x slower than the [mpfr] or [gmp] libraries.]]
]
@@ -396,7 +408,7 @@
}} // namespaces
-The `gmp_float` backend is used in conjunction with `mp_number` : it acts as a thin wrapper around the [gmp] `mpf_t`
+The `gmp_float` back-end is used in conjunction with `mp_number` : it acts as a thin wrapper around the [gmp] `mpf_t`
to provide an real-number type that is a drop-in replacement for the native C++ floating-point types, but with
much greater precision.
@@ -404,7 +416,7 @@
at variable precision by setting the template argument to zero. The typedefs mpf_float_50, mpf_float_100,
mpf_float_500, mpf_float_1000 provide arithmetic types at 50, 100, 500 and 1000 decimal digits precision
respectively. The typedef mpf_float provides a variable precision type whose precision can be controlled via the
-`mp_number`'s member functions.
+`mp_number`s member functions.
[note This type only provides standard library and `numeric_limits` support when the precision is fixed at compile time.]
@@ -418,7 +430,7 @@
Things you should know when using this type:
-* Default constructed `gmp_float`'s have the value zero (this is the [gmp] library's default behavior).
+* Default constructed `gmp_float`s have the value zero (this is the [gmp] library's default behavior).
* No changes are made to the [gmp] library's global settings, so this type can be safely mixed with
existing [gmp] code.
* It is not possible to round-trip objects of this type to and from a string and get back
@@ -458,7 +470,7 @@
at variable precision by setting the template argument to zero. The typedefs mpfr_float_50, mpfr_float_100,
mpfr_float_500, mpfr_float_1000 provide arithmetic types at 50, 100, 500 and 1000 decimal digits precision
respectively. The typedef mpfr_float provides a variable precision type whose precision can be controlled via the
-`mp_number`'s member functions.
+`mp_number`s member functions.
[note This type only provides `numeric_limits` support when the precision is fixed at compile time.]
@@ -495,19 +507,19 @@
}} // namespaces
-The `cpp_dec_float` backend is used in conjunction with `mp_number`: It acts as an entirely C++ (header only and dependency free)
+The `cpp_dec_float` back-end is used in conjunction with `mp_number`: It acts as an entirely C++ (header only and dependency free)
real-number type that is a drop-in replacement for the native C++ floating-point types, but with
much greater precision.
Type `cpp_dec_float` can be used at fixed precision by specifying a non-zero `Digits10` template parameter.
-The typedefs cpp_dec_float_50 and cpp_dec_float_100 provide arithmetic types at 50 and 100 decimal digits precision
+The typedefs `cpp_dec_float_50` and `cpp_dec_float_100` provide arithmetic types at 50 and 100 decimal digits precision
respectively.
There is full standard library and `numeric_limits` support available for this type.
Things you should know when using this type:
-* Default constructed `cpp_dec_float`'s have a value of zero.
+* Default constructed `cpp_dec_float`s have a value of zero.
* The radix of this type is 10. As a result it can behave subtly differently from base-2 types.
* It is not possible to round-trip this type to and from a string and get back to exactly the same value
(this is a result of the type having some hidden internal guard digits).
@@ -522,14 +534,14 @@
[section:rational Rational Number Types]
-The following backends provide rational number arithmetic:
+The following back-ends provide rational number arithmetic:
[table
[[Backend Type][Header][Radix][Dependencies][Pros][Cons]]
-[[`gmp_rational`][boost/multiprecision/gmp.hpp][2][[gmp]][Very fast and efficient backend.][Dependency on GNU licenced [gmp] library.]]
+[[`gmp_rational`][boost/multiprecision/gmp.hpp][2][[gmp]][Very fast and efficient back-end.][Dependency on GNU licenced [gmp] library.]]
[[`cpp_rational`][boost/multiprecision/cpp_int.hpp][2][None][An all C++ Boost-licenced implementation.][Slower than [gmp].]]
[[`tommath_rational`][boost/multiprecision/tommath.hpp][2][[tommath]][All C/C++ implementation that's Boost Software Licence compatible.][Slower than [gmp].]]
-[[`rational_adapter`][boost/multiprecision/rational_adapter.hpp][N/A][none][All C++ adapter that allows any inetger backend type to be used as a rational type.][Requires an underlying integer backend type.]]
+[[`rational_adapter`][boost/multiprecision/rational_adapter.hpp][N/A][none][All C++ adapter that allows any inetger back-end type to be used as a rational type.][Requires an underlying integer back-end type.]]
[[`boost::rational`][boost/rational.hpp][N/A][None][A C++ rational number type that can used with any `mp_number` integer type.][The expression templates used by `mp_number` end up being "hidden" inside `boost::rational`: performance may well suffer as a result.]]
]
@@ -543,7 +555,7 @@
}} // namespaces
-The `gmp_rational` backend is used via the typedef `boost::multiprecision::mpq_rational`. It acts as a thin wrapper around the [gmp] `mpq_t`
+The `gmp_rational` back-end is used via the typedef `boost::multiprecision::mpq_rational`. It acts as a thin wrapper around the [gmp] `mpq_t`
to provide a rational number type that is a drop-in replacement for the native C++ number types, but with unlimited precision.
As well as the usual conversions from arithmetic and string types, instances of `mp_number<gmp_rational>` are copy constructible
@@ -565,7 +577,7 @@
Things you should know when using this type:
-* Default constructed `mpq_rational`'s have the value zero (this is the [gmp] default behavior).
+* Default constructed `mpq_rational`s have the value zero (this is the [gmp] default behavior).
* Division by zero results in a hardware exception inside the [gmp] library.
* No changes are made to the [gmp] library's global settings, so this type can coexist with existing
[gmp] code.
@@ -602,7 +614,7 @@
Things you should know when using this type:
-* Default constructed `cpp_rational`'s have the value zero.
+* Default constructed `cpp_rational`s have the value zero.
* Division by zero results in a `std::rumtime_error` being thrown.
[h5 Example:]
@@ -618,7 +630,7 @@
}} // namespaces
-The `tommath_rational` backend is used via the typedef `boost::multiprecision::tom_rational`. It acts as a thin wrapper around
+The `tommath_rational` back-end is used via the typedef `boost::multiprecision::tom_rational`. It acts as a thin wrapper around
`boost::rational<tom_int>`
to provide a rational number type that is a drop-in replacement for the native C++ number types, but with unlimited precision.
@@ -634,7 +646,7 @@
Things you should know when using this type:
-* Default constructed `tom_rational`'s have the value zero (this the inherited Boost.Rational behavior).
+* Default constructed `tom_rational`s have the value zero (this the inherited Boost.Rational behavior).
* Division by zero results in a `boost::bad_rational` exception being thrown (see the rational number library's docs for more information).
* No changes are made to [tommath]'s global state, so this type can safely coexist with other [tommath] code.
* Performance of this type has been found to be pretty poor - this need further investigation - but it appears that Boost.Rational
@@ -646,7 +658,7 @@
[h4 Use With Boost.Rational]
-All of the inetger types in this library can be used as template arguments to `boost::rational<IntType>`.
+All of the integer types in this library can be used as template arguments to `boost::rational<IntType>`.
Note that using the library in this way largely negates the effect of the expression templates in `mp_number`.
@@ -659,10 +671,10 @@
}}
-The class template `rational_adapter` is a backend for `mp_number` which converts any existing integer backend
-into a rational-number backend.
+The class template `rational_adapter` is a back-end for `mp_number` which converts any existing integer back-end
+into a rational-number back-end.
-So for example, given an integer backend type `MyIntegerBackend`, the use would be something like:
+So for example, given an integer back-end type `MyIntegerBackend`, the use would be something like:
typedef mp_number<MyIntegerBackend> MyInt;
typedef mp_number<rational_adapter<MyIntegerBackend> > MyRational;
@@ -719,13 +731,13 @@
bool miller_rabin_test(const mp_number<Backend, ExpressionTemplates>& n, unsigned trials);
These functions perform a Miller-Rabin test for primality, if the result is `false` then /n/ is definitely composite,
-while if the result is `true` then /n/ is prime with probability 0.25^trials. The algorithm used is straight out of
+while if the result is `true` then /n/ is prime with probability ['0.25^trials]. The algorithm used is straight out of
Knuth Vol 2, which recomends 25 trials for a pretty strong likelyhood that /n/ is prime.
The third optional argument is for a Uniform Random Number Generator from Boost.Random. When not provided the `mt19937`
generator is used. Note that when producing random primes then you should probably use a different random number generator
-to produce possible primes, than used internally for testing whether the value is prime. It also helps of course to seed the
-generators with some source of randomness.
+to produce candidate prime numbers for testing, than is used internally by `miller_rabin_test` for determining
+whether the value is prime. It also helps of course to seed the generators with some source of randomness.
The following example searches for a prime `p` for which `(p-1)/2` is also probably prime:
@@ -918,7 +930,7 @@
Class `mp_number` has two template arguments:
[variablelist
-[[Backend][The actual arithmetic backend that does all the work.]]
+[[Backend][The actual arithmetic back-end that does all the work.]]
[[ExpressionTemplates][A boolean value: when true, then expression templates are enabled, otherwise they are disabled.]]
]
@@ -1023,7 +1035,7 @@
Backend& backend();
const Backend& backend()const;
-Returns the underlying backend instance used by `*this`.
+Returns the underlying back-end instance used by `*this`.
[h4 Non-member operators]
@@ -1083,7 +1095,7 @@
These operators provided formatted input-output operations on `mp_number` types, and expression templates derived from them.
-It's down to the backend type to actually implement string conversion. However, the backends provided with
+It's down to the back-end type to actually implement string conversion. However, the back-ends provided with
this library support all of the iostream formatting flags, field width and precision settings.
[h4 Non-member standard library function support]
@@ -1299,8 +1311,8 @@
[table Optional Requirements on the Backend Type
[[Expression][Returns][Comments]]
-[[`B(b2)`][`B`][Copy constructor from a different backend type.]]
-[[`b = b2`][`b&`][Assignment operator from a different backend type.]]
+[[`B(b2)`][`B`][Copy constructor from a different back-end type.]]
+[[`b = b2`][`b&`][Assignment operator from a different back-end type.]]
[[`assign_components(b, a, a)`][`void`][Assigns to `b` the two components in the following arguments.
Only applies to rational and complex number types.]]
[[`assign_components(b, b2, b2)`][`void`][Assigns to `b` the two components in the following arguments.
@@ -1389,13 +1401,13 @@
[[`eval_atan2(b, cb, cb2)`][`void`][Performs the equivalent operation to `std::atan` on arguments `cb` and `cb2`, and store the result in `b`. Only required when `B` is an floating-point type.]]
[[`eval_qr(cb, cb2, b, b2)`][`void`][Sets `b` to the result of `cb / cb2` and `b2` to the result of `cb % cb2`. Only required when `B` is an integer type.]]
[[`eval_integer_modulus(cb, ui)`][`unsigned`][Returns the result of `cb % ui`. Only required when `B` is an integer type.]]
-[[`eval_lsb(cb)`][`unsigned`][Returns the index of the least significant bit that is set.` Only required when `B` is an integer type.]]
-[[`eval_bit_test(cb, ui)`][`bool`][Returns true if `cb` has bit `ui` set. Only required when `B` is an integer type.]]
+[[`eval_lsb(cb)`][`unsigned`][Returns the index of the least significant bit that is set. Only required when `B` is an integer type.]]
+[[`eval_bit_test(cb, ui)`][`bool`][Returns true if `cb` has bit `ui` set. Only required when `B` is an integer type.]]
[[`eval_bit_set(b, ui)`][`void`][Sets the bit at index `ui` in `b`. Only required when `B` is an integer type.]]
[[`eval_bit_unset(b, ui)`][`void`][Unsets the bit at index `ui` in `b`. Only required when `B` is an integer type.]]
[[`eval_bit_flip(b, ui)`][`void`][Flips the bit at index `ui` in `b`. Only required when `B` is an integer type.]]
-[[`eval_gcd(b, cb, cb2)`][`void`][Sets `b` to the greatest common divisor of `cb` and `cb2`. Only required when `B` is an integer type.]]
-[[`eval_lcm(b, cb, cb2)`][`void`][Sets `b` to the least common multiple of `cb` and `cb2`. Only required when `B` is an integer type.]]
+[[`eval_gcd(b, cb, cb2)`][`void`][Sets `b` to the greatest common divisor of `cb` and `cb2`. Only required when `B` is an integer type.]]
+[[`eval_lcm(b, cb, cb2)`][`void`][Sets `b` to the least common multiple of `cb` and `cb2`. Only required when `B` is an integer type.]]
]
[note
@@ -1413,7 +1425,7 @@
These tests test the total time taken to execute all of Boost.Math's test cases for these functions.
In each case the best performing library gets a relative score of 1, with the total execution time
given in brackets. The first three libraries listed are the various floating point types provided
-by this library, while for comparison, two popular C++ frontends to [mpfr] ([mpfr_class] and [mpreal])
+by this library, while for comparison, two popular C++ front-ends to [mpfr] ([mpfr_class] and [mpreal])
are also shown.
Test code was compiled with Microsoft Visual Studio 2010 with all optimisations
@@ -1452,7 +1464,7 @@
[table
[[Integer Type][Relative (and Absolute) Times]]
[[mpz_int][1.08279(0.370326s)]]
-[[mpz_int (no Expression templates)][1.1702(0.400222s)]]]
+[[mpz_int (no Expression templates)][1.1702(0.400222s)]]
[[cpp_int][1.3612(0.465547s)]]
[[cpp_int (no Expression templates)][1.33286(0.455854s)]]
[[cpp_int (64-bit cache)][1.33134(0.455333s)]]
@@ -1476,7 +1488,7 @@
Note that these tests are carefully designed to test performance of the underlying algorithms
and not memory allocation or variable copying. As usual, performance results should be taken
-with a healthy dose of scepticsm, and real-world peformance may vary widely depending upon the
+with a healthy dose of scepticism, and real-world peformance may vary widely depending upon the
specifics of the program. In each table relative times are given first, with the best performer
given a score of 1. Total actual times are given in brackets, measured in seconds for 500000
operations.
@@ -1546,7 +1558,7 @@
Note that these tests are carefully designed to test performance of the underlying algorithms
and not memory allocation or variable copying. As usual, performance results should be taken
-with a healthy dose of scepticsm, and real-world peformance may vary widely depending upon the
+with a healthy dose of scepticism, and real-world peformance may vary widely depending upon the
specifics of the program. In each table relative times are given first, with the best performer
given a score of 1. Total actual times are given in brackets, measured in seconds for 500000
operations.
@@ -1703,7 +1715,7 @@
Note that these tests are carefully designed to test performance of the underlying algorithms
and not memory allocation or variable copying. As usual, performance results should be taken
-with a healthy dose of scepticsm, and real-world peformance may vary widely depending upon the
+with a healthy dose of scepticism, and real-world peformance may vary widely depending upon the
specifics of the program. In each table relative times are given first, with the best performer
given a score of 1. Total actual times are given in brackets, measured in seconds for 500000
operations.
@@ -1771,9 +1783,9 @@
More a list of what ['could] be done, rather than what ['should] be done (which may be a much smaller list!).
-* Add backend support for libdecNumber.
-* Add an adapter backend for complex number types.
-* Add a backend for MPFR interval arithmetic.
+* Add back-end support for libdecNumber.
+* Add an adapter back-end for complex number types.
+* Add a back-end for MPFR interval arithmetic.
* Add better multiplication routines (Karatsuba, FFT etc) to cpp_int_backend.
* Add assembly level routines to cpp_int_backend.
* Add an all C++ binary floating point type.
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