From cad462387628f21c9569293038745c51365978ec Mon Sep 17 00:00:00 2001 From: Nick Thompson Date: Fri, 2 Nov 2018 13:45:45 -0600 Subject: [PATCH] Regenerate documentation. --- doc/html/boost_integer/cstdint.html | 2 +- .../boost_integer/extended_euclidean.html | 109 ++++++++++++++++++ doc/html/boost_integer/gcd_lcm.html | 90 +++++++-------- doc/html/boost_integer/history.html | 2 +- doc/html/boost_integer/integer.html | 8 +- doc/html/boost_integer/log2.html | 4 +- doc/html/boost_integer/mask.html | 10 +- doc/html/boost_integer/minmax.html | 4 +- doc/html/boost_integer/mod_inverse.html | 105 +++++++++++++++++ doc/html/boost_integer/traits.html | 4 +- doc/html/index.html | 46 +++++++- 11 files changed, 319 insertions(+), 65 deletions(-) create mode 100644 doc/html/boost_integer/extended_euclidean.html create mode 100644 doc/html/boost_integer/mod_inverse.html diff --git a/doc/html/boost_integer/cstdint.html b/doc/html/boost_integer/cstdint.html index cb0223f..5d2c1ba 100644 --- a/doc/html/boost_integer/cstdint.html +++ b/doc/html/boost_integer/cstdint.html @@ -3,7 +3,7 @@ Removed from library: Standard Integer Types - + diff --git a/doc/html/boost_integer/extended_euclidean.html b/doc/html/boost_integer/extended_euclidean.html new file mode 100644 index 0000000..e132901 --- /dev/null +++ b/doc/html/boost_integer/extended_euclidean.html @@ -0,0 +1,109 @@ + + + +Extended Euclidean Algorithm + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ + +
+ +

+ The extended Euclidean algorithm solves the integer relation mx + + ny = gcd(m, n) for + x and y. +

+
+
+ +
#include <boost/integer/extended_euclidean.hpp>
+
+namespace boost { namespace integer {
+
+template<class Z>
+struct euclidean_result_t {
+  Z gcd;
+  Z x;
+  Z y;
+};
+
+
+template<class Z>
+euclidean_result_t<Z> extended_euclidean(Z m, Z n);
+
+}}
+
+
+
+

+Usage +

+
int m = 12;
+int n = 15;
+auto res = extended_euclidean(m, n);
+
+int gcd = res.gcd;
+int x = res.x;
+int y = res.y;
+// mx + ny = gcd(m,n) should now hold
+
+

+ Unlike most of the library, the extended Euclidean algorithm requires C++11 + features. +

+
+
+ +

+ Wagstaff, Samuel S., The Joy of Factoring, Vol. 68. + American Mathematical Soc., 2013. +

+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost_integer/gcd_lcm.html b/doc/html/boost_integer/gcd_lcm.html index 097afc0..588b98f 100644 --- a/doc/html/boost_integer/gcd_lcm.html +++ b/doc/html/boost_integer/gcd_lcm.html @@ -3,11 +3,11 @@ Greatest Common Divisor and Least Common Multiple - + - + @@ -20,14 +20,14 @@

-PrevUpHomeNext +PrevUpHomeNext
-
namespace boost
 {
-namespace math
+namespace integer
 {
 
 template < typename IntegerType >
@@ -102,10 +102,10 @@
       Object
 
 

- Header: <boost/math/common_factor_rt.hpp> + Header: <boost/integer/common_factor_rt.hpp>

template < typename IntegerType >
-class boost::math::gcd_evaluator
+class boost::integer::gcd_evaluator
 {
 public:
    // Types
@@ -120,11 +120,11 @@
 };
 

- The boost::math::gcd_evaluator class template defines a function object class - to return the greatest common divisor of two integers. The template is parameterized - by a single type, called IntegerType here. This type should be a numeric - type that represents integers. The result of the function object is always - nonnegative, even if either of the operator arguments is negative. + The boost::integer::gcd_evaluator class template defines a function object + class to return the greatest common divisor of two integers. The template + is parameterized by a single type, called IntegerType here. This type should + be a numeric type that represents integers. The result of the function object + is always nonnegative, even if either of the operator arguments is negative.

This function object class template is used in the corresponding version @@ -144,10 +144,10 @@ Object

- Header: <boost/math/common_factor_rt.hpp> + Header: <boost/integer/common_factor_rt.hpp>

template < typename IntegerType >
-class boost::math::lcm_evaluator
+class boost::integer::lcm_evaluator
 {
 public:
    // Types
@@ -162,13 +162,13 @@
 };
 

- The boost::math::lcm_evaluator class template defines a function object class - to return the least common multiple of two integers. The template is parameterized - by a single type, called IntegerType here. This type should be a numeric - type that represents integers. The result of the function object is always - nonnegative, even if either of the operator arguments is negative. If the - least common multiple is beyond the range of the integer type, the results - are undefined. + The boost::integer::lcm_evaluator class template defines a function object + class to return the least common multiple of two integers. The template is + parameterized by a single type, called IntegerType here. This type should + be a numeric type that represents integers. The result of the function object + is always nonnegative, even if either of the operator arguments is negative. + If the least common multiple is beyond the range of the integer type, the + results are undefined.

This function object class template is used in the corresponding version @@ -188,13 +188,13 @@ Determination

- Header: <boost/math/common_factor_rt.hpp> + Header: <boost/integer/common_factor_rt.hpp>

template < typename IntegerType >
-constexpr IntegerType  boost::math::gcd( IntegerType const &a, IntegerType const &b );
+constexpr IntegerType  boost::integer::gcd( IntegerType const &a, IntegerType const &b );
 
 template < typename IntegerType >
-constexpr IntegerType  boost::math::lcm( IntegerType const &a, IntegerType const &b );
+constexpr IntegerType  boost::integer::lcm( IntegerType const &a, IntegerType const &b );
 
 template < typename IntegerType, typename... Args >
    constexpr IntegerType  gcd( IntegerType const &a, IntegerType const &b, Args const&... );
@@ -211,8 +211,8 @@
    lcm_range(I first, I last);
 

- The boost::math::gcd function template returns the greatest common (nonnegative) - divisor of the two integers passed to it. boost::math::gcd_range + The boost::integer::gcd function template returns the greatest common (nonnegative) + divisor of the two integers passed to it. boost::integer::gcd_range is the iteration of the above gcd algorithm over a range, returning the greatest common divisor of all the elements. The algorithm terminates when the gcd reaches unity or the end of the range. Thus it also returns the iterator @@ -222,7 +222,7 @@ to reach unity.

- The boost::math::lcm function template returns the least common (nonnegative) + The boost::integer::lcm function template returns the least common (nonnegative) multiple of the two integers passed to it. As with gcd, there are range and variadic versions of the function for more than 2 arguments.

@@ -249,17 +249,17 @@

- Header: <boost/math/common_factor_ct.hpp> + Header: <boost/integer/common_factor_ct.hpp>

typedef unspecified static_gcd_type;
 
 template < static_gcd_type Value1, static_gcd_type Value2 >
-struct boost::math::static_gcd : public mpl::integral_c<static_gcd_type, implementation_defined>
+struct boost::integer::static_gcd : public mpl::integral_c<static_gcd_type, implementation_defined>
 {
 };
 
 template < static_gcd_type Value1, static_gcd_type Value2 >
-struct boost::math::static_lcm : public mpl::integral_c<static_gcd_type, implementation_defined>
+struct boost::integer::static_lcm : public mpl::integral_c<static_gcd_type, implementation_defined>
 {
 };
 
@@ -271,8 +271,8 @@ long for some older compilers.

- The boost::math::static_gcd and boost::math::static_lcm class templates take - two value-based template parameters of the static_gcd_type + The boost::integer::static_gcd and boost::integer::static_lcm class templates + take two value-based template parameters of the static_gcd_type type and inherit from the type boost::mpl::integral_c. Inherited from the base class, they have a member value that is the greatest common factor or least common multiple, respectively, of the template arguments. @@ -283,7 +283,7 @@ Example -

#include <boost/math/common_factor.hpp>
+
#include <boost/integer/common_factor.hpp>
 #include <algorithm>
 #include <iterator>
 #include <iostream>
@@ -294,29 +294,29 @@
    using std::endl;
 
    cout << "The GCD and LCM of 6 and 15 are "
-   << boost::math::gcd(6, 15) << " and "
-   << boost::math::lcm(6, 15) << ", respectively."
+   << boost::integer::gcd(6, 15) << " and "
+   << boost::integer::lcm(6, 15) << ", respectively."
    << endl;
 
    cout << "The GCD and LCM of 8 and 9 are "
-   << boost::math::static_gcd<8, 9>::value
+   << boost::integer::static_gcd<8, 9>::value
    << " and "
-   << boost::math::static_lcm<8, 9>::value
+   << boost::integer::static_lcm<8, 9>::value
    << ", respectively." << endl;
 
    int  a[] = { 4, 5, 6 }, b[] = { 7, 8, 9 }, c[3];
-   std::transform( a, a + 3, b, c, boost::math::gcd_evaluator<int>() );
+   std::transform( a, a + 3, b, c, boost::integer::gcd_evaluator<int>() );
    std::copy( c, c + 3, std::ostream_iterator<int>(cout, " ") );
 }
 

- This header simply includes the headers <boost/math/common_factor_ct.hpp> - and <boost/math/common_factor_rt.hpp>. + This header simply includes the headers <boost/integer/common_factor_ct.hpp> + and <boost/integer/common_factor_rt.hpp>.

Note this is a legacy header: it used to contain the actual implementation, @@ -329,7 +329,7 @@ Demonstration Program

- The program common_factor_test.cpp + The program common_factor_test.cpp is a demonstration of the results from instantiating various examples of the run-time GCD and LCM function templates and the compile-time GCD and LCM class templates. (The run-time GCD and LCM class templates are tested @@ -344,7 +344,7 @@ The greatest common divisor and least common multiple functions are greatly used in some numeric contexts, including some of the other Boost libraries. Centralizing these functions to one header improves code factoring and eases - maintainence. + maintenance.

@@ -394,7 +394,7 @@
-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/boost_integer/history.html b/doc/html/boost_integer/history.html index 77257ba..544e5d7 100644 --- a/doc/html/boost_integer/history.html +++ b/doc/html/boost_integer/history.html @@ -3,7 +3,7 @@ History - + diff --git a/doc/html/boost_integer/integer.html b/doc/html/boost_integer/integer.html index 6dc60ef..65f2558 100644 --- a/doc/html/boost_integer/integer.html +++ b/doc/html/boost_integer/integer.html @@ -3,7 +3,7 @@ Integer Type Selection - + @@ -26,7 +26,7 @@ -
+
Synopsis
Easiest-to-Manipulate Types
@@ -353,10 +353,10 @@ { boost::int_t<24>::least my_var; // my_var has at least 24-bits //... - // This one is guarenteed not to be truncated: + // This one is guaranteed not to be truncated: boost::int_max_value_t<1000>::least my1000 = 1000; //... - // This one is guarenteed not to be truncated, and as fast + // This one is guaranteed not to be truncated, and as fast // to manipulate as possible, its size may be greater than // that of my1000: boost::int_max_value_t<1000>::fast my_fast1000 = 1000; diff --git a/doc/html/boost_integer/log2.html b/doc/html/boost_integer/log2.html index 19c1a21..685969c 100644 --- a/doc/html/boost_integer/log2.html +++ b/doc/html/boost_integer/log2.html @@ -3,7 +3,7 @@ Compile Time log2 Calculation - + @@ -26,7 +26,7 @@ -
+
Synopsis
Usage
Demonstration diff --git a/doc/html/boost_integer/mask.html b/doc/html/boost_integer/mask.html index 0d72e1e..030ace0 100644 --- a/doc/html/boost_integer/mask.html +++ b/doc/html/boost_integer/mask.html @@ -3,10 +3,10 @@ Integer Masks - + - + @@ -20,13 +20,13 @@
-PrevUpHomeNext +PrevUpHomeNext
-
+
Overview
Synopsis
Single @@ -374,7 +374,7 @@
-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/boost_integer/minmax.html b/doc/html/boost_integer/minmax.html index d67425f..d12ad1a 100644 --- a/doc/html/boost_integer/minmax.html +++ b/doc/html/boost_integer/minmax.html @@ -3,7 +3,7 @@ Compile time min/max calculation - + @@ -26,7 +26,7 @@ -
+
Synopsis
Usage
Example
diff --git a/doc/html/boost_integer/mod_inverse.html b/doc/html/boost_integer/mod_inverse.html new file mode 100644 index 0000000..abdffc9 --- /dev/null +++ b/doc/html/boost_integer/mod_inverse.html @@ -0,0 +1,105 @@ + + + +Modular Multiplicative Inverse + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ + +
+ +

+ The modular multiplicative inverse of a number a is + that number x which satisfies ax + = 1 mod p. A fast algorithm for computing modular multiplicative + inverses based on the extended Euclidean algorithm exists and is provided + by Boost. +

+
+
+ +
#include <boost/integer/mod_inverse.hpp>
+
+namespace boost { namespace integer {
+
+template<class Z>
+boost::optional<Z> mod_inverse(Z a, Z m);
+
+}}
+
+
+
+

+Usage +

+

+ Multiplicative modular inverses exist if and only if a + and m are coprime. So for example +

+
auto x = mod_inverse(2, 5);
+if (x)
+{
+    int should_be_three = x.value();
+}
+auto y = mod_inverse(2, 4);
+if (!y)
+{
+    std::cout << "There is no inverse of 2 mod 4\n";
+}
+
+
+
+ +

+ Wagstaff, Samuel S., The Joy of Factoring, Vol. 68. + American Mathematical Soc., 2013. +

+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost_integer/traits.html b/doc/html/boost_integer/traits.html index 76987ad..677eb23 100644 --- a/doc/html/boost_integer/traits.html +++ b/doc/html/boost_integer/traits.html @@ -3,7 +3,7 @@ Integer Traits - + @@ -26,7 +26,7 @@ -
+
Motivation
Synopsis
Description
diff --git a/doc/html/index.html b/doc/html/index.html index 040ad3e..5954497 100644 --- a/doc/html/index.html +++ b/doc/html/index.html @@ -3,7 +3,7 @@ Boost.Integer - + @@ -50,12 +50,14 @@
- +

Last revised: April 24, 2017 at 17:49:59 GMT

Last revised: November 02, 2018 at 19:38:28 GMT