diff --git a/doc/gcd/math-gcd.qbk b/doc/gcd/math-gcd.qbk index e6c32a322..e1bc4d729 100644 --- a/doc/gcd/math-gcd.qbk +++ b/doc/gcd/math-gcd.qbk @@ -1,250 +1,10 @@ [mathpart gcd_lcm Integer Utilities (Greatest Common Divisor and Least Common Multiple)] -[section Introduction] +This code has now been moved to Boost.Integer, please see [@http://www.boost.org/doc/libs/release/libs/integer/doc/html/index.html here]. -The class and function templates in `` -provide both run-time and compile-time evaluation of the greatest common divisor -(GCD) or least common multiple (LCM) of two integers. -These facilities are useful for many numeric-oriented generic -programming problems. - -[endsect] [/section Introduction] - -[section Synopsis] - - namespace boost - { - namespace math - { - - template < typename IntegerType > - class gcd_evaluator; - template < typename IntegerType > - class lcm_evaluator; - - template < typename IntegerType > - IntegerType gcd( IntegerType const &a, IntegerType const &b ); - template < typename ForwardIterator > - std::pair::value_type, I> gcd_range(I first, I last); - template < typename IntegerType > - IntegerType lcm( IntegerType const &a, IntegerType const &b ); - - typedef ``['see-below]`` static_gcd_type; - - template < static_gcd_type Value1, static_gcd_type Value2 > - struct static_gcd; - template < static_gcd_type Value1, static_gcd_type Value2 > - struct static_lcm; - - } - } - -[endsect] [/section Introduction] - -[section GCD Function Object] - -[*Header: ] [@../../../../boost/math/common_factor_rt.hpp ] - - template < typename IntegerType > - class boost::math::gcd_evaluator - { - public: - // Types - typedef IntegerType result_type; - typedef IntegerType first_argument_type; - typedef IntegerType second_argument_type; - - // Function object interface - result_type operator ()( first_argument_type const &a, - second_argument_type const &b ) const; - }; - -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. - -This function object class template is used in the corresponding version of -the GCD function template. If a numeric type wants to customize evaluations -of its greatest common divisors, then the type should specialize on the -`gcd_evaluator` class template. - -[endsect] [/section GCD Function Object] - -[section LCM Function Object] - -[*Header: ] [@../../../../boost/math/common_factor_rt.hpp ] - - template < typename IntegerType > - class boost::math::lcm_evaluator - { - public: - // Types - typedef IntegerType result_type; - typedef IntegerType first_argument_type; - typedef IntegerType second_argument_type; - - // Function object interface - result_type operator ()( first_argument_type const &a, - second_argument_type const &b ) const; - }; - -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. - -This function object class template is used in the corresponding version -of the LCM function template. If a numeric type wants to customize -evaluations of its least common multiples, then the type should -specialize on the `lcm_evaluator` class template. - -[endsect] [/section LCM Function Object] - -[section:run_time Run-time GCD & LCM Determination] - -[*Header: ] [@../../../../boost/math/common_factor_rt.hpp ] - - template < typename IntegerType > - IntegerType boost::math::gcd( IntegerType const &a, IntegerType const &b ); - - template < typename ForwardIterator > - std::pair::value_type, I> gcd_range(I first, I last); - - template < typename IntegerType > - IntegerType boost::math::lcm( IntegerType const &a, IntegerType const &b ); - -The `boost::math::gcd` function template returns the greatest common -(nonnegative) divisor of the two integers passed to it. -`boost::math::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 after the last element inspected because this may not be -equal to the end of the range. -The boost::math::lcm function template returns the least common -(nonnegative) multiple of the two integers passed to it. -The function templates are parameterized on the function arguments' -IntegerType, which is also the return type. Internally, these function -templates use an object of the corresponding version of the -`gcd_evaluator` and `lcm_evaluator` class templates, respectively. - -[endsect] [/section:run_time Run-time GCD & LCM Determination] - -[section:compile_time Compile-time GCD and LCM determination] - -[*Header: ] [@../../../../boost/math/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 - { - }; - - template < static_gcd_type Value1, static_gcd_type Value2 > - struct boost::math::static_lcm : public mpl::integral_c - { - }; - -The type `static_gcd_type` is the widest unsigned-integer-type that is supported -for use in integral-constant-expressions by the compiler. Usually this -the same type as `boost::uintmax_t`, but may fall back to being `unsigned 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] 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. -A compile-time error will occur if the least common multiple -is beyond the range of `static_gcd_type`. - -[h3 Example] - - #include - #include - #include - #include - - int main() - { - using std::cout; - 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." - << endl; - - cout << "The GCD and LCM of 8 and 9 are " - << boost::math::static_gcd<8, 9>::value - << " and " - << boost::math::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() ); - std::copy( c, c + 3, std::ostream_iterator(cout, " ") ); - } - -[endsect] [/section:compile_time Compile time GCD and LCM determination] - -[section:gcd_header Header ] - -This header simply includes the headers -[@../../../../boost/math/common_factor_ct.hpp ] -and [@../../../../boost/math/common_factor_rt.hpp ]. - -[note This is a legacy header: it used to contain the actual implementation, -but the compile-time and run-time facilities -were moved to separate headers (since they were independent of each other).] - -[endsect] [/section:gcd_header Header ] - -[section:demo Demonstration Program] - -The program [@../../../../libs/math/test/common_factor_test.cpp 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 indirectly through -the run-time function templates.) - -[endsect] [/section:demo Demonstration Program] - -[section Rationale] - -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. - -[endsect] [/section Rationale] - -[section:gcd_history History] - -* 13 May 2013 Moved into main Boost.Math Quickbook documentation. -* 17 Dec 2005: Converted documentation to Quickbook Format. -* 2 Jul 2002: Compile-time and run-time items separated to new headers. -* 7 Nov 2001: Initial version - -[endsect] [/section:gcd_history History] - -[section:gcd_credits Credits] - -The author of the Boost compilation of GCD and LCM computations is -Daryle Walker. The code was prompted by existing code hiding in the -implementations of Paul Moore's rational library and Steve Cleary's -pool library. The code had updates by Helmut Zeisel. - -[endsect] [/section:gcd_credits Credits] +Note that for the time being the headers ``, `` and `` will continue to exist +and redirect to the moved headers. [endmathpart] [/mathpart gcd_lcm Integer Utilities (Greatest Common Divisor and Least Common Multiple)] diff --git a/doc/html/backgrounders.html b/doc/html/backgrounders.html index a737262d5..c525226ee 100644 --- a/doc/html/backgrounders.html +++ b/doc/html/backgrounders.html @@ -4,8 +4,8 @@ Chapter 17. Backgrounders - - + + diff --git a/doc/html/constants.html b/doc/html/constants.html index 458711d4e..c1167aa83 100644 --- a/doc/html/constants.html +++ b/doc/html/constants.html @@ -4,8 +4,8 @@ Chapter 4. Mathematical Constants - - + + diff --git a/doc/html/cstdfloat.html b/doc/html/cstdfloat.html index aa19b76ad..19b93219c 100644 --- a/doc/html/cstdfloat.html +++ b/doc/html/cstdfloat.html @@ -4,8 +4,8 @@ Chapter 3. Specified-width floating-point typedefs - - + + diff --git a/doc/html/dist.html b/doc/html/dist.html index 0a6867f72..ac216738f 100644 --- a/doc/html/dist.html +++ b/doc/html/dist.html @@ -4,8 +4,8 @@ Chapter 5. Statistical Distributions and Functions - - + + diff --git a/doc/html/extern_c.html b/doc/html/extern_c.html index 73dc3a36d..d841e23f7 100644 --- a/doc/html/extern_c.html +++ b/doc/html/extern_c.html @@ -4,8 +4,8 @@ Chapter 7. TR1 and C99 external "C" Functions - - + + diff --git a/doc/html/gcd_lcm.html b/doc/html/gcd_lcm.html index 0afa8c533..937b9ec70 100644 --- a/doc/html/gcd_lcm.html +++ b/doc/html/gcd_lcm.html @@ -4,10 +4,10 @@ Chapter 11. Integer Utilities (Greatest Common Divisor and Least Common Multiple) - - + + - + @@ -20,27 +20,20 @@

-PrevUpHomeNext +PrevUpHomeNext

Chapter 11. Integer Utilities (Greatest Common Divisor and Least Common Multiple)

- +

+ This code has now been moved to Boost.Integer, please see here. +

+

+ Note that for the time being the headers <boost/math/common_factor.hpp>, + <boost/math/common_factor_ct.hpp> and + <boost/math/common_factor_rt.hpp> will + continue to exist and redirect to the moved headers. +

@@ -55,7 +48,7 @@

-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/index.html b/doc/html/index.html index 2c33cf18d..08732a864 100644 --- a/doc/html/index.html +++ b/doc/html/index.html @@ -1,10 +1,10 @@ -Math Toolkit 2.5.1 +Math Toolkit 2.5.2 - + @@ -22,7 +22,7 @@ @@ -711,7 +708,6 @@
  • @@ -1260,7 +1256,6 @@
  • C99 and C++ TR1 C-style Functions

  • C99 and TR1 C Functions Overview

  • History and What's New

  • -
  • Known Issues, and TODO List

  • Noncentral T Distribution

  • Sinus Cardinal and Hyperbolic Sinus Cardinal Functions Overview

  • TR1 C Functions Quick Reference

  • @@ -1315,10 +1310,6 @@
  • -

    gcd

    - -
  • -
  • get

    A B C D E F G H I L M N O P Q R S T U W

    diff --git a/doc/html/indexes/s03.html b/doc/html/indexes/s03.html index 68f35b4c5..1b45ecfca 100644 --- a/doc/html/indexes/s03.html +++ b/doc/html/indexes/s03.html @@ -4,7 +4,7 @@ Typedef Index - + @@ -24,7 +24,7 @@

    -Typedef Index

    +Typedef Index

    A B C D E F G H I L N O P R S T U V W

    diff --git a/doc/html/indexes/s04.html b/doc/html/indexes/s04.html index a81605ea5..cf01c41b7 100644 --- a/doc/html/indexes/s04.html +++ b/doc/html/indexes/s04.html @@ -4,7 +4,7 @@ Macro Index - + @@ -24,7 +24,7 @@

    -Macro Index

    +Macro Index

    B F

    diff --git a/doc/html/indexes/s05.html b/doc/html/indexes/s05.html index c5db07bd1..963477183 100644 --- a/doc/html/indexes/s05.html +++ b/doc/html/indexes/s05.html @@ -4,7 +4,7 @@ Index - + @@ -23,7 +23,7 @@

    -Index

    +Index

    2 4 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

    @@ -1583,10 +1583,6 @@
  • -

    Comparing the means of two samples with the Students-t test

    - -
  • -
  • Comparison of Cube Root Finding Algorithms

    • double

    • @@ -1625,13 +1621,6 @@
  • -

    Compile-time GCD and LCM determination

    - -
  • -
  • Compilers

  • @@ -2021,7 +2008,6 @@
  • @@ -2078,7 +2064,6 @@
  • C99 and TR1 C Functions Overview

  • Error Logs For Error Rate Tables

  • Error rates for cyl_neumann (integer orders)

  • -
  • Known Issues, and TODO List

  • TR1 C Functions Quick Reference

  • @@ -2095,7 +2080,6 @@
  • @@ -3216,7 +3200,6 @@
  • C99 C Functions

  • Calculating confidence intervals on the mean with the Students-t distribution

  • Compile Time Power of a Runtime Base

  • -
  • Compile-time GCD and LCM determination

  • Complements are supported too - and when to use them

  • Computing the Fifth Root

  • Conceptual Requirements for Distribution Types

  • @@ -3702,7 +3685,6 @@
  • C99 and C++ TR1 C-style Functions

  • C99 and TR1 C Functions Overview

  • History and What's New

  • -
  • Known Issues, and TODO List

  • Noncentral T Distribution

  • Sinus Cardinal and Hyperbolic Sinus Cardinal Functions Overview

  • TR1 C Functions Quick Reference

  • @@ -3795,14 +3777,6 @@
  • -

    gcd

    - -
  • -
  • -

    GCD Function Object

    - -
  • -
  • Generalizing to Compute the nth root

    • accuracy

    • @@ -4375,7 +4349,6 @@
      • data

      • expression

      • -
      • less

      • performance

      • scale

      • variance

      • @@ -4618,11 +4591,6 @@
        • accuracy

        • by

        • -
        • cyl_bessel_j

        • -
        • cyl_bessel_j_prime

        • -
        • cyl_neumann

        • -
        • cyl_neumann_prime

        • -
        • functions

        • J

        • K

        • Lanczos approximation

        • @@ -4739,14 +4707,6 @@
        • laplace_distribution

        • -

          lcm

          - -
        • -
        • -

          LCM Function Object

          - -
        • -
        • ldexp

        • @@ -4801,13 +4761,6 @@
        • -

          less

          - -
        • -
        • lgamma

          • C99 and C++ TR1 C-style Functions

          • @@ -5576,10 +5529,8 @@
          • Computing the Fifth Root

          • Continued Fraction Evaluation

          • Finding the Cubed Root With and Without Derivatives

          • -
          • GCD Function Object

          • Generalizing to Compute the nth root

          • Graphing, Profiling, and Generating Test Data for Special Functions

          • -
          • LCM Function Object

          • Locating Function Minima using Brent's algorithm

          • Series Evaluation

          • Termination Condition Functors

          • @@ -6701,9 +6652,7 @@
          • conj

          • cylindrical

          • cylindrospherical

          • -
          • gcd

          • l1

          • -
          • lcm

          • multipolar

          • norm

          • semipolar

          • diff --git a/doc/html/internals.html b/doc/html/internals.html index 878571dc6..469d9f988 100644 --- a/doc/html/internals.html +++ b/doc/html/internals.html @@ -4,8 +4,8 @@ Chapter 13. Internal Details: Series, Rationals and Continued Fractions, Testing, and Development Tools - - + + diff --git a/doc/html/inverse_complex.html b/doc/html/inverse_complex.html index de4c20d3d..672028829 100644 --- a/doc/html/inverse_complex.html +++ b/doc/html/inverse_complex.html @@ -4,8 +4,8 @@ Chapter 8. Complex Number Functions - - + + diff --git a/doc/html/math_toolkit/acknowledgement.html b/doc/html/math_toolkit/acknowledgement.html index 881151e5e..02bf874c8 100644 --- a/doc/html/math_toolkit/acknowledgement.html +++ b/doc/html/math_toolkit/acknowledgement.html @@ -4,7 +4,7 @@ Acknowledgements - + diff --git a/doc/html/math_toolkit/acknowledgements.html b/doc/html/math_toolkit/acknowledgements.html index ae8a56a1d..111213705 100644 --- a/doc/html/math_toolkit/acknowledgements.html +++ b/doc/html/math_toolkit/acknowledgements.html @@ -4,7 +4,7 @@ Acknowledgements - + diff --git a/doc/html/math_toolkit/acos.html b/doc/html/math_toolkit/acos.html index 4668323a4..ab1f53983 100644 --- a/doc/html/math_toolkit/acos.html +++ b/doc/html/math_toolkit/acos.html @@ -4,7 +4,7 @@ acos - + diff --git a/doc/html/math_toolkit/acosh.html b/doc/html/math_toolkit/acosh.html index b34221e1a..7ad597431 100644 --- a/doc/html/math_toolkit/acosh.html +++ b/doc/html/math_toolkit/acosh.html @@ -4,7 +4,7 @@ acosh - + diff --git a/doc/html/math_toolkit/airy.html b/doc/html/math_toolkit/airy.html index c3fadaa1c..caaa6c728 100644 --- a/doc/html/math_toolkit/airy.html +++ b/doc/html/math_toolkit/airy.html @@ -4,7 +4,7 @@ Airy Functions - + diff --git a/doc/html/math_toolkit/airy/ai.html b/doc/html/math_toolkit/airy/ai.html index 168a0257b..5bbf83a92 100644 --- a/doc/html/math_toolkit/airy/ai.html +++ b/doc/html/math_toolkit/airy/ai.html @@ -4,7 +4,7 @@ Airy Ai Function - + diff --git a/doc/html/math_toolkit/airy/aip.html b/doc/html/math_toolkit/airy/aip.html index 4d7431f2e..318c2c392 100644 --- a/doc/html/math_toolkit/airy/aip.html +++ b/doc/html/math_toolkit/airy/aip.html @@ -4,7 +4,7 @@ Airy Ai' Function - + diff --git a/doc/html/math_toolkit/airy/airy_root.html b/doc/html/math_toolkit/airy/airy_root.html index 1d04c1995..e57617749 100644 --- a/doc/html/math_toolkit/airy/airy_root.html +++ b/doc/html/math_toolkit/airy/airy_root.html @@ -4,7 +4,7 @@ Finding Zeros of Airy Functions - + diff --git a/doc/html/math_toolkit/airy/bi.html b/doc/html/math_toolkit/airy/bi.html index 2d4f6421d..7abb0b6fe 100644 --- a/doc/html/math_toolkit/airy/bi.html +++ b/doc/html/math_toolkit/airy/bi.html @@ -4,7 +4,7 @@ Airy Bi Function - + diff --git a/doc/html/math_toolkit/airy/bip.html b/doc/html/math_toolkit/airy/bip.html index f06e429fa..b951a4099 100644 --- a/doc/html/math_toolkit/airy/bip.html +++ b/doc/html/math_toolkit/airy/bip.html @@ -4,7 +4,7 @@ Airy Bi' Function - + diff --git a/doc/html/math_toolkit/archetypes.html b/doc/html/math_toolkit/archetypes.html index 04810a9ce..3dd7edb34 100644 --- a/doc/html/math_toolkit/archetypes.html +++ b/doc/html/math_toolkit/archetypes.html @@ -4,7 +4,7 @@ Conceptual Archetypes for Reals and Distributions - + diff --git a/doc/html/math_toolkit/asin.html b/doc/html/math_toolkit/asin.html index 17650cf48..f577b9d3b 100644 --- a/doc/html/math_toolkit/asin.html +++ b/doc/html/math_toolkit/asin.html @@ -4,7 +4,7 @@ asin - + diff --git a/doc/html/math_toolkit/asinh.html b/doc/html/math_toolkit/asinh.html index 663455c3a..8ea252e41 100644 --- a/doc/html/math_toolkit/asinh.html +++ b/doc/html/math_toolkit/asinh.html @@ -4,7 +4,7 @@ asinh - + diff --git a/doc/html/math_toolkit/atan.html b/doc/html/math_toolkit/atan.html index ab58d4c3f..cd3478af1 100644 --- a/doc/html/math_toolkit/atan.html +++ b/doc/html/math_toolkit/atan.html @@ -4,7 +4,7 @@ atan - + diff --git a/doc/html/math_toolkit/atanh.html b/doc/html/math_toolkit/atanh.html index 02bfe7bc8..7a44de2ed 100644 --- a/doc/html/math_toolkit/atanh.html +++ b/doc/html/math_toolkit/atanh.html @@ -4,7 +4,7 @@ atanh - + diff --git a/doc/html/math_toolkit/bessel.html b/doc/html/math_toolkit/bessel.html index 801fc2d81..878b82c76 100644 --- a/doc/html/math_toolkit/bessel.html +++ b/doc/html/math_toolkit/bessel.html @@ -4,7 +4,7 @@ Bessel Functions - + diff --git a/doc/html/math_toolkit/bessel/bessel_derivatives.html b/doc/html/math_toolkit/bessel/bessel_derivatives.html index 7d003cd7b..98a175f6f 100644 --- a/doc/html/math_toolkit/bessel/bessel_derivatives.html +++ b/doc/html/math_toolkit/bessel/bessel_derivatives.html @@ -4,7 +4,7 @@ Derivatives of the Bessel Functions - + diff --git a/doc/html/math_toolkit/bessel/bessel_first.html b/doc/html/math_toolkit/bessel/bessel_first.html index 82cf417bc..b805810db 100644 --- a/doc/html/math_toolkit/bessel/bessel_first.html +++ b/doc/html/math_toolkit/bessel/bessel_first.html @@ -4,7 +4,7 @@ Bessel Functions of the First and Second Kinds - + diff --git a/doc/html/math_toolkit/bessel/bessel_over.html b/doc/html/math_toolkit/bessel/bessel_over.html index 6b5c7f097..50305d8f1 100644 --- a/doc/html/math_toolkit/bessel/bessel_over.html +++ b/doc/html/math_toolkit/bessel/bessel_over.html @@ -4,7 +4,7 @@ Bessel Function Overview - + diff --git a/doc/html/math_toolkit/bessel/bessel_root.html b/doc/html/math_toolkit/bessel/bessel_root.html index ed3a177b5..073a062a9 100644 --- a/doc/html/math_toolkit/bessel/bessel_root.html +++ b/doc/html/math_toolkit/bessel/bessel_root.html @@ -4,7 +4,7 @@ Finding Zeros of Bessel Functions of the First and Second Kinds - + diff --git a/doc/html/math_toolkit/bessel/mbessel.html b/doc/html/math_toolkit/bessel/mbessel.html index 5364d1400..4053bbdcd 100644 --- a/doc/html/math_toolkit/bessel/mbessel.html +++ b/doc/html/math_toolkit/bessel/mbessel.html @@ -4,7 +4,7 @@ Modified Bessel Functions of the First and Second Kinds - + diff --git a/doc/html/math_toolkit/bessel/sph_bessel.html b/doc/html/math_toolkit/bessel/sph_bessel.html index 4a580a25c..5ef05e6fd 100644 --- a/doc/html/math_toolkit/bessel/sph_bessel.html +++ b/doc/html/math_toolkit/bessel/sph_bessel.html @@ -4,7 +4,7 @@ Spherical Bessel Functions of the First and Second Kinds - + diff --git a/doc/html/math_toolkit/building.html b/doc/html/math_toolkit/building.html index b65c14534..d22e9f332 100644 --- a/doc/html/math_toolkit/building.html +++ b/doc/html/math_toolkit/building.html @@ -4,7 +4,7 @@ If and How to Build a Boost.Math Library, and its Examples and Tests - + diff --git a/doc/html/math_toolkit/c99.html b/doc/html/math_toolkit/c99.html index 65bebe814..b1669737d 100644 --- a/doc/html/math_toolkit/c99.html +++ b/doc/html/math_toolkit/c99.html @@ -4,7 +4,7 @@ C99 C Functions - + diff --git a/doc/html/math_toolkit/comp_compilers.html b/doc/html/math_toolkit/comp_compilers.html index e5ec30856..8b3c8ecb5 100644 --- a/doc/html/math_toolkit/comp_compilers.html +++ b/doc/html/math_toolkit/comp_compilers.html @@ -4,7 +4,7 @@ Comparing Different Compilers - + diff --git a/doc/html/math_toolkit/comparisons.html b/doc/html/math_toolkit/comparisons.html index f683f02c8..35c52e81d 100644 --- a/doc/html/math_toolkit/comparisons.html +++ b/doc/html/math_toolkit/comparisons.html @@ -4,7 +4,7 @@ Comparisons to Other Open Source Libraries - + diff --git a/doc/html/math_toolkit/compile_time.html b/doc/html/math_toolkit/compile_time.html index 168fb8270..c4eae4bfc 100644 --- a/doc/html/math_toolkit/compile_time.html +++ b/doc/html/math_toolkit/compile_time.html @@ -4,7 +4,7 @@ Compile-time GCD and LCM determination - + diff --git a/doc/html/math_toolkit/compilers_overview.html b/doc/html/math_toolkit/compilers_overview.html index f68353582..52b855c0c 100644 --- a/doc/html/math_toolkit/compilers_overview.html +++ b/doc/html/math_toolkit/compilers_overview.html @@ -4,7 +4,7 @@ Compilers - + diff --git a/doc/html/math_toolkit/complex_history.html b/doc/html/math_toolkit/complex_history.html index 92e8a2e88..3a4cc4df5 100644 --- a/doc/html/math_toolkit/complex_history.html +++ b/doc/html/math_toolkit/complex_history.html @@ -4,7 +4,7 @@ History - + diff --git a/doc/html/math_toolkit/complex_implementation.html b/doc/html/math_toolkit/complex_implementation.html index 7ab59ddef..be35ce8d5 100644 --- a/doc/html/math_toolkit/complex_implementation.html +++ b/doc/html/math_toolkit/complex_implementation.html @@ -4,7 +4,7 @@ Implementation and Accuracy - + diff --git a/doc/html/math_toolkit/config_macros.html b/doc/html/math_toolkit/config_macros.html index ac92a8960..bf52804f6 100644 --- a/doc/html/math_toolkit/config_macros.html +++ b/doc/html/math_toolkit/config_macros.html @@ -4,7 +4,7 @@ Configuration Macros - + diff --git a/doc/html/math_toolkit/constants.html b/doc/html/math_toolkit/constants.html index 6e54a34fd..fac07c063 100644 --- a/doc/html/math_toolkit/constants.html +++ b/doc/html/math_toolkit/constants.html @@ -4,7 +4,7 @@ The Mathematical Constants - + diff --git a/doc/html/math_toolkit/constants_faq.html b/doc/html/math_toolkit/constants_faq.html index ca69e7f30..8667e08be 100644 --- a/doc/html/math_toolkit/constants_faq.html +++ b/doc/html/math_toolkit/constants_faq.html @@ -4,7 +4,7 @@ FAQs - + diff --git a/doc/html/math_toolkit/constants_intro.html b/doc/html/math_toolkit/constants_intro.html index ec1609bee..d5e1445a1 100644 --- a/doc/html/math_toolkit/constants_intro.html +++ b/doc/html/math_toolkit/constants_intro.html @@ -4,7 +4,7 @@ Introduction - + diff --git a/doc/html/math_toolkit/contact.html b/doc/html/math_toolkit/contact.html index e2f9a5335..52a851e73 100644 --- a/doc/html/math_toolkit/contact.html +++ b/doc/html/math_toolkit/contact.html @@ -4,7 +4,7 @@ Contact Info and Support - + diff --git a/doc/html/math_toolkit/conventions.html b/doc/html/math_toolkit/conventions.html index 8a90b1900..7be7293ff 100644 --- a/doc/html/math_toolkit/conventions.html +++ b/doc/html/math_toolkit/conventions.html @@ -4,7 +4,7 @@ Document Conventions - + @@ -27,7 +27,7 @@ Document Conventions

      - +

      This documentation aims to use of the following naming and formatting conventions. diff --git a/doc/html/math_toolkit/create.html b/doc/html/math_toolkit/create.html index dcac10cd1..ef1de029a 100644 --- a/doc/html/math_toolkit/create.html +++ b/doc/html/math_toolkit/create.html @@ -4,7 +4,7 @@ Quaternion Creation Functions - + diff --git a/doc/html/math_toolkit/credits.html b/doc/html/math_toolkit/credits.html index e3d62bd5c..83c9071bf 100644 --- a/doc/html/math_toolkit/credits.html +++ b/doc/html/math_toolkit/credits.html @@ -4,7 +4,7 @@ Credits and Acknowledgements - + diff --git a/doc/html/math_toolkit/demo.html b/doc/html/math_toolkit/demo.html index 9e2f79418..3669370bf 100644 --- a/doc/html/math_toolkit/demo.html +++ b/doc/html/math_toolkit/demo.html @@ -4,7 +4,7 @@ Demonstration Program - + diff --git a/doc/html/math_toolkit/directories.html b/doc/html/math_toolkit/directories.html index 3b7c5076d..df0193865 100644 --- a/doc/html/math_toolkit/directories.html +++ b/doc/html/math_toolkit/directories.html @@ -4,7 +4,7 @@ Directory and File Structure - + diff --git a/doc/html/math_toolkit/dist_concept.html b/doc/html/math_toolkit/dist_concept.html index f6ee2aabc..26cfbc1b7 100644 --- a/doc/html/math_toolkit/dist_concept.html +++ b/doc/html/math_toolkit/dist_concept.html @@ -4,7 +4,7 @@ Conceptual Requirements for Distribution Types - + diff --git a/doc/html/math_toolkit/dist_ref.html b/doc/html/math_toolkit/dist_ref.html index 56a251a1a..5290ef378 100644 --- a/doc/html/math_toolkit/dist_ref.html +++ b/doc/html/math_toolkit/dist_ref.html @@ -4,7 +4,7 @@ Statistical Distributions Reference - + diff --git a/doc/html/math_toolkit/dist_ref/dist_algorithms.html b/doc/html/math_toolkit/dist_ref/dist_algorithms.html index 7a3502734..392a9cd0f 100644 --- a/doc/html/math_toolkit/dist_ref/dist_algorithms.html +++ b/doc/html/math_toolkit/dist_ref/dist_algorithms.html @@ -4,7 +4,7 @@ Distribution Algorithms - + diff --git a/doc/html/math_toolkit/dist_ref/dists.html b/doc/html/math_toolkit/dist_ref/dists.html index 47729eeb1..a9e752f6b 100644 --- a/doc/html/math_toolkit/dist_ref/dists.html +++ b/doc/html/math_toolkit/dist_ref/dists.html @@ -4,7 +4,7 @@ Distributions - + diff --git a/doc/html/math_toolkit/dist_ref/dists/arcine_dist.html b/doc/html/math_toolkit/dist_ref/dists/arcine_dist.html index 34eeb3c2e..a8a38589d 100644 --- a/doc/html/math_toolkit/dist_ref/dists/arcine_dist.html +++ b/doc/html/math_toolkit/dist_ref/dists/arcine_dist.html @@ -4,7 +4,7 @@ Arcsine Distribution - + diff --git a/doc/html/math_toolkit/dist_ref/dists/bernoulli_dist.html b/doc/html/math_toolkit/dist_ref/dists/bernoulli_dist.html index 94aac9466..c2ca386c5 100644 --- a/doc/html/math_toolkit/dist_ref/dists/bernoulli_dist.html +++ b/doc/html/math_toolkit/dist_ref/dists/bernoulli_dist.html @@ -4,7 +4,7 @@ Bernoulli Distribution - + diff --git a/doc/html/math_toolkit/dist_ref/dists/beta_dist.html b/doc/html/math_toolkit/dist_ref/dists/beta_dist.html index 74832955f..63fb03fb4 100644 --- a/doc/html/math_toolkit/dist_ref/dists/beta_dist.html +++ b/doc/html/math_toolkit/dist_ref/dists/beta_dist.html @@ -4,7 +4,7 @@ Beta Distribution - + diff --git a/doc/html/math_toolkit/dist_ref/dists/binomial_dist.html b/doc/html/math_toolkit/dist_ref/dists/binomial_dist.html index 624876ef8..9b604dfa6 100644 --- a/doc/html/math_toolkit/dist_ref/dists/binomial_dist.html +++ b/doc/html/math_toolkit/dist_ref/dists/binomial_dist.html @@ -4,7 +4,7 @@ Binomial Distribution - + diff --git a/doc/html/math_toolkit/dist_ref/dists/cauchy_dist.html b/doc/html/math_toolkit/dist_ref/dists/cauchy_dist.html index 677f5d9da..2a86c3d29 100644 --- a/doc/html/math_toolkit/dist_ref/dists/cauchy_dist.html +++ b/doc/html/math_toolkit/dist_ref/dists/cauchy_dist.html @@ -4,7 +4,7 @@ Cauchy-Lorentz Distribution - + diff --git a/doc/html/math_toolkit/dist_ref/dists/chi_squared_dist.html b/doc/html/math_toolkit/dist_ref/dists/chi_squared_dist.html index cecace760..c5cebe26e 100644 --- a/doc/html/math_toolkit/dist_ref/dists/chi_squared_dist.html +++ b/doc/html/math_toolkit/dist_ref/dists/chi_squared_dist.html @@ -4,7 +4,7 @@ Chi Squared Distribution - + diff --git a/doc/html/math_toolkit/dist_ref/dists/exp_dist.html b/doc/html/math_toolkit/dist_ref/dists/exp_dist.html index 1c26e7ba4..7c8b44941 100644 --- a/doc/html/math_toolkit/dist_ref/dists/exp_dist.html +++ b/doc/html/math_toolkit/dist_ref/dists/exp_dist.html @@ -4,7 +4,7 @@ Exponential Distribution - + diff --git a/doc/html/math_toolkit/dist_ref/dists/extreme_dist.html b/doc/html/math_toolkit/dist_ref/dists/extreme_dist.html index 96d2dff6f..a0b6b66d8 100644 --- a/doc/html/math_toolkit/dist_ref/dists/extreme_dist.html +++ b/doc/html/math_toolkit/dist_ref/dists/extreme_dist.html @@ -4,7 +4,7 @@ Extreme Value Distribution - + diff --git a/doc/html/math_toolkit/dist_ref/dists/f_dist.html b/doc/html/math_toolkit/dist_ref/dists/f_dist.html index bb813962b..882fb5aa9 100644 --- a/doc/html/math_toolkit/dist_ref/dists/f_dist.html +++ b/doc/html/math_toolkit/dist_ref/dists/f_dist.html @@ -4,7 +4,7 @@ F Distribution - + diff --git a/doc/html/math_toolkit/dist_ref/dists/gamma_dist.html b/doc/html/math_toolkit/dist_ref/dists/gamma_dist.html index f6e31c2c9..c46631d7e 100644 --- a/doc/html/math_toolkit/dist_ref/dists/gamma_dist.html +++ b/doc/html/math_toolkit/dist_ref/dists/gamma_dist.html @@ -4,7 +4,7 @@ Gamma (and Erlang) Distribution - + diff --git a/doc/html/math_toolkit/dist_ref/dists/geometric_dist.html b/doc/html/math_toolkit/dist_ref/dists/geometric_dist.html index 1ddd3afe0..de3ed38a9 100644 --- a/doc/html/math_toolkit/dist_ref/dists/geometric_dist.html +++ b/doc/html/math_toolkit/dist_ref/dists/geometric_dist.html @@ -4,7 +4,7 @@ Geometric Distribution - + diff --git a/doc/html/math_toolkit/dist_ref/dists/hyperexponential_dist.html b/doc/html/math_toolkit/dist_ref/dists/hyperexponential_dist.html index f2f375245..1de645f08 100644 --- a/doc/html/math_toolkit/dist_ref/dists/hyperexponential_dist.html +++ b/doc/html/math_toolkit/dist_ref/dists/hyperexponential_dist.html @@ -4,7 +4,7 @@ Hyperexponential Distribution - + diff --git a/doc/html/math_toolkit/dist_ref/dists/hypergeometric_dist.html b/doc/html/math_toolkit/dist_ref/dists/hypergeometric_dist.html index 497a48b8a..ec4b9922a 100644 --- a/doc/html/math_toolkit/dist_ref/dists/hypergeometric_dist.html +++ b/doc/html/math_toolkit/dist_ref/dists/hypergeometric_dist.html @@ -4,7 +4,7 @@ Hypergeometric Distribution - + diff --git a/doc/html/math_toolkit/dist_ref/dists/inverse_chi_squared_dist.html b/doc/html/math_toolkit/dist_ref/dists/inverse_chi_squared_dist.html index 3f9371b49..3dfa3532b 100644 --- a/doc/html/math_toolkit/dist_ref/dists/inverse_chi_squared_dist.html +++ b/doc/html/math_toolkit/dist_ref/dists/inverse_chi_squared_dist.html @@ -4,7 +4,7 @@ Inverse Chi Squared Distribution - + diff --git a/doc/html/math_toolkit/dist_ref/dists/inverse_gamma_dist.html b/doc/html/math_toolkit/dist_ref/dists/inverse_gamma_dist.html index ac5c66400..fb44e664e 100644 --- a/doc/html/math_toolkit/dist_ref/dists/inverse_gamma_dist.html +++ b/doc/html/math_toolkit/dist_ref/dists/inverse_gamma_dist.html @@ -4,7 +4,7 @@ Inverse Gamma Distribution - + diff --git a/doc/html/math_toolkit/dist_ref/dists/inverse_gaussian_dist.html b/doc/html/math_toolkit/dist_ref/dists/inverse_gaussian_dist.html index 85a3031bb..cebf3f9ad 100644 --- a/doc/html/math_toolkit/dist_ref/dists/inverse_gaussian_dist.html +++ b/doc/html/math_toolkit/dist_ref/dists/inverse_gaussian_dist.html @@ -4,7 +4,7 @@ Inverse Gaussian (or Inverse Normal) Distribution - + diff --git a/doc/html/math_toolkit/dist_ref/dists/laplace_dist.html b/doc/html/math_toolkit/dist_ref/dists/laplace_dist.html index 037af33b5..2dc8955cd 100644 --- a/doc/html/math_toolkit/dist_ref/dists/laplace_dist.html +++ b/doc/html/math_toolkit/dist_ref/dists/laplace_dist.html @@ -4,7 +4,7 @@ Laplace Distribution - + diff --git a/doc/html/math_toolkit/dist_ref/dists/logistic_dist.html b/doc/html/math_toolkit/dist_ref/dists/logistic_dist.html index b1931a41c..24210b02b 100644 --- a/doc/html/math_toolkit/dist_ref/dists/logistic_dist.html +++ b/doc/html/math_toolkit/dist_ref/dists/logistic_dist.html @@ -4,7 +4,7 @@ Logistic Distribution - + diff --git a/doc/html/math_toolkit/dist_ref/dists/lognormal_dist.html b/doc/html/math_toolkit/dist_ref/dists/lognormal_dist.html index d605ea12c..8f5cd67c5 100644 --- a/doc/html/math_toolkit/dist_ref/dists/lognormal_dist.html +++ b/doc/html/math_toolkit/dist_ref/dists/lognormal_dist.html @@ -4,7 +4,7 @@ Log Normal Distribution - + diff --git a/doc/html/math_toolkit/dist_ref/dists/nc_beta_dist.html b/doc/html/math_toolkit/dist_ref/dists/nc_beta_dist.html index c6fd14ae1..5ecb6dcf5 100644 --- a/doc/html/math_toolkit/dist_ref/dists/nc_beta_dist.html +++ b/doc/html/math_toolkit/dist_ref/dists/nc_beta_dist.html @@ -4,7 +4,7 @@ Noncentral Beta Distribution - + diff --git a/doc/html/math_toolkit/dist_ref/dists/nc_chi_squared_dist.html b/doc/html/math_toolkit/dist_ref/dists/nc_chi_squared_dist.html index b9d86b243..141fba4c1 100644 --- a/doc/html/math_toolkit/dist_ref/dists/nc_chi_squared_dist.html +++ b/doc/html/math_toolkit/dist_ref/dists/nc_chi_squared_dist.html @@ -4,7 +4,7 @@ Noncentral Chi-Squared Distribution - + diff --git a/doc/html/math_toolkit/dist_ref/dists/nc_f_dist.html b/doc/html/math_toolkit/dist_ref/dists/nc_f_dist.html index b01d7ef0f..76465062f 100644 --- a/doc/html/math_toolkit/dist_ref/dists/nc_f_dist.html +++ b/doc/html/math_toolkit/dist_ref/dists/nc_f_dist.html @@ -4,7 +4,7 @@ Noncentral F Distribution - + diff --git a/doc/html/math_toolkit/dist_ref/dists/nc_t_dist.html b/doc/html/math_toolkit/dist_ref/dists/nc_t_dist.html index 37e96f4ba..8c0cbc2d2 100644 --- a/doc/html/math_toolkit/dist_ref/dists/nc_t_dist.html +++ b/doc/html/math_toolkit/dist_ref/dists/nc_t_dist.html @@ -4,7 +4,7 @@ Noncentral T Distribution - + diff --git a/doc/html/math_toolkit/dist_ref/dists/negative_binomial_dist.html b/doc/html/math_toolkit/dist_ref/dists/negative_binomial_dist.html index 53f4dbb9b..ae207c214 100644 --- a/doc/html/math_toolkit/dist_ref/dists/negative_binomial_dist.html +++ b/doc/html/math_toolkit/dist_ref/dists/negative_binomial_dist.html @@ -4,7 +4,7 @@ Negative Binomial Distribution - + diff --git a/doc/html/math_toolkit/dist_ref/dists/normal_dist.html b/doc/html/math_toolkit/dist_ref/dists/normal_dist.html index 289ca7485..46a9e4fb5 100644 --- a/doc/html/math_toolkit/dist_ref/dists/normal_dist.html +++ b/doc/html/math_toolkit/dist_ref/dists/normal_dist.html @@ -4,7 +4,7 @@ Normal (Gaussian) Distribution - + diff --git a/doc/html/math_toolkit/dist_ref/dists/pareto.html b/doc/html/math_toolkit/dist_ref/dists/pareto.html index 1c493b7ee..668034e04 100644 --- a/doc/html/math_toolkit/dist_ref/dists/pareto.html +++ b/doc/html/math_toolkit/dist_ref/dists/pareto.html @@ -4,7 +4,7 @@ Pareto Distribution - + diff --git a/doc/html/math_toolkit/dist_ref/dists/poisson_dist.html b/doc/html/math_toolkit/dist_ref/dists/poisson_dist.html index 43be35327..588806b53 100644 --- a/doc/html/math_toolkit/dist_ref/dists/poisson_dist.html +++ b/doc/html/math_toolkit/dist_ref/dists/poisson_dist.html @@ -4,7 +4,7 @@ Poisson Distribution - + diff --git a/doc/html/math_toolkit/dist_ref/dists/rayleigh.html b/doc/html/math_toolkit/dist_ref/dists/rayleigh.html index ba087ec36..83840f145 100644 --- a/doc/html/math_toolkit/dist_ref/dists/rayleigh.html +++ b/doc/html/math_toolkit/dist_ref/dists/rayleigh.html @@ -4,7 +4,7 @@ Rayleigh Distribution - + diff --git a/doc/html/math_toolkit/dist_ref/dists/skew_normal_dist.html b/doc/html/math_toolkit/dist_ref/dists/skew_normal_dist.html index 683160ab0..c1a6f81aa 100644 --- a/doc/html/math_toolkit/dist_ref/dists/skew_normal_dist.html +++ b/doc/html/math_toolkit/dist_ref/dists/skew_normal_dist.html @@ -4,7 +4,7 @@ Skew Normal Distribution - + diff --git a/doc/html/math_toolkit/dist_ref/dists/students_t_dist.html b/doc/html/math_toolkit/dist_ref/dists/students_t_dist.html index 14280ebf4..7e3e69838 100644 --- a/doc/html/math_toolkit/dist_ref/dists/students_t_dist.html +++ b/doc/html/math_toolkit/dist_ref/dists/students_t_dist.html @@ -4,7 +4,7 @@ Students t Distribution - + diff --git a/doc/html/math_toolkit/dist_ref/dists/triangular_dist.html b/doc/html/math_toolkit/dist_ref/dists/triangular_dist.html index e053bda17..c39eb1eeb 100644 --- a/doc/html/math_toolkit/dist_ref/dists/triangular_dist.html +++ b/doc/html/math_toolkit/dist_ref/dists/triangular_dist.html @@ -4,7 +4,7 @@ Triangular Distribution - + diff --git a/doc/html/math_toolkit/dist_ref/dists/uniform_dist.html b/doc/html/math_toolkit/dist_ref/dists/uniform_dist.html index 689a0f8ac..b2a6026a7 100644 --- a/doc/html/math_toolkit/dist_ref/dists/uniform_dist.html +++ b/doc/html/math_toolkit/dist_ref/dists/uniform_dist.html @@ -4,7 +4,7 @@ Uniform Distribution - + diff --git a/doc/html/math_toolkit/dist_ref/dists/weibull_dist.html b/doc/html/math_toolkit/dist_ref/dists/weibull_dist.html index ff7bfb4a4..0c7a80ebe 100644 --- a/doc/html/math_toolkit/dist_ref/dists/weibull_dist.html +++ b/doc/html/math_toolkit/dist_ref/dists/weibull_dist.html @@ -4,7 +4,7 @@ Weibull Distribution - + diff --git a/doc/html/math_toolkit/dist_ref/nmp.html b/doc/html/math_toolkit/dist_ref/nmp.html index 714f9c882..ffd5d62f8 100644 --- a/doc/html/math_toolkit/dist_ref/nmp.html +++ b/doc/html/math_toolkit/dist_ref/nmp.html @@ -4,7 +4,7 @@ Non-Member Properties - + diff --git a/doc/html/math_toolkit/ellint.html b/doc/html/math_toolkit/ellint.html index 4df48594c..2316c7441 100644 --- a/doc/html/math_toolkit/ellint.html +++ b/doc/html/math_toolkit/ellint.html @@ -4,7 +4,7 @@ Elliptic Integrals - + diff --git a/doc/html/math_toolkit/ellint/ellint_1.html b/doc/html/math_toolkit/ellint/ellint_1.html index fea3f6b01..e86edf3e8 100644 --- a/doc/html/math_toolkit/ellint/ellint_1.html +++ b/doc/html/math_toolkit/ellint/ellint_1.html @@ -4,7 +4,7 @@ Elliptic Integrals of the First Kind - Legendre Form - + diff --git a/doc/html/math_toolkit/ellint/ellint_2.html b/doc/html/math_toolkit/ellint/ellint_2.html index 8f0cbad5a..d45284ef2 100644 --- a/doc/html/math_toolkit/ellint/ellint_2.html +++ b/doc/html/math_toolkit/ellint/ellint_2.html @@ -4,7 +4,7 @@ Elliptic Integrals of the Second Kind - Legendre Form - + diff --git a/doc/html/math_toolkit/ellint/ellint_3.html b/doc/html/math_toolkit/ellint/ellint_3.html index 58eb4333d..cb1f59776 100644 --- a/doc/html/math_toolkit/ellint/ellint_3.html +++ b/doc/html/math_toolkit/ellint/ellint_3.html @@ -4,7 +4,7 @@ Elliptic Integrals of the Third Kind - Legendre Form - + diff --git a/doc/html/math_toolkit/ellint/ellint_carlson.html b/doc/html/math_toolkit/ellint/ellint_carlson.html index 921351309..fd432d425 100644 --- a/doc/html/math_toolkit/ellint/ellint_carlson.html +++ b/doc/html/math_toolkit/ellint/ellint_carlson.html @@ -4,7 +4,7 @@ Elliptic Integrals - Carlson Form - + diff --git a/doc/html/math_toolkit/ellint/ellint_d.html b/doc/html/math_toolkit/ellint/ellint_d.html index 36a6c9c68..dec5303aa 100644 --- a/doc/html/math_toolkit/ellint/ellint_d.html +++ b/doc/html/math_toolkit/ellint/ellint_d.html @@ -4,7 +4,7 @@ Elliptic Integral D - Legendre Form - + diff --git a/doc/html/math_toolkit/ellint/ellint_intro.html b/doc/html/math_toolkit/ellint/ellint_intro.html index ffa94dcb1..bcc6c3539 100644 --- a/doc/html/math_toolkit/ellint/ellint_intro.html +++ b/doc/html/math_toolkit/ellint/ellint_intro.html @@ -4,7 +4,7 @@ Elliptic Integral Overview - + diff --git a/doc/html/math_toolkit/ellint/heuman_lambda.html b/doc/html/math_toolkit/ellint/heuman_lambda.html index 14296d097..f277481b9 100644 --- a/doc/html/math_toolkit/ellint/heuman_lambda.html +++ b/doc/html/math_toolkit/ellint/heuman_lambda.html @@ -4,7 +4,7 @@ Heuman Lambda Function - + diff --git a/doc/html/math_toolkit/ellint/jacobi_zeta.html b/doc/html/math_toolkit/ellint/jacobi_zeta.html index 53f65230c..def9ab596 100644 --- a/doc/html/math_toolkit/ellint/jacobi_zeta.html +++ b/doc/html/math_toolkit/ellint/jacobi_zeta.html @@ -4,7 +4,7 @@ Jacobi Zeta Function - + diff --git a/doc/html/math_toolkit/error_handling.html b/doc/html/math_toolkit/error_handling.html index b57301c8e..8d7de16d1 100644 --- a/doc/html/math_toolkit/error_handling.html +++ b/doc/html/math_toolkit/error_handling.html @@ -4,7 +4,7 @@ Error Handling - + diff --git a/doc/html/math_toolkit/exact_typdefs.html b/doc/html/math_toolkit/exact_typdefs.html index aa65f8712..096be4a99 100644 --- a/doc/html/math_toolkit/exact_typdefs.html +++ b/doc/html/math_toolkit/exact_typdefs.html @@ -4,7 +4,7 @@ Exact-Width Floating-Point typedefs - + diff --git a/doc/html/math_toolkit/examples.html b/doc/html/math_toolkit/examples.html index 7d2578999..c0359c3c3 100644 --- a/doc/html/math_toolkit/examples.html +++ b/doc/html/math_toolkit/examples.html @@ -4,7 +4,7 @@ Examples - + diff --git a/doc/html/math_toolkit/exp.html b/doc/html/math_toolkit/exp.html index 6fa33b4df..56b2707ef 100644 --- a/doc/html/math_toolkit/exp.html +++ b/doc/html/math_toolkit/exp.html @@ -4,7 +4,7 @@ The Quaternionic Exponential - + diff --git a/doc/html/math_toolkit/expint.html b/doc/html/math_toolkit/expint.html index 0a00cdf79..bdf8a021f 100644 --- a/doc/html/math_toolkit/expint.html +++ b/doc/html/math_toolkit/expint.html @@ -4,7 +4,7 @@ Exponential Integrals - + diff --git a/doc/html/math_toolkit/expint/expint_i.html b/doc/html/math_toolkit/expint/expint_i.html index 6a434291b..713a9ce76 100644 --- a/doc/html/math_toolkit/expint/expint_i.html +++ b/doc/html/math_toolkit/expint/expint_i.html @@ -4,7 +4,7 @@ Exponential Integral Ei - + diff --git a/doc/html/math_toolkit/expint/expint_n.html b/doc/html/math_toolkit/expint/expint_n.html index e5360ec58..05c88a253 100644 --- a/doc/html/math_toolkit/expint/expint_n.html +++ b/doc/html/math_toolkit/expint/expint_n.html @@ -4,7 +4,7 @@ Exponential Integral En - + diff --git a/doc/html/math_toolkit/factorials.html b/doc/html/math_toolkit/factorials.html index 7e34078a8..67253bf0d 100644 --- a/doc/html/math_toolkit/factorials.html +++ b/doc/html/math_toolkit/factorials.html @@ -4,7 +4,7 @@ Factorials and Binomial Coefficients - + diff --git a/doc/html/math_toolkit/factorials/sf_binomial.html b/doc/html/math_toolkit/factorials/sf_binomial.html index 5599b8567..4c8a73eef 100644 --- a/doc/html/math_toolkit/factorials/sf_binomial.html +++ b/doc/html/math_toolkit/factorials/sf_binomial.html @@ -4,7 +4,7 @@ Binomial Coefficients - + diff --git a/doc/html/math_toolkit/factorials/sf_double_factorial.html b/doc/html/math_toolkit/factorials/sf_double_factorial.html index c40a4b463..7a0052e72 100644 --- a/doc/html/math_toolkit/factorials/sf_double_factorial.html +++ b/doc/html/math_toolkit/factorials/sf_double_factorial.html @@ -4,7 +4,7 @@ Double Factorial - + diff --git a/doc/html/math_toolkit/factorials/sf_factorial.html b/doc/html/math_toolkit/factorials/sf_factorial.html index 86a4c0991..a06fff203 100644 --- a/doc/html/math_toolkit/factorials/sf_factorial.html +++ b/doc/html/math_toolkit/factorials/sf_factorial.html @@ -4,7 +4,7 @@ Factorial - + diff --git a/doc/html/math_toolkit/factorials/sf_falling_factorial.html b/doc/html/math_toolkit/factorials/sf_falling_factorial.html index a12c0a92c..d0cc9d15f 100644 --- a/doc/html/math_toolkit/factorials/sf_falling_factorial.html +++ b/doc/html/math_toolkit/factorials/sf_falling_factorial.html @@ -4,7 +4,7 @@ Falling Factorial - + diff --git a/doc/html/math_toolkit/factorials/sf_rising_factorial.html b/doc/html/math_toolkit/factorials/sf_rising_factorial.html index 8b2c3e308..b6db6cb99 100644 --- a/doc/html/math_toolkit/factorials/sf_rising_factorial.html +++ b/doc/html/math_toolkit/factorials/sf_rising_factorial.html @@ -4,7 +4,7 @@ Rising Factorial - + diff --git a/doc/html/math_toolkit/fastest_typdefs.html b/doc/html/math_toolkit/fastest_typdefs.html index 0449c2383..3b5947a1b 100644 --- a/doc/html/math_toolkit/fastest_typdefs.html +++ b/doc/html/math_toolkit/fastest_typdefs.html @@ -4,7 +4,7 @@ Fastest floating-point typedefs - + diff --git a/doc/html/math_toolkit/float128.html b/doc/html/math_toolkit/float128.html index 63f67e668..6ed5e6786 100644 --- a/doc/html/math_toolkit/float128.html +++ b/doc/html/math_toolkit/float128.html @@ -4,7 +4,7 @@ Implementation of Float128 type - + diff --git a/doc/html/math_toolkit/float128/exp_function.html b/doc/html/math_toolkit/float128/exp_function.html index fb86fe733..e21b3a396 100644 --- a/doc/html/math_toolkit/float128/exp_function.html +++ b/doc/html/math_toolkit/float128/exp_function.html @@ -4,7 +4,7 @@ Exponential function - + diff --git a/doc/html/math_toolkit/float128/overloading.html b/doc/html/math_toolkit/float128/overloading.html index 04147ff27..7786e506b 100644 --- a/doc/html/math_toolkit/float128/overloading.html +++ b/doc/html/math_toolkit/float128/overloading.html @@ -4,7 +4,7 @@ Overloading template functions with float128_t - + diff --git a/doc/html/math_toolkit/float128/typeinfo.html b/doc/html/math_toolkit/float128/typeinfo.html index 70b423753..32925f5f6 100644 --- a/doc/html/math_toolkit/float128/typeinfo.html +++ b/doc/html/math_toolkit/float128/typeinfo.html @@ -4,7 +4,7 @@ typeinfo - + diff --git a/doc/html/math_toolkit/float128_hints.html b/doc/html/math_toolkit/float128_hints.html index d9c839dec..75b99e555 100644 --- a/doc/html/math_toolkit/float128_hints.html +++ b/doc/html/math_toolkit/float128_hints.html @@ -4,7 +4,7 @@ Hints on using float128 (and __float128) - + diff --git a/doc/html/math_toolkit/float_comparison.html b/doc/html/math_toolkit/float_comparison.html index 67b657171..83b954664 100644 --- a/doc/html/math_toolkit/float_comparison.html +++ b/doc/html/math_toolkit/float_comparison.html @@ -4,7 +4,7 @@ Floating-point Comparison - + diff --git a/doc/html/math_toolkit/fp_facets.html b/doc/html/math_toolkit/fp_facets.html index 3fa96daf2..db86e0a03 100644 --- a/doc/html/math_toolkit/fp_facets.html +++ b/doc/html/math_toolkit/fp_facets.html @@ -4,7 +4,7 @@ Facets for Floating-Point Infinities and NaNs - + diff --git a/doc/html/math_toolkit/fp_facets/examples.html b/doc/html/math_toolkit/fp_facets/examples.html index 3d0995403..e801464c9 100644 --- a/doc/html/math_toolkit/fp_facets/examples.html +++ b/doc/html/math_toolkit/fp_facets/examples.html @@ -4,7 +4,7 @@ Examples - + diff --git a/doc/html/math_toolkit/fp_facets/facets_intro.html b/doc/html/math_toolkit/fp_facets/facets_intro.html index bc2072c01..87f4246ce 100644 --- a/doc/html/math_toolkit/fp_facets/facets_intro.html +++ b/doc/html/math_toolkit/fp_facets/facets_intro.html @@ -4,7 +4,7 @@ Introduction - + diff --git a/doc/html/math_toolkit/fp_facets/portability.html b/doc/html/math_toolkit/fp_facets/portability.html index c4dd78fdb..c747a729c 100644 --- a/doc/html/math_toolkit/fp_facets/portability.html +++ b/doc/html/math_toolkit/fp_facets/portability.html @@ -4,7 +4,7 @@ Portability - + diff --git a/doc/html/math_toolkit/fp_facets/rationale.html b/doc/html/math_toolkit/fp_facets/rationale.html index c0046fe37..aa11ca240 100644 --- a/doc/html/math_toolkit/fp_facets/rationale.html +++ b/doc/html/math_toolkit/fp_facets/rationale.html @@ -4,7 +4,7 @@ Design Rationale - + diff --git a/doc/html/math_toolkit/fp_facets/reference.html b/doc/html/math_toolkit/fp_facets/reference.html index 3b2580808..732c111f9 100644 --- a/doc/html/math_toolkit/fp_facets/reference.html +++ b/doc/html/math_toolkit/fp_facets/reference.html @@ -4,7 +4,7 @@ Reference - + diff --git a/doc/html/math_toolkit/fpclass.html b/doc/html/math_toolkit/fpclass.html index d80b4bba3..95f8125bb 100644 --- a/doc/html/math_toolkit/fpclass.html +++ b/doc/html/math_toolkit/fpclass.html @@ -4,7 +4,7 @@ Floating-Point Classification: Infinities and NaNs - + diff --git a/doc/html/math_toolkit/future.html b/doc/html/math_toolkit/future.html index c16cb90a1..c0345995b 100644 --- a/doc/html/math_toolkit/future.html +++ b/doc/html/math_toolkit/future.html @@ -4,7 +4,7 @@ Extras/Future Directions - + diff --git a/doc/html/math_toolkit/gcd_credits.html b/doc/html/math_toolkit/gcd_credits.html index 976de04e2..c49415600 100644 --- a/doc/html/math_toolkit/gcd_credits.html +++ b/doc/html/math_toolkit/gcd_credits.html @@ -4,7 +4,7 @@ Credits - + diff --git a/doc/html/math_toolkit/gcd_function_object.html b/doc/html/math_toolkit/gcd_function_object.html index 01c6758bc..06c4da092 100644 --- a/doc/html/math_toolkit/gcd_function_object.html +++ b/doc/html/math_toolkit/gcd_function_object.html @@ -4,7 +4,7 @@ GCD Function Object - + diff --git a/doc/html/math_toolkit/gcd_header.html b/doc/html/math_toolkit/gcd_header.html index 1dc8dd4b7..0d2db5684 100644 --- a/doc/html/math_toolkit/gcd_header.html +++ b/doc/html/math_toolkit/gcd_header.html @@ -4,7 +4,7 @@ Header <boost/math/common_factor.hpp> - + diff --git a/doc/html/math_toolkit/gcd_history.html b/doc/html/math_toolkit/gcd_history.html index 20d14805a..4fdf5878b 100644 --- a/doc/html/math_toolkit/gcd_history.html +++ b/doc/html/math_toolkit/gcd_history.html @@ -4,7 +4,7 @@ History - + diff --git a/doc/html/math_toolkit/getting_best.html b/doc/html/math_toolkit/getting_best.html index f4aa39798..c9bb3fbcc 100644 --- a/doc/html/math_toolkit/getting_best.html +++ b/doc/html/math_toolkit/getting_best.html @@ -4,7 +4,7 @@ Getting the Best Performance from this Library: Compiler and Compiler Options - + diff --git a/doc/html/math_toolkit/greatest_typdefs.html b/doc/html/math_toolkit/greatest_typdefs.html index db1ddc86d..8e4994c12 100644 --- a/doc/html/math_toolkit/greatest_typdefs.html +++ b/doc/html/math_toolkit/greatest_typdefs.html @@ -4,7 +4,7 @@ Greatest-width floating-point typedef - + diff --git a/doc/html/math_toolkit/hankel.html b/doc/html/math_toolkit/hankel.html index a3238894e..d3b0b7e66 100644 --- a/doc/html/math_toolkit/hankel.html +++ b/doc/html/math_toolkit/hankel.html @@ -4,7 +4,7 @@ Hankel Functions - + diff --git a/doc/html/math_toolkit/hankel/cyl_hankel.html b/doc/html/math_toolkit/hankel/cyl_hankel.html index 466ec11f7..005c34ce7 100644 --- a/doc/html/math_toolkit/hankel/cyl_hankel.html +++ b/doc/html/math_toolkit/hankel/cyl_hankel.html @@ -4,7 +4,7 @@ Cyclic Hankel Functions - + diff --git a/doc/html/math_toolkit/hankel/sph_hankel.html b/doc/html/math_toolkit/hankel/sph_hankel.html index 0da46cef5..f5e533d39 100644 --- a/doc/html/math_toolkit/hankel/sph_hankel.html +++ b/doc/html/math_toolkit/hankel/sph_hankel.html @@ -4,7 +4,7 @@ Spherical Hankel Functions - + diff --git a/doc/html/math_toolkit/high_precision.html b/doc/html/math_toolkit/high_precision.html index 3a9aedfa2..61475e4a1 100644 --- a/doc/html/math_toolkit/high_precision.html +++ b/doc/html/math_toolkit/high_precision.html @@ -4,7 +4,7 @@ Using Boost.Math with High-Precision Floating-Point Libraries - + diff --git a/doc/html/math_toolkit/high_precision/e_float.html b/doc/html/math_toolkit/high_precision/e_float.html index dc6a0b4df..80c454371 100644 --- a/doc/html/math_toolkit/high_precision/e_float.html +++ b/doc/html/math_toolkit/high_precision/e_float.html @@ -4,7 +4,7 @@ Using e_float Library - + diff --git a/doc/html/math_toolkit/high_precision/float128.html b/doc/html/math_toolkit/high_precision/float128.html index 23ff2ef42..ca75b7a4f 100644 --- a/doc/html/math_toolkit/high_precision/float128.html +++ b/doc/html/math_toolkit/high_precision/float128.html @@ -4,7 +4,7 @@ Using with GCC's __float128 datatype - + diff --git a/doc/html/math_toolkit/high_precision/use_mpfr.html b/doc/html/math_toolkit/high_precision/use_mpfr.html index f012596bb..16bba15e1 100644 --- a/doc/html/math_toolkit/high_precision/use_mpfr.html +++ b/doc/html/math_toolkit/high_precision/use_mpfr.html @@ -4,7 +4,7 @@ Using With MPFR or GMP - High-Precision Floating-Point Library - + diff --git a/doc/html/math_toolkit/high_precision/use_multiprecision.html b/doc/html/math_toolkit/high_precision/use_multiprecision.html index 244daca8e..8db407543 100644 --- a/doc/html/math_toolkit/high_precision/use_multiprecision.html +++ b/doc/html/math_toolkit/high_precision/use_multiprecision.html @@ -4,7 +4,7 @@ Using Boost.Multiprecision - + diff --git a/doc/html/math_toolkit/high_precision/use_ntl.html b/doc/html/math_toolkit/high_precision/use_ntl.html index 74ccde673..25f5674e8 100644 --- a/doc/html/math_toolkit/high_precision/use_ntl.html +++ b/doc/html/math_toolkit/high_precision/use_ntl.html @@ -4,7 +4,7 @@ Using NTL Library - + diff --git a/doc/html/math_toolkit/high_precision/using_test.html b/doc/html/math_toolkit/high_precision/using_test.html index 39dc491c8..48b01085e 100644 --- a/doc/html/math_toolkit/high_precision/using_test.html +++ b/doc/html/math_toolkit/high_precision/using_test.html @@ -4,7 +4,7 @@ Using without expression templates for Boost.Test and others - + diff --git a/doc/html/math_toolkit/high_precision/why_high_precision.html b/doc/html/math_toolkit/high_precision/why_high_precision.html index 0797c1d0b..7e4efb065 100644 --- a/doc/html/math_toolkit/high_precision/why_high_precision.html +++ b/doc/html/math_toolkit/high_precision/why_high_precision.html @@ -4,7 +4,7 @@ Why use a high-precision library rather than built-in floating-point types? - + diff --git a/doc/html/math_toolkit/hints.html b/doc/html/math_toolkit/hints.html index 9b835338d..c3e2f2d30 100644 --- a/doc/html/math_toolkit/hints.html +++ b/doc/html/math_toolkit/hints.html @@ -4,7 +4,7 @@ Other Hints and tips - + diff --git a/doc/html/math_toolkit/history1.html b/doc/html/math_toolkit/history1.html index 451edd1f9..3da12bbc2 100644 --- a/doc/html/math_toolkit/history1.html +++ b/doc/html/math_toolkit/history1.html @@ -4,7 +4,7 @@ History and What's New - + @@ -34,6 +34,23 @@

      + Math-2.5.2 + (Boost-1.64) +
      +

      + Patches: +

      +
        +
      • + Big push to ensure all functions in also in C99 are compatible with Annex + F. +
      • +
      • + Improved accuracy of the Bessel functions I0, I1, K0 and K1, see 12066. +
      • +
      +
      + Math-2.5.1 (Boost-1.63)
      @@ -49,7 +66,7 @@
    - + Math-2.5.0 (Boost-1.62)
    @@ -74,7 +91,7 @@
  • - + Math-2.4.0 (Boost-1.61)
    @@ -85,7 +102,7 @@ Polynomial arithmetic added to tools.
    - + Math-2.3.0 (Boost-1.60)
    @@ -163,7 +180,7 @@
    - + Math-2.2.1

    @@ -182,7 +199,7 @@

    - + Math-2.2.0 (boost-1.58.0)
    @@ -226,7 +243,7 @@
    - + Math-2.1.0 (boost-1.57.0)
    @@ -252,7 +269,7 @@
    - + Math-2.0.0 (Boost-1.56.0)
    @@ -303,7 +320,7 @@
    - + Math-1.9.1
      @@ -318,7 +335,7 @@
    - + Math-1.9.0
      @@ -385,7 +402,7 @@
    - + Boost-1.55
      @@ -444,7 +461,7 @@ and Accurate Parallel Inversion of the Gamma Distribution, Thomas Luu

      - + Boost-1.54
      @@ -498,7 +515,7 @@
    - + Boost-1.53
      @@ -533,7 +550,7 @@
    - + Boost-1.52
      @@ -580,14 +597,14 @@ by switching to use the Students t distribution (or Normal distribution
    - + Boost-1.51

    See Boost-1.52 - some items were added but not listed in time for the release.

    - + Boost-1.50
      @@ -624,7 +641,7 @@ by switching to use the Students t distribution (or Normal distribution
    - + Boost-1.49
      @@ -668,7 +685,7 @@ by switching to use the Students t distribution (or Normal distribution
    - + Boost-1.48
      @@ -719,7 +736,7 @@ by switching to use the Students t distribution (or Normal distribution
    - + Boost-1.47
      @@ -736,7 +753,7 @@ by switching to use the Students t distribution (or Normal distribution
    - + Boost-1.46.1
    • @@ -744,7 +761,7 @@ by switching to use the Students t distribution (or Normal distribution #5113.
    - + Boost-1.46.0
      @@ -759,7 +776,7 @@ by switching to use the Students t distribution (or Normal distribution
    - + Boost-1.45.0
      @@ -776,7 +793,7 @@ by switching to use the Students t distribution (or Normal distribution
    - + Boost-1.44.0
      @@ -790,7 +807,7 @@ by switching to use the Students t distribution (or Normal distribution
    - + Boost-1.41.0
    • @@ -798,7 +815,7 @@ by switching to use the Students t distribution (or Normal distribution its inverse.
    - + Boost-1.40.0
      @@ -834,7 +851,7 @@ by switching to use the Students t distribution (or Normal distribution
    - + Boost-1.38.0
      @@ -846,14 +863,14 @@ by switching to use the Students t distribution (or Normal distribution
    - + Boost-1.37.0
    • Improved accuracy and testing of the inverse hypergeometric functions.
    - + Boost-1.36.0
      @@ -886,7 +903,7 @@ by switching to use the Students t distribution (or Normal distribution
    - + Boost-1.35.0: Post Review First Official Release
    @@ -918,7 +935,7 @@ by switching to use the Students t distribution (or Normal distribution
    - + Milestone 4: Second Review Candidate (1st March 2007)
    @@ -932,7 +949,7 @@ by switching to use the Students t distribution (or Normal distribution
    - + Milestone 3: First Review Candidate (31st Dec 2006)
    @@ -960,7 +977,7 @@ by switching to use the Students t distribution (or Normal distribution
    - + Milestone 2: Released September 10th 2006
    @@ -996,7 +1013,7 @@ by switching to use the Students t distribution (or Normal distribution
    - + Milestone 1: Released March 31st 2006
    diff --git a/doc/html/math_toolkit/history2.html b/doc/html/math_toolkit/history2.html index 85b323a1d..a69fffd9a 100644 --- a/doc/html/math_toolkit/history2.html +++ b/doc/html/math_toolkit/history2.html @@ -4,7 +4,7 @@ History and What's New - + @@ -34,6 +34,23 @@

    + Math-2.5.2 + (Boost-1.64) +
    +

    + Patches: +

    +
      +
    • + Big push to ensure all functions in also in C99 are compatible with Annex + F. +
    • +
    • + Improved accuracy of the Bessel functions I0, I1, K0 and K1, see 12066. +
    • +
    +
    + Math-2.5.1 (Boost-1.63)
    @@ -49,7 +66,7 @@
    - + Math-2.5.0 (Boost-1.62)
    @@ -74,7 +91,7 @@
    - + Math-2.4.0 (Boost-1.61)
    @@ -85,7 +102,7 @@ Polynomial arithmetic added to tools.
    - + Math-2.3.0 (Boost-1.60)
    @@ -163,7 +180,7 @@
    - + Math-2.2.1

    @@ -182,7 +199,7 @@

    - + Math-2.2.0 (boost-1.58.0)
    @@ -226,7 +243,7 @@
    - + Math-2.1.0 (boost-1.57.0)
    @@ -252,7 +269,7 @@
    - + Math-2.0.0 (Boost-1.56.0)
    @@ -303,7 +320,7 @@
    - + Math-1.9.1
      @@ -318,7 +335,7 @@
    - + Math-1.9.0
      @@ -385,7 +402,7 @@
    - + Boost-1.55
      @@ -444,7 +461,7 @@ and Accurate Parallel Inversion of the Gamma Distribution, Thomas Luu

      - + Boost-1.54
      @@ -498,7 +515,7 @@
    - + Boost-1.53
      @@ -533,7 +550,7 @@
    - + Boost-1.52
      @@ -580,14 +597,14 @@ by switching to use the Students t distribution (or Normal distribution
    - + Boost-1.51

    See Boost-1.52 - some items were added but not listed in time for the release.

    - + Boost-1.50
      @@ -624,7 +641,7 @@ by switching to use the Students t distribution (or Normal distribution
    - + Boost-1.49
      @@ -668,7 +685,7 @@ by switching to use the Students t distribution (or Normal distribution
    - + Boost-1.48
      @@ -719,7 +736,7 @@ by switching to use the Students t distribution (or Normal distribution
    - + Boost-1.47
      @@ -736,7 +753,7 @@ by switching to use the Students t distribution (or Normal distribution
    - + Boost-1.46.1
    • @@ -744,7 +761,7 @@ by switching to use the Students t distribution (or Normal distribution #5113.
    - + Boost-1.46.0
      @@ -759,7 +776,7 @@ by switching to use the Students t distribution (or Normal distribution
    - + Boost-1.45.0
      @@ -776,7 +793,7 @@ by switching to use the Students t distribution (or Normal distribution
    - + Boost-1.44.0
      @@ -790,7 +807,7 @@ by switching to use the Students t distribution (or Normal distribution
    - + Boost-1.41.0
    • @@ -798,7 +815,7 @@ by switching to use the Students t distribution (or Normal distribution its inverse.
    - + Boost-1.40.0
      @@ -834,7 +851,7 @@ by switching to use the Students t distribution (or Normal distribution
    - + Boost-1.38.0
      @@ -846,14 +863,14 @@ by switching to use the Students t distribution (or Normal distribution
    - + Boost-1.37.0
    • Improved accuracy and testing of the inverse hypergeometric functions.
    - + Boost-1.36.0
      @@ -886,7 +903,7 @@ by switching to use the Students t distribution (or Normal distribution
    - + Boost-1.35.0: Post Review First Official Release
    @@ -918,7 +935,7 @@ by switching to use the Students t distribution (or Normal distribution
    - + Milestone 4: Second Review Candidate (1st March 2007)
    @@ -932,7 +949,7 @@ by switching to use the Students t distribution (or Normal distribution
    - + Milestone 3: First Review Candidate (31st Dec 2006)
    @@ -960,7 +977,7 @@ by switching to use the Students t distribution (or Normal distribution
    - + Milestone 2: Released September 10th 2006
    @@ -996,7 +1013,7 @@ by switching to use the Students t distribution (or Normal distribution
    - + Milestone 1: Released March 31st 2006
    diff --git a/doc/html/math_toolkit/internals.html b/doc/html/math_toolkit/internals.html index a73630827..694e09de8 100644 --- a/doc/html/math_toolkit/internals.html +++ b/doc/html/math_toolkit/internals.html @@ -4,7 +4,7 @@ Internal tools - + diff --git a/doc/html/math_toolkit/internals/cf.html b/doc/html/math_toolkit/internals/cf.html index 7f38d1086..05754e83a 100644 --- a/doc/html/math_toolkit/internals/cf.html +++ b/doc/html/math_toolkit/internals/cf.html @@ -4,7 +4,7 @@ Continued Fraction Evaluation - + diff --git a/doc/html/math_toolkit/internals/error_test.html b/doc/html/math_toolkit/internals/error_test.html index 1e1dc9e9c..1f3438eb1 100644 --- a/doc/html/math_toolkit/internals/error_test.html +++ b/doc/html/math_toolkit/internals/error_test.html @@ -4,7 +4,7 @@ Relative Error and Testing - + diff --git a/doc/html/math_toolkit/internals/minimax.html b/doc/html/math_toolkit/internals/minimax.html index 3477832dc..0c0e00cd4 100644 --- a/doc/html/math_toolkit/internals/minimax.html +++ b/doc/html/math_toolkit/internals/minimax.html @@ -4,7 +4,7 @@ Minimax Approximations and the Remez Algorithm - + diff --git a/doc/html/math_toolkit/internals/series_evaluation.html b/doc/html/math_toolkit/internals/series_evaluation.html index 05c66459e..8dbd535da 100644 --- a/doc/html/math_toolkit/internals/series_evaluation.html +++ b/doc/html/math_toolkit/internals/series_evaluation.html @@ -4,7 +4,7 @@ Series Evaluation - + diff --git a/doc/html/math_toolkit/internals/test_data.html b/doc/html/math_toolkit/internals/test_data.html index 804a52099..b903292f9 100644 --- a/doc/html/math_toolkit/internals/test_data.html +++ b/doc/html/math_toolkit/internals/test_data.html @@ -4,7 +4,7 @@ Graphing, Profiling, and Generating Test Data for Special Functions - + diff --git a/doc/html/math_toolkit/internals/tuples.html b/doc/html/math_toolkit/internals/tuples.html index 5767f9994..7917be523 100644 --- a/doc/html/math_toolkit/internals/tuples.html +++ b/doc/html/math_toolkit/internals/tuples.html @@ -4,7 +4,7 @@ Tuples - + diff --git a/doc/html/math_toolkit/internals_overview.html b/doc/html/math_toolkit/internals_overview.html index 2cbd60abc..4fad75a07 100644 --- a/doc/html/math_toolkit/internals_overview.html +++ b/doc/html/math_toolkit/internals_overview.html @@ -4,7 +4,7 @@ Overview - + diff --git a/doc/html/math_toolkit/interp.html b/doc/html/math_toolkit/interp.html index ce5f1f65c..a57d55133 100644 --- a/doc/html/math_toolkit/interp.html +++ b/doc/html/math_toolkit/interp.html @@ -4,7 +4,7 @@ Interpreting these Results - + diff --git a/doc/html/math_toolkit/intro_pol_overview.html b/doc/html/math_toolkit/intro_pol_overview.html index 395f56c31..8592c15b3 100644 --- a/doc/html/math_toolkit/intro_pol_overview.html +++ b/doc/html/math_toolkit/intro_pol_overview.html @@ -4,7 +4,7 @@ Policies - + diff --git a/doc/html/math_toolkit/introduction.html b/doc/html/math_toolkit/introduction.html index 046b37a1b..41fdda100 100644 --- a/doc/html/math_toolkit/introduction.html +++ b/doc/html/math_toolkit/introduction.html @@ -4,7 +4,7 @@ Introduction - + diff --git a/doc/html/math_toolkit/inv_hyper.html b/doc/html/math_toolkit/inv_hyper.html index f2fe2da29..aaad192ca 100644 --- a/doc/html/math_toolkit/inv_hyper.html +++ b/doc/html/math_toolkit/inv_hyper.html @@ -4,7 +4,7 @@ Inverse Hyperbolic Functions - + diff --git a/doc/html/math_toolkit/inv_hyper/acosh.html b/doc/html/math_toolkit/inv_hyper/acosh.html index deab33f9c..3f47a10af 100644 --- a/doc/html/math_toolkit/inv_hyper/acosh.html +++ b/doc/html/math_toolkit/inv_hyper/acosh.html @@ -4,7 +4,7 @@ acosh - + diff --git a/doc/html/math_toolkit/inv_hyper/asinh.html b/doc/html/math_toolkit/inv_hyper/asinh.html index c2438fc44..1d02dbb9b 100644 --- a/doc/html/math_toolkit/inv_hyper/asinh.html +++ b/doc/html/math_toolkit/inv_hyper/asinh.html @@ -4,7 +4,7 @@ asinh - + diff --git a/doc/html/math_toolkit/inv_hyper/atanh.html b/doc/html/math_toolkit/inv_hyper/atanh.html index b9d0f2521..db187339f 100644 --- a/doc/html/math_toolkit/inv_hyper/atanh.html +++ b/doc/html/math_toolkit/inv_hyper/atanh.html @@ -4,7 +4,7 @@ atanh - + diff --git a/doc/html/math_toolkit/inv_hyper/inv_hyper_over.html b/doc/html/math_toolkit/inv_hyper/inv_hyper_over.html index 0ebff2134..cfab0bf8b 100644 --- a/doc/html/math_toolkit/inv_hyper/inv_hyper_over.html +++ b/doc/html/math_toolkit/inv_hyper/inv_hyper_over.html @@ -4,7 +4,7 @@ Inverse Hyperbolic Functions Overview - + diff --git a/doc/html/math_toolkit/issues.html b/doc/html/math_toolkit/issues.html index 9c10eaf12..16f105de6 100644 --- a/doc/html/math_toolkit/issues.html +++ b/doc/html/math_toolkit/issues.html @@ -4,7 +4,7 @@ Known Issues, and TODO List - + @@ -41,21 +41,6 @@

    - Derivatives - of Bessel functions (and their zeros) -
    -

    - Potentially, there could be native support for cyl_bessel_j_prime() and cyl_neumann_prime(). One could also imagine supporting the zeros - thereof, but they might be slower to calculate since root bracketing might - be needed instead of Newton iteration (for the lack of 2nd derivatives). -

    -

    - Since Boost.Math's Bessel functions are so excellent, the quick way to cyl_bessel_j_prime() - and cyl_neumann_prime() - would be via relationship with cyl_bessel_j() and cyl_neumann(). -

    -
    - tgamma
    • @@ -63,7 +48,7 @@ be optimized any further? (low priority)
    - + Incomplete Beta
    @@ -72,7 +57,7 @@ (medium priority).
    - + Inverse Gamma
    @@ -81,7 +66,7 @@ is good enough (Medium Priority).
    - + Polynomials
    • @@ -91,7 +76,7 @@ not (Low Priority).
    - + Elliptic Integrals
    @@ -114,7 +99,7 @@
    - + Owen's T Function
    @@ -130,16 +115,7 @@ it remains elusive at present.

    - - Jocobi - elliptic functions -
    -

    - These are useful in engineering applications - we have had a request to add - these. -

    -
    - + Statistical distributions
    @@ -148,7 +124,7 @@ for very large degrees of freedom?
    - + Feature Requests
    diff --git a/doc/html/math_toolkit/jacobi.html b/doc/html/math_toolkit/jacobi.html index a18b752fd..b7229414d 100644 --- a/doc/html/math_toolkit/jacobi.html +++ b/doc/html/math_toolkit/jacobi.html @@ -4,7 +4,7 @@ Jacobi Elliptic Functions - + diff --git a/doc/html/math_toolkit/jacobi/jac_over.html b/doc/html/math_toolkit/jacobi/jac_over.html index 9260c9131..b22f25c62 100644 --- a/doc/html/math_toolkit/jacobi/jac_over.html +++ b/doc/html/math_toolkit/jacobi/jac_over.html @@ -4,7 +4,7 @@ Overvew of the Jacobi Elliptic Functions - + diff --git a/doc/html/math_toolkit/jacobi/jacobi_cd.html b/doc/html/math_toolkit/jacobi/jacobi_cd.html index 497fef5a5..316714ad8 100644 --- a/doc/html/math_toolkit/jacobi/jacobi_cd.html +++ b/doc/html/math_toolkit/jacobi/jacobi_cd.html @@ -4,7 +4,7 @@ Jacobi Elliptic Function cd - + diff --git a/doc/html/math_toolkit/jacobi/jacobi_cn.html b/doc/html/math_toolkit/jacobi/jacobi_cn.html index 543f9f8a9..20d0627de 100644 --- a/doc/html/math_toolkit/jacobi/jacobi_cn.html +++ b/doc/html/math_toolkit/jacobi/jacobi_cn.html @@ -4,7 +4,7 @@ Jacobi Elliptic Function cn - + diff --git a/doc/html/math_toolkit/jacobi/jacobi_cs.html b/doc/html/math_toolkit/jacobi/jacobi_cs.html index 52e26fd6c..45c0aeadd 100644 --- a/doc/html/math_toolkit/jacobi/jacobi_cs.html +++ b/doc/html/math_toolkit/jacobi/jacobi_cs.html @@ -4,7 +4,7 @@ Jacobi Elliptic Function cs - + diff --git a/doc/html/math_toolkit/jacobi/jacobi_dc.html b/doc/html/math_toolkit/jacobi/jacobi_dc.html index 3d68e360f..055ec6a8f 100644 --- a/doc/html/math_toolkit/jacobi/jacobi_dc.html +++ b/doc/html/math_toolkit/jacobi/jacobi_dc.html @@ -4,7 +4,7 @@ Jacobi Elliptic Function dc - + diff --git a/doc/html/math_toolkit/jacobi/jacobi_dn.html b/doc/html/math_toolkit/jacobi/jacobi_dn.html index 9bb53db0d..5c09fb234 100644 --- a/doc/html/math_toolkit/jacobi/jacobi_dn.html +++ b/doc/html/math_toolkit/jacobi/jacobi_dn.html @@ -4,7 +4,7 @@ Jacobi Elliptic Function dn - + diff --git a/doc/html/math_toolkit/jacobi/jacobi_ds.html b/doc/html/math_toolkit/jacobi/jacobi_ds.html index 95f78aab8..400d1da66 100644 --- a/doc/html/math_toolkit/jacobi/jacobi_ds.html +++ b/doc/html/math_toolkit/jacobi/jacobi_ds.html @@ -4,7 +4,7 @@ Jacobi Elliptic Function ds - + diff --git a/doc/html/math_toolkit/jacobi/jacobi_elliptic.html b/doc/html/math_toolkit/jacobi/jacobi_elliptic.html index 37ab6c96f..bf40c8308 100644 --- a/doc/html/math_toolkit/jacobi/jacobi_elliptic.html +++ b/doc/html/math_toolkit/jacobi/jacobi_elliptic.html @@ -4,7 +4,7 @@ Jacobi Elliptic SN, CN and DN - + diff --git a/doc/html/math_toolkit/jacobi/jacobi_nc.html b/doc/html/math_toolkit/jacobi/jacobi_nc.html index 9aeb9cc2d..3fee4e0ce 100644 --- a/doc/html/math_toolkit/jacobi/jacobi_nc.html +++ b/doc/html/math_toolkit/jacobi/jacobi_nc.html @@ -4,7 +4,7 @@ Jacobi Elliptic Function nc - + diff --git a/doc/html/math_toolkit/jacobi/jacobi_nd.html b/doc/html/math_toolkit/jacobi/jacobi_nd.html index b73c31920..9024369cc 100644 --- a/doc/html/math_toolkit/jacobi/jacobi_nd.html +++ b/doc/html/math_toolkit/jacobi/jacobi_nd.html @@ -4,7 +4,7 @@ Jacobi Elliptic Function nd - + diff --git a/doc/html/math_toolkit/jacobi/jacobi_ns.html b/doc/html/math_toolkit/jacobi/jacobi_ns.html index b39f616c0..85a5a6750 100644 --- a/doc/html/math_toolkit/jacobi/jacobi_ns.html +++ b/doc/html/math_toolkit/jacobi/jacobi_ns.html @@ -4,7 +4,7 @@ Jacobi Elliptic Function ns - + diff --git a/doc/html/math_toolkit/jacobi/jacobi_sc.html b/doc/html/math_toolkit/jacobi/jacobi_sc.html index 372d21669..49c2c31d3 100644 --- a/doc/html/math_toolkit/jacobi/jacobi_sc.html +++ b/doc/html/math_toolkit/jacobi/jacobi_sc.html @@ -4,7 +4,7 @@ Jacobi Elliptic Function sc - + diff --git a/doc/html/math_toolkit/jacobi/jacobi_sd.html b/doc/html/math_toolkit/jacobi/jacobi_sd.html index a2a057870..f2ce7e6a9 100644 --- a/doc/html/math_toolkit/jacobi/jacobi_sd.html +++ b/doc/html/math_toolkit/jacobi/jacobi_sd.html @@ -4,7 +4,7 @@ Jacobi Elliptic Function sd - + diff --git a/doc/html/math_toolkit/jacobi/jacobi_sn.html b/doc/html/math_toolkit/jacobi/jacobi_sn.html index 973873a25..203c2604c 100644 --- a/doc/html/math_toolkit/jacobi/jacobi_sn.html +++ b/doc/html/math_toolkit/jacobi/jacobi_sn.html @@ -4,7 +4,7 @@ Jacobi Elliptic Function sn - + diff --git a/doc/html/math_toolkit/lanczos.html b/doc/html/math_toolkit/lanczos.html index 02c8a0fd6..3be143419 100644 --- a/doc/html/math_toolkit/lanczos.html +++ b/doc/html/math_toolkit/lanczos.html @@ -4,7 +4,7 @@ The Lanczos Approximation - + diff --git a/doc/html/math_toolkit/lcm_function_object.html b/doc/html/math_toolkit/lcm_function_object.html index ac8a18ef3..2e4eb8a57 100644 --- a/doc/html/math_toolkit/lcm_function_object.html +++ b/doc/html/math_toolkit/lcm_function_object.html @@ -4,7 +4,7 @@ LCM Function Object - + diff --git a/doc/html/math_toolkit/logs_and_tables.html b/doc/html/math_toolkit/logs_and_tables.html index 2896791e0..b47f290e2 100644 --- a/doc/html/math_toolkit/logs_and_tables.html +++ b/doc/html/math_toolkit/logs_and_tables.html @@ -4,7 +4,7 @@ Error logs and tables - + diff --git a/doc/html/math_toolkit/logs_and_tables/all_table.html b/doc/html/math_toolkit/logs_and_tables/all_table.html index 2cb2a64ae..efb553781 100644 --- a/doc/html/math_toolkit/logs_and_tables/all_table.html +++ b/doc/html/math_toolkit/logs_and_tables/all_table.html @@ -4,7 +4,7 @@ Tables of Error Rates for all Functions - + diff --git a/doc/html/math_toolkit/logs_and_tables/logs.html b/doc/html/math_toolkit/logs_and_tables/logs.html index c604ade15..40c7f4a88 100644 --- a/doc/html/math_toolkit/logs_and_tables/logs.html +++ b/doc/html/math_toolkit/logs_and_tables/logs.html @@ -4,7 +4,7 @@ Error Logs For Error Rate Tables - + diff --git a/doc/html/math_toolkit/macros.html b/doc/html/math_toolkit/macros.html index beb5ccda6..a6a9ef0d5 100644 --- a/doc/html/math_toolkit/macros.html +++ b/doc/html/math_toolkit/macros.html @@ -4,7 +4,7 @@ Floating-Point Constant Macros - + diff --git a/doc/html/math_toolkit/main_faq.html b/doc/html/math_toolkit/main_faq.html index 51daa0063..b7794a484 100644 --- a/doc/html/math_toolkit/main_faq.html +++ b/doc/html/math_toolkit/main_faq.html @@ -4,7 +4,7 @@ Frequently Asked Questions FAQ - + diff --git a/doc/html/math_toolkit/main_intro.html b/doc/html/math_toolkit/main_intro.html index 979521b48..db945b61d 100644 --- a/doc/html/math_toolkit/main_intro.html +++ b/doc/html/math_toolkit/main_intro.html @@ -4,7 +4,7 @@ About the Math Toolkit - + diff --git a/doc/html/math_toolkit/main_tr1.html b/doc/html/math_toolkit/main_tr1.html index 294fe127c..b7c4a98d6 100644 --- a/doc/html/math_toolkit/main_tr1.html +++ b/doc/html/math_toolkit/main_tr1.html @@ -4,7 +4,7 @@ C99 and TR1 C Functions Overview - + diff --git a/doc/html/math_toolkit/mem_typedef.html b/doc/html/math_toolkit/mem_typedef.html index 7a0e44c29..632d82841 100644 --- a/doc/html/math_toolkit/mem_typedef.html +++ b/doc/html/math_toolkit/mem_typedef.html @@ -4,7 +4,7 @@ Quaternion Member Typedefs - + diff --git a/doc/html/math_toolkit/minimum_typdefs.html b/doc/html/math_toolkit/minimum_typdefs.html index dc01ae291..3f4af79e7 100644 --- a/doc/html/math_toolkit/minimum_typdefs.html +++ b/doc/html/math_toolkit/minimum_typdefs.html @@ -4,7 +4,7 @@ Minimum-width floating-point typedefs - + diff --git a/doc/html/math_toolkit/multiprecision.html b/doc/html/math_toolkit/multiprecision.html index c71bf7c40..1e78a4596 100644 --- a/doc/html/math_toolkit/multiprecision.html +++ b/doc/html/math_toolkit/multiprecision.html @@ -4,7 +4,7 @@ Cost of High-Precision Non-built-in Floating-point - + diff --git a/doc/html/math_toolkit/namespaces.html b/doc/html/math_toolkit/namespaces.html index bab27fc35..077c77d04 100644 --- a/doc/html/math_toolkit/namespaces.html +++ b/doc/html/math_toolkit/namespaces.html @@ -4,7 +4,7 @@ Namespaces - + diff --git a/doc/html/math_toolkit/navigation.html b/doc/html/math_toolkit/navigation.html index 6b67834a4..c2f1647bc 100644 --- a/doc/html/math_toolkit/navigation.html +++ b/doc/html/math_toolkit/navigation.html @@ -4,7 +4,7 @@ Navigation - + @@ -27,7 +27,7 @@ Navigation

    - +

    Boost.Math documentation is provided in both HTML and PDF formats. diff --git a/doc/html/math_toolkit/new_const.html b/doc/html/math_toolkit/new_const.html index 8f4213de8..0e3545fa8 100644 --- a/doc/html/math_toolkit/new_const.html +++ b/doc/html/math_toolkit/new_const.html @@ -4,7 +4,7 @@ Defining New Constants - + diff --git a/doc/html/math_toolkit/next_float.html b/doc/html/math_toolkit/next_float.html index 839620f26..91456d2b6 100644 --- a/doc/html/math_toolkit/next_float.html +++ b/doc/html/math_toolkit/next_float.html @@ -4,7 +4,7 @@ Floating-Point Representation Distance (ULP), and Finding Adjacent Floating-Point Values - + diff --git a/doc/html/math_toolkit/next_float/float_advance.html b/doc/html/math_toolkit/next_float/float_advance.html index 0e36e6531..008f140e4 100644 --- a/doc/html/math_toolkit/next_float/float_advance.html +++ b/doc/html/math_toolkit/next_float/float_advance.html @@ -4,7 +4,7 @@ Advancing a floating-point Value by a Specific Representation Distance (ULP) float_advance - + diff --git a/doc/html/math_toolkit/next_float/float_distance.html b/doc/html/math_toolkit/next_float/float_distance.html index fbd091699..56e46d025 100644 --- a/doc/html/math_toolkit/next_float/float_distance.html +++ b/doc/html/math_toolkit/next_float/float_distance.html @@ -4,7 +4,7 @@ Calculating the Representation Distance Between Two floating-point Values (ULP) float_distance - + diff --git a/doc/html/math_toolkit/next_float/float_next.html b/doc/html/math_toolkit/next_float/float_next.html index e969af96e..d306fae37 100644 --- a/doc/html/math_toolkit/next_float/float_next.html +++ b/doc/html/math_toolkit/next_float/float_next.html @@ -4,7 +4,7 @@ Finding the Next Greater Representable Value (float_next) - + diff --git a/doc/html/math_toolkit/next_float/float_prior.html b/doc/html/math_toolkit/next_float/float_prior.html index ad7af894e..db4969cf2 100644 --- a/doc/html/math_toolkit/next_float/float_prior.html +++ b/doc/html/math_toolkit/next_float/float_prior.html @@ -4,7 +4,7 @@ Finding the Next Smaller Representable Value (float_prior) - + diff --git a/doc/html/math_toolkit/next_float/nextafter.html b/doc/html/math_toolkit/next_float/nextafter.html index 8bd69f7f1..282117fd0 100644 --- a/doc/html/math_toolkit/next_float/nextafter.html +++ b/doc/html/math_toolkit/next_float/nextafter.html @@ -4,7 +4,7 @@ Finding the Next Representable Value in a Specific Direction (nextafter) - + diff --git a/doc/html/math_toolkit/next_float/ulp.html b/doc/html/math_toolkit/next_float/ulp.html index a7a785642..2c7927355 100644 --- a/doc/html/math_toolkit/next_float/ulp.html +++ b/doc/html/math_toolkit/next_float/ulp.html @@ -4,7 +4,7 @@ Obtaining the Size of a Unit In the Last Place - ULP - + diff --git a/doc/html/math_toolkit/number_series.html b/doc/html/math_toolkit/number_series.html index 1fc5b66bc..6103acdc5 100644 --- a/doc/html/math_toolkit/number_series.html +++ b/doc/html/math_toolkit/number_series.html @@ -4,7 +4,7 @@ Number Series - + diff --git a/doc/html/math_toolkit/number_series/bernoulli_numbers.html b/doc/html/math_toolkit/number_series/bernoulli_numbers.html index 7cda52ef8..f30729517 100644 --- a/doc/html/math_toolkit/number_series/bernoulli_numbers.html +++ b/doc/html/math_toolkit/number_series/bernoulli_numbers.html @@ -4,7 +4,7 @@ Bernoulli Numbers - + diff --git a/doc/html/math_toolkit/number_series/primes.html b/doc/html/math_toolkit/number_series/primes.html index 32d1f6e25..25bf58dc3 100644 --- a/doc/html/math_toolkit/number_series/primes.html +++ b/doc/html/math_toolkit/number_series/primes.html @@ -4,7 +4,7 @@ Prime Numbers - + diff --git a/doc/html/math_toolkit/number_series/tangent_numbers.html b/doc/html/math_toolkit/number_series/tangent_numbers.html index 708dbceee..b555a0930 100644 --- a/doc/html/math_toolkit/number_series/tangent_numbers.html +++ b/doc/html/math_toolkit/number_series/tangent_numbers.html @@ -4,7 +4,7 @@ Tangent Numbers - + diff --git a/doc/html/math_toolkit/oct_create.html b/doc/html/math_toolkit/oct_create.html index c18dedb16..95307b3df 100644 --- a/doc/html/math_toolkit/oct_create.html +++ b/doc/html/math_toolkit/oct_create.html @@ -4,7 +4,7 @@ Octonion Creation Functions - + diff --git a/doc/html/math_toolkit/oct_header.html b/doc/html/math_toolkit/oct_header.html index f98d80468..b5877d62a 100644 --- a/doc/html/math_toolkit/oct_header.html +++ b/doc/html/math_toolkit/oct_header.html @@ -4,7 +4,7 @@ Header File - + diff --git a/doc/html/math_toolkit/oct_history.html b/doc/html/math_toolkit/oct_history.html index 4cb05a344..428999100 100644 --- a/doc/html/math_toolkit/oct_history.html +++ b/doc/html/math_toolkit/oct_history.html @@ -4,7 +4,7 @@ History - + diff --git a/doc/html/math_toolkit/oct_mem_fun.html b/doc/html/math_toolkit/oct_mem_fun.html index e782596da..1742178ff 100644 --- a/doc/html/math_toolkit/oct_mem_fun.html +++ b/doc/html/math_toolkit/oct_mem_fun.html @@ -4,7 +4,7 @@ Octonion Member Functions - + diff --git a/doc/html/math_toolkit/oct_non_mem.html b/doc/html/math_toolkit/oct_non_mem.html index b5d8dd045..091736137 100644 --- a/doc/html/math_toolkit/oct_non_mem.html +++ b/doc/html/math_toolkit/oct_non_mem.html @@ -4,7 +4,7 @@ Octonion Non-Member Operators - + diff --git a/doc/html/math_toolkit/oct_overview.html b/doc/html/math_toolkit/oct_overview.html index 522df1116..094bf9929 100644 --- a/doc/html/math_toolkit/oct_overview.html +++ b/doc/html/math_toolkit/oct_overview.html @@ -4,7 +4,7 @@ Overview - + diff --git a/doc/html/math_toolkit/oct_specialization.html b/doc/html/math_toolkit/oct_specialization.html index 7a5200580..78d7d8689 100644 --- a/doc/html/math_toolkit/oct_specialization.html +++ b/doc/html/math_toolkit/oct_specialization.html @@ -4,7 +4,7 @@ Octonion Specializations - + diff --git a/doc/html/math_toolkit/oct_synopsis.html b/doc/html/math_toolkit/oct_synopsis.html index 2da26581d..9999c8c20 100644 --- a/doc/html/math_toolkit/oct_synopsis.html +++ b/doc/html/math_toolkit/oct_synopsis.html @@ -4,7 +4,7 @@ Synopsis - + diff --git a/doc/html/math_toolkit/oct_tests.html b/doc/html/math_toolkit/oct_tests.html index e94318d3d..9ab8fcb2d 100644 --- a/doc/html/math_toolkit/oct_tests.html +++ b/doc/html/math_toolkit/oct_tests.html @@ -4,7 +4,7 @@ Test Program - + diff --git a/doc/html/math_toolkit/oct_todo.html b/doc/html/math_toolkit/oct_todo.html index 0fd5b55a0..1e389a44a 100644 --- a/doc/html/math_toolkit/oct_todo.html +++ b/doc/html/math_toolkit/oct_todo.html @@ -4,7 +4,7 @@ To Do - + diff --git a/doc/html/math_toolkit/oct_trans.html b/doc/html/math_toolkit/oct_trans.html index b9851d1bc..eefff8c1d 100644 --- a/doc/html/math_toolkit/oct_trans.html +++ b/doc/html/math_toolkit/oct_trans.html @@ -4,7 +4,7 @@ Octonions Transcendentals - + diff --git a/doc/html/math_toolkit/oct_typedefs.html b/doc/html/math_toolkit/oct_typedefs.html index a17f2a324..1736aaf50 100644 --- a/doc/html/math_toolkit/oct_typedefs.html +++ b/doc/html/math_toolkit/oct_typedefs.html @@ -4,7 +4,7 @@ Octonion Member Typedefs - + diff --git a/doc/html/math_toolkit/oct_value_ops.html b/doc/html/math_toolkit/oct_value_ops.html index a5dfc95db..86ed602b2 100644 --- a/doc/html/math_toolkit/oct_value_ops.html +++ b/doc/html/math_toolkit/oct_value_ops.html @@ -4,7 +4,7 @@ Octonion Value Operations - + diff --git a/doc/html/math_toolkit/octonion.html b/doc/html/math_toolkit/octonion.html index c313c06cb..c4f5002eb 100644 --- a/doc/html/math_toolkit/octonion.html +++ b/doc/html/math_toolkit/octonion.html @@ -4,7 +4,7 @@ Template Class octonion - + diff --git a/doc/html/math_toolkit/overview_tr1.html b/doc/html/math_toolkit/overview_tr1.html index 5a238df10..99b5bedd8 100644 --- a/doc/html/math_toolkit/overview_tr1.html +++ b/doc/html/math_toolkit/overview_tr1.html @@ -4,7 +4,7 @@ C99 and C++ TR1 C-style Functions - + diff --git a/doc/html/math_toolkit/owens_t.html b/doc/html/math_toolkit/owens_t.html index 11b426909..44b7b6b51 100644 --- a/doc/html/math_toolkit/owens_t.html +++ b/doc/html/math_toolkit/owens_t.html @@ -4,7 +4,7 @@ Owen's T function - + diff --git a/doc/html/math_toolkit/perf_over1.html b/doc/html/math_toolkit/perf_over1.html index ca775d729..3db886d53 100644 --- a/doc/html/math_toolkit/perf_over1.html +++ b/doc/html/math_toolkit/perf_over1.html @@ -4,7 +4,7 @@ Performance - + diff --git a/doc/html/math_toolkit/perf_over2.html b/doc/html/math_toolkit/perf_over2.html index 0858593a4..df3217e2e 100644 --- a/doc/html/math_toolkit/perf_over2.html +++ b/doc/html/math_toolkit/perf_over2.html @@ -4,7 +4,7 @@ Performance Overview - + diff --git a/doc/html/math_toolkit/perf_test_app.html b/doc/html/math_toolkit/perf_test_app.html index 328d54010..0f28a156c 100644 --- a/doc/html/math_toolkit/perf_test_app.html +++ b/doc/html/math_toolkit/perf_test_app.html @@ -4,7 +4,7 @@ The Performance Test Applications - + diff --git a/doc/html/math_toolkit/pol_overview.html b/doc/html/math_toolkit/pol_overview.html index 62c51a8cc..5a70f4a43 100644 --- a/doc/html/math_toolkit/pol_overview.html +++ b/doc/html/math_toolkit/pol_overview.html @@ -4,7 +4,7 @@ Policy Overview - + diff --git a/doc/html/math_toolkit/pol_ref.html b/doc/html/math_toolkit/pol_ref.html index 4fc1fdabb..9fe86b632 100644 --- a/doc/html/math_toolkit/pol_ref.html +++ b/doc/html/math_toolkit/pol_ref.html @@ -4,7 +4,7 @@ Policy Reference - + diff --git a/doc/html/math_toolkit/pol_ref/assert_undefined.html b/doc/html/math_toolkit/pol_ref/assert_undefined.html index 546d2b1ff..6639fa824 100644 --- a/doc/html/math_toolkit/pol_ref/assert_undefined.html +++ b/doc/html/math_toolkit/pol_ref/assert_undefined.html @@ -4,7 +4,7 @@ Mathematically Undefined Function Policies - + diff --git a/doc/html/math_toolkit/pol_ref/discrete_quant_ref.html b/doc/html/math_toolkit/pol_ref/discrete_quant_ref.html index 145eedec7..5fb3f2cfd 100644 --- a/doc/html/math_toolkit/pol_ref/discrete_quant_ref.html +++ b/doc/html/math_toolkit/pol_ref/discrete_quant_ref.html @@ -4,7 +4,7 @@ Discrete Quantile Policies - + diff --git a/doc/html/math_toolkit/pol_ref/error_handling_policies.html b/doc/html/math_toolkit/pol_ref/error_handling_policies.html index e191b7728..d7b2513c4 100644 --- a/doc/html/math_toolkit/pol_ref/error_handling_policies.html +++ b/doc/html/math_toolkit/pol_ref/error_handling_policies.html @@ -4,7 +4,7 @@ Error Handling Policies - + diff --git a/doc/html/math_toolkit/pol_ref/internal_promotion.html b/doc/html/math_toolkit/pol_ref/internal_promotion.html index 849381585..decaaf31f 100644 --- a/doc/html/math_toolkit/pol_ref/internal_promotion.html +++ b/doc/html/math_toolkit/pol_ref/internal_promotion.html @@ -4,7 +4,7 @@ Internal Floating-point Promotion Policies - + diff --git a/doc/html/math_toolkit/pol_ref/iteration_pol.html b/doc/html/math_toolkit/pol_ref/iteration_pol.html index 0113547e0..875161422 100644 --- a/doc/html/math_toolkit/pol_ref/iteration_pol.html +++ b/doc/html/math_toolkit/pol_ref/iteration_pol.html @@ -4,7 +4,7 @@ Iteration Limits Policies - + diff --git a/doc/html/math_toolkit/pol_ref/namespace_pol.html b/doc/html/math_toolkit/pol_ref/namespace_pol.html index fc3377193..43181b7d8 100644 --- a/doc/html/math_toolkit/pol_ref/namespace_pol.html +++ b/doc/html/math_toolkit/pol_ref/namespace_pol.html @@ -4,7 +4,7 @@ Setting Polices at Namespace Scope - + diff --git a/doc/html/math_toolkit/pol_ref/pol_ref_ref.html b/doc/html/math_toolkit/pol_ref/pol_ref_ref.html index 7e354ba0a..7dc388baa 100644 --- a/doc/html/math_toolkit/pol_ref/pol_ref_ref.html +++ b/doc/html/math_toolkit/pol_ref/pol_ref_ref.html @@ -4,7 +4,7 @@ Policy Class Reference - + diff --git a/doc/html/math_toolkit/pol_ref/policy_defaults.html b/doc/html/math_toolkit/pol_ref/policy_defaults.html index 5cab6f040..7a16c74a4 100644 --- a/doc/html/math_toolkit/pol_ref/policy_defaults.html +++ b/doc/html/math_toolkit/pol_ref/policy_defaults.html @@ -4,7 +4,7 @@ Using Macros to Change the Policy Defaults - + diff --git a/doc/html/math_toolkit/pol_ref/precision_pol.html b/doc/html/math_toolkit/pol_ref/precision_pol.html index a2ed49650..5f9ecdd4c 100644 --- a/doc/html/math_toolkit/pol_ref/precision_pol.html +++ b/doc/html/math_toolkit/pol_ref/precision_pol.html @@ -4,7 +4,7 @@ Precision Policies - + diff --git a/doc/html/math_toolkit/pol_tutorial.html b/doc/html/math_toolkit/pol_tutorial.html index 81142abc1..2e7bb1a94 100644 --- a/doc/html/math_toolkit/pol_tutorial.html +++ b/doc/html/math_toolkit/pol_tutorial.html @@ -4,7 +4,7 @@ Policy Tutorial - + diff --git a/doc/html/math_toolkit/pol_tutorial/ad_hoc_dist_policies.html b/doc/html/math_toolkit/pol_tutorial/ad_hoc_dist_policies.html index e5dd1f536..395837d4f 100644 --- a/doc/html/math_toolkit/pol_tutorial/ad_hoc_dist_policies.html +++ b/doc/html/math_toolkit/pol_tutorial/ad_hoc_dist_policies.html @@ -4,7 +4,7 @@ Setting Policies for Distributions on an Ad Hoc Basis - + diff --git a/doc/html/math_toolkit/pol_tutorial/ad_hoc_sf_policies.html b/doc/html/math_toolkit/pol_tutorial/ad_hoc_sf_policies.html index eb17528f3..091409a05 100644 --- a/doc/html/math_toolkit/pol_tutorial/ad_hoc_sf_policies.html +++ b/doc/html/math_toolkit/pol_tutorial/ad_hoc_sf_policies.html @@ -4,7 +4,7 @@ Changing the Policy on an Ad Hoc Basis for the Special Functions - + diff --git a/doc/html/math_toolkit/pol_tutorial/changing_policy_defaults.html b/doc/html/math_toolkit/pol_tutorial/changing_policy_defaults.html index 443ce8d75..443b7ca5c 100644 --- a/doc/html/math_toolkit/pol_tutorial/changing_policy_defaults.html +++ b/doc/html/math_toolkit/pol_tutorial/changing_policy_defaults.html @@ -4,7 +4,7 @@ Changing the Policy Defaults - + diff --git a/doc/html/math_toolkit/pol_tutorial/namespace_policies.html b/doc/html/math_toolkit/pol_tutorial/namespace_policies.html index 79bbc9aed..15f701917 100644 --- a/doc/html/math_toolkit/pol_tutorial/namespace_policies.html +++ b/doc/html/math_toolkit/pol_tutorial/namespace_policies.html @@ -4,7 +4,7 @@ Setting Policies at Namespace or Translation Unit Scope - + diff --git a/doc/html/math_toolkit/pol_tutorial/policy_tut_defaults.html b/doc/html/math_toolkit/pol_tutorial/policy_tut_defaults.html index 1220941c9..e95c1c91a 100644 --- a/doc/html/math_toolkit/pol_tutorial/policy_tut_defaults.html +++ b/doc/html/math_toolkit/pol_tutorial/policy_tut_defaults.html @@ -4,7 +4,7 @@ Policies Have Sensible Defaults - + diff --git a/doc/html/math_toolkit/pol_tutorial/policy_usage.html b/doc/html/math_toolkit/pol_tutorial/policy_usage.html index 1a3f00f26..e1980d502 100644 --- a/doc/html/math_toolkit/pol_tutorial/policy_usage.html +++ b/doc/html/math_toolkit/pol_tutorial/policy_usage.html @@ -4,7 +4,7 @@ So How are Policies Used Anyway? - + diff --git a/doc/html/math_toolkit/pol_tutorial/understand_dis_quant.html b/doc/html/math_toolkit/pol_tutorial/understand_dis_quant.html index fec730b69..b59719661 100644 --- a/doc/html/math_toolkit/pol_tutorial/understand_dis_quant.html +++ b/doc/html/math_toolkit/pol_tutorial/understand_dis_quant.html @@ -4,7 +4,7 @@ Understanding Quantiles of Discrete Distributions - + diff --git a/doc/html/math_toolkit/pol_tutorial/user_def_err_pol.html b/doc/html/math_toolkit/pol_tutorial/user_def_err_pol.html index 7e56d2b23..2b7babb31 100644 --- a/doc/html/math_toolkit/pol_tutorial/user_def_err_pol.html +++ b/doc/html/math_toolkit/pol_tutorial/user_def_err_pol.html @@ -4,7 +4,7 @@ Calling User Defined Error Handlers - + diff --git a/doc/html/math_toolkit/pol_tutorial/what_is_a_policy.html b/doc/html/math_toolkit/pol_tutorial/what_is_a_policy.html index 564e91243..a3220b385 100644 --- a/doc/html/math_toolkit/pol_tutorial/what_is_a_policy.html +++ b/doc/html/math_toolkit/pol_tutorial/what_is_a_policy.html @@ -4,7 +4,7 @@ So Just What is a Policy Anyway? - + diff --git a/doc/html/math_toolkit/powers.html b/doc/html/math_toolkit/powers.html index 276e8eeac..69fc4519e 100644 --- a/doc/html/math_toolkit/powers.html +++ b/doc/html/math_toolkit/powers.html @@ -4,7 +4,7 @@ Basic Functions - + diff --git a/doc/html/math_toolkit/powers/cbrt.html b/doc/html/math_toolkit/powers/cbrt.html index 33d66050d..8ea73dd7b 100644 --- a/doc/html/math_toolkit/powers/cbrt.html +++ b/doc/html/math_toolkit/powers/cbrt.html @@ -4,7 +4,7 @@ cbrt - + diff --git a/doc/html/math_toolkit/powers/cos_pi.html b/doc/html/math_toolkit/powers/cos_pi.html index f7ef79008..893fb7c07 100644 --- a/doc/html/math_toolkit/powers/cos_pi.html +++ b/doc/html/math_toolkit/powers/cos_pi.html @@ -4,7 +4,7 @@ cos_pi - + diff --git a/doc/html/math_toolkit/powers/ct_pow.html b/doc/html/math_toolkit/powers/ct_pow.html index 988ddfa5f..75e1da62e 100644 --- a/doc/html/math_toolkit/powers/ct_pow.html +++ b/doc/html/math_toolkit/powers/ct_pow.html @@ -4,7 +4,7 @@ Compile Time Power of a Runtime Base - + diff --git a/doc/html/math_toolkit/powers/expm1.html b/doc/html/math_toolkit/powers/expm1.html index c43dd0ffb..d7bfe542e 100644 --- a/doc/html/math_toolkit/powers/expm1.html +++ b/doc/html/math_toolkit/powers/expm1.html @@ -4,7 +4,7 @@ expm1 - + diff --git a/doc/html/math_toolkit/powers/hypot.html b/doc/html/math_toolkit/powers/hypot.html index 91a5aa2ef..b6e159bf6 100644 --- a/doc/html/math_toolkit/powers/hypot.html +++ b/doc/html/math_toolkit/powers/hypot.html @@ -4,7 +4,7 @@ hypot - + diff --git a/doc/html/math_toolkit/powers/log1p.html b/doc/html/math_toolkit/powers/log1p.html index d3df8782b..a8edd32b5 100644 --- a/doc/html/math_toolkit/powers/log1p.html +++ b/doc/html/math_toolkit/powers/log1p.html @@ -4,7 +4,7 @@ log1p - + diff --git a/doc/html/math_toolkit/powers/powm1.html b/doc/html/math_toolkit/powers/powm1.html index 90a4e3be3..794fc754b 100644 --- a/doc/html/math_toolkit/powers/powm1.html +++ b/doc/html/math_toolkit/powers/powm1.html @@ -4,7 +4,7 @@ powm1 - + diff --git a/doc/html/math_toolkit/powers/sin_pi.html b/doc/html/math_toolkit/powers/sin_pi.html index 4cf749043..4a50fe1ff 100644 --- a/doc/html/math_toolkit/powers/sin_pi.html +++ b/doc/html/math_toolkit/powers/sin_pi.html @@ -4,7 +4,7 @@ sin_pi - + diff --git a/doc/html/math_toolkit/powers/sqrt1pm1.html b/doc/html/math_toolkit/powers/sqrt1pm1.html index aac178e8e..d6c5131a4 100644 --- a/doc/html/math_toolkit/powers/sqrt1pm1.html +++ b/doc/html/math_toolkit/powers/sqrt1pm1.html @@ -4,7 +4,7 @@ sqrt1pm1 - + diff --git a/doc/html/math_toolkit/quat.html b/doc/html/math_toolkit/quat.html index a237d4264..81ce888eb 100644 --- a/doc/html/math_toolkit/quat.html +++ b/doc/html/math_toolkit/quat.html @@ -4,7 +4,7 @@ Template Class quaternion - + diff --git a/doc/html/math_toolkit/quat_header.html b/doc/html/math_toolkit/quat_header.html index d36d560d2..b20a38c37 100644 --- a/doc/html/math_toolkit/quat_header.html +++ b/doc/html/math_toolkit/quat_header.html @@ -4,7 +4,7 @@ Header File - + diff --git a/doc/html/math_toolkit/quat_history.html b/doc/html/math_toolkit/quat_history.html index 5fe24a2ea..8c4313627 100644 --- a/doc/html/math_toolkit/quat_history.html +++ b/doc/html/math_toolkit/quat_history.html @@ -4,7 +4,7 @@ History - + diff --git a/doc/html/math_toolkit/quat_mem_fun.html b/doc/html/math_toolkit/quat_mem_fun.html index 3f878f4cb..a95549314 100644 --- a/doc/html/math_toolkit/quat_mem_fun.html +++ b/doc/html/math_toolkit/quat_mem_fun.html @@ -4,7 +4,7 @@ Quaternion Member Functions - + diff --git a/doc/html/math_toolkit/quat_non_mem.html b/doc/html/math_toolkit/quat_non_mem.html index 4632b95a6..0438b0c46 100644 --- a/doc/html/math_toolkit/quat_non_mem.html +++ b/doc/html/math_toolkit/quat_non_mem.html @@ -4,7 +4,7 @@ Quaternion Non-Member Operators - + diff --git a/doc/html/math_toolkit/quat_overview.html b/doc/html/math_toolkit/quat_overview.html index 33febd78c..7ac9890cd 100644 --- a/doc/html/math_toolkit/quat_overview.html +++ b/doc/html/math_toolkit/quat_overview.html @@ -4,7 +4,7 @@ Overview - + diff --git a/doc/html/math_toolkit/quat_synopsis.html b/doc/html/math_toolkit/quat_synopsis.html index 4ad41b9c1..e4ffcca22 100644 --- a/doc/html/math_toolkit/quat_synopsis.html +++ b/doc/html/math_toolkit/quat_synopsis.html @@ -4,7 +4,7 @@ Synopsis - + diff --git a/doc/html/math_toolkit/quat_tests.html b/doc/html/math_toolkit/quat_tests.html index b8b15ae7d..8c012d482 100644 --- a/doc/html/math_toolkit/quat_tests.html +++ b/doc/html/math_toolkit/quat_tests.html @@ -4,7 +4,7 @@ Test Program - + diff --git a/doc/html/math_toolkit/quat_todo.html b/doc/html/math_toolkit/quat_todo.html index 4b398eb95..96b011f30 100644 --- a/doc/html/math_toolkit/quat_todo.html +++ b/doc/html/math_toolkit/quat_todo.html @@ -4,7 +4,7 @@ To Do - + diff --git a/doc/html/math_toolkit/rationale.html b/doc/html/math_toolkit/rationale.html index 3980b5906..ce3919536 100644 --- a/doc/html/math_toolkit/rationale.html +++ b/doc/html/math_toolkit/rationale.html @@ -4,7 +4,7 @@ Rationale - + diff --git a/doc/html/math_toolkit/rationale0.html b/doc/html/math_toolkit/rationale0.html index 8e03d6307..664442688 100644 --- a/doc/html/math_toolkit/rationale0.html +++ b/doc/html/math_toolkit/rationale0.html @@ -4,7 +4,7 @@ Rationale - + diff --git a/doc/html/math_toolkit/real_concepts.html b/doc/html/math_toolkit/real_concepts.html index 330ec5067..bb5c38f9b 100644 --- a/doc/html/math_toolkit/real_concepts.html +++ b/doc/html/math_toolkit/real_concepts.html @@ -4,7 +4,7 @@ Conceptual Requirements for Real Number Types - + diff --git a/doc/html/math_toolkit/refs.html b/doc/html/math_toolkit/refs.html index 751081f52..8f71197ac 100644 --- a/doc/html/math_toolkit/refs.html +++ b/doc/html/math_toolkit/refs.html @@ -4,7 +4,7 @@ References - + diff --git a/doc/html/math_toolkit/relative_error.html b/doc/html/math_toolkit/relative_error.html index 9b32a029a..efb5bd0dd 100644 --- a/doc/html/math_toolkit/relative_error.html +++ b/doc/html/math_toolkit/relative_error.html @@ -4,7 +4,7 @@ Relative Error - + diff --git a/doc/html/math_toolkit/remez.html b/doc/html/math_toolkit/remez.html index fa107b4f7..d907f754d 100644 --- a/doc/html/math_toolkit/remez.html +++ b/doc/html/math_toolkit/remez.html @@ -4,7 +4,7 @@ The Remez Method - + diff --git a/doc/html/math_toolkit/result_type.html b/doc/html/math_toolkit/result_type.html index 4d14ffc1b..adf4ba9db 100644 --- a/doc/html/math_toolkit/result_type.html +++ b/doc/html/math_toolkit/result_type.html @@ -4,7 +4,7 @@ Calculation of the Type of the Result - + diff --git a/doc/html/math_toolkit/roots.html b/doc/html/math_toolkit/roots.html index 5652417db..0f197f872 100644 --- a/doc/html/math_toolkit/roots.html +++ b/doc/html/math_toolkit/roots.html @@ -4,7 +4,7 @@ Root finding - + diff --git a/doc/html/math_toolkit/roots/bad_guess.html b/doc/html/math_toolkit/roots/bad_guess.html index 77fbd6bed..a4474334f 100644 --- a/doc/html/math_toolkit/roots/bad_guess.html +++ b/doc/html/math_toolkit/roots/bad_guess.html @@ -4,7 +4,7 @@ The Effect of a Poor Initial Guess - + diff --git a/doc/html/math_toolkit/roots/bad_roots.html b/doc/html/math_toolkit/roots/bad_roots.html index 7ed511bea..61c8823e8 100644 --- a/doc/html/math_toolkit/roots/bad_roots.html +++ b/doc/html/math_toolkit/roots/bad_roots.html @@ -4,7 +4,7 @@ Examples Where Root Finding Goes Wrong - + diff --git a/doc/html/math_toolkit/roots/brent_minima.html b/doc/html/math_toolkit/roots/brent_minima.html index 7d634f4f1..efc452b45 100644 --- a/doc/html/math_toolkit/roots/brent_minima.html +++ b/doc/html/math_toolkit/roots/brent_minima.html @@ -4,7 +4,7 @@ Locating Function Minima using Brent's algorithm - + diff --git a/doc/html/math_toolkit/roots/polynomials.html b/doc/html/math_toolkit/roots/polynomials.html index 765e1b0e0..5a2476348 100644 --- a/doc/html/math_toolkit/roots/polynomials.html +++ b/doc/html/math_toolkit/roots/polynomials.html @@ -4,7 +4,7 @@ Polynomials - + @@ -179,6 +179,16 @@ (here floating point, complex, etc) and over a unique factorization domain (integers). Division of polynomials over a field is compatible with Euclidean GCD.

    +

    + Division of polynomials over a UFD is compatible with the subresultant algorithm + for GCD (implemented as subresultant_gcd), but a serious word of warning + is required: the intermediate value swell of that algorithm will cause single-precision + integral types to overflow very easily. So although the algorithm will work + on single-precision integral types, an overload of the gcd function is only + provided for polynomials with multi-precision integral types, to prevent + nasty surprises. This is done somewhat crudely by disabling the overload + for non-POD integral types. +

    Advanced manipulations: the FFT, factorisation etc are not currently provided. Submissions for these are of course welcome :-) diff --git a/doc/html/math_toolkit/roots/rational.html b/doc/html/math_toolkit/roots/rational.html index 1fd97173d..620d818fd 100644 --- a/doc/html/math_toolkit/roots/rational.html +++ b/doc/html/math_toolkit/roots/rational.html @@ -4,7 +4,7 @@ Polynomial and Rational Function Evaluation - + diff --git a/doc/html/math_toolkit/roots/root_comparison.html b/doc/html/math_toolkit/roots/root_comparison.html index a24624558..16bf97ecf 100644 --- a/doc/html/math_toolkit/roots/root_comparison.html +++ b/doc/html/math_toolkit/roots/root_comparison.html @@ -4,7 +4,7 @@ Comparison of Root Finding Algorithms - + diff --git a/doc/html/math_toolkit/roots/root_comparison/cbrt_comparison.html b/doc/html/math_toolkit/roots/root_comparison/cbrt_comparison.html index f5bcbb9a1..af50ca030 100644 --- a/doc/html/math_toolkit/roots/root_comparison/cbrt_comparison.html +++ b/doc/html/math_toolkit/roots/root_comparison/cbrt_comparison.html @@ -4,7 +4,7 @@ Comparison of Cube Root Finding Algorithms - + diff --git a/doc/html/math_toolkit/roots/root_comparison/elliptic_comparison.html b/doc/html/math_toolkit/roots/root_comparison/elliptic_comparison.html index dc20b49ee..15ec2e4cf 100644 --- a/doc/html/math_toolkit/roots/root_comparison/elliptic_comparison.html +++ b/doc/html/math_toolkit/roots/root_comparison/elliptic_comparison.html @@ -4,7 +4,7 @@ Comparison of Elliptic Integral Root Finding Algoritghms - + diff --git a/doc/html/math_toolkit/roots/root_comparison/root_n_comparison.html b/doc/html/math_toolkit/roots/root_comparison/root_n_comparison.html index a33ce750b..f991430a1 100644 --- a/doc/html/math_toolkit/roots/root_comparison/root_n_comparison.html +++ b/doc/html/math_toolkit/roots/root_comparison/root_n_comparison.html @@ -4,7 +4,7 @@ Comparison of Nth-root Finding Algorithms - + diff --git a/doc/html/math_toolkit/roots/root_finding_examples.html b/doc/html/math_toolkit/roots/root_finding_examples.html index 12c38f6f1..dc2799514 100644 --- a/doc/html/math_toolkit/roots/root_finding_examples.html +++ b/doc/html/math_toolkit/roots/root_finding_examples.html @@ -4,7 +4,7 @@ Examples of Root-Finding (with and without derivatives) - + diff --git a/doc/html/math_toolkit/roots/root_finding_examples/5th_root_eg.html b/doc/html/math_toolkit/roots/root_finding_examples/5th_root_eg.html index 0b2ba8f48..fa35c3ac6 100644 --- a/doc/html/math_toolkit/roots/root_finding_examples/5th_root_eg.html +++ b/doc/html/math_toolkit/roots/root_finding_examples/5th_root_eg.html @@ -4,7 +4,7 @@ Computing the Fifth Root - + diff --git a/doc/html/math_toolkit/roots/root_finding_examples/cbrt_eg.html b/doc/html/math_toolkit/roots/root_finding_examples/cbrt_eg.html index 17acd8e95..cd62febc9 100644 --- a/doc/html/math_toolkit/roots/root_finding_examples/cbrt_eg.html +++ b/doc/html/math_toolkit/roots/root_finding_examples/cbrt_eg.html @@ -4,7 +4,7 @@ Finding the Cubed Root With and Without Derivatives - + diff --git a/doc/html/math_toolkit/roots/root_finding_examples/elliptic_eg.html b/doc/html/math_toolkit/roots/root_finding_examples/elliptic_eg.html index 2eb55fa43..66d2ee781 100644 --- a/doc/html/math_toolkit/roots/root_finding_examples/elliptic_eg.html +++ b/doc/html/math_toolkit/roots/root_finding_examples/elliptic_eg.html @@ -4,7 +4,7 @@ A More complex example - Inverting the Elliptic Integrals - + diff --git a/doc/html/math_toolkit/roots/root_finding_examples/lambda.html b/doc/html/math_toolkit/roots/root_finding_examples/lambda.html index 54b5cae30..7fe8c48e1 100644 --- a/doc/html/math_toolkit/roots/root_finding_examples/lambda.html +++ b/doc/html/math_toolkit/roots/root_finding_examples/lambda.html @@ -4,7 +4,7 @@ Using C++11 Lambda's - + diff --git a/doc/html/math_toolkit/roots/root_finding_examples/multiprecision_root.html b/doc/html/math_toolkit/roots/root_finding_examples/multiprecision_root.html index de99f2b47..185f804a7 100644 --- a/doc/html/math_toolkit/roots/root_finding_examples/multiprecision_root.html +++ b/doc/html/math_toolkit/roots/root_finding_examples/multiprecision_root.html @@ -4,7 +4,7 @@ Root-finding using Boost.Multiprecision - + diff --git a/doc/html/math_toolkit/roots/root_finding_examples/nth_root.html b/doc/html/math_toolkit/roots/root_finding_examples/nth_root.html index de3372d92..e5ac2898b 100644 --- a/doc/html/math_toolkit/roots/root_finding_examples/nth_root.html +++ b/doc/html/math_toolkit/roots/root_finding_examples/nth_root.html @@ -4,7 +4,7 @@ Generalizing to Compute the nth root - + diff --git a/doc/html/math_toolkit/roots/roots_deriv.html b/doc/html/math_toolkit/roots/roots_deriv.html index e15244ae9..527c77bc9 100644 --- a/doc/html/math_toolkit/roots/roots_deriv.html +++ b/doc/html/math_toolkit/roots/roots_deriv.html @@ -4,7 +4,7 @@ Root Finding With Derivatives: Newton-Raphson, Halley & Schröder - + diff --git a/doc/html/math_toolkit/roots/roots_noderiv.html b/doc/html/math_toolkit/roots/roots_noderiv.html index eeee1d767..43ef649e7 100644 --- a/doc/html/math_toolkit/roots/roots_noderiv.html +++ b/doc/html/math_toolkit/roots/roots_noderiv.html @@ -4,7 +4,7 @@ Root Finding Without Derivatives - + diff --git a/doc/html/math_toolkit/roots/roots_noderiv/TOMS748.html b/doc/html/math_toolkit/roots/roots_noderiv/TOMS748.html index d728ef66c..5977ebfd7 100644 --- a/doc/html/math_toolkit/roots/roots_noderiv/TOMS748.html +++ b/doc/html/math_toolkit/roots/roots_noderiv/TOMS748.html @@ -4,7 +4,7 @@ Algorithm TOMS 748: Alefeld, Potra and Shi: Enclosing zeros of continuous functions - + diff --git a/doc/html/math_toolkit/roots/roots_noderiv/bisect.html b/doc/html/math_toolkit/roots/roots_noderiv/bisect.html index f3b639851..ec961bf98 100644 --- a/doc/html/math_toolkit/roots/roots_noderiv/bisect.html +++ b/doc/html/math_toolkit/roots/roots_noderiv/bisect.html @@ -4,7 +4,7 @@ Bisection - + diff --git a/doc/html/math_toolkit/roots/roots_noderiv/bracket_solve.html b/doc/html/math_toolkit/roots/roots_noderiv/bracket_solve.html index 4f819aa85..5a6cb91e6 100644 --- a/doc/html/math_toolkit/roots/roots_noderiv/bracket_solve.html +++ b/doc/html/math_toolkit/roots/roots_noderiv/bracket_solve.html @@ -4,7 +4,7 @@ Bracket and Solve Root - + diff --git a/doc/html/math_toolkit/roots/roots_noderiv/brent.html b/doc/html/math_toolkit/roots/roots_noderiv/brent.html index e04847c18..36a3cd11f 100644 --- a/doc/html/math_toolkit/roots/roots_noderiv/brent.html +++ b/doc/html/math_toolkit/roots/roots_noderiv/brent.html @@ -4,7 +4,7 @@ Brent-Decker Algorithm - + diff --git a/doc/html/math_toolkit/roots/roots_noderiv/implementation.html b/doc/html/math_toolkit/roots/roots_noderiv/implementation.html index 8c6829a71..67b6836a3 100644 --- a/doc/html/math_toolkit/roots/roots_noderiv/implementation.html +++ b/doc/html/math_toolkit/roots/roots_noderiv/implementation.html @@ -4,7 +4,7 @@ Implementation - + diff --git a/doc/html/math_toolkit/roots/roots_noderiv/root_termination.html b/doc/html/math_toolkit/roots/roots_noderiv/root_termination.html index 456eef825..e11a52f70 100644 --- a/doc/html/math_toolkit/roots/roots_noderiv/root_termination.html +++ b/doc/html/math_toolkit/roots/roots_noderiv/root_termination.html @@ -4,7 +4,7 @@ Termination Condition Functors - + diff --git a/doc/html/math_toolkit/rounding.html b/doc/html/math_toolkit/rounding.html index be2db30cb..b2cd4e99a 100644 --- a/doc/html/math_toolkit/rounding.html +++ b/doc/html/math_toolkit/rounding.html @@ -4,7 +4,7 @@ Rounding Truncation and Integer Conversion - + diff --git a/doc/html/math_toolkit/rounding/modf.html b/doc/html/math_toolkit/rounding/modf.html index 1efef1290..b9268ca61 100644 --- a/doc/html/math_toolkit/rounding/modf.html +++ b/doc/html/math_toolkit/rounding/modf.html @@ -4,7 +4,7 @@ Integer and Fractional Part Splitting (modf) - + diff --git a/doc/html/math_toolkit/rounding/round.html b/doc/html/math_toolkit/rounding/round.html index a350a5f58..fd69da631 100644 --- a/doc/html/math_toolkit/rounding/round.html +++ b/doc/html/math_toolkit/rounding/round.html @@ -4,7 +4,7 @@ Rounding Functions - + diff --git a/doc/html/math_toolkit/rounding/trunc.html b/doc/html/math_toolkit/rounding/trunc.html index 6f38cc56b..0e833b8c8 100644 --- a/doc/html/math_toolkit/rounding/trunc.html +++ b/doc/html/math_toolkit/rounding/trunc.html @@ -4,7 +4,7 @@ Truncation Functions - + diff --git a/doc/html/math_toolkit/run_time.html b/doc/html/math_toolkit/run_time.html index a0282c918..50b70612b 100644 --- a/doc/html/math_toolkit/run_time.html +++ b/doc/html/math_toolkit/run_time.html @@ -4,7 +4,7 @@ Run-time GCD & LCM Determination - + diff --git a/doc/html/math_toolkit/sf_beta.html b/doc/html/math_toolkit/sf_beta.html index 10115a4d9..d14c89a26 100644 --- a/doc/html/math_toolkit/sf_beta.html +++ b/doc/html/math_toolkit/sf_beta.html @@ -4,7 +4,7 @@ Beta Functions - + diff --git a/doc/html/math_toolkit/sf_beta/beta_derivative.html b/doc/html/math_toolkit/sf_beta/beta_derivative.html index 3ada7183b..28f2c8e5b 100644 --- a/doc/html/math_toolkit/sf_beta/beta_derivative.html +++ b/doc/html/math_toolkit/sf_beta/beta_derivative.html @@ -4,7 +4,7 @@ Derivative of the Incomplete Beta Function - + diff --git a/doc/html/math_toolkit/sf_beta/beta_function.html b/doc/html/math_toolkit/sf_beta/beta_function.html index abf2f450f..7974e6dcf 100644 --- a/doc/html/math_toolkit/sf_beta/beta_function.html +++ b/doc/html/math_toolkit/sf_beta/beta_function.html @@ -4,7 +4,7 @@ Beta - + diff --git a/doc/html/math_toolkit/sf_beta/ibeta_function.html b/doc/html/math_toolkit/sf_beta/ibeta_function.html index ceed6efe0..299db0190 100644 --- a/doc/html/math_toolkit/sf_beta/ibeta_function.html +++ b/doc/html/math_toolkit/sf_beta/ibeta_function.html @@ -4,7 +4,7 @@ Incomplete Beta Functions - + diff --git a/doc/html/math_toolkit/sf_beta/ibeta_inv_function.html b/doc/html/math_toolkit/sf_beta/ibeta_inv_function.html index c6ce229ed..0e8e0c1df 100644 --- a/doc/html/math_toolkit/sf_beta/ibeta_inv_function.html +++ b/doc/html/math_toolkit/sf_beta/ibeta_inv_function.html @@ -4,7 +4,7 @@ The Incomplete Beta Function Inverses - + diff --git a/doc/html/math_toolkit/sf_erf.html b/doc/html/math_toolkit/sf_erf.html index 08548e2fe..51cd7f6e0 100644 --- a/doc/html/math_toolkit/sf_erf.html +++ b/doc/html/math_toolkit/sf_erf.html @@ -4,7 +4,7 @@ Error Functions - + diff --git a/doc/html/math_toolkit/sf_erf/error_function.html b/doc/html/math_toolkit/sf_erf/error_function.html index 5b8d3d3fe..41202d815 100644 --- a/doc/html/math_toolkit/sf_erf/error_function.html +++ b/doc/html/math_toolkit/sf_erf/error_function.html @@ -4,7 +4,7 @@ Error Functions - + diff --git a/doc/html/math_toolkit/sf_erf/error_inv.html b/doc/html/math_toolkit/sf_erf/error_inv.html index c17de5c6b..72f2eb6c4 100644 --- a/doc/html/math_toolkit/sf_erf/error_inv.html +++ b/doc/html/math_toolkit/sf_erf/error_inv.html @@ -4,7 +4,7 @@ Error Function Inverses - + diff --git a/doc/html/math_toolkit/sf_gamma.html b/doc/html/math_toolkit/sf_gamma.html index b467f3dc8..faae8723d 100644 --- a/doc/html/math_toolkit/sf_gamma.html +++ b/doc/html/math_toolkit/sf_gamma.html @@ -4,7 +4,7 @@ Gamma Functions - + diff --git a/doc/html/math_toolkit/sf_gamma/digamma.html b/doc/html/math_toolkit/sf_gamma/digamma.html index 622f82243..be568f79d 100644 --- a/doc/html/math_toolkit/sf_gamma/digamma.html +++ b/doc/html/math_toolkit/sf_gamma/digamma.html @@ -4,7 +4,7 @@ Digamma - + diff --git a/doc/html/math_toolkit/sf_gamma/gamma_derivatives.html b/doc/html/math_toolkit/sf_gamma/gamma_derivatives.html index c03810c56..0c2483e44 100644 --- a/doc/html/math_toolkit/sf_gamma/gamma_derivatives.html +++ b/doc/html/math_toolkit/sf_gamma/gamma_derivatives.html @@ -4,7 +4,7 @@ Derivative of the Incomplete Gamma Function - + diff --git a/doc/html/math_toolkit/sf_gamma/gamma_ratios.html b/doc/html/math_toolkit/sf_gamma/gamma_ratios.html index 08a4bff5b..3d06f2621 100644 --- a/doc/html/math_toolkit/sf_gamma/gamma_ratios.html +++ b/doc/html/math_toolkit/sf_gamma/gamma_ratios.html @@ -4,7 +4,7 @@ Ratios of Gamma Functions - + diff --git a/doc/html/math_toolkit/sf_gamma/igamma.html b/doc/html/math_toolkit/sf_gamma/igamma.html index fe86c30f7..ffaeaac09 100644 --- a/doc/html/math_toolkit/sf_gamma/igamma.html +++ b/doc/html/math_toolkit/sf_gamma/igamma.html @@ -4,7 +4,7 @@ Incomplete Gamma Functions - + diff --git a/doc/html/math_toolkit/sf_gamma/igamma_inv.html b/doc/html/math_toolkit/sf_gamma/igamma_inv.html index 4757da366..fa16ab686 100644 --- a/doc/html/math_toolkit/sf_gamma/igamma_inv.html +++ b/doc/html/math_toolkit/sf_gamma/igamma_inv.html @@ -4,7 +4,7 @@ Incomplete Gamma Function Inverses - + diff --git a/doc/html/math_toolkit/sf_gamma/lgamma.html b/doc/html/math_toolkit/sf_gamma/lgamma.html index 7d36099f3..0bf5dd7f9 100644 --- a/doc/html/math_toolkit/sf_gamma/lgamma.html +++ b/doc/html/math_toolkit/sf_gamma/lgamma.html @@ -4,7 +4,7 @@ Log Gamma - + diff --git a/doc/html/math_toolkit/sf_gamma/polygamma.html b/doc/html/math_toolkit/sf_gamma/polygamma.html index 5ddfc3a88..122bbc715 100644 --- a/doc/html/math_toolkit/sf_gamma/polygamma.html +++ b/doc/html/math_toolkit/sf_gamma/polygamma.html @@ -4,7 +4,7 @@ Polygamma - + diff --git a/doc/html/math_toolkit/sf_gamma/tgamma.html b/doc/html/math_toolkit/sf_gamma/tgamma.html index eddb53392..2aad379d5 100644 --- a/doc/html/math_toolkit/sf_gamma/tgamma.html +++ b/doc/html/math_toolkit/sf_gamma/tgamma.html @@ -4,7 +4,7 @@ Gamma - + diff --git a/doc/html/math_toolkit/sf_gamma/trigamma.html b/doc/html/math_toolkit/sf_gamma/trigamma.html index 8857273e5..73919ff12 100644 --- a/doc/html/math_toolkit/sf_gamma/trigamma.html +++ b/doc/html/math_toolkit/sf_gamma/trigamma.html @@ -4,7 +4,7 @@ Trigamma - + diff --git a/doc/html/math_toolkit/sf_implementation.html b/doc/html/math_toolkit/sf_implementation.html index ae83b168c..443a8f210 100644 --- a/doc/html/math_toolkit/sf_implementation.html +++ b/doc/html/math_toolkit/sf_implementation.html @@ -4,7 +4,7 @@ Additional Implementation Notes - + diff --git a/doc/html/math_toolkit/sf_poly.html b/doc/html/math_toolkit/sf_poly.html index ed2ee5508..b0b3ebc09 100644 --- a/doc/html/math_toolkit/sf_poly.html +++ b/doc/html/math_toolkit/sf_poly.html @@ -4,7 +4,7 @@ Polynomials - + diff --git a/doc/html/math_toolkit/sf_poly/hermite.html b/doc/html/math_toolkit/sf_poly/hermite.html index c775f0948..40792eddc 100644 --- a/doc/html/math_toolkit/sf_poly/hermite.html +++ b/doc/html/math_toolkit/sf_poly/hermite.html @@ -4,7 +4,7 @@ Hermite Polynomials - + diff --git a/doc/html/math_toolkit/sf_poly/laguerre.html b/doc/html/math_toolkit/sf_poly/laguerre.html index d3b2f463e..d70a7ba5e 100644 --- a/doc/html/math_toolkit/sf_poly/laguerre.html +++ b/doc/html/math_toolkit/sf_poly/laguerre.html @@ -4,7 +4,7 @@ Laguerre (and Associated) Polynomials - + diff --git a/doc/html/math_toolkit/sf_poly/legendre.html b/doc/html/math_toolkit/sf_poly/legendre.html index 5818091c8..833de766a 100644 --- a/doc/html/math_toolkit/sf_poly/legendre.html +++ b/doc/html/math_toolkit/sf_poly/legendre.html @@ -4,7 +4,7 @@ Legendre (and Associated) Polynomials - + diff --git a/doc/html/math_toolkit/sf_poly/sph_harm.html b/doc/html/math_toolkit/sf_poly/sph_harm.html index 35ea71b21..42e8777d5 100644 --- a/doc/html/math_toolkit/sf_poly/sph_harm.html +++ b/doc/html/math_toolkit/sf_poly/sph_harm.html @@ -4,7 +4,7 @@ Spherical Harmonics - + diff --git a/doc/html/math_toolkit/sign_functions.html b/doc/html/math_toolkit/sign_functions.html index deeb5ed4e..dd3be3bf8 100644 --- a/doc/html/math_toolkit/sign_functions.html +++ b/doc/html/math_toolkit/sign_functions.html @@ -4,7 +4,7 @@ Sign Manipulation Functions - + diff --git a/doc/html/math_toolkit/sinc.html b/doc/html/math_toolkit/sinc.html index a7db41477..12b1a04f0 100644 --- a/doc/html/math_toolkit/sinc.html +++ b/doc/html/math_toolkit/sinc.html @@ -4,7 +4,7 @@ Sinus Cardinal and Hyperbolic Sinus Cardinal Functions - + diff --git a/doc/html/math_toolkit/sinc/sinc_overview.html b/doc/html/math_toolkit/sinc/sinc_overview.html index 3199f4ad2..eb107c85b 100644 --- a/doc/html/math_toolkit/sinc/sinc_overview.html +++ b/doc/html/math_toolkit/sinc/sinc_overview.html @@ -4,7 +4,7 @@ Sinus Cardinal and Hyperbolic Sinus Cardinal Functions Overview - + diff --git a/doc/html/math_toolkit/sinc/sinc_pi.html b/doc/html/math_toolkit/sinc/sinc_pi.html index 6ac94b9ba..5ea316cd0 100644 --- a/doc/html/math_toolkit/sinc/sinc_pi.html +++ b/doc/html/math_toolkit/sinc/sinc_pi.html @@ -4,7 +4,7 @@ sinc_pi - + diff --git a/doc/html/math_toolkit/sinc/sinhc_pi.html b/doc/html/math_toolkit/sinc/sinhc_pi.html index 6c9798ddb..a4a40dac4 100644 --- a/doc/html/math_toolkit/sinc/sinhc_pi.html +++ b/doc/html/math_toolkit/sinc/sinhc_pi.html @@ -4,7 +4,7 @@ sinhc_pi - + diff --git a/doc/html/math_toolkit/spec.html b/doc/html/math_toolkit/spec.html index af6aab42c..25f95f2d7 100644 --- a/doc/html/math_toolkit/spec.html +++ b/doc/html/math_toolkit/spec.html @@ -4,7 +4,7 @@ Quaternion Specializations - + diff --git a/doc/html/math_toolkit/special_tut.html b/doc/html/math_toolkit/special_tut.html index bbb1a33db..012252b94 100644 --- a/doc/html/math_toolkit/special_tut.html +++ b/doc/html/math_toolkit/special_tut.html @@ -4,7 +4,7 @@ Tutorial: How to Write a New Special Function - + diff --git a/doc/html/math_toolkit/special_tut/special_tut_impl.html b/doc/html/math_toolkit/special_tut/special_tut_impl.html index fdc52edd2..df2db20fe 100644 --- a/doc/html/math_toolkit/special_tut/special_tut_impl.html +++ b/doc/html/math_toolkit/special_tut/special_tut_impl.html @@ -4,7 +4,7 @@ Implementation - + diff --git a/doc/html/math_toolkit/special_tut/special_tut_test.html b/doc/html/math_toolkit/special_tut/special_tut_test.html index 5b7f7eec6..af47cb7cc 100644 --- a/doc/html/math_toolkit/special_tut/special_tut_test.html +++ b/doc/html/math_toolkit/special_tut/special_tut_test.html @@ -4,7 +4,7 @@ Testing - + diff --git a/doc/html/math_toolkit/specified_typedefs.html b/doc/html/math_toolkit/specified_typedefs.html index 58a976d8c..e0d15fd15 100644 --- a/doc/html/math_toolkit/specified_typedefs.html +++ b/doc/html/math_toolkit/specified_typedefs.html @@ -4,7 +4,7 @@ Overview - + diff --git a/doc/html/math_toolkit/stat_tut.html b/doc/html/math_toolkit/stat_tut.html index b81234189..f6f4a5178 100644 --- a/doc/html/math_toolkit/stat_tut.html +++ b/doc/html/math_toolkit/stat_tut.html @@ -4,7 +4,7 @@ Statistical Distributions Tutorial - + diff --git a/doc/html/math_toolkit/stat_tut/dist_params.html b/doc/html/math_toolkit/stat_tut/dist_params.html index f216a7af9..b477cfabc 100644 --- a/doc/html/math_toolkit/stat_tut/dist_params.html +++ b/doc/html/math_toolkit/stat_tut/dist_params.html @@ -4,7 +4,7 @@ Discrete Probability Distributions - + diff --git a/doc/html/math_toolkit/stat_tut/overview.html b/doc/html/math_toolkit/stat_tut/overview.html index 57db0acbd..19145c9a4 100644 --- a/doc/html/math_toolkit/stat_tut/overview.html +++ b/doc/html/math_toolkit/stat_tut/overview.html @@ -4,7 +4,7 @@ Overview of Distributions - + diff --git a/doc/html/math_toolkit/stat_tut/overview/complements.html b/doc/html/math_toolkit/stat_tut/overview/complements.html index 5e96ae0c2..01d91c6dd 100644 --- a/doc/html/math_toolkit/stat_tut/overview/complements.html +++ b/doc/html/math_toolkit/stat_tut/overview/complements.html @@ -4,7 +4,7 @@ Complements are supported too - and when to use them - + diff --git a/doc/html/math_toolkit/stat_tut/overview/generic.html b/doc/html/math_toolkit/stat_tut/overview/generic.html index fd85d1709..104fb1dbc 100644 --- a/doc/html/math_toolkit/stat_tut/overview/generic.html +++ b/doc/html/math_toolkit/stat_tut/overview/generic.html @@ -4,7 +4,7 @@ Generic operations common to all distributions are non-member functions - + diff --git a/doc/html/math_toolkit/stat_tut/overview/headers.html b/doc/html/math_toolkit/stat_tut/overview/headers.html index acc001031..1876a9dd6 100644 --- a/doc/html/math_toolkit/stat_tut/overview/headers.html +++ b/doc/html/math_toolkit/stat_tut/overview/headers.html @@ -4,7 +4,7 @@ Headers and Namespaces - + diff --git a/doc/html/math_toolkit/stat_tut/overview/objects.html b/doc/html/math_toolkit/stat_tut/overview/objects.html index 5e876419d..604232375 100644 --- a/doc/html/math_toolkit/stat_tut/overview/objects.html +++ b/doc/html/math_toolkit/stat_tut/overview/objects.html @@ -4,7 +4,7 @@ Distributions are Objects - + diff --git a/doc/html/math_toolkit/stat_tut/overview/parameters.html b/doc/html/math_toolkit/stat_tut/overview/parameters.html index ca582294b..eb18fa2a1 100644 --- a/doc/html/math_toolkit/stat_tut/overview/parameters.html +++ b/doc/html/math_toolkit/stat_tut/overview/parameters.html @@ -4,7 +4,7 @@ Parameters can be calculated - + diff --git a/doc/html/math_toolkit/stat_tut/overview/summary.html b/doc/html/math_toolkit/stat_tut/overview/summary.html index d93dce6aa..186b65107 100644 --- a/doc/html/math_toolkit/stat_tut/overview/summary.html +++ b/doc/html/math_toolkit/stat_tut/overview/summary.html @@ -4,7 +4,7 @@ Summary - + diff --git a/doc/html/math_toolkit/stat_tut/variates.html b/doc/html/math_toolkit/stat_tut/variates.html index e6a551e51..69547963e 100644 --- a/doc/html/math_toolkit/stat_tut/variates.html +++ b/doc/html/math_toolkit/stat_tut/variates.html @@ -4,7 +4,7 @@ Random Variates and Distribution Parameters - + diff --git a/doc/html/math_toolkit/stat_tut/weg.html b/doc/html/math_toolkit/stat_tut/weg.html index 3121715c9..6286f06e9 100644 --- a/doc/html/math_toolkit/stat_tut/weg.html +++ b/doc/html/math_toolkit/stat_tut/weg.html @@ -4,7 +4,7 @@ Worked Examples - + diff --git a/doc/html/math_toolkit/stat_tut/weg/binom_eg.html b/doc/html/math_toolkit/stat_tut/weg/binom_eg.html index 55a122d71..1c07a3cbb 100644 --- a/doc/html/math_toolkit/stat_tut/weg/binom_eg.html +++ b/doc/html/math_toolkit/stat_tut/weg/binom_eg.html @@ -4,7 +4,7 @@ Binomial Distribution Examples - + diff --git a/doc/html/math_toolkit/stat_tut/weg/binom_eg/binom_conf.html b/doc/html/math_toolkit/stat_tut/weg/binom_eg/binom_conf.html index 1d12710ca..16c30c118 100644 --- a/doc/html/math_toolkit/stat_tut/weg/binom_eg/binom_conf.html +++ b/doc/html/math_toolkit/stat_tut/weg/binom_eg/binom_conf.html @@ -4,7 +4,7 @@ Calculating Confidence Limits on the Frequency of Occurrence for a Binomial Distribution - + diff --git a/doc/html/math_toolkit/stat_tut/weg/binom_eg/binom_size_eg.html b/doc/html/math_toolkit/stat_tut/weg/binom_eg/binom_size_eg.html index 9e7bc6e7c..e8f852910 100644 --- a/doc/html/math_toolkit/stat_tut/weg/binom_eg/binom_size_eg.html +++ b/doc/html/math_toolkit/stat_tut/weg/binom_eg/binom_size_eg.html @@ -4,7 +4,7 @@ Estimating Sample Sizes for a Binomial Distribution. - + diff --git a/doc/html/math_toolkit/stat_tut/weg/binom_eg/binomial_coinflip_example.html b/doc/html/math_toolkit/stat_tut/weg/binom_eg/binomial_coinflip_example.html index f0e40ba98..7857bf34f 100644 --- a/doc/html/math_toolkit/stat_tut/weg/binom_eg/binomial_coinflip_example.html +++ b/doc/html/math_toolkit/stat_tut/weg/binom_eg/binomial_coinflip_example.html @@ -4,7 +4,7 @@ Binomial Coin-Flipping Example - + diff --git a/doc/html/math_toolkit/stat_tut/weg/binom_eg/binomial_quiz_example.html b/doc/html/math_toolkit/stat_tut/weg/binom_eg/binomial_quiz_example.html index d0516b352..b7e1275b8 100644 --- a/doc/html/math_toolkit/stat_tut/weg/binom_eg/binomial_quiz_example.html +++ b/doc/html/math_toolkit/stat_tut/weg/binom_eg/binomial_quiz_example.html @@ -4,7 +4,7 @@ Binomial Quiz Example - + diff --git a/doc/html/math_toolkit/stat_tut/weg/c_sharp.html b/doc/html/math_toolkit/stat_tut/weg/c_sharp.html index 17b4b484b..317259dd8 100644 --- a/doc/html/math_toolkit/stat_tut/weg/c_sharp.html +++ b/doc/html/math_toolkit/stat_tut/weg/c_sharp.html @@ -4,7 +4,7 @@ Using the Distributions from Within C# - + diff --git a/doc/html/math_toolkit/stat_tut/weg/cs_eg.html b/doc/html/math_toolkit/stat_tut/weg/cs_eg.html index 9e2cf01c4..baf587020 100644 --- a/doc/html/math_toolkit/stat_tut/weg/cs_eg.html +++ b/doc/html/math_toolkit/stat_tut/weg/cs_eg.html @@ -4,7 +4,7 @@ Chi Squared Distribution Examples - + diff --git a/doc/html/math_toolkit/stat_tut/weg/cs_eg/chi_sq_intervals.html b/doc/html/math_toolkit/stat_tut/weg/cs_eg/chi_sq_intervals.html index 60cdaadd0..66f8458aa 100644 --- a/doc/html/math_toolkit/stat_tut/weg/cs_eg/chi_sq_intervals.html +++ b/doc/html/math_toolkit/stat_tut/weg/cs_eg/chi_sq_intervals.html @@ -4,7 +4,7 @@ Confidence Intervals on the Standard Deviation - + diff --git a/doc/html/math_toolkit/stat_tut/weg/cs_eg/chi_sq_size.html b/doc/html/math_toolkit/stat_tut/weg/cs_eg/chi_sq_size.html index cd490a86e..4dac8e079 100644 --- a/doc/html/math_toolkit/stat_tut/weg/cs_eg/chi_sq_size.html +++ b/doc/html/math_toolkit/stat_tut/weg/cs_eg/chi_sq_size.html @@ -4,7 +4,7 @@ Estimating the Required Sample Sizes for a Chi-Square Test for the Standard Deviation - + diff --git a/doc/html/math_toolkit/stat_tut/weg/cs_eg/chi_sq_test.html b/doc/html/math_toolkit/stat_tut/weg/cs_eg/chi_sq_test.html index e1b893485..8f7521ab9 100644 --- a/doc/html/math_toolkit/stat_tut/weg/cs_eg/chi_sq_test.html +++ b/doc/html/math_toolkit/stat_tut/weg/cs_eg/chi_sq_test.html @@ -4,7 +4,7 @@ Chi-Square Test for the Standard Deviation - + diff --git a/doc/html/math_toolkit/stat_tut/weg/dist_construct_eg.html b/doc/html/math_toolkit/stat_tut/weg/dist_construct_eg.html index 7675902e0..fc6d72d55 100644 --- a/doc/html/math_toolkit/stat_tut/weg/dist_construct_eg.html +++ b/doc/html/math_toolkit/stat_tut/weg/dist_construct_eg.html @@ -4,7 +4,7 @@ Distribution Construction Examples - + diff --git a/doc/html/math_toolkit/stat_tut/weg/error_eg.html b/doc/html/math_toolkit/stat_tut/weg/error_eg.html index a6a34723c..5cba0a15d 100644 --- a/doc/html/math_toolkit/stat_tut/weg/error_eg.html +++ b/doc/html/math_toolkit/stat_tut/weg/error_eg.html @@ -4,7 +4,7 @@ Error Handling Example - + diff --git a/doc/html/math_toolkit/stat_tut/weg/f_eg.html b/doc/html/math_toolkit/stat_tut/weg/f_eg.html index 10241ed89..d4934d9b5 100644 --- a/doc/html/math_toolkit/stat_tut/weg/f_eg.html +++ b/doc/html/math_toolkit/stat_tut/weg/f_eg.html @@ -4,7 +4,7 @@ F Distribution Examples - + diff --git a/doc/html/math_toolkit/stat_tut/weg/find_eg.html b/doc/html/math_toolkit/stat_tut/weg/find_eg.html index 70362418d..c38dcab36 100644 --- a/doc/html/math_toolkit/stat_tut/weg/find_eg.html +++ b/doc/html/math_toolkit/stat_tut/weg/find_eg.html @@ -4,7 +4,7 @@ Find Location and Scale Examples - + diff --git a/doc/html/math_toolkit/stat_tut/weg/find_eg/find_location_eg.html b/doc/html/math_toolkit/stat_tut/weg/find_eg/find_location_eg.html index e036faa0a..ba49f4ea1 100644 --- a/doc/html/math_toolkit/stat_tut/weg/find_eg/find_location_eg.html +++ b/doc/html/math_toolkit/stat_tut/weg/find_eg/find_location_eg.html @@ -4,7 +4,7 @@ Find Location (Mean) Example - + diff --git a/doc/html/math_toolkit/stat_tut/weg/find_eg/find_mean_and_sd_eg.html b/doc/html/math_toolkit/stat_tut/weg/find_eg/find_mean_and_sd_eg.html index 45b841cab..de453e3b6 100644 --- a/doc/html/math_toolkit/stat_tut/weg/find_eg/find_mean_and_sd_eg.html +++ b/doc/html/math_toolkit/stat_tut/weg/find_eg/find_mean_and_sd_eg.html @@ -4,7 +4,7 @@ Find mean and standard deviation example - + diff --git a/doc/html/math_toolkit/stat_tut/weg/find_eg/find_scale_eg.html b/doc/html/math_toolkit/stat_tut/weg/find_eg/find_scale_eg.html index 6bc851f50..7f5a1e8af 100644 --- a/doc/html/math_toolkit/stat_tut/weg/find_eg/find_scale_eg.html +++ b/doc/html/math_toolkit/stat_tut/weg/find_eg/find_scale_eg.html @@ -4,7 +4,7 @@ Find Scale (Standard Deviation) Example - + diff --git a/doc/html/math_toolkit/stat_tut/weg/geometric_eg.html b/doc/html/math_toolkit/stat_tut/weg/geometric_eg.html index e61ecc5e3..d620ff7c3 100644 --- a/doc/html/math_toolkit/stat_tut/weg/geometric_eg.html +++ b/doc/html/math_toolkit/stat_tut/weg/geometric_eg.html @@ -4,7 +4,7 @@ Geometric Distribution Examples - + diff --git a/doc/html/math_toolkit/stat_tut/weg/inverse_chi_squared_eg.html b/doc/html/math_toolkit/stat_tut/weg/inverse_chi_squared_eg.html index 8e4955f88..c27cce943 100644 --- a/doc/html/math_toolkit/stat_tut/weg/inverse_chi_squared_eg.html +++ b/doc/html/math_toolkit/stat_tut/weg/inverse_chi_squared_eg.html @@ -4,7 +4,7 @@ Inverse Chi-Squared Distribution Bayes Example - + diff --git a/doc/html/math_toolkit/stat_tut/weg/nag_library.html b/doc/html/math_toolkit/stat_tut/weg/nag_library.html index ba4cf058b..c27a348d5 100644 --- a/doc/html/math_toolkit/stat_tut/weg/nag_library.html +++ b/doc/html/math_toolkit/stat_tut/weg/nag_library.html @@ -4,7 +4,7 @@ Comparison with C, R, FORTRAN-style Free Functions - + diff --git a/doc/html/math_toolkit/stat_tut/weg/nccs_eg.html b/doc/html/math_toolkit/stat_tut/weg/nccs_eg.html index cd066c838..c7a548747 100644 --- a/doc/html/math_toolkit/stat_tut/weg/nccs_eg.html +++ b/doc/html/math_toolkit/stat_tut/weg/nccs_eg.html @@ -4,7 +4,7 @@ Non Central Chi Squared Example - + diff --git a/doc/html/math_toolkit/stat_tut/weg/nccs_eg/nccs_power_eg.html b/doc/html/math_toolkit/stat_tut/weg/nccs_eg/nccs_power_eg.html index ef6f578b5..75e07fd63 100644 --- a/doc/html/math_toolkit/stat_tut/weg/nccs_eg/nccs_power_eg.html +++ b/doc/html/math_toolkit/stat_tut/weg/nccs_eg/nccs_power_eg.html @@ -4,7 +4,7 @@ Tables of the power function of the chi2 test. - + diff --git a/doc/html/math_toolkit/stat_tut/weg/neg_binom_eg.html b/doc/html/math_toolkit/stat_tut/weg/neg_binom_eg.html index 05100b4f1..796873fd2 100644 --- a/doc/html/math_toolkit/stat_tut/weg/neg_binom_eg.html +++ b/doc/html/math_toolkit/stat_tut/weg/neg_binom_eg.html @@ -4,7 +4,7 @@ Negative Binomial Distribution Examples - + diff --git a/doc/html/math_toolkit/stat_tut/weg/neg_binom_eg/neg_binom_conf.html b/doc/html/math_toolkit/stat_tut/weg/neg_binom_eg/neg_binom_conf.html index c9785d522..bdd04b7db 100644 --- a/doc/html/math_toolkit/stat_tut/weg/neg_binom_eg/neg_binom_conf.html +++ b/doc/html/math_toolkit/stat_tut/weg/neg_binom_eg/neg_binom_conf.html @@ -4,7 +4,7 @@ Calculating Confidence Limits on the Frequency of Occurrence for the Negative Binomial Distribution - + diff --git a/doc/html/math_toolkit/stat_tut/weg/neg_binom_eg/neg_binom_size_eg.html b/doc/html/math_toolkit/stat_tut/weg/neg_binom_eg/neg_binom_size_eg.html index 350a05e4a..ba980e188 100644 --- a/doc/html/math_toolkit/stat_tut/weg/neg_binom_eg/neg_binom_size_eg.html +++ b/doc/html/math_toolkit/stat_tut/weg/neg_binom_eg/neg_binom_size_eg.html @@ -4,7 +4,7 @@ Estimating Sample Sizes for the Negative Binomial. - + diff --git a/doc/html/math_toolkit/stat_tut/weg/neg_binom_eg/negative_binomial_example1.html b/doc/html/math_toolkit/stat_tut/weg/neg_binom_eg/negative_binomial_example1.html index 7da917b8a..c47e1592b 100644 --- a/doc/html/math_toolkit/stat_tut/weg/neg_binom_eg/negative_binomial_example1.html +++ b/doc/html/math_toolkit/stat_tut/weg/neg_binom_eg/negative_binomial_example1.html @@ -4,7 +4,7 @@ Negative Binomial Sales Quota Example. - + diff --git a/doc/html/math_toolkit/stat_tut/weg/neg_binom_eg/negative_binomial_example2.html b/doc/html/math_toolkit/stat_tut/weg/neg_binom_eg/negative_binomial_example2.html index 2a6abfc4c..90f6e70d5 100644 --- a/doc/html/math_toolkit/stat_tut/weg/neg_binom_eg/negative_binomial_example2.html +++ b/doc/html/math_toolkit/stat_tut/weg/neg_binom_eg/negative_binomial_example2.html @@ -4,7 +4,7 @@ Negative Binomial Table Printing Example. - + diff --git a/doc/html/math_toolkit/stat_tut/weg/normal_example.html b/doc/html/math_toolkit/stat_tut/weg/normal_example.html index d134a7738..bfc704160 100644 --- a/doc/html/math_toolkit/stat_tut/weg/normal_example.html +++ b/doc/html/math_toolkit/stat_tut/weg/normal_example.html @@ -4,7 +4,7 @@ Normal Distribution Examples - + diff --git a/doc/html/math_toolkit/stat_tut/weg/normal_example/normal_misc.html b/doc/html/math_toolkit/stat_tut/weg/normal_example/normal_misc.html index e80645b94..20054fb20 100644 --- a/doc/html/math_toolkit/stat_tut/weg/normal_example/normal_misc.html +++ b/doc/html/math_toolkit/stat_tut/weg/normal_example/normal_misc.html @@ -4,7 +4,7 @@ Some Miscellaneous Examples of the Normal (Gaussian) Distribution - + diff --git a/doc/html/math_toolkit/stat_tut/weg/st_eg.html b/doc/html/math_toolkit/stat_tut/weg/st_eg.html index b4d362068..7976608ad 100644 --- a/doc/html/math_toolkit/stat_tut/weg/st_eg.html +++ b/doc/html/math_toolkit/stat_tut/weg/st_eg.html @@ -4,7 +4,7 @@ Student's t Distribution Examples - + diff --git a/doc/html/math_toolkit/stat_tut/weg/st_eg/paired_st.html b/doc/html/math_toolkit/stat_tut/weg/st_eg/paired_st.html index 093870983..fa0c43a1b 100644 --- a/doc/html/math_toolkit/stat_tut/weg/st_eg/paired_st.html +++ b/doc/html/math_toolkit/stat_tut/weg/st_eg/paired_st.html @@ -4,7 +4,7 @@ Comparing two paired samples with the Student's t distribution - + diff --git a/doc/html/math_toolkit/stat_tut/weg/st_eg/tut_mean_intervals.html b/doc/html/math_toolkit/stat_tut/weg/st_eg/tut_mean_intervals.html index 93a2f76c8..6548cf459 100644 --- a/doc/html/math_toolkit/stat_tut/weg/st_eg/tut_mean_intervals.html +++ b/doc/html/math_toolkit/stat_tut/weg/st_eg/tut_mean_intervals.html @@ -4,7 +4,7 @@ Calculating confidence intervals on the mean with the Students-t distribution - + diff --git a/doc/html/math_toolkit/stat_tut/weg/st_eg/tut_mean_size.html b/doc/html/math_toolkit/stat_tut/weg/st_eg/tut_mean_size.html index 90ac3cd27..fc1dda72d 100644 --- a/doc/html/math_toolkit/stat_tut/weg/st_eg/tut_mean_size.html +++ b/doc/html/math_toolkit/stat_tut/weg/st_eg/tut_mean_size.html @@ -4,7 +4,7 @@ Estimating how large a sample size would have to become in order to give a significant Students-t test result with a single sample test - + diff --git a/doc/html/math_toolkit/stat_tut/weg/st_eg/tut_mean_test.html b/doc/html/math_toolkit/stat_tut/weg/st_eg/tut_mean_test.html index 2a9878a2c..9501babdc 100644 --- a/doc/html/math_toolkit/stat_tut/weg/st_eg/tut_mean_test.html +++ b/doc/html/math_toolkit/stat_tut/weg/st_eg/tut_mean_test.html @@ -4,7 +4,7 @@ Testing a sample mean for difference from a "true" mean - + diff --git a/doc/html/math_toolkit/stat_tut/weg/st_eg/two_sample_students_t.html b/doc/html/math_toolkit/stat_tut/weg/st_eg/two_sample_students_t.html index d26500778..58e3d0424 100644 --- a/doc/html/math_toolkit/stat_tut/weg/st_eg/two_sample_students_t.html +++ b/doc/html/math_toolkit/stat_tut/weg/st_eg/two_sample_students_t.html @@ -4,7 +4,7 @@ Comparing the means of two samples with the Students-t test - + diff --git a/doc/html/math_toolkit/synopsis.html b/doc/html/math_toolkit/synopsis.html index bf59d23f6..0b211ccaa 100644 --- a/doc/html/math_toolkit/synopsis.html +++ b/doc/html/math_toolkit/synopsis.html @@ -4,7 +4,7 @@ Synopsis - + diff --git a/doc/html/math_toolkit/threads.html b/doc/html/math_toolkit/threads.html index cd3aacdbb..c6b63d736 100644 --- a/doc/html/math_toolkit/threads.html +++ b/doc/html/math_toolkit/threads.html @@ -4,7 +4,7 @@ Thread Safety - + diff --git a/doc/html/math_toolkit/tr1_ref.html b/doc/html/math_toolkit/tr1_ref.html index 9a400b0cc..99ce266bd 100644 --- a/doc/html/math_toolkit/tr1_ref.html +++ b/doc/html/math_toolkit/tr1_ref.html @@ -4,7 +4,7 @@ TR1 C Functions Quick Reference - + diff --git a/doc/html/math_toolkit/tradoffs.html b/doc/html/math_toolkit/tradoffs.html index 5b216849c..b27f159df 100644 --- a/doc/html/math_toolkit/tradoffs.html +++ b/doc/html/math_toolkit/tradoffs.html @@ -4,7 +4,7 @@ Trading Accuracy for Performance - + diff --git a/doc/html/math_toolkit/trans.html b/doc/html/math_toolkit/trans.html index 8e7008422..3010d7122 100644 --- a/doc/html/math_toolkit/trans.html +++ b/doc/html/math_toolkit/trans.html @@ -4,7 +4,7 @@ Quaternion Transcendentals - + diff --git a/doc/html/math_toolkit/tuning.html b/doc/html/math_toolkit/tuning.html index fe0e9a93d..8e9d26465 100644 --- a/doc/html/math_toolkit/tuning.html +++ b/doc/html/math_toolkit/tuning.html @@ -4,7 +4,7 @@ Performance Tuning Macros - + diff --git a/doc/html/math_toolkit/tutorial.html b/doc/html/math_toolkit/tutorial.html index dc0dcdc42..c07b9afc4 100644 --- a/doc/html/math_toolkit/tutorial.html +++ b/doc/html/math_toolkit/tutorial.html @@ -4,7 +4,7 @@ Tutorial - + diff --git a/doc/html/math_toolkit/tutorial/non_templ.html b/doc/html/math_toolkit/tutorial/non_templ.html index 0d6b1daed..70797f688 100644 --- a/doc/html/math_toolkit/tutorial/non_templ.html +++ b/doc/html/math_toolkit/tutorial/non_templ.html @@ -4,7 +4,7 @@ Use in non-template code - + diff --git a/doc/html/math_toolkit/tutorial/templ.html b/doc/html/math_toolkit/tutorial/templ.html index faaa835a1..9f7876f12 100644 --- a/doc/html/math_toolkit/tutorial/templ.html +++ b/doc/html/math_toolkit/tutorial/templ.html @@ -4,7 +4,7 @@ Use in template code - + diff --git a/doc/html/math_toolkit/tutorial/user_def.html b/doc/html/math_toolkit/tutorial/user_def.html index 4021f6e82..bf09b64a0 100644 --- a/doc/html/math_toolkit/tutorial/user_def.html +++ b/doc/html/math_toolkit/tutorial/user_def.html @@ -4,7 +4,7 @@ Use With User-Defined Types - + diff --git a/doc/html/math_toolkit/value_op.html b/doc/html/math_toolkit/value_op.html index 694d82ff0..2e7f39f06 100644 --- a/doc/html/math_toolkit/value_op.html +++ b/doc/html/math_toolkit/value_op.html @@ -4,7 +4,7 @@ Quaternion Value Operations - + diff --git a/doc/html/math_toolkit/zetas.html b/doc/html/math_toolkit/zetas.html index 461025c64..3b8cdc410 100644 --- a/doc/html/math_toolkit/zetas.html +++ b/doc/html/math_toolkit/zetas.html @@ -4,7 +4,7 @@ Zeta Functions - + diff --git a/doc/html/math_toolkit/zetas/zeta.html b/doc/html/math_toolkit/zetas/zeta.html index 8f9fab24d..0c46373be 100644 --- a/doc/html/math_toolkit/zetas/zeta.html +++ b/doc/html/math_toolkit/zetas/zeta.html @@ -4,7 +4,7 @@ Riemann Zeta Function - + diff --git a/doc/html/octonions.html b/doc/html/octonions.html index 16086f679..8e9cd08a0 100644 --- a/doc/html/octonions.html +++ b/doc/html/octonions.html @@ -4,8 +4,8 @@ Chapter 10. Octonions - - + + diff --git a/doc/html/overview.html b/doc/html/overview.html index 292968141..c7b6945c9 100644 --- a/doc/html/overview.html +++ b/doc/html/overview.html @@ -4,9 +4,9 @@ Chapter 1. Overview - - - + + + diff --git a/doc/html/perf.html b/doc/html/perf.html index a9199b3d1..b2030b022 100644 --- a/doc/html/perf.html +++ b/doc/html/perf.html @@ -4,8 +4,8 @@ Chapter 16. Performance - - + + diff --git a/doc/html/policy.html b/doc/html/policy.html index 1656ff879..c0367a618 100644 --- a/doc/html/policy.html +++ b/doc/html/policy.html @@ -4,8 +4,8 @@ Chapter 15. Policies: Controlling Precision, Error Handling etc - - + + diff --git a/doc/html/quaternions.html b/doc/html/quaternions.html index 3f43203ff..617f9be33 100644 --- a/doc/html/quaternions.html +++ b/doc/html/quaternions.html @@ -4,8 +4,8 @@ Chapter 9. Quaternions - - + + diff --git a/doc/html/rooting.html b/doc/html/rooting.html index dd37eeee3..9117cff6e 100644 --- a/doc/html/rooting.html +++ b/doc/html/rooting.html @@ -4,9 +4,9 @@ Chapter 12. Tools: Root Finding & Minimization Algorithms, Polynomial Arithmetic & Evaluation - - - + + + @@ -20,7 +20,7 @@


    -PrevUpHomeNext +PrevUpHomeNext

    @@ -99,7 +99,7 @@
    -PrevUpHomeNext +PrevUpHomeNext
    diff --git a/doc/html/special.html b/doc/html/special.html index fdd3842c5..f42755338 100644 --- a/doc/html/special.html +++ b/doc/html/special.html @@ -4,8 +4,8 @@ Chapter 6. Special Functions - - + + diff --git a/doc/html/standalone_HTML.manifest b/doc/html/standalone_HTML.manifest index 319e71a2f..67568ed38 100644 --- a/doc/html/standalone_HTML.manifest +++ b/doc/html/standalone_HTML.manifest @@ -293,17 +293,6 @@ math_toolkit/acknowledgements.html math_toolkit/oct_history.html math_toolkit/oct_todo.html gcd_lcm.html -math_toolkit/introduction.html -math_toolkit/synopsis.html -math_toolkit/gcd_function_object.html -math_toolkit/lcm_function_object.html -math_toolkit/run_time.html -math_toolkit/compile_time.html -math_toolkit/gcd_header.html -math_toolkit/demo.html -math_toolkit/rationale0.html -math_toolkit/gcd_history.html -math_toolkit/gcd_credits.html rooting.html math_toolkit/roots.html math_toolkit/roots/roots_noderiv.html diff --git a/doc/html/status.html b/doc/html/status.html index 6834a4303..4994a9973 100644 --- a/doc/html/status.html +++ b/doc/html/status.html @@ -4,8 +4,8 @@ Chapter 18. Library Status - - + + diff --git a/doc/html/using_udt.html b/doc/html/using_udt.html index 2f0b8b99d..4570e95d3 100644 --- a/doc/html/using_udt.html +++ b/doc/html/using_udt.html @@ -4,8 +4,8 @@ Chapter 14. Use with User-Defined Floating-Point Types - Boost.Multiprecision and others - - + + diff --git a/doc/html/utils.html b/doc/html/utils.html index 7ae874ba0..807d3c3ef 100644 --- a/doc/html/utils.html +++ b/doc/html/utils.html @@ -4,8 +4,8 @@ Chapter 2. Floating Point Utilities - - + + diff --git a/doc/internals/polynomial.qbk b/doc/internals/polynomial.qbk index 3888d5420..c06e5c63d 100644 --- a/doc/internals/polynomial.qbk +++ b/doc/internals/polynomial.qbk @@ -144,6 +144,8 @@ and over a unique factorization domain (integers). Division of polynomials over a field is compatible with [@https://en.wikipedia.org/wiki/Euclidean_algorithm Euclidean GCD]. +Division of polynomials over a UFD is compatible with the subresultant algorithm for GCD (implemented as subresultant_gcd), but a serious word of warning is required: the intermediate value swell of that algorithm will cause single-precision integral types to overflow very easily. So although the algorithm will work on single-precision integral types, an overload of the gcd function is only provided for polynomials with multi-precision integral types, to prevent nasty surprises. This is done somewhat crudely by disabling the overload for non-POD integral types. + Advanced manipulations: the FFT, factorisation etc are not currently provided. Submissions for these are of course welcome :-) diff --git a/doc/interpolators/barycentric_rational_interpolation.qbk b/doc/interpolators/barycentric_rational_interpolation.qbk new file mode 100644 index 000000000..a636b21f7 --- /dev/null +++ b/doc/interpolators/barycentric_rational_interpolation.qbk @@ -0,0 +1,75 @@ +[/ + Copyright 2017 Nick Thompson + + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:barycentric Barycentric Rational Interpolation] + +[heading Synopsis] + +`` +#include + +namespace boost{ namespace math{ + template + class barycentric_rational + { + public: + template + barycentric_rational(InputIterator1 start_x, InputIterator1 end_x, InputIterator2 start_y, size_t approximation_order = 3); + barycentric_rational(const Real* const x, const Real* const y, size_t n, size_t approximation_order = 3); + + Real operator()(Real x) const; + }; + +}} +`` + + +[heading Description] + +Barycentric rational interpolation is a high-accuracy interpolation method for non-uniformly spaced samples. +It requires [bigo](N) time for construction, and [bigo](N) time for each evaluation. +Linear time evaluation is not optimal; for instance the cubic B-spline can be evaluated in constant time. +However, using the cubic b spline requires uniformly spaced samples, which are not always available. + +Use of the class requires a vector of independent variables x[0], x[1], .... x[n-1] where x[i+1] > x[i], +and a vector of dependent variables y[0], y[1], ... , y[n-1]. +The call is trivial: + + boost::math::tools::barycentric_rational interpolant(x.data(), y.data(), y.size()); + +This implicitly calls the constructor with approximation order 3, and hence the accuracy is [bigo](h[super 4]). +In general, if you require an approximation order /d/, then the error is [bigo](h[super d+1]). +A call to the constructor with an explicit approximation order could be + + boost::math::tools::barycentric_rational interpolant(x.data(), y.data(), y.size(), 5); + +To evaluate the interpolant, simply use + + double x = 2.3; + double y = interpolant(x); + +Although this algorithm is robust, it can surprise you. +The main way this occurs is if the sample spacing at the endpoints is much larger than the spacing in the center. +This is to be expected; all interpolants perform better in the opposite regime, where samples are clustered at the endpoints and somewhat uniformly spaced throughout the center. + + +The reference used for implementation of this algorithm is [@https://web.archive.org/save/_embed/http://www.mn.uio.no/math/english/people/aca/michaelf/papers/rational.pdf Barycentric rational interpolation with no poles and a high rate of interpolation]. + +[heading Examples] + +[import ../../example/barycentric_interpolation_example.cpp] +[import ../../example/barycentric_interpolation_example_2.cpp] + +[barycentric_rational_example] + +[barycentric_rational_example2] + +[barycentric_rational_example2_out] + + +[endsect] [/section:barycentric Barycentric Rational Interpolation] diff --git a/doc/interpolators/cubic_b_spline.qbk b/doc/interpolators/cubic_b_spline.qbk new file mode 100644 index 000000000..19dfdab21 --- /dev/null +++ b/doc/interpolators/cubic_b_spline.qbk @@ -0,0 +1,116 @@ +[/ +Copyright (c) 2017 Nick Thompson +Use, modification and distribution are subject to the +Boost Software License, Version 1.0. (See accompanying file +LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +] + +[section:cubic_b Cubic B-spline interpolation] + +[heading Synopsis] +`` + #include +`` + + namespace boost { namespace math { + + template + class cubic_b_spline + { + public: + + template + cubic_b_spline(BidiIterator a, BidiIterator b, Real left_endpoint, Real step_size, + Real left_endpoint_derivative = std::numeric_limits::quiet_NaN(), + Real right_endpoint_derivative = std::numeric_limits::quiet_NaN()); + cubic_b_spline(const Real* const f, size_t length, Real left_endpoint, Real step_size, + Real left_endpoint_derivative = std::numeric_limits::quiet_NaN(), + Real right_endpoint_derivative = std::numeric_limits::quiet_NaN()); + + Real operator()(Real x) const; + + Real prime(Real x) const; + }; + + }} // namespaces + + +[heading Cubic B-Spline Interpolation] + +The cubic B-spline class provided by boost allows fast and accurate interpolation of a function which is known at equally spaced points. +The cubic B-spline interpolation is numerically stable as it uses compactly supported basis functions constructed via iterative convolution. +This is to be contrasted to traditional cubic spline interpolation is ill-conditioned as the global support of cubic polynomials causes small changes far from the evaluation point exert a large influence on the calculated value. + +There are many use cases for interpolating a function at equally spaced points. +One particularly important example is solving ODE's whose coefficients depend on data determined from experiment or numerical simulation. +Since most ODE steppers are adaptive, they must be able to sample the coefficients at arbitrary points; not just at the points we know the values of our function. + +The first two arguments to the constructor are either: + +* A pair of bidirectional iterators into the data, or +* A pointer to the data, and a length of the data array. + +These are then followed by: + +* The start of the functions domain +* The step size + +Optionally, you may provide two additional arguments to the constructor, namely the derivative of the function at the left endpoint, and the derivative at the right endpoint. +If you do not provide these arguments, they will be estimated using one-sided finite-difference formulas. +An example of a valid call to the constructor is + + std::vector f{0.01, -0.02, 0.3, 0.8, 1.9, -8.78, -22.6}; + double t0 = 0; + double h = 0.01; + boost::math::cubic_b_spline spline(f.begin(), f.end(), t0, h); + +The endpoints are estimated using a one-sided finite-difference formula. If you know the derivative at the endpoint, you may pass it to the constructor via + + boost::math::cubic_b_spline spline(f.begin(), f.end(), t0, h, a_prime, b_prime); + + +To evaluate the interpolant at a point, we simply use + + double y = spline(x); + +and to evaluate the derivative of the interpolant we use + + double yp = spline.prime(x); + +Be aware that the accuracy guarantees on the derivative of the spline are an order lower than the guarantees on the original function, see [@http://www.springer.com/us/book/9780387984087 Numerical Analysis, Graduate Texts in Mathematics, 181, Rainer Kress] for details. + +Finally, note that this is an interpolator, not an extrapolator. +Therefore, you should strenuously avoid evaluating the spline outside the endpoints. +However, it is not an error if you do, as often you cannot control where (say) an ODE stepper will evaluate your function. +As such the interpolant tries to do something reasonable when the passed a value outside the endpoints. +For evaluation within one stepsize of the interval, you can assume something somewhat reasonable was returned. +As you move further away from the endpoints, the interpolant decays to its average on the interval. + + +[heading Complexity and Performance] + +The call to the constructor requires [bigo](/n/) operations, where /n/ is the number of points to interpolate. +Each call the the interpolant is [bigo](1) (constant time). +On the author's Intel Xeon E3-1230, this takes 21ns as long as the vector is small enough to fit in cache. + +[heading Accuracy] + +Let /h/ be the stepsize. If /f/ is four-times continuously differentiable, then the interpolant is ['[bigo](h[super 4])] accurate and the derivative is ['[bigo](h[super 3])] accurate. + +[heading Testing] + +Since the interpolant obeys ['s(x[sub j]) = f(x[sub j])] at all interpolation points, +the tests generate random data and evaluate the interpolant at the interpolation points, +validating that equality with the data holds. + +In addition, constant, linear, and quadratic functions are interpolated to ensure that the interpolant behaves as expected. + +[heading Example] + +[import ../../example/cubic_b_spline_example.cpp] + +[cubic_b_spline_example] + +[cubic_b_spline_example_out] + +[endsect] diff --git a/doc/math.qbk b/doc/math.qbk index 6bf25c9a2..f4a80f9d1 100644 --- a/doc/math.qbk +++ b/doc/math.qbk @@ -1,15 +1,15 @@ [book Math Toolkit [quickbook 1.6] - [copyright 2006, 2007, 2008, 2009, 2010, 2012, 2013, 2014 Nikhar Agrawal, Anton Bikineev, Paul A. Bristow, Marco Guazzone, Christopher Kormanyos, Hubert Holin, Bruno Lalande, John Maddock, Jeremy Murphy, Johan RÃ¥de, Gautam Sewani, Benjamin Sobotta, Thijs van den Berg, Daryle Walker and Xiaogang Zhang] + [copyright 2006, 2007, 2008, 2009, 2010, 2012, 2013, 2014, 2017 Nikhar Agrawal, Anton Bikineev, Paul A. Bristow, Marco Guazzone, Christopher Kormanyos, Hubert Holin, Bruno Lalande, John Maddock, Jeremy Murphy, Johan RÃ¥de, Gautam Sewani, Benjamin Sobotta, Nicholas Thompson, Thijs van den Berg, Daryle Walker and Xiaogang Zhang] [/purpose ISBN 0-9504833-2-X 978-0-9504833-2-0, Classification 519.2-dc22] [license Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at [@http://www.boost.org/LICENSE_1_0.txt]) ] - [authors [Agrawal, Nikhar], [Bikineev, Anton], [Bristow, Paul A.], [Holin, Hubert], [Guazzone, Marco], [Kormanyos, Christopher], [Lalande, Bruno], [Maddock, John], [Murphy, Jeremy W.], [RÃ¥de, Johan], [Sobotta, Benjamin], [Sewani, Gautam], [van den Berg, Thijs], [Walker, Daryle], [Zhang, Xiaogang]] + [authors [Agrawal, Nikhar], [Bikineev, Anton], [Bristow, Paul A.], [Holin, Hubert], [Guazzone, Marco], [Kormanyos, Christopher], [Lalande, Bruno], [Maddock, John], [Murphy, Jeremy W.], [RÃ¥de, Johan], [Sobotta, Benjamin], [Sewani, Gautam], [Thompson, Nicholas], [van den Berg, Thijs], [Walker, Daryle], [Zhang, Xiaogang]] [/last-revision $Date$] - [version 2.5.1] + [version 2.5.2] ] [template mathpart[id title] @@ -131,8 +131,8 @@ and use the function's name as the link text.] [def __fifth_root [link math_toolkit.roots.root_finding_examples.5th_root_eg fifth root]] [def __nth_root [link math_toolkit.roots.root_finding_examples.nth_root nth root]] [def __multiprecision_root [link math_toolkit.roots.root_finding_examples.multiprecision_root multiprecision root]] -[def __polynomial_arithmetic [link math_toolkit.roots.polynomial_arithmetic polynomial arithmetic]] -[def __evaluation [link math_toolkit.roots.rational.polynomial_evaluation polynomial \& rational evaluation]] +[def __polynomial_arithmetic [link math_toolkit.polynomial_arithmetic polynomial arithmetic]] +[def __evaluation [link math_toolkit.rational.polynomial_evaluation polynomial \& rational evaluation]] [/gammas] [def __lgamma [link math_toolkit.sf_gamma.lgamma lgamma]] @@ -565,6 +565,7 @@ and as a CD ISBN 0-9504833-2-X 978-0-9504833-2-0, Classification 519.2-dc22. [section:sf_poly Polynomials] [include sf/legendre.qbk] +[include sf/legendre_stieltjes.qbk] [include sf/laguerre.qbk] [include sf/hermite.qbk] [include sf/spherical_harmonic.qbk] @@ -622,9 +623,13 @@ and as a CD ISBN 0-9504833-2-X 978-0-9504833-2-0, Classification 519.2-dc22. [mathpart rooting Tools: Root Finding \& Minimization Algorithms, Polynomial Arithmetic \& Evaluation] [section:roots Root finding] [include roots/roots_overview.qbk] +[endsect] [/section:roots Root finding] [include internals/polynomial.qbk] [include internals/rational.qbk] -[endsect] [/section:roots Root finding] +[section:interpolate Interpolation Functions] +[include interpolators/cubic_b_spline.qbk] +[include interpolators/barycentric_rational_interpolation.qbk] +[endsect] [endmathpart] [/mathpart roots Root Finding Algorithms] @@ -661,6 +666,7 @@ and as a CD ISBN 0-9504833-2-X 978-0-9504833-2-0, Classification 519.2-dc22. [include background/references.qbk] [include quadrature/trapezoidal.qbk] + [section:logs_and_tables Error logs and tables] [section:all_table Tables of Error Rates for all Functions] diff --git a/doc/overview/issues.qbk b/doc/overview/issues.qbk index 1f7641c1d..34ac6b22d 100644 --- a/doc/overview/issues.qbk +++ b/doc/overview/issues.qbk @@ -12,20 +12,6 @@ some point. Such classifications are obviously highly subjective. If you don't see a component listed here, then we don't have any known issues with it. -[h4 Derivatives of Bessel functions (and their zeros)] - -Potentially, there could be native support -for `cyl_bessel_j_prime()` and `cyl_neumann_prime()`. -One could also imagine supporting the zeros -thereof, but they might be slower to calculate -since root bracketing might be needed instead -of Newton iteration (for the lack of 2nd derivatives). - -Since Boost.Math's Bessel functions are so excellent, -the quick way to `cyl_bessel_j_prime()` and -`cyl_neumann_prime()` would be via relationship with -`cyl_bessel_j()` and `cyl_neumann()`. - [h4 tgamma] * Can the __lanczos be optimized any further? (low priority) @@ -72,10 +58,6 @@ difference between ['T(h, a)] and ['T(h, 1)]. Unfortunately this doesn't improv convergence of those series in that area. It certainly looks as though a new series in terms of ['(1-a)[super k]] is both possible and desirable in this area, but it remains elusive at present. -[h4 Jocobi elliptic functions] - -These are useful in engineering applications - we have had a request to add these. - [h4 Statistical distributions] * Student's t Perhaps switch to normal distribution diff --git a/doc/overview/overview.qbk b/doc/overview/overview.qbk index d5e89c85b..5aab8cee8 100644 --- a/doc/overview/overview.qbk +++ b/doc/overview/overview.qbk @@ -69,14 +69,14 @@ whose interfaces and\/or implementations may change without notice. There are helpers for the [link math_toolkit.internals.series_evaluation evaluation of infinite series], [link math_toolkit.internals.cf continued -fractions] and [link math_toolkit.roots.rational +fractions] and [link math_toolkit.rational rational approximations]. A [link math_toolkit.internals.minimax Remez algorithm implementation] allows for the locating of minimax rational approximations. There are also (experimental) classes for the -[link math_toolkit.roots.polynomials manipulation of polynomials], for +[link math_toolkit.polynomials manipulation of polynomials], for [link math_toolkit.internals.error_test testing a special function against tabulated test data], and for the [link math_toolkit.internals.test_data diff --git a/doc/overview/roadmap.qbk b/doc/overview/roadmap.qbk index 6e6dae00a..c0d4721d0 100644 --- a/doc/overview/roadmap.qbk +++ b/doc/overview/roadmap.qbk @@ -6,6 +6,13 @@ Currently open bug reports can be viewed All bug reports including closed ones can be viewed [@https://svn.boost.org/trac/boost/query?status=assigned&status=closed&status=new&status=reopened&component=math&col=id&col=summary&col=status&col=type&col=milestone&col=component&order=priority here]. +[h4 Math-2.5.2 (Boost-1.64)] + +Patches: + +* Big push to ensure all functions in also in C99 are compatible with Annex F. +* Improved accuracy of the Bessel functions I0, I1, K0 and K1, see [@https://svn.boost.org/trac/boost/ticket/12066 12066]. + [h4 Math-2.5.1 (Boost-1.63)] Patches: diff --git a/doc/sf/legendre.qbk b/doc/sf/legendre.qbk index d80866ca4..50eeb30af 100644 --- a/doc/sf/legendre.qbk +++ b/doc/sf/legendre.qbk @@ -7,36 +7,48 @@ `` namespace boost{ namespace math{ - + template ``__sf_result`` legendre_p(int n, T x); - + template ``__sf_result`` legendre_p(int n, T x, const ``__Policy``&); - + + template + ``__sf_result`` legendre_p_prime(int n, T x); + + template + ``__sf_result`` legendre_p_prime(int n, T x, const ``__Policy``&); + + template + std::vector legendre_p_zeros(int l, const ``__Policy``&); + + template + std::vector legendre_p_zeros(int l); + template ``__sf_result`` legendre_p(int n, int m, T x); - + template ``__sf_result`` legendre_p(int n, int m, T x, const ``__Policy``&); - + template ``__sf_result`` legendre_q(unsigned n, T x); - + template ``__sf_result`` legendre_q(unsigned n, T x, const ``__Policy``&); - + template ``__sf_result`` legendre_next(unsigned l, T1 x, T2 Pl, T3 Plm1); - + template ``__sf_result`` legendre_next(unsigned l, unsigned m, T1 x, T2 Pl, T3 Plm1); - + }} // namespaces - + The return type of these functions is computed using the __arg_promotion_rules: -note than when there is a single template argument the result is the same type +note than when there is a single template argument the result is the same type as that argument or `double` if the template argument is an integer type. [optional_policy] @@ -45,10 +57,10 @@ as that argument or `double` if the template argument is an integer type. template ``__sf_result`` legendre_p(int l, T x); - + template ``__sf_result`` legendre_p(int l, T x, const ``__Policy``&); - + Returns the Legendre Polynomial of the first kind: [equation legendre_0] @@ -59,17 +71,43 @@ Negative orders are handled via the reflection formula: P[sub -l-1](x) = P[sub l](x) -The following graph illustrates the behaviour of the first few +The following graph illustrates the behaviour of the first few Legendre Polynomials: [graph legendre_p] - + + template + ``__sf_result`` legendre_p_prime(int n, T x); + + template + ``__sf_result`` legendre_p_prime(int n, T x, const ``__Policy``&); + +Returns the derivatives of the Legendre polynomials. + + template + std::vector legendre_p_zeros(int l, const ``__Policy``&); + + template + std::vector legendre_p_zeros(int l); + +The zeros of the Legendre polynomials are calculated by Newton's method using an initial guess given by Tricomi with root bracketing provided by Szego. + +Since the Legendre polynomials are alternatively even and odd, only the non-negative zeros are returned. +For the odd Legendre polynomials, the first zero is always zero. +The rest of the zeros are returned in increasing order. + +Note that the argument to the routine is an integer, and the output is a floating-point type. +Hence the template argument is mandatory. +The time to extract a single root is linear in `l` (this is scaling to evaluate the Legendre polynomials), so recovering all roots is [bigo](`l`[super 2]). +Algorithms with linear scaling [@ http://dx.doi.org/10.1137/06067016X exist] for recovering all roots, but requires tooling not currently built into boost.math. +This implementation proceeds under the assumption that calculating zeros of these functions will not be a bottleneck for any workflow. + template ``__sf_result`` legendre_p(int l, int m, T x); - + template ``__sf_result`` legendre_p(int l, int m, T x, const ``__Policy``&); - + Returns the associated Legendre polynomial of the first kind: [equation legendre_1] @@ -84,31 +122,31 @@ Negative values of /l/ and /m/ are handled via the identity relations: includes a leading Condon-Shortley phase term of (-1)[super m]. This matches the definition given by Abramowitz and Stegun (8.6.6) and that used by [@http://mathworld.wolfram.com/LegendrePolynomial.html Mathworld] -and [@http://documents.wolfram.com/mathematica/functions/LegendreP +and [@http://documents.wolfram.com/mathematica/functions/LegendreP Mathematica's LegendreP function]. However, uses in the literature do not always include this phase term, and strangely the specification -for the associated Legendre function in the C++ TR1 (assoc_legendre) -also omits it, in spite of stating that it uses Abramowitz and Stegun +for the associated Legendre function in the C++ TR1 (assoc_legendre) +also omits it, in spite of stating that it uses Abramowitz and Stegun as the final arbiter on these matters. -See: +See: -[@http://mathworld.wolfram.com/LegendrePolynomial.html -Weisstein, Eric W. "Legendre Polynomial." +[@http://mathworld.wolfram.com/LegendrePolynomial.html +Weisstein, Eric W. "Legendre Polynomial." From MathWorld--A Wolfram Web Resource]. -Abramowitz, M. and Stegun, I. A. (Eds.). "Legendre Functions" and -"Orthogonal Polynomials." Ch. 22 in Chs. 8 and 22 in Handbook of -Mathematical Functions with Formulas, Graphs, and Mathematical Tables, -9th printing. New York: Dover, pp. 331-339 and 771-802, 1972. +Abramowitz, M. and Stegun, I. A. (Eds.). "Legendre Functions" and +"Orthogonal Polynomials." Ch. 22 in Chs. 8 and 22 in Handbook of +Mathematical Functions with Formulas, Graphs, and Mathematical Tables, +9th printing. New York: Dover, pp. 331-339 and 771-802, 1972. ] - + template ``__sf_result`` legendre_q(unsigned n, T x); - + template ``__sf_result`` legendre_q(unsigned n, T x, const ``__Policy``&); - + Returns the value of the Legendre polynomial that is the second solution to the Legendre differential equation, for example: @@ -120,10 +158,10 @@ The following graph illustrates the first few Legendre functions of the second kind: [graph legendre_q] - + template ``__sf_result`` legendre_next(unsigned l, T1 x, T2 Pl, T3 Plm1); - + Implements the three term recurrence relation for the Legendre polynomials, this function can be used to create a sequence of values evaluated at the same /x/, and for rising /l/. This recurrence @@ -143,7 +181,7 @@ values using: // Double check values: for(unsigned l = 1; l < 10; ++l) assert(v[l] == legendre_p(l, x)); - + Formally the arguments are: [variablelist @@ -152,7 +190,7 @@ Formally the arguments are: [[Pl][The value of the polynomial evaluated at degree /l/.]] [[Plm1][The value of the polynomial evaluated at degree /l-1/.]] ] - + template ``__sf_result`` legendre_next(unsigned l, unsigned m, T1 x, T2 Pl, T3 Plm1); @@ -175,7 +213,7 @@ values using: // Double check values: for(unsigned l = 1; l < 10; ++l) assert(v[l] == legendre_p(10 + l, m, x)); - + Formally the arguments are: [variablelist @@ -185,12 +223,12 @@ Formally the arguments are: [[Pl][The value of the polynomial evaluated at degree /l/.]] [[Plm1][The value of the polynomial evaluated at degree /l-1/.]] ] - + [h4 Accuracy] -The following table shows peak errors (in units of epsilon) -for various domains of input arguments. -Note that only results for the widest floating point type on the system are +The following table shows peak errors (in units of epsilon) +for various domains of input arguments. +Note that only results for the widest floating point type on the system are given as narrower types have __zero_error. [table_legendre_p] @@ -206,7 +244,7 @@ are likely to grow arbitrarily large when the function is very close to a root. [h4 Testing] -A mixture of spot tests of values calculated using functions.wolfram.com, +A mixture of spot tests of values calculated using functions.wolfram.com, and randomly generated test data are used: the test data was computed using [@http://shoup.net/ntl/doc/RR.txt NTL::RR] at 1000-bit precision. @@ -219,10 +257,9 @@ but cannot guarantee low relative error near one of the roots of the polynomials. [endsect][/section:beta_function The Beta Function] -[/ +[/ Copyright 2006 John Maddock and Paul A. Bristow. Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt). ] - diff --git a/doc/sf/legendre_stieltjes.qbk b/doc/sf/legendre_stieltjes.qbk new file mode 100644 index 000000000..0a9494642 --- /dev/null +++ b/doc/sf/legendre_stieltjes.qbk @@ -0,0 +1,71 @@ +[section:legendre_stieltjes Legendre-Stieltjes Polynomials] + +[h4 Synopsis] + + `` + #include + `` + + namespace boost{ namespace math{ + + template + class legendre_stieltjes + { + public: + legendre_stieltjes(size_t m); + + Real norm_sq() const; + + Real operator()(Real x) const; + + Real prime(Real x) const; + + std::vector zeros() const; + } + + }} + +[h4 Description] + +The Legendre-Stieltjes polynomials are a family of polynomials used to generate Gauss-Konrod quadrature formulas. +Gauss-Konrod quadratures are algorithms which extend a Gaussian quadrature in such a way that all abscissas +are reused when computed a higher-order estimate of the integral, allowing efficient calculation of an error estimate. +The Legendre-Stieltjes polynomials assist with this task because their zeros /interlace/ the zeros of the Legendre polynomials, +meaning that between any two zeros of a Legendre polynomial of degree n, there exists a zero of the Legendre-Stieltjes polynomial +of degree n+1. + +The Legendre-Stieltjes polynomials /E/[sub n+1] are defined by the property that they have /n/ vanishing moments against the oscillatory measure P[sub n], i.e., \u222B[sub -1][super 1] E[sub n+1](x)P[sub n](x) x[super k] dx = 0 for /k = 0, 1, ..., n/. +The first few are + +* E[sub 1](x) = P[sub 1](x) +* E[sub 2](x) = P[sub 2](x) - 2P[sub 0](x)/5 +* E[sub 3](x) = P[sub 3](x) - 9P[sub 1](x)/14 +* E[sub 4](x) = P[sub 4](x) - 20P[sub 2](x)/27 + 14P[sub 0](x)/891 +* E[sub 5](x) = P[sub 5](x) - 35P[sub 3](x)/44 + 135P[sub 1](x)/12584 + +where P[sub i] are the Legendre polynomials. +The scaling follows [@http://www.ams.org/journals/mcom/1968-22-104/S0025-5718-68-99866-9/S0025-5718-68-99866-9.pdf Patterson], +who expanded the Legendre-Stieltjes polynomials in a Legendre series and took the coefficient of the highest-order Legendre polynomial in the series to be unity. + +The Legendre-Stieltjes polynomials do not satisfy three-term recurrence relations or have a particulary simple representation. +Hence the constructor call determines what, in fact, the polynomial is. +Once the constructor comes back, the polynomial can be evaluated via the Legendre series. + +Example usage: + + // Call to the constructor determines the coefficients in the Legendre expansion + legendre_stieltjes E(12); + // Evaluate the polynomial at a point: + double x = E(0.3); + // Evaluate the derivative at a point: + double x_p = E.prime(0.3); + // Use the norm_sq to change between scalings, if desired: + double norm = std::sqrt(E.norm_sq()); + +[endsect] +[/ + Copyright 2017 Nick Thompson + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] diff --git a/example/Jamfile.v2 b/example/Jamfile.v2 index 4db544243..a13dc509c 100644 --- a/example/Jamfile.v2 +++ b/example/Jamfile.v2 @@ -7,6 +7,7 @@ # bring in the rules for testing import testing ; +import ../../config/checks/config : requires ; project : requirements @@ -62,6 +63,7 @@ run geometric_examples.cpp : : : off:no ; run hyperexponential_snips.cpp ; run hyperexponential_more_snips.cpp ; run inverse_chi_squared_example.cpp ; +run legendre_stieltjes_example.cpp : : : [ requires cxx11_auto_declarations ] ; # run inverse_chi_squared_find_df_example.cpp ; run inverse_gamma_example.cpp ; run inverse_gamma_distribution_example.cpp : : : off:no ; @@ -124,4 +126,8 @@ explicit root_elliptic_finding ; explicit root_finding_algorithms ; explicit root_n_finding_algorithms ; +run barycentric_interpolation_example.cpp : : : [ requires cxx11_smart_ptr ] ; +run barycentric_interpolation_example_2.cpp : : : [ requires cxx11_smart_ptr ] ; +run cubic_b_spline_example.cpp : : : [ requires cxx11_smart_ptr ] ; + diff --git a/example/barycentric_interpolation_example.cpp b/example/barycentric_interpolation_example.cpp new file mode 100644 index 000000000..8aed10347 --- /dev/null +++ b/example/barycentric_interpolation_example.cpp @@ -0,0 +1,91 @@ + +// Copyright Nick Thompson, 2017 + +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or +// copy at http://www.boost.org/LICENSE_1_0.txt). + +#include +#include +#include + +//[barycentric_rational_example + +/*`This example shows how to use barycentric rational interpolation, using Walter Kohn's classic paper + "Solution of the Schrodinger Equation in Periodic Lattices with an Application to Metallic Lithium" + In this paper, Kohn needs to repeatedly solve an ODE (the radial Schrodinger equation) given a potential + which is only known at non-equally samples data. + + If he'd only had the barycentric rational interpolant of boost::math! + References: + Kohn, W., and N. Rostoker. "Solution of the Schrödinger equation in periodic lattices with an application to metallic lithium." Physical Review 94.5 (1954): 1111. +*/ + +#include + +int main() +{ + // The lithium potential is given in Kohn's paper, Table I: + std::vector r(45); + std::vector mrV(45); + + // We'll skip the code for filling the above vectors with data for now... + //<- + + r[0] = 0.02; mrV[0] = 5.727; + r[1] = 0.04, mrV[1] = 5.544; + r[2] = 0.06, mrV[2] = 5.450; + r[3] = 0.08, mrV[3] = 5.351; + r[4] = 0.10, mrV[4] = 5.253; + r[5] = 0.12, mrV[5] = 5.157; + r[6] = 0.14, mrV[6] = 5.058; + r[7] = 0.16, mrV[7] = 4.960; + r[8] = 0.18, mrV[8] = 4.862; + r[9] = 0.20, mrV[9] = 4.762; + r[10] = 0.24, mrV[10] = 4.563; + r[11] = 0.28, mrV[11] = 4.360; + r[12] = 0.32, mrV[12] = 4.1584; + r[13] = 0.36, mrV[13] = 3.9463; + r[14] = 0.40, mrV[14] = 3.7360; + r[15] = 0.44, mrV[15] = 3.5429; + r[16] = 0.48, mrV[16] = 3.3797; + r[17] = 0.52, mrV[17] = 3.2417; + r[18] = 0.56, mrV[18] = 3.1209; + r[19] = 0.60, mrV[19] = 3.0138; + r[20] = 0.68, mrV[20] = 2.8342; + r[21] = 0.76, mrV[21] = 2.6881; + r[22] = 0.84, mrV[22] = 2.5662; + r[23] = 0.92, mrV[23] = 2.4242; + r[24] = 1.00, mrV[24] = 2.3766; + r[25] = 1.08, mrV[25] = 2.3058; + r[26] = 1.16, mrV[26] = 2.2458; + r[27] = 1.24, mrV[27] = 2.2035; + r[28] = 1.32, mrV[28] = 2.1661; + r[29] = 1.40, mrV[29] = 2.1350; + r[30] = 1.48, mrV[30] = 2.1090; + r[31] = 1.64, mrV[31] = 2.0697; + r[32] = 1.80, mrV[32] = 2.0466; + r[33] = 1.96, mrV[33] = 2.0325; + r[34] = 2.12, mrV[34] = 2.0288; + r[35] = 2.28, mrV[35] = 2.0292; + r[36] = 2.44, mrV[36] = 2.0228; + r[37] = 2.60, mrV[37] = 2.0124; + r[38] = 2.76, mrV[38] = 2.0065; + r[39] = 2.92, mrV[39] = 2.0031; + r[40] = 3.08, mrV[40] = 2.0015; + r[41] = 3.24, mrV[41] = 2.0008; + r[42] = 3.40, mrV[42] = 2.0004; + r[43] = 3.56, mrV[43] = 2.0002; + r[44] = 3.72, mrV[44] = 2.0001; + //-> + + // Now we want to interpolate this potential at any r: + boost::math::barycentric_rational b(r.data(), mrV.data(), r.size()); + + for (size_t i = 1; i < 8; ++i) + { + double r = i*0.5; + std::cout << "(r, V) = (" << r << ", " << -b(r)/r << ")\n"; + } +} +//] [/barycentric_rational_example] diff --git a/example/barycentric_interpolation_example_2.cpp b/example/barycentric_interpolation_example_2.cpp new file mode 100644 index 000000000..c5b45a4f3 --- /dev/null +++ b/example/barycentric_interpolation_example_2.cpp @@ -0,0 +1,109 @@ + +// Copyright Nick Thompson, 2017 + +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or +// copy at http://www.boost.org/LICENSE_1_0.txt). + +#include +#include +#include + +//[barycentric_rational_example2 + +/*`This further example shows how to use the iterator based constructor, and then uses the +function object in our root finding algorithms to locate the points where the potential +achieves a specific value. +*/ + +#include +#include +#include + +int main() +{ + // The lithium potential is given in Kohn's paper, Table I, + // we could equally use an unordered_map, a list of tuples or pairs, + // or a 2-dimentional array equally easily: + std::map r; + + r[0.02] = 5.727; + r[0.04] = 5.544; + r[0.06] = 5.450; + r[0.08] = 5.351; + r[0.10] = 5.253; + r[0.12] = 5.157; + r[0.14] = 5.058; + r[0.16] = 4.960; + r[0.18] = 4.862; + r[0.20] = 4.762; + r[0.24] = 4.563; + r[0.28] = 4.360; + r[0.32] = 4.1584; + r[0.36] = 3.9463; + r[0.40] = 3.7360; + r[0.44] = 3.5429; + r[0.48] = 3.3797; + r[0.52] = 3.2417; + r[0.56] = 3.1209; + r[0.60] = 3.0138; + r[0.68] = 2.8342; + r[0.76] = 2.6881; + r[0.84] = 2.5662; + r[0.92] = 2.4242; + r[1.00] = 2.3766; + r[1.08] = 2.3058; + r[1.16] = 2.2458; + r[1.24] = 2.2035; + r[1.32] = 2.1661; + r[1.40] = 2.1350; + r[1.48] = 2.1090; + r[1.64] = 2.0697; + r[1.80] = 2.0466; + r[1.96] = 2.0325; + r[2.12] = 2.0288; + r[2.28] = 2.0292; + r[2.44] = 2.0228; + r[2.60] = 2.0124; + r[2.76] = 2.0065; + r[2.92] = 2.0031; + r[3.08] = 2.0015; + r[3.24] = 2.0008; + r[3.40] = 2.0004; + r[3.56] = 2.0002; + r[3.72] = 2.0001; + + // Let's discover the absissa that will generate a potential of exactly 3.0, + // start by creating 2 ranges for the x and y values: + auto x_range = boost::adaptors::keys(r); + auto y_range = boost::adaptors::values(r); + boost::math::barycentric_rational b(x_range.begin(), x_range.end(), y_range.begin()); + // + // We'll use a lamda expression to provide the functor to our root finder, since we want + // the abscissa value that yields 3, not zero. We pass the functor b by value to the + // lambda expression since barycentric_rational is trivial to copy. + // Here we're using simple bisection to find the root: + boost::uintmax_t iterations = std::numeric_limits::max(); + double abscissa_3 = boost::math::tools::bisect([=](double x) { return b(x) - 3; }, 0.44, 1.24, boost::math::tools::eps_tolerance(), iterations).first; + std::cout << "Abscissa value that yields a potential of 3 = " << abscissa_3 << std::endl; + std::cout << "Root was found in " << iterations << " iterations." << std::endl; + // + // However, we have a more efficient root finding algorithm than simple bisection: + iterations = std::numeric_limits::max(); + abscissa_3 = boost::math::tools::bracket_and_solve_root([=](double x) { return b(x) - 3; }, 0.6, 1.2, false, boost::math::tools::eps_tolerance(), iterations).first; + std::cout << "Abscissa value that yields a potential of 3 = " << abscissa_3 << std::endl; + std::cout << "Root was found in " << iterations << " iterations." << std::endl; +} +//] [/barycentric_rational_example2] + + +//[barycentric_rational_example2_out +/*` Program output is: +[pre +Abscissa value that yields a potential of 3 = 0.604728 +Root was found in 54 iterations. +Abscissa value that yields a potential of 3 = 0.604728 +Root was found in 10 iterations. +] +*/ +//] diff --git a/example/cubic_b_spline_example.cpp b/example/cubic_b_spline_example.cpp new file mode 100644 index 000000000..e80a31f4c --- /dev/null +++ b/example/cubic_b_spline_example.cpp @@ -0,0 +1,147 @@ +// Copyright Nicholas Thompson 2017. +// Copyright Paul A. Bristow 2017. +// Copyright John Maddock 2017. + +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or +// copy at http://www.boost.org/LICENSE_1_0.txt). + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +//[cubic_b_spline_example + +/*`This example demonstrates how to use the cubic b spline interpolator for regularly spaced data. +*/ +#include + +int main() +{ + // We begin with an array of samples: + std::vector v(500); + // And decide on a stepsize: + double step = 0.01; + + // Initialize the vector with a function we'd like to interpolate: + for (size_t i = 0; i < v.size(); ++i) + { + v[i] = sin(i*step); + } + // We could define an arbitrary start time, but for now we'll just use 0: + boost::math::cubic_b_spline spline(v.data(), v.size(), 0 /* start time */, step); + + // Now we can evaluate the spline wherever we please. + std::mt19937 gen; + boost::random::uniform_real_distribution absissa(0, v.size()*step); + for (size_t i = 0; i < 10; ++i) + { + double x = absissa(gen); + std::cout << "sin(" << x << ") = " << sin(x) << ", spline interpolation gives " << spline(x) << std::endl; + std::cout << "cos(" << x << ") = " << cos(x) << ", spline derivative interpolation gives " << spline.prime(x) << std::endl; + } + + // The next example is less trivial: + // We will try to figure out when the population of the United States crossed 100 million. + // Since the census is taken every 10 years, the data is equally spaced, so we can use the cubic b spline. + // Data taken from https://en.wikipedia.org/wiki/United_States_Census + // An eye + // We'll start at the year 1860: + double t0 = 1860; + double time_step = 10; + std::vector population{31443321, /* 1860 */ + 39818449, /* 1870 */ + 50189209, /* 1880 */ + 62947714, /* 1890 */ + 76212168, /* 1900 */ + 92228496, /* 1910 */ + 106021537, /* 1920 */ + 122775046, /* 1930 */ + 132164569, /* 1940 */ + 150697361, /* 1950 */ + 179323175};/* 1960 */ + + // An eyeball estimate indicates that the population crossed 100 million around 1915. + // Let's see what interpolation says: + boost::math::cubic_b_spline p(population.data(), population.size(), t0, 10); + + // Now create a function which has a zero at p = 100,000,000: + auto f = [=](double t){ return p(t) - 100000000; }; + + // Boost includes a bisection algorithm, which is robust, though not as fast as some others + // we provide, but lets try that first. We need a termination condition for it, which + // takes the two endpoints of the range and returns either true (stop) or false (keep going), + // we could use a predefined one such as boost::math::tools::eps_tolerance, but that + // won't stop until we have full double precision which is overkill, since we just need the + // endpoint to yield the same month. While we're at it, we'll keep track of the number of + // iterations required too, though this is strictly optional: + + auto termination = [](double left, double right) + { + double left_month = std::round((left - std::floor(left)) * 12 + 1); + double right_month = std::round((right - std::floor(right)) * 12 + 1); + return (left_month == right_month) && (std::floor(left) == std::floor(right)); + }; + std::uintmax_t iterations = 1000; + auto result = boost::math::tools::bisect(f, 1910.0, 1920.0, termination, iterations); + auto time = result.first; // termination condition ensures that both endpoints yield the same result + auto month = std::round((time - std::floor(time))*12 + 1); + auto year = std::floor(time); + std::cout << "The population of the United States surpassed 100 million on the "; + std::cout << month << "th month of " << year << std::endl; + std::cout << "Found in " << iterations << " iterations" << std::endl; + + // Since the cubic B spline offers the first derivative, we could equally have used Newton iterations, + // this takes "number of bits correct" as a termination condition - 20 should be plenty for what we need, + // and once again, we track how many iterations are taken: + + auto f_n = [=](double t) { return std::make_pair(p(t) - 100000000, p.prime(t)); }; + iterations = 1000; + time = boost::math::tools::newton_raphson_iterate(f_n, 1910.0, 1900.0, 2000.0, 20, iterations); + month = std::round((time - std::floor(time))*12 + 1); + year = std::floor(time); + std::cout << "The population of the United States surpassed 100 million on the "; + std::cout << month << "th month of " << year << std::endl; + std::cout << "Found in " << iterations << " iterations" << std::endl; + +} + +//] [/cubic_b_spline_example] + +//[cubic_b_spline_example_out +/*` Program output is: +[pre +sin(4.07362) = -0.802829, spline interpolation gives - 0.802829 +cos(4.07362) = -0.596209, spline derivative interpolation gives - 0.596209 +sin(0.677385) = 0.626758, spline interpolation gives 0.626758 +cos(0.677385) = 0.779214, spline derivative interpolation gives 0.779214 +sin(4.52896) = -0.983224, spline interpolation gives - 0.983224 +cos(4.52896) = -0.182402, spline derivative interpolation gives - 0.182402 +sin(4.17504) = -0.85907, spline interpolation gives - 0.85907 +cos(4.17504) = -0.511858, spline derivative interpolation gives - 0.511858 +sin(0.634934) = 0.593124, spline interpolation gives 0.593124 +cos(0.634934) = 0.805111, spline derivative interpolation gives 0.805111 +sin(4.84434) = -0.991307, spline interpolation gives - 0.991307 +cos(4.84434) = 0.131567, spline derivative interpolation gives 0.131567 +sin(4.56688) = -0.989432, spline interpolation gives - 0.989432 +cos(4.56688) = -0.144997, spline derivative interpolation gives - 0.144997 +sin(1.10517) = 0.893541, spline interpolation gives 0.893541 +cos(1.10517) = 0.448982, spline derivative interpolation gives 0.448982 +sin(3.1618) = -0.0202022, spline interpolation gives - 0.0202022 +cos(3.1618) = -0.999796, spline derivative interpolation gives - 0.999796 +sin(1.54084) = 0.999551, spline interpolation gives 0.999551 +cos(1.54084) = 0.0299566, spline derivative interpolation gives 0.0299566 +The population of the United States surpassed 100 million on the 11th month of 1915 +Found in 12 iterations +The population of the United States surpassed 100 million on the 11th month of 1915 +Found in 3 iterations +] +*/ +//] diff --git a/example/legendre_stieltjes_example.cpp b/example/legendre_stieltjes_example.cpp new file mode 100644 index 000000000..ab92e68c4 --- /dev/null +++ b/example/legendre_stieltjes_example.cpp @@ -0,0 +1,98 @@ +// Copyright Nick Thompson 2017. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include +#include +#include + +using boost::math::legendre_p; +using boost::math::legendre_p_zeros; +using boost::math::legendre_p_prime; +using boost::math::legendre_stieltjes; +using boost::multiprecision::cpp_bin_float_quad; +using boost::multiprecision::cpp_bin_float_100; + +template +void gauss_konrod_rule(size_t order) +{ + std::cout << std::setprecision(std::numeric_limits::digits10); + std::cout << std::fixed; + auto gauss_nodes = boost::math::legendre_p_zeros(order); + auto E = legendre_stieltjes(order + 1); + std::vector gauss_weights(gauss_nodes.size(), std::numeric_limits::quiet_NaN()); + std::vector gauss_konrod_weights(gauss_nodes.size(), std::numeric_limits::quiet_NaN()); + for (size_t i = 0; i < gauss_nodes.size(); ++i) + { + Real node = gauss_nodes[i]; + Real lp = legendre_p_prime(order, node); + gauss_weights[i] = 2/( (1-node*node)*lp*lp); + // P_n(x) = (2n)!/(2^n (n!)^2) pi_n(x), where pi_n is the monic Legendre polynomial. + gauss_konrod_weights[i] = gauss_weights[i] + static_cast(2)/(static_cast(order+1)*legendre_p_prime(order, node)*E(node)); + } + + std::cout << "Gauss Nodes:\n"; + for (auto const & node : gauss_nodes) + { + std::cout << node << "\n"; + } + + std::cout << "Gauss Weights:\n"; + for (auto const & weight : gauss_weights) + { + std::cout << weight << "\n"; + } + + std::cout << "Gauss-Konrod weights: \n"; + for (auto const & w : gauss_konrod_weights) + { + std::cout << w << "\n"; + } + + auto konrod_nodes = E.zeros(); + std::vector konrod_weights(konrod_nodes.size()); + for (size_t i = 0; i < konrod_weights.size(); ++i) + { + Real node = konrod_nodes[i]; + konrod_weights[i] = static_cast(2)/(static_cast(order+1)*legendre_p(order, node)*E.prime(node)); + } + + std::cout << "Konrod nodes:\n"; + for (auto node : konrod_nodes) + { + std::cout << node << "\n"; + } + + std::cout << "Konrod weights: \n"; + for (auto const & w : gauss_konrod_weights) + { + std::cout << w << "\n"; + } + +} + +int main() +{ + std::cout << "Gauss-Konrod 7-15 Rule:\n"; + gauss_konrod_rule(7); + + std::cout << "\n\nGauss-Konrod 10-21 Rule:\n"; + gauss_konrod_rule(10); + + std::cout << "\n\nGauss-Konrod 15-31 Rule:\n"; + gauss_konrod_rule(15); + + std::cout << "\n\nGauss-Konrod 20-41 Rule:\n"; + gauss_konrod_rule(20); + + std::cout << "\n\nGauss-Konrod 25-51 Rule:\n"; + gauss_konrod_rule(25); + + std::cout << "\n\nGauss-Konrod 30-61 Rule:\n"; + gauss_konrod_rule(30); + +} diff --git a/include/boost/math/common_factor_ct.hpp b/include/boost/math/common_factor_ct.hpp index bf58b94eb..3ca090594 100644 --- a/include/boost/math/common_factor_ct.hpp +++ b/include/boost/math/common_factor_ct.hpp @@ -1,6 +1,6 @@ // Boost common_factor_ct.hpp header file ----------------------------------// -// (C) Copyright Daryle Walker and Stephen Cleary 2001-2002. +// (C) Copyright John Maddock 2017. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) @@ -10,85 +10,16 @@ #ifndef BOOST_MATH_COMMON_FACTOR_CT_HPP #define BOOST_MATH_COMMON_FACTOR_CT_HPP -#include // self include -#include // for BOOST_STATIC_CONSTANT, etc. -#include +#include namespace boost { namespace math { -// Implementation details --------------------------------------------------// - -namespace detail -{ - // Build GCD with Euclid's recursive algorithm - template < static_gcd_type Value1, static_gcd_type Value2 > - struct static_gcd_helper_t - { - private: - BOOST_STATIC_CONSTANT( static_gcd_type, new_value1 = Value2 ); - BOOST_STATIC_CONSTANT( static_gcd_type, new_value2 = Value1 % Value2 ); - - #ifndef __BORLANDC__ - #define BOOST_DETAIL_GCD_HELPER_VAL(Value) static_cast(Value) - #else - typedef static_gcd_helper_t self_type; - #define BOOST_DETAIL_GCD_HELPER_VAL(Value) (self_type:: Value ) - #endif - - typedef static_gcd_helper_t< BOOST_DETAIL_GCD_HELPER_VAL(new_value1), - BOOST_DETAIL_GCD_HELPER_VAL(new_value2) > next_step_type; - - #undef BOOST_DETAIL_GCD_HELPER_VAL - - public: - BOOST_STATIC_CONSTANT( static_gcd_type, value = next_step_type::value ); - }; - - // Non-recursive case - template < static_gcd_type Value1 > - struct static_gcd_helper_t< Value1, 0UL > - { - BOOST_STATIC_CONSTANT( static_gcd_type, value = Value1 ); - }; - - // Build the LCM from the GCD - template < static_gcd_type Value1, static_gcd_type Value2 > - struct static_lcm_helper_t - { - typedef static_gcd_helper_t gcd_type; - - BOOST_STATIC_CONSTANT( static_gcd_type, value = Value1 / gcd_type::value - * Value2 ); - }; - - // Special case for zero-GCD values - template < > - struct static_lcm_helper_t< 0UL, 0UL > - { - BOOST_STATIC_CONSTANT( static_gcd_type, value = 0UL ); - }; - -} // namespace detail - - -// Compile-time greatest common divisor evaluator class declaration --------// - -template < static_gcd_type Value1, static_gcd_type Value2 > -struct static_gcd : public mpl::integral_c::value) > -{ -}; // boost::math::static_gcd - - -// Compile-time least common multiple evaluator class declaration ----------// - -template < static_gcd_type Value1, static_gcd_type Value2 > -struct static_lcm : public mpl::integral_c::value) > -{ -}; // boost::math::static_lcm - + using boost::integer::static_gcd; + using boost::integer::static_lcm; + using boost::integer::static_gcd_type; } // namespace math } // namespace boost diff --git a/include/boost/math/common_factor_rt.hpp b/include/boost/math/common_factor_rt.hpp index acde21d2c..42d9edfc0 100644 --- a/include/boost/math/common_factor_rt.hpp +++ b/include/boost/math/common_factor_rt.hpp @@ -1,4 +1,4 @@ -// (C) Copyright Jeremy William Murphy 2016. +// (C) Copyright John Maddock 2017. // Use, modification and distribution are subject to the // Boost Software License, Version 1.0. (See accompanying file @@ -7,422 +7,19 @@ #ifndef BOOST_MATH_COMMON_FACTOR_RT_HPP #define BOOST_MATH_COMMON_FACTOR_RT_HPP -#include -#include -#include -#include - -#include // for BOOST_NESTED_TEMPLATE, etc. -#include // for std::numeric_limits -#include // for CHAR_MIN -#include -#include -#include -#include - -#if (defined(BOOST_MSVC) || (defined(__clang__) && defined(__c2__)) || (defined(BOOST_INTEL) && defined(_MSC_VER))) && (defined(_M_IX86) || defined(_M_X64)) -#include -#endif - -#ifdef BOOST_MSVC -#pragma warning(push) -#pragma warning(disable:4127 4244) // Conditional expression is constant -#endif +#include namespace boost { namespace math { - template ::value || (std::numeric_limits::is_specialized && !std::numeric_limits::is_signed)> - struct gcd_traits_abs_defaults - { - inline static const T& abs(const T& val) { return val; } - }; - template - struct gcd_traits_abs_defaults - { - inline static T abs(const T& val) - { - using std::abs; - return abs(val); - } - }; + using boost::integer::gcd; + using boost::integer::lcm; + using boost::integer::gcd_range; + using boost::integer::lcm_range; + using boost::integer::gcd_evaluator; + using boost::integer::lcm_evaluator; - template - struct gcd_traits_defaults : public gcd_traits_abs_defaults - { - BOOST_FORCEINLINE static unsigned make_odd(T& val) - { - unsigned r = 0; - while(!(val & 1u)) - { - val >>= 1; - ++r; - } - return r; - } - inline static bool less(const T& a, const T& b) - { - return a < b; - } - - enum method_type - { - method_euclid = 0, - method_binary = 1, - method_mixed = 2, - }; - - static const method_type method = - boost::has_right_shift_assign::value && boost::has_left_shift_assign::value && boost::has_less::value && boost::has_modulus::value - ? method_mixed : - boost::has_right_shift_assign::value && boost::has_left_shift_assign::value && boost::has_less::value - ? method_binary : method_euclid; - }; - // - // Default gcd_traits just inherits from defaults: - // - template - struct gcd_traits : public gcd_traits_defaults {}; - // - // Special handling for polynomials: - // - namespace tools { - template - class polynomial; - } - - template - struct gcd_traits > : public gcd_traits_defaults - { - static const boost::math::tools::polynomial& abs(const boost::math::tools::polynomial& val) { return val; } - }; - // - // Some platforms have fast bitscan operations, that allow us to implement - // make_odd much more efficiently: - // -#if (defined(BOOST_MSVC) || (defined(__clang__) && defined(__c2__)) || (defined(BOOST_INTEL) && defined(_MSC_VER))) && (defined(_M_IX86) || defined(_M_X64)) -#pragma intrinsic(_BitScanForward,) - template <> - struct gcd_traits : public gcd_traits_defaults - { - BOOST_FORCEINLINE static unsigned find_lsb(unsigned long val) - { - unsigned long result; - _BitScanForward(&result, val); - return result; - } - BOOST_FORCEINLINE static unsigned make_odd(unsigned long& val) - { - unsigned result = find_lsb(val); - val >>= result; - return result; - } - }; - -#ifdef _M_X64 -#pragma intrinsic(_BitScanForward64) - template <> - struct gcd_traits : public gcd_traits_defaults - { - BOOST_FORCEINLINE static unsigned find_lsb(unsigned __int64 mask) - { - unsigned long result; - _BitScanForward64(&result, mask); - return result; - } - BOOST_FORCEINLINE static unsigned make_odd(unsigned __int64& val) - { - unsigned result = find_lsb(val); - val >>= result; - return result; - } - }; -#endif - // - // Other integer type are trivial adaptations of the above, - // this works for signed types too, as by the time these functions - // are called, all values are > 0. - // - template <> struct gcd_traits : public gcd_traits_defaults - { BOOST_FORCEINLINE static unsigned make_odd(long& val){ unsigned result = gcd_traits::find_lsb(val); val >>= result; return result; } }; - template <> struct gcd_traits : public gcd_traits_defaults - { BOOST_FORCEINLINE static unsigned make_odd(unsigned int& val){ unsigned result = gcd_traits::find_lsb(val); val >>= result; return result; } }; - template <> struct gcd_traits : public gcd_traits_defaults - { BOOST_FORCEINLINE static unsigned make_odd(int& val){ unsigned result = gcd_traits::find_lsb(val); val >>= result; return result; } }; - template <> struct gcd_traits : public gcd_traits_defaults - { BOOST_FORCEINLINE static unsigned make_odd(unsigned short& val){ unsigned result = gcd_traits::find_lsb(val); val >>= result; return result; } }; - template <> struct gcd_traits : public gcd_traits_defaults - { BOOST_FORCEINLINE static unsigned make_odd(short& val){ unsigned result = gcd_traits::find_lsb(val); val >>= result; return result; } }; - template <> struct gcd_traits : public gcd_traits_defaults - { BOOST_FORCEINLINE static unsigned make_odd(unsigned char& val){ unsigned result = gcd_traits::find_lsb(val); val >>= result; return result; } }; - template <> struct gcd_traits : public gcd_traits_defaults - { BOOST_FORCEINLINE static signed make_odd(signed char& val){ signed result = gcd_traits::find_lsb(val); val >>= result; return result; } }; - template <> struct gcd_traits : public gcd_traits_defaults - { BOOST_FORCEINLINE static unsigned make_odd(char& val){ unsigned result = gcd_traits::find_lsb(val); val >>= result; return result; } }; - template <> struct gcd_traits : public gcd_traits_defaults - { BOOST_FORCEINLINE static unsigned make_odd(wchar_t& val){ unsigned result = gcd_traits::find_lsb(val); val >>= result; return result; } }; -#ifdef _M_X64 - template <> struct gcd_traits<__int64> : public gcd_traits_defaults<__int64> - { BOOST_FORCEINLINE static unsigned make_odd(__int64& val){ unsigned result = gcd_traits::find_lsb(val); val >>= result; return result; } }; -#endif - -#elif defined(BOOST_GCC) || defined(__clang__) || (defined(BOOST_INTEL) && defined(__GNUC__)) - - template <> - struct gcd_traits : public gcd_traits_defaults - { - BOOST_FORCEINLINE static unsigned find_lsb(unsigned mask) - { - return __builtin_ctz(mask); - } - BOOST_FORCEINLINE static unsigned make_odd(unsigned& val) - { - unsigned result = find_lsb(val); - val >>= result; - return result; - } - }; - template <> - struct gcd_traits : public gcd_traits_defaults - { - BOOST_FORCEINLINE static unsigned find_lsb(unsigned long mask) - { - return __builtin_ctzl(mask); - } - BOOST_FORCEINLINE static unsigned make_odd(unsigned long& val) - { - unsigned result = find_lsb(val); - val >>= result; - return result; - } - }; - template <> - struct gcd_traits : public gcd_traits_defaults - { - BOOST_FORCEINLINE static unsigned find_lsb(boost::ulong_long_type mask) - { - return __builtin_ctzll(mask); - } - BOOST_FORCEINLINE static unsigned make_odd(boost::ulong_long_type& val) - { - unsigned result = find_lsb(val); - val >>= result; - return result; - } - }; - // - // Other integer type are trivial adaptations of the above, - // this works for signed types too, as by the time these functions - // are called, all values are > 0. - // - template <> struct gcd_traits : public gcd_traits_defaults - { - BOOST_FORCEINLINE static unsigned make_odd(boost::long_long_type& val) { unsigned result = gcd_traits::find_lsb(val); val >>= result; return result; } - }; - template <> struct gcd_traits : public gcd_traits_defaults - { - BOOST_FORCEINLINE static unsigned make_odd(long& val) { unsigned result = gcd_traits::find_lsb(val); val >>= result; return result; } - }; - template <> struct gcd_traits : public gcd_traits_defaults - { - BOOST_FORCEINLINE static unsigned make_odd(int& val) { unsigned result = gcd_traits::find_lsb(val); val >>= result; return result; } - }; - template <> struct gcd_traits : public gcd_traits_defaults - { - BOOST_FORCEINLINE static unsigned make_odd(unsigned short& val) { unsigned result = gcd_traits::find_lsb(val); val >>= result; return result; } - }; - template <> struct gcd_traits : public gcd_traits_defaults - { - BOOST_FORCEINLINE static unsigned make_odd(short& val) { unsigned result = gcd_traits::find_lsb(val); val >>= result; return result; } - }; - template <> struct gcd_traits : public gcd_traits_defaults - { - BOOST_FORCEINLINE static unsigned make_odd(unsigned char& val) { unsigned result = gcd_traits::find_lsb(val); val >>= result; return result; } - }; - template <> struct gcd_traits : public gcd_traits_defaults - { - BOOST_FORCEINLINE static signed make_odd(signed char& val) { signed result = gcd_traits::find_lsb(val); val >>= result; return result; } - }; - template <> struct gcd_traits : public gcd_traits_defaults - { - BOOST_FORCEINLINE static unsigned make_odd(char& val) { unsigned result = gcd_traits::find_lsb(val); val >>= result; return result; } - }; - template <> struct gcd_traits : public gcd_traits_defaults - { - BOOST_FORCEINLINE static unsigned make_odd(wchar_t& val) { unsigned result = gcd_traits::find_lsb(val); val >>= result; return result; } - }; -#endif - -namespace detail -{ - - // - // The Mixed Binary Euclid Algorithm - // Sidi Mohamed Sedjelmaci - // Electronic Notes in Discrete Mathematics 35 (2009) 169-176 - // - template - T mixed_binary_gcd(T u, T v) - { - using std::swap; - if(gcd_traits::less(u, v)) - swap(u, v); - - unsigned shifts = 0; - - if(!u) - return v; - if(!v) - return u; - - shifts = (std::min)(gcd_traits::make_odd(u), gcd_traits::make_odd(v)); - - while(gcd_traits::less(1, v)) - { - u %= v; - v -= u; - if(!u) - return v << shifts; - if(!v) - return u << shifts; - gcd_traits::make_odd(u); - gcd_traits::make_odd(v); - if(gcd_traits::less(u, v)) - swap(u, v); - } - return (v == 1 ? v : u) << shifts; } - - /** Stein gcd (aka 'binary gcd') - * - * From Mathematics to Generic Programming, Alexander Stepanov, Daniel Rose - */ - template - SteinDomain Stein_gcd(SteinDomain m, SteinDomain n) - { - using std::swap; - BOOST_ASSERT(m >= 0); - BOOST_ASSERT(n >= 0); - if (m == SteinDomain(0)) - return n; - if (n == SteinDomain(0)) - return m; - // m > 0 && n > 0 - int d_m = gcd_traits::make_odd(m); - int d_n = gcd_traits::make_odd(n); - // odd(m) && odd(n) - while (m != n) - { - if (n > m) - swap(n, m); - m -= n; - gcd_traits::make_odd(m); - } - // m == n - m <<= (std::min)(d_m, d_n); - return m; - } - - - /** Euclidean algorithm - * - * From Mathematics to Generic Programming, Alexander Stepanov, Daniel Rose - * - */ - template - inline EuclideanDomain Euclid_gcd(EuclideanDomain a, EuclideanDomain b) - { - using std::swap; - while (b != EuclideanDomain(0)) - { - a %= b; - swap(a, b); - } - return a; - } - - - template - inline BOOST_DEDUCED_TYPENAME enable_if_c::method == gcd_traits::method_mixed, T>::type - optimal_gcd_select(T const &a, T const &b) - { - return detail::mixed_binary_gcd(a, b); - } - - template - inline BOOST_DEDUCED_TYPENAME enable_if_c::method == gcd_traits::method_binary, T>::type - optimal_gcd_select(T const &a, T const &b) - { - return detail::Stein_gcd(a, b); - } - - template - inline BOOST_DEDUCED_TYPENAME enable_if_c::method == gcd_traits::method_euclid, T>::type - optimal_gcd_select(T const &a, T const &b) - { - return detail::Euclid_gcd(a, b); - } - - template - inline T lcm_imp(const T& a, const T& b) - { - T temp = boost::math::detail::optimal_gcd_select(a, b); -#if BOOST_WORKAROUND(BOOST_GCC_VERSION, < 40500) - return (temp != T(0)) ? T(a / temp * b) : T(0); -#else - return temp ? T(a / temp * b) : T(0); -#endif - } - -} // namespace detail - - -template -inline Integer gcd(Integer const &a, Integer const &b) -{ - return detail::optimal_gcd_select(static_cast(gcd_traits::abs(a)), static_cast(gcd_traits::abs(b))); } -template -inline Integer lcm(Integer const &a, Integer const &b) -{ - return detail::lcm_imp(static_cast(gcd_traits::abs(a)), static_cast(gcd_traits::abs(b))); -} - -/** - * Knuth, The Art of Computer Programming: Volume 2, Third edition, 1998 - * Chapter 4.5.2, Algorithm C: Greatest common divisor of n integers. - * - * Knuth counts down from n to zero but we naturally go from first to last. - * We also return the termination position because it might be useful to know. - * - * Partly by quirk, partly by design, this algorithm is defined for n = 1, - * because the gcd of {x} is x. It is not defined for n = 0. - * - * @tparam I Input iterator. - * @return The gcd of the range and the iterator position at termination. - */ -template -std::pair::value_type, I> -gcd_range(I first, I last) -{ - BOOST_ASSERT(first != last); - typedef typename std::iterator_traits::value_type T; - - T d = *first++; - while (d != T(1) && first != last) - { - d = gcd(d, *first); - first++; - } - return std::make_pair(d, first); -} - -} // namespace math -} // namespace boost - -#ifdef BOOST_MSVC -#pragma warning(pop) -#endif - #endif // BOOST_MATH_COMMON_FACTOR_RT_HPP diff --git a/include/boost/math/constants/constants.hpp b/include/boost/math/constants/constants.hpp index b5db9cedf..8c5c4105d 100644 --- a/include/boost/math/constants/constants.hpp +++ b/include/boost/math/constants/constants.hpp @@ -266,6 +266,7 @@ namespace boost{ namespace math BOOST_DEFINE_MATH_CONSTANT(third, 3.333333333333333333333333333333333333e-01, "3.33333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333e-01") BOOST_DEFINE_MATH_CONSTANT(twothirds, 6.666666666666666666666666666666666666e-01, "6.66666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666667e-01") BOOST_DEFINE_MATH_CONSTANT(two_thirds, 6.666666666666666666666666666666666666e-01, "6.66666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666667e-01") + BOOST_DEFINE_MATH_CONSTANT(sixth, 1.66666666666666666666666666666666666666666e-01, "1.66666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666667e-01") BOOST_DEFINE_MATH_CONSTANT(three_quarters, 7.500000000000000000000000000000000000e-01, "7.50000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e-01") BOOST_DEFINE_MATH_CONSTANT(root_two, 1.414213562373095048801688724209698078e+00, "1.41421356237309504880168872420969807856967187537694807317667973799073247846210703885038753432764157273501384623e+00") BOOST_DEFINE_MATH_CONSTANT(root_three, 1.732050807568877293527446341505872366e+00, "1.73205080756887729352744634150587236694280525381038062805580697945193301690880003708114618675724857567562614142e+00") @@ -343,5 +344,3 @@ namespace boost{ namespace math #include #endif // BOOST_MATH_CONSTANTS_CONSTANTS_INCLUDED - - diff --git a/include/boost/math/interpolators/barycentric_rational.hpp b/include/boost/math/interpolators/barycentric_rational.hpp new file mode 100644 index 000000000..79bab9042 --- /dev/null +++ b/include/boost/math/interpolators/barycentric_rational.hpp @@ -0,0 +1,70 @@ +/* + * Copyright Nick Thompson, 2017 + * Use, modification and distribution are subject to the + * Boost Software License, Version 1.0. (See accompanying file + * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + * + * Given N samples (t_i, y_i) which are irregularly spaced, this routine constructs an + * interpolant s which is constructed in O(N) time, occupies O(N) space, and can be evaluated in O(N) time. + * The interpolation is stable, unless one point is incredibly close to another, and the next point is incredibly far. + * The measure of this stability is the "local mesh ratio", which can be queried from the routine. + * Pictorially, the following t_i spacing is bad (has a high local mesh ratio) + * || | | | | + * and this t_i spacing is good (has a low local mesh ratio) + * | | | | | | | | | | + * + * + * If f is C^{d+2}, then the interpolant is O(h^(d+1)) accurate, where d is the interpolation order. + * A disadvantage of this interpolant is that it does not reproduce rational functions; for example, 1/(1+x^2) is not interpolated exactly. + * + * References: + * Floater, Michael S., and Kai Hormann. "Barycentric rational interpolation with no poles and high rates of approximation." Numerische Mathematik 107.2 (2007): 315-331. + * Press, William H., et al. "Numerical recipes third edition: the art of scientific computing." Cambridge University Press 32 (2007): 10013-2473. + */ + +#ifndef BOOST_MATH_INTERPOLATORS_BARYCENTRIC_RATIONAL_HPP +#define BOOST_MATH_INTERPOLATORS_BARYCENTRIC_RATIONAL_HPP + +#include +#include + +namespace boost{ namespace math{ + +template +class barycentric_rational +{ +public: + barycentric_rational(const Real* const x, const Real* const y, size_t n, size_t approximation_order = 3); + + template + barycentric_rational(InputIterator1 start_x, InputIterator1 end_x, InputIterator2 start_y, size_t approximation_order = 3, typename boost::disable_if_c::value>::type* = 0); + + Real operator()(Real x) const; + +private: + std::shared_ptr> m_imp; +}; + +template +barycentric_rational::barycentric_rational(const Real* const x, const Real* const y, size_t n, size_t approximation_order): + m_imp(std::make_shared>(x, x + n, y, approximation_order)) +{ + return; +} + +template +template +barycentric_rational::barycentric_rational(InputIterator1 start_x, InputIterator1 end_x, InputIterator2 start_y, size_t approximation_order, typename boost::disable_if_c::value>::type*) + : m_imp(std::make_shared>(start_x, end_x, start_y, approximation_order)) +{ +} + +template +Real barycentric_rational::operator()(Real x) const +{ + return m_imp->operator()(x); +} + + +}} +#endif diff --git a/include/boost/math/interpolators/cubic_b_spline.hpp b/include/boost/math/interpolators/cubic_b_spline.hpp new file mode 100644 index 000000000..73ac1d013 --- /dev/null +++ b/include/boost/math/interpolators/cubic_b_spline.hpp @@ -0,0 +1,78 @@ +// Copyright Nick Thompson, 2017 +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// This implements the compactly supported cubic b spline algorithm described in +// Kress, Rainer. "Numerical analysis, volume 181 of Graduate Texts in Mathematics." (1998). +// Splines of compact support are faster to evaluate and are better conditioned than classical cubic splines. + +// Let f be the function we are trying to interpolate, and s be the interpolating spline. +// The routine constructs the interpolant in O(N) time, and evaluating s at a point takes constant time. +// The order of accuracy depends on the regularity of the f, however, assuming f is +// four-times continuously differentiable, the error is of O(h^4). +// In addition, we can differentiate the spline and obtain a good interpolant for f'. +// The main restriction of this method is that the samples of f must be evenly spaced. +// Look for barycentric rational interpolation for non-evenly sampled data. +// Properties: +// - s(x_j) = f(x_j) +// - All cubic polynomials interpolated exactly + +#ifndef BOOST_MATH_INTERPOLATORS_CUBIC_B_SPLINE_HPP +#define BOOST_MATH_INTERPOLATORS_CUBIC_B_SPLINE_HPP + +#include + +namespace boost{ namespace math{ + +template +class cubic_b_spline +{ +public: + // If you don't know the value of the derivative at the endpoints, leave them as nans and the routine will estimate them. + // f[0] = f(a), f[length -1] = b, step_size = (b - a)/(length -1). + template + cubic_b_spline(const BidiIterator f, BidiIterator end_p, Real left_endpoint, Real step_size, + Real left_endpoint_derivative = std::numeric_limits::quiet_NaN(), + Real right_endpoint_derivative = std::numeric_limits::quiet_NaN()); + cubic_b_spline(const Real* const f, size_t length, Real left_endpoint, Real step_size, + Real left_endpoint_derivative = std::numeric_limits::quiet_NaN(), + Real right_endpoint_derivative = std::numeric_limits::quiet_NaN()); + + cubic_b_spline() = default; + Real operator()(Real x) const; + + Real prime(Real x) const; + +private: + std::shared_ptr> m_imp; +}; + +template +cubic_b_spline::cubic_b_spline(const Real* const f, size_t length, Real left_endpoint, Real step_size, + Real left_endpoint_derivative, Real right_endpoint_derivative) : m_imp(std::make_shared>(f, f + length, left_endpoint, step_size, left_endpoint_derivative, right_endpoint_derivative)) +{ +} + +template +template +cubic_b_spline::cubic_b_spline(BidiIterator f, BidiIterator end_p, Real left_endpoint, Real step_size, + Real left_endpoint_derivative, Real right_endpoint_derivative) : m_imp(std::make_shared>(f, end_p, left_endpoint, step_size, left_endpoint_derivative, right_endpoint_derivative)) +{ +} + +template +Real cubic_b_spline::operator()(Real x) const +{ + return m_imp->operator()(x); +} + +template +Real cubic_b_spline::prime(Real x) const +{ + return m_imp->prime(x); +} + +}} +#endif diff --git a/include/boost/math/interpolators/detail/barycentric_rational_detail.hpp b/include/boost/math/interpolators/detail/barycentric_rational_detail.hpp new file mode 100644 index 000000000..b853901d8 --- /dev/null +++ b/include/boost/math/interpolators/detail/barycentric_rational_detail.hpp @@ -0,0 +1,151 @@ +/* + * Copyright Nick Thompson, 2017 + * Use, modification and distribution are subject to the + * Boost Software License, Version 1.0. (See accompanying file + * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + */ + +#ifndef BOOST_MATH_INTERPOLATORS_BARYCENTRIC_RATIONAL_DETAIL_HPP +#define BOOST_MATH_INTERPOLATORS_BARYCENTRIC_RATIONAL_DETAIL_HPP + +#include +#include +#include +#include + +namespace boost{ namespace math{ namespace detail{ + +template +class barycentric_rational_imp +{ +public: + template + barycentric_rational_imp(InputIterator1 start_x, InputIterator1 end_x, InputIterator2 start_y, size_t approximation_order = 3); + + Real operator()(Real x) const; + + // The barycentric weights are not really that interesting; except to the unit tests! + Real weight(size_t i) const { return m_w[i]; } + +private: + // Technically, we do not need to copy over y to m_y, or x to m_x. + // We could simply store a pointer. However, in doing so, + // we'd need to make sure the user managed the lifetime of m_y, + // and didn't alter its data. Since we are unlikely to run out of + // memory for a linearly scaling algorithm, it seems best just to make a copy. + std::vector m_y; + std::vector m_x; + std::vector m_w; +}; + +template +template +barycentric_rational_imp::barycentric_rational_imp(InputIterator1 start_x, InputIterator1 end_x, InputIterator2 start_y, size_t approximation_order) +{ + using std::abs; + + std::ptrdiff_t n = std::distance(start_x, end_x); + + if (approximation_order >= (std::size_t)n) + { + throw std::domain_error("Approximation order must be < data length."); + } + + // Big sad memcpy to make sure the object is easy to use. + m_x.resize(n); + m_y.resize(n); + for(unsigned i = 0; start_x != end_x; ++start_x, ++start_y, ++i) + { + // But if we're going to do a memcpy, we can do some error checking which is inexpensive relative to the copy: + if(boost::math::isnan(*start_x)) + { + std::string msg = std::string("x[") + boost::lexical_cast(i) + "] is a NAN"; + throw std::domain_error(msg); + } + + if(boost::math::isnan(*start_y)) + { + std::string msg = std::string("y[") + boost::lexical_cast(i) + "] is a NAN"; + throw std::domain_error(msg); + } + + m_x[i] = *start_x; + m_y[i] = *start_y; + } + + m_w.resize(n, 0); + for(int64_t k = 0; k < n; ++k) + { + int64_t i_min = (std::max)(k - (int64_t) approximation_order, (int64_t) 0); + int64_t i_max = k; + if (k >= n - (std::ptrdiff_t)approximation_order) + { + i_max = n - approximation_order - 1; + } + + for(int64_t i = i_min; i <= i_max; ++i) + { + Real inv_product = 1; + int64_t j_max = (std::min)(static_cast(i + approximation_order), static_cast(n - 1)); + for(int64_t j = i; j <= j_max; ++j) + { + if (j == k) + { + continue; + } + + Real diff = m_x[k] - m_x[j]; + if (abs(diff) < std::numeric_limits::epsilon()) + { + std::string msg = std::string("Spacing between x[") + + boost::lexical_cast(k) + std::string("] and x[") + + boost::lexical_cast(i) + std::string("] is ") + + boost::lexical_cast(diff) + std::string(", which is smaller than the epsilon of ") + + boost::core::demangle(typeid(Real).name()); + throw std::logic_error(msg); + } + inv_product *= diff; + } + if (i % 2 == 0) + { + m_w[k] += 1/inv_product; + } + else + { + m_w[k] -= 1/inv_product; + } + } + } +} + +template +Real barycentric_rational_imp::operator()(Real x) const +{ + Real numerator = 0; + Real denominator = 0; + for(size_t i = 0; i < m_x.size(); ++i) + { + // Presumably we should see if the accuracy is improved by using ULP distance of say, 5 here, instead of testing for floating point equality. + // However, it has been shown that if x approx x_i, but x != x_i, then inaccuracy in the numerator cancels the inaccuracy in the denominator, + // and the result is fairly accurate. See: http://epubs.siam.org/doi/pdf/10.1137/S0036144502417715 + if (x == m_x[i]) + { + return m_y[i]; + } + Real t = m_w[i]/(x - m_x[i]); + numerator += t*m_y[i]; + denominator += t; + } + return numerator/denominator; +} + +/* + * A formula for computing the derivative of the barycentric representation is given in + * "Some New Aspects of Rational Interpolation", by Claus Schneider and Wilhelm Werner, + * Mathematics of Computation, v47, number 175, 1986. + * http://www.ams.org/journals/mcom/1986-47-175/S0025-5718-1986-0842136-8/S0025-5718-1986-0842136-8.pdf + * However, this requires a lot of machinery which is not built into the library at present. + * So we wait until there is a requirement to interpolate the derivative. + */ +}}} +#endif diff --git a/include/boost/math/interpolators/detail/cubic_b_spline_detail.hpp b/include/boost/math/interpolators/detail/cubic_b_spline_detail.hpp new file mode 100644 index 000000000..f7b2d6cd2 --- /dev/null +++ b/include/boost/math/interpolators/detail/cubic_b_spline_detail.hpp @@ -0,0 +1,287 @@ +// Copyright Nick Thompson, 2017 +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +#ifndef CUBIC_B_SPLINE_DETAIL_HPP +#define CUBIC_B_SPLINE_DETAIL_HPP + +#include +#include +#include +#include +#include +#include + +namespace boost{ namespace math{ namespace detail{ + + +template +class cubic_b_spline_imp +{ +public: + // If you don't know the value of the derivative at the endpoints, leave them as nans and the routine will estimate them. + // f[0] = f(a), f[length -1] = b, step_size = (b - a)/(length -1). + template + cubic_b_spline_imp(BidiIterator f, BidiIterator end_p, Real left_endpoint, Real step_size, + Real left_endpoint_derivative = std::numeric_limits::quiet_NaN(), + Real right_endpoint_derivative = std::numeric_limits::quiet_NaN()); + + Real operator()(Real x) const; + + Real prime(Real x) const; + +private: + std::vector m_beta; + Real m_h_inv; + Real m_a; + Real m_avg; +}; + + + +template +Real b3_spline(Real x) +{ + using std::abs; + Real absx = abs(x); + if (absx < 1) + { + Real y = 2 - absx; + Real z = 1 - absx; + return boost::math::constants::sixth()*(y*y*y - 4*z*z*z); + } + if (absx < 2) + { + Real y = 2 - absx; + return boost::math::constants::sixth()*y*y*y; + } + return (Real) 0; +} + +template +Real b3_spline_prime(Real x) +{ + if (x < 0) + { + return -b3_spline_prime(-x); + } + + if (x < 1) + { + return x*(3*boost::math::constants::half()*x - 2); + } + if (x < 2) + { + return -boost::math::constants::half()*(2 - x)*(2 - x); + } + return (Real) 0; +} + + +template +template +cubic_b_spline_imp::cubic_b_spline_imp(BidiIterator f, BidiIterator end_p, Real left_endpoint, Real step_size, + Real left_endpoint_derivative, Real right_endpoint_derivative) : m_a(left_endpoint), m_avg(0) +{ + using boost::math::constants::third; + + std::size_t length = end_p - f; + + if (length < 5) + { + if (boost::math::isnan(left_endpoint_derivative) || boost::math::isnan(right_endpoint_derivative)) + { + throw std::logic_error("Interpolation using a cubic b spline with derivatives estimated at the endpoints requires at least 5 points.\n"); + } + if (length < 3) + { + throw std::logic_error("Interpolation using a cubic b spline requires at least 3 points.\n"); + } + } + + if (boost::math::isnan(left_endpoint)) + { + throw std::logic_error("Left endpoint is NAN; this is disallowed.\n"); + } + if (left_endpoint + length*step_size >= (std::numeric_limits::max)()) + { + throw std::logic_error("Right endpoint overflows the maximum representable number of the specified precision.\n"); + } + if (step_size <= 0) + { + throw std::logic_error("The step size must be strictly > 0.\n"); + } + // Storing the inverse of the stepsize does provide a measurable speedup. + // It's not huge, but nonetheless worthwhile. + m_h_inv = 1/step_size; + + // Following Kress's notation, s'(a) = a1, s'(b) = b1 + Real a1 = left_endpoint_derivative; + // See the finite-difference table on Wikipedia for reference on how + // to construct high-order estimates for one-sided derivatives: + // https://en.wikipedia.org/wiki/Finite_difference_coefficient#Forward_and_backward_finite_difference + // Here, we estimate then to O(h^4), as that is the maximum accuracy we could obtain from this method. + if (boost::math::isnan(a1)) + { + // For simple functions (linear, quadratic, so on) + // almost all the error comes from derivative estimation. + // This does pairwise summation which gives us another digit of accuracy over naive summation. + Real t0 = 4*(f[1] + third()*f[3]); + Real t1 = -(25*third()*f[0] + f[4])/4 - 3*f[2]; + a1 = m_h_inv*(t0 + t1); + } + + Real b1 = right_endpoint_derivative; + if (boost::math::isnan(b1)) + { + size_t n = length - 1; + Real t0 = 4*(f[n-3] + third()*f[n - 1]); + Real t1 = -(25*third()*f[n - 4] + f[n])/4 - 3*f[n - 2]; + + b1 = m_h_inv*(t0 + t1); + } + + // s(x) = \sum \alpha_i B_{3}( (x- x_i - a)/h ) + // Of course we must reindex from Kress's notation, since he uses negative indices which make C++ unhappy. + m_beta.resize(length + 2, std::numeric_limits::quiet_NaN()); + + // Since the splines have compact support, they decay to zero very fast outside the endpoints. + // This is often very annoying; we'd like to evaluate the interpolant a little bit outside the + // boundary [a,b] without massive error. + // A simple way to deal with this is just to subtract the DC component off the signal, so we need the average. + // This algorithm for computing the average is recommended in + // http://www.heikohoffmann.de/htmlthesis/node134.html + Real t = 1; + for (size_t i = 0; i < length; ++i) + { + if (boost::math::isnan(f[i])) + { + std::string err = "This function you are trying to interpolate is a nan at index " + std::to_string(i) + "\n"; + throw std::logic_error(err); + } + m_avg += (f[i] - m_avg) / t; + t += 1; + } + + + // Now we must solve an almost-tridiagonal system, which requires O(N) operations. + // There are, in fact 5 diagonals, but they only differ from zero on the first and last row, + // so we can patch up the tridiagonal row reduction algorithm to deal with two special rows. + // See Kress, equations 8.41 + // The the "tridiagonal" matrix is: + // 1 0 -1 + // 1 4 1 + // 1 4 1 + // 1 4 1 + // .... + // 1 4 1 + // 1 0 -1 + // Numerical estimate indicate that as N->Infinity, cond(A) -> 6.9, so this matrix is good. + std::vector rhs(length + 2, std::numeric_limits::quiet_NaN()); + std::vector super_diagonal(length + 2, std::numeric_limits::quiet_NaN()); + + rhs[0] = -2*step_size*a1; + rhs[rhs.size() - 1] = -2*step_size*b1; + + super_diagonal[0] = 0; + + for(size_t i = 1; i < rhs.size() - 1; ++i) + { + rhs[i] = 6*(f[i - 1] - m_avg); + super_diagonal[i] = 1; + } + + + // One step of row reduction on the first row to patch up the 5-diagonal problem: + // 1 0 -1 | r0 + // 1 4 1 | r1 + // mapsto: + // 1 0 -1 | r0 + // 0 4 2 | r1 - r0 + // mapsto + // 1 0 -1 | r0 + // 0 1 1/2| (r1 - r0)/4 + super_diagonal[1] = 0.5; + rhs[1] = (rhs[1] - rhs[0])/4; + + // Now do a tridiagonal row reduction the standard way, until just before the last row: + for (size_t i = 2; i < rhs.size() - 1; ++i) + { + Real diagonal = 4 - super_diagonal[i - 1]; + rhs[i] = (rhs[i] - rhs[i - 1])/diagonal; + super_diagonal[i] /= diagonal; + } + + // Now the last row, which is in the form + // 1 sd[n-3] 0 | rhs[n-3] + // 0 1 sd[n-2] | rhs[n-2] + // 1 0 -1 | rhs[n-1] + Real final_subdiag = -super_diagonal[rhs.size() - 3]; + rhs[rhs.size() - 1] = (rhs[rhs.size() - 1] - rhs[rhs.size() - 3])/final_subdiag; + Real final_diag = -1/final_subdiag; + // Now we're here: + // 1 sd[n-3] 0 | rhs[n-3] + // 0 1 sd[n-2] | rhs[n-2] + // 0 1 final_diag | (rhs[n-1] - rhs[n-3])/diag + + final_diag = final_diag - super_diagonal[rhs.size() - 2]; + rhs[rhs.size() - 1] = rhs[rhs.size() - 1] - rhs[rhs.size() - 2]; + + + // Back substitutions: + m_beta[rhs.size() - 1] = rhs[rhs.size() - 1]/final_diag; + for(size_t i = rhs.size() - 2; i > 0; --i) + { + m_beta[i] = rhs[i] - super_diagonal[i]*m_beta[i + 1]; + } + m_beta[0] = m_beta[2] + rhs[0]; +} + +template +Real cubic_b_spline_imp::operator()(Real x) const +{ + // See Kress, 8.40: Since B3 has compact support, we don't have to sum over all terms, + // just the (at most 5) whose support overlaps the argument. + Real z = m_avg; + Real t = m_h_inv*(x - m_a) + 1; + + using std::max; + using std::min; + using std::ceil; + using std::floor; + + size_t k_min = (size_t) max(static_cast(0), boost::math::ltrunc(ceil(t - 2))); + size_t k_max = (size_t) max(min(static_cast(m_beta.size() - 1), boost::math::ltrunc(floor(t + 2))), (long) 0); + for (size_t k = k_min; k <= k_max; ++k) + { + z += m_beta[k]*b3_spline(t - k); + } + + return z; +} + +template +Real cubic_b_spline_imp::prime(Real x) const +{ + Real z = 0; + Real t = m_h_inv*(x - m_a) + 1; + + using std::max; + using std::min; + using std::ceil; + using std::floor; + + size_t k_min = (size_t) max(static_cast(0), boost::math::ltrunc(ceil(t - 2))); + size_t k_max = (size_t) min(static_cast(m_beta.size() - 1), boost::math::ltrunc(floor(t + 2))); + + for (size_t k = k_min; k <= k_max; ++k) + { + z += m_beta[k]*b3_spline_prime(t - k); + } + return z*m_h_inv; +} + +}}} +#endif diff --git a/include/boost/math/special_functions/legendre.hpp b/include/boost/math/special_functions/legendre.hpp index 1a2ef5d61..6028b377d 100644 --- a/include/boost/math/special_functions/legendre.hpp +++ b/include/boost/math/special_functions/legendre.hpp @@ -11,8 +11,11 @@ #pragma once #endif +#include +#include #include #include +#include #include namespace boost{ @@ -68,6 +71,149 @@ T legendre_imp(unsigned l, T x, const Policy& pol, bool second = false) return p1; } +template +T legendre_p_prime_imp(unsigned l, T x, const Policy& pol, T* Pn +#ifdef BOOST_NO_CXX11_NULLPTR + = 0 +#else + = nullptr +#endif +) +{ + static const char* function = "boost::math::legrendre_p_prime<%1%>(unsigned, %1%)"; + // Error handling: + if ((x < -1) || (x > 1)) + return policies::raise_domain_error( + function, + "The Legendre Polynomial is defined for" + " -1 <= x <= 1, but got x = %1%.", x, pol); + + if (l == 0) + { + if (Pn) + { + *Pn = 1; + } + return 0; + } + T p0 = 1; + T p1 = x; + T p_prime; + bool odd = l & 1; + // If the order is odd, we sum all the even polynomials: + if (odd) + { + p_prime = p0; + } + else // Otherwise we sum the odd polynomials * (2n+1) + { + p_prime = 3*p1; + } + + unsigned n = 1; + while(n < l - 1) + { + std::swap(p0, p1); + p1 = boost::math::legendre_next(n, x, p0, p1); + ++n; + if (odd) + { + p_prime += (2*n+1)*p1; + odd = false; + } + else + { + odd = true; + } + } + // This allows us to evaluate the derivative and the function for the same cost. + if (Pn) + { + std::swap(p0, p1); + *Pn = boost::math::legendre_next(n, x, p0, p1); + } + return p_prime; +} + +template +struct legendre_p_zero_func +{ + int n; + const Policy& pol; + + legendre_p_zero_func(int n_, const Policy& p) : n(n_), pol(p) {} + + std::pair operator()(T x) const + { + T Pn; + T Pn_prime = detail::legendre_p_prime_imp(n, x, pol, &Pn); + return std::pair(Pn, Pn_prime); + }; +}; + +template +std::vector legendre_p_zeros_imp(int n, const Policy& pol) +{ + using std::cos; + using std::sin; + using std::ceil; + using std::sqrt; + using boost::math::constants::pi; + using boost::math::constants::half; + using boost::math::tools::newton_raphson_iterate; + + BOOST_ASSERT(n >= 0); + std::vector zeros; + if (n == 0) + { + // There are no zeros of P_0(x) = 1. + return zeros; + } + int k; + if (n & 1) + { + zeros.resize((n-1)/2 + 1, std::numeric_limits::quiet_NaN()); + zeros[0] = 0; + k = 1; + } + else + { + zeros.resize(n/2, std::numeric_limits::quiet_NaN()); + k = 0; + } + T half_n = ceil(n*half()); + + while (k < (int)zeros.size()) + { + // Bracket the root: Szego: + // Gabriel Szego, Inequalities for the Zeros of Legendre Polynomials and Related Functions, Transactions of the American Mathematical Society, Vol. 39, No. 1 (1936) + T theta_nk = ((half_n - half()*half() - static_cast(k))*pi())/(static_cast(n)+half()); + T lower_bound = cos( (half_n - static_cast(k))*pi()/static_cast(n + 1)); + T cos_nk = cos(theta_nk); + T upper_bound = cos_nk; + // First guess follows from: + // F. G. Tricomi, Sugli zeri dei polinomi sferici ed ultrasferici, Ann. Mat. Pura Appl., 31 (1950), pp. 93–97; + T inv_n_sq = 1/static_cast(n*n); + T sin_nk = sin(theta_nk); + T x_nk_guess = (1 - inv_n_sq/static_cast(8) + inv_n_sq /static_cast(8*n) - (inv_n_sq*inv_n_sq/384)*(39 - 28 / (sin_nk*sin_nk) ) )*cos_nk; + + boost::uintmax_t number_of_iterations = policies::get_max_root_iterations(); + + legendre_p_zero_func f(n, pol); + + const T x_nk = newton_raphson_iterate(f, x_nk_guess, + lower_bound, upper_bound, + policies::digits(), + number_of_iterations); + + BOOST_ASSERT(lower_bound < x_nk); + BOOST_ASSERT(upper_bound > x_nk); + zeros[k] = x_nk; + ++k; + } + return zeros; +} + } // namespace detail template @@ -82,13 +228,49 @@ inline typename boost::enable_if_c::value, typename return policies::checked_narrowing_cast(detail::legendre_imp(l, static_cast(x), pol, false), function); } + +template +inline typename boost::enable_if_c::value, typename tools::promote_args::type>::type + legendre_p_prime(int l, T x, const Policy& pol) +{ + typedef typename tools::promote_args::type result_type; + typedef typename policies::evaluation::type value_type; + static const char* function = "boost::math::legendre_p_prime<%1%>(unsigned, %1%)"; + if(l < 0) + return policies::checked_narrowing_cast(detail::legendre_p_prime_imp(-l-1, static_cast(x), pol), function); + return policies::checked_narrowing_cast(detail::legendre_p_prime_imp(l, static_cast(x), pol), function); +} + template -inline typename tools::promote_args::type +inline typename tools::promote_args::type legendre_p(int l, T x) { return boost::math::legendre_p(l, x, policies::policy<>()); } +template +inline typename tools::promote_args::type + legendre_p_prime(int l, T x) +{ + return boost::math::legendre_p_prime(l, x, policies::policy<>()); +} + +template +inline std::vector legendre_p_zeros(int l, const Policy& pol) +{ + if(l < 0) + return detail::legendre_p_zeros_imp(-l-1, pol); + + return detail::legendre_p_zeros_imp(l, pol); +} + + +template +inline std::vector legendre_p_zeros(int l) +{ + return boost::math::legendre_p_zeros(l, policies::policy<>()); +} + template inline typename boost::enable_if_c::value, typename tools::promote_args::type>::type legendre_q(unsigned l, T x, const Policy& pol) @@ -99,7 +281,7 @@ inline typename boost::enable_if_c::value, typename } template -inline typename tools::promote_args::type +inline typename tools::promote_args::type legendre_q(unsigned l, T x) { return boost::math::legendre_q(l, x, policies::policy<>()); @@ -107,7 +289,7 @@ inline typename tools::promote_args::type // Recurrence for associated polynomials: template -inline typename tools::promote_args::type +inline typename tools::promote_args::type legendre_next(unsigned l, unsigned m, T1 x, T2 Pl, T3 Plm1) { typedef typename tools::promote_args::type result_type; @@ -189,6 +371,3 @@ inline typename tools::promote_args::type } // namespace boost #endif // BOOST_MATH_SPECIAL_LEGENDRE_HPP - - - diff --git a/include/boost/math/special_functions/legendre_stieltjes.hpp b/include/boost/math/special_functions/legendre_stieltjes.hpp new file mode 100644 index 000000000..5d6819887 --- /dev/null +++ b/include/boost/math/special_functions/legendre_stieltjes.hpp @@ -0,0 +1,235 @@ +// Copyright Nick Thompson 2017. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_MATH_SPECIAL_LEGENDRE_STIELTJES_HPP +#define BOOST_MATH_SPECIAL_LEGENDRE_STIELTJES_HPP + +/* + * Constructs the Legendre-Stieltjes polynomial of degree m. + * The Legendre-Stieltjes polynomials are used to create extensions for Gaussian quadratures, + * commonly called "Gauss-Konrod" quadratures. + * + * References: + * Patterson, TNL. "The optimum addition of points to quadrature formulae." Mathematics of Computation 22.104 (1968): 847-856. + */ + +#include +#include +#include +#include + +namespace boost{ +namespace math{ + +template +class legendre_stieltjes +{ +public: + legendre_stieltjes(size_t m) + { + if (m == 0) + { + throw std::domain_error("The Legendre-Stieltjes polynomial is defined for order m > 0.\n"); + } + m_m = m; + std::ptrdiff_t n = m - 1; + std::ptrdiff_t q; + std::ptrdiff_t r; + bool odd = n & 1; + if (odd) + { + q = 1; + r = (n-1)/2 + 2; + } + else + { + q = 0; + r = n/2 + 1; + } + m_a.resize(r + 1); + // We'll keep the ones-based indexing at the cost of storing a superfluous element + // so that we can follow Patterson's notation exactly. + m_a[r] = static_cast(1); + // Make sure using the zero index is a bug: + m_a[0] = std::numeric_limits::quiet_NaN(); + + for (std::ptrdiff_t k = 1; k < r; ++k) + { + Real ratio = 1; + m_a[r - k] = 0; + for (std::ptrdiff_t i = r + 1 - k; i <= r; ++i) + { + // See Patterson, equation 12 + std::ptrdiff_t num = (n - q + 2*(i + k - 1))*(n + q + 2*(k - i + 1))*(n-1-q+2*(i-k))*(2*(k+i-1) -1 -q -n); + std::ptrdiff_t den = (n - q + 2*(i - k))*(2*(k + i - 1) - q - n)*(n + 1 + q + 2*(k - i))*(n - 1 - q + 2*(i + k)); + ratio *= static_cast(num)/static_cast(den); + m_a[r - k] -= ratio*m_a[i]; + } + } + } + + + Real norm_sq() const + { + Real t = 0; + bool odd = m_m & 1; + for (size_t i = 1; i < m_a.size(); ++i) + { + if(odd) + { + t += 2*m_a[i]*m_a[i]/static_cast(4*i-1); + } + else + { + t += 2*m_a[i]*m_a[i]/static_cast(4*i-3); + } + } + return t; + } + + + Real operator()(Real x) const + { + // Trivial implementation: + // Em += m_a[i]*legendre_p(2*i - 1, x); m odd + // Em += m_a[i]*legendre_p(2*i - 2, x); m even + size_t r = m_a.size() - 1; + Real p0 = 1; + Real p1 = x; + + Real Em; + bool odd = m_m & 1; + if (odd) + { + Em = m_a[1]*p1; + } + else + { + Em = m_a[1]*p0; + } + + unsigned n = 1; + for (size_t i = 2; i <= r; ++i) + { + std::swap(p0, p1); + p1 = boost::math::legendre_next(n, x, p0, p1); + ++n; + if (!odd) + { + Em += m_a[i]*p1; + } + std::swap(p0, p1); + p1 = boost::math::legendre_next(n, x, p0, p1); + ++n; + if(odd) + { + Em += m_a[i]*p1; + } + } + return Em; + } + + + Real prime(Real x) const + { + Real Em_prime = 0; + + for (size_t i = 1; i < m_a.size(); ++i) + { + if(m_m & 1) + { + Em_prime += m_a[i]*detail::legendre_p_prime_imp(2*i - 1, x, policies::policy<>()); + } + else + { + Em_prime += m_a[i]*detail::legendre_p_prime_imp(2*i - 2, x, policies::policy<>()); + } + } + return Em_prime; + } + + std::vector zeros() const + { + using boost::math::constants::half; + + std::vector stieltjes_zeros; + std::vector legendre_zeros = legendre_p_zeros(m_m - 1); + int k; + if (m_m & 1) + { + stieltjes_zeros.resize(legendre_zeros.size() + 1, std::numeric_limits::quiet_NaN()); + stieltjes_zeros[0] = 0; + k = 1; + } + else + { + stieltjes_zeros.resize(legendre_zeros.size(), std::numeric_limits::quiet_NaN()); + k = 0; + } + + while (k < (int)stieltjes_zeros.size()) + { + Real lower_bound; + Real upper_bound; + if (m_m & 1) + { + lower_bound = legendre_zeros[k - 1]; + if (k == (int)legendre_zeros.size()) + { + upper_bound = 1; + } + else + { + upper_bound = legendre_zeros[k]; + } + } + else + { + lower_bound = legendre_zeros[k]; + if (k == (int)legendre_zeros.size() - 1) + { + upper_bound = 1; + } + else + { + upper_bound = legendre_zeros[k+1]; + } + } + + // The root bracketing is not very tight; to keep weird stuff from happening + // in the Newton's method, let's tighten up the tolerance using a few bisections. + boost::math::tools::eps_tolerance tol(6); + auto g = [&](Real t) { return this->operator()(t); }; + auto p = boost::math::tools::bisect(g, lower_bound, upper_bound, tol); + + Real x_nk_guess = p.first + (p.second - p.first)*half(); + boost::uintmax_t number_of_iterations = 500; + + auto f = [&] (Real x) { Real Pn = this->operator()(x); + Real Pn_prime = this->prime(x); + return std::pair(Pn, Pn_prime); }; + + const Real x_nk = boost::math::tools::newton_raphson_iterate(f, x_nk_guess, + p.first, p.second, + 2*std::numeric_limits::digits10, + number_of_iterations); + + BOOST_ASSERT(p.first < x_nk); + BOOST_ASSERT(x_nk < p.second); + stieltjes_zeros[k] = x_nk; + ++k; + } + return stieltjes_zeros; + } + +private: + // Coefficients of Legendre expansion + std::vector m_a; + int m_m; +}; + +}} +#endif diff --git a/include/boost/math/special_functions/math_fwd.hpp b/include/boost/math/special_functions/math_fwd.hpp index efb8f067a..9becef9f6 100644 --- a/include/boost/math/special_functions/math_fwd.hpp +++ b/include/boost/math/special_functions/math_fwd.hpp @@ -23,6 +23,7 @@ #pragma once #endif +#include #include #include // for argument promotion. #include @@ -181,10 +182,24 @@ namespace boost template typename tools::promote_args::type legendre_p(int l, T x); + template + typename tools::promote_args::type + legendre_p_prime(int l, T x); + + + template + inline std::vector legendre_p_zeros(int l, const Policy& pol); + + template + inline std::vector legendre_p_zeros(int l); + #if !BOOST_WORKAROUND(BOOST_MSVC, <= 1310) template typename boost::enable_if_c::value, typename tools::promote_args::type>::type legendre_p(int l, T x, const Policy& pol); + template + inline typename boost::enable_if_c::value, typename tools::promote_args::type>::type + legendre_p_prime(int l, T x, const Policy& pol); #endif template typename tools::promote_args::type @@ -1144,6 +1159,10 @@ namespace boost template \ inline typename boost::math::tools::promote_args::type \ legendre_p(int l, T x){ return ::boost::math::legendre_p(l, x, Policy()); }\ +\ + template \ + inline typename boost::math::tools::promote_args::type \ + legendre_p_prime(int l, T x){ return ::boost::math::legendre_p(l, x, Policy()); }\ \ template \ inline typename boost::math::tools::promote_args::type \ @@ -1593,5 +1612,3 @@ template \ #endif // BOOST_MATH_SPECIAL_MATH_FWD_HPP - - diff --git a/include/boost/math/special_functions/sign.hpp b/include/boost/math/special_functions/sign.hpp index 3324c90a8..5cb21bac5 100644 --- a/include/boost/math/special_functions/sign.hpp +++ b/include/boost/math/special_functions/sign.hpp @@ -27,7 +27,7 @@ namespace detail { template inline int signbit_impl(T x, native_tag const&) { - return (std::signbit)(x); + return (std::signbit)(x) ? 1 : 0; } #endif diff --git a/include/boost/math/tools/polynomial.hpp b/include/boost/math/tools/polynomial.hpp index 464c334d1..56c4e6895 100644 --- a/include/boost/math/tools/polynomial.hpp +++ b/include/boost/math/tools/polynomial.hpp @@ -15,7 +15,6 @@ #include #include -#include #include #include #include @@ -713,6 +712,11 @@ inline std::basic_ostream& operator << (std::basic_ostream + #endif // BOOST_MATH_TOOLS_POLYNOMIAL_HPP diff --git a/include/boost/math/tools/polynomial_gcd.hpp b/include/boost/math/tools/polynomial_gcd.hpp new file mode 100644 index 000000000..fdbafda6c --- /dev/null +++ b/include/boost/math/tools/polynomial_gcd.hpp @@ -0,0 +1,209 @@ +// (C) Copyright Jeremy William Murphy 2016. + +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_MATH_TOOLS_POLYNOMIAL_GCD_HPP +#define BOOST_MATH_TOOLS_POLYNOMIAL_GCD_HPP + +#ifdef _MSC_VER +#pragma once +#endif + +#include +#include +#include + + +namespace boost{ + + namespace integer { + + namespace gcd_detail { + + template + struct gcd_traits; + + template + struct gcd_traits > + { + inline static const boost::math::tools::polynomial& abs(const boost::math::tools::polynomial& val) { return val; } + + static const method_type method = method_euclid; + }; + + } +} + + + +namespace math{ namespace tools{ + +/* From Knuth, 4.6.1: +* +* We may write any nonzero polynomial u(x) from R[x] where R is a UFD as +* +* u(x) = cont(u) · pp(u(x)) +* +* where cont(u), the content of u, is an element of S, and pp(u(x)), the primitive +* part of u(x), is a primitive polynomial over S. +* When u(x) = 0, it is convenient to define cont(u) = pp(u(x)) = O. +*/ + +template +T content(polynomial const &x) +{ + return x ? gcd_range(x.data().begin(), x.data().end()).first : T(0); +} + +// Knuth, 4.6.1 +template +polynomial primitive_part(polynomial const &x, T const &cont) +{ + return x ? x / cont : polynomial(); +} + + +template +polynomial primitive_part(polynomial const &x) +{ + return primitive_part(x, content(x)); +} + + +// Trivial but useful convenience function referred to simply as l() in Knuth. +template +T leading_coefficient(polynomial const &x) +{ + return x ? x.data().back() : T(0); +} + + +namespace detail +{ + /* Reduce u and v to their primitive parts and return the gcd of their + * contents. Used in a couple of gcd algorithms. + */ + template + T reduce_to_primitive(polynomial &u, polynomial &v) + { + using boost::math::gcd; + T const u_cont = content(u), v_cont = content(v); + u /= u_cont; + v /= v_cont; + return gcd(u_cont, v_cont); + } +} + + +/** +* Knuth, The Art of Computer Programming: Volume 2, Third edition, 1998 +* Algorithm 4.6.1C: Greatest common divisor over a unique factorization domain. +* +* The subresultant algorithm by George E. Collins [JACM 14 (1967), 128-142], +* later improved by W. S. Brown and J. F. Traub [JACM 18 (1971), 505-514]. +* +* Although step C3 keeps the coefficients to a "reasonable" size, they are +* still potentially several binary orders of magnitude larger than the inputs. +* Thus, this algorithm should only be used where T is a multi-precision type. +* +* @tparam T Polynomial coefficient type. +* @param u First polynomial. +* @param v Second polynomial. +* @return Greatest common divisor of polynomials u and v. +*/ +template +typename enable_if_c< std::numeric_limits::is_integer, polynomial >::type +subresultant_gcd(polynomial u, polynomial v) +{ + using std::swap; + BOOST_ASSERT(u || v); + + if (!u) + return v; + if (!v) + return u; + + typedef typename polynomial::size_type N; + + if (u.degree() < v.degree()) + swap(u, v); + + T const d = detail::reduce_to_primitive(u, v); + T g = 1, h = 1; + polynomial r; + while (true) + { + BOOST_ASSERT(u.degree() >= v.degree()); + // Pseudo-division. + r = u % v; + if (!r) + return d * primitive_part(v); // Attach the content. + if (r.degree() == 0) + return d * polynomial(T(1)); // The content is the result. + N const delta = u.degree() - v.degree(); + // Adjust remainder. + u = v; + v = r / (g * detail::integer_power(h, delta)); + g = leading_coefficient(u); + T const tmp = detail::integer_power(g, delta); + if (delta <= N(1)) + h = tmp * detail::integer_power(h, N(1) - delta); + else + h = tmp / detail::integer_power(h, delta - N(1)); + } +} + + +/** + * @brief GCD for polynomials with unbounded multi-precision integral coefficients. + * + * The multi-precision constraint is enforced via numeric_limits. + * + * Note that intermediate terms in the evaluation can grow arbitrarily large, hence the need for + * unbounded integers, otherwise numeric loverflow would break the algorithm. + * + * @tparam T A multi-precision integral type. + */ +template +typename enable_if_c::is_integer && !std::numeric_limits::is_bounded, polynomial >::type +gcd(polynomial const &u, polynomial const &v) +{ + return subresultant_gcd(u, v); +} +// GCD over bounded integers is not currently allowed: +template +typename enable_if_c::is_integer && std::numeric_limits::is_bounded, polynomial >::type +gcd(polynomial const &u, polynomial const &v) +{ + BOOST_STATIC_ASSERT_MSG(sizeof(v) == 0, "GCD on polynomials of bounded integers is disallowed due to the excessive growth in the size of intermediate terms."); + return subresultant_gcd(u, v); +} +// GCD over polynomials of floats can go via the Euclid algorithm: +template +typename enable_if_c::is_integer && (std::numeric_limits::min_exponent != std::numeric_limits::max_exponent) && !std::numeric_limits::is_exact, polynomial >::type +gcd(polynomial const &u, polynomial const &v) +{ + return boost::integer::gcd_detail::Euclid_gcd(u, v); +} + +} +// +// Using declaration so we overload the default implementation in this namespace: +// +using boost::math::tools::gcd; + +} + +namespace integer +{ + // + // Using declaration so we overload the default implementation in this namespace: + // + using boost::math::tools::gcd; +} + +} // namespace boost::math::tools + +#endif diff --git a/minimax/Jamfile.v2 b/minimax/Jamfile.v2 index 212ff5952..adb924eb0 100644 --- a/minimax/Jamfile.v2 +++ b/minimax/Jamfile.v2 @@ -10,8 +10,6 @@ import modules ; import path ; -local ntl-path = [ modules.peek : NTL_PATH ] ; - project : requirements gcc:-Wno-missing-braces @@ -33,20 +31,16 @@ project BOOST_ALL_NO_LIB=1 BOOST_UBLAS_UNSUPPORTED_COMPILER=0 . + ../include_private $(ntl-path)/include ; -if $(ntl-path) -{ - lib ntl : [ GLOB $(ntl-path)/src : *.cpp ] ; -} -else -{ - lib ntl ; -} +lib mpfr : gmp : mpfr ; -exe minimax : f.cpp main.cpp ntl ; +lib gmp : : gmp ; + +exe minimax : f.cpp main.cpp gmp mpfr ; install bin : minimax ; diff --git a/reporting/performance/doc/performance_tables.qbk b/reporting/performance/doc/performance_tables.qbk index 288831366..e3d6a0456 100644 --- a/reporting/performance/doc/performance_tables.qbk +++ b/reporting/performance/doc/performance_tables.qbk @@ -846,6 +846,12 @@ [/sections:] +[template section_gcd_method_comparison_with_Microsoft_Visual_C_version_14_1_on_Windows_x64[] +[section:section_gcd_method_comparison_with_Microsoft_Visual_C_version_14_1_on_Windows_x64 gcd method comparison with Microsoft Visual C++ version 14.1 on Windows x64] +[table_gcd_method_comparison_with_Microsoft_Visual_C_version_14_1_on_Windows_x64] +[endsect] +] + [template section_gcd_method_comparison_with_Clang_version_3_8_0_trunk_256686_on_linux[] [section:section_gcd_method_comparison_with_Clang_version_3_8_0_trunk_256686_on_linux gcd method comparison with Clang version 3.8.0 (trunk 256686) on linux] [table_gcd_method_comparison_with_Clang_version_3_8_0_trunk_256686_on_linux] @@ -1039,6 +1045,7 @@ [section_gcd_method_comparison_with_GNU_C_version_5_3_0_on_linux] [section_gcd_method_comparison_with_Intel_C_C_0x_mode_version_1500_on_linux] [section_gcd_method_comparison_with_Microsoft_Visual_C_version_14_0_on_Windows_x64] +[section_gcd_method_comparison_with_Microsoft_Visual_C_version_14_1_on_Windows_x64] ] [template performance_all_tables[] @@ -1069,10 +1076,58 @@ [table_gcd_method_comparison_with_GNU_C_version_5_3_0_on_linux] [table_gcd_method_comparison_with_Intel_C_C_0x_mode_version_1500_on_linux] [table_gcd_method_comparison_with_Microsoft_Visual_C_version_14_0_on_Windows_x64] +[table_gcd_method_comparison_with_Microsoft_Visual_C_version_14_1_on_Windows_x64] ] [/tables:] +[template table_gcd_method_comparison_with_Microsoft_Visual_C_version_14_1_on_Windows_x64[] +[table:table_gcd_method_comparison_with_Microsoft_Visual_C_version_14_1_on_Windows_x64 gcd method comparison with Microsoft Visual C++ version 14.1 on Windows x64 +[[Function][gcd +boost 1.64][Euclid_gcd +boost 1.64][Stein_gcd +boost 1.64][mixed_binary_gcd +boost 1.64][Stein_gcd_textbook +boost 1.64][gcd_euclid_textbook +boost 1.64]] +[[gcd (Trivial cases)][[role green 1.09[br](801ns)]][[role green 1.00[br](732ns)]][[role red 4.16[br](3043ns)]][[role red 4.03[br](2953ns)]][[role blue 1.56[br](1142ns)]][[role green 1.09[br](796ns)]]] +[[gcd (adjacent Fibonacci numbers)][[role green 1.00[br](18814466ns)]][[role red 3.14[br](59009620ns)]][[role red 3.99[br](75116072ns)]][[role red 2.26[br](42593821ns)]][[role blue 1.58[br](29655430ns)]][[role red 2.77[br](52174915ns)]]] +[[gcd (permutations of Fibonacci numbers)][[role red 4.67[br](9475590235ns)]][[role green 1.07[br](2173235780ns)]][[role red 22.49[br](45639139129ns)]][[role red 3.14[br](6369244677ns)]][[role red 8.18[br](16601284933ns)]][[role green 1.00[br](2028937087ns)]]] +[[gcd (random prime number products)][[role blue 1.20[br](1551460ns)]][[role green 1.02[br](1314451ns)]][[role red 7.92[br](10230767ns)]][[role blue 1.74[br](2243194ns)]][[role red 3.36[br](4338456ns)]][[role green 1.00[br](1291852ns)]]] +[[gcd (uniform random numbers)][[role green 1.13[br](97004967ns)]][[role green 1.20[br](102255110ns)]][[role red 3.36[br](287286304ns)]][[role red 2.23[br](190999693ns)]][[role blue 1.42[br](121531123ns)]][[role green 1.00[br](85503149ns)]]] +[[gcd (Trivial cases)][[role green 1.15[br](575ns)]][[role green 1.00[br](502ns)]][[role red 4.94[br](2481ns)]][[role red 4.62[br](2320ns)]][[role blue 1.86[br](936ns)]][[role green 1.17[br](589ns)]]] +[[gcd (adjacent Fibonacci numbers)][[role green 1.00[br](7847419ns)]][[role blue 1.78[br](13945600ns)]][[role red 4.42[br](34688200ns)]][[role red 2.42[br](19021587ns)]][[role blue 1.84[br](14421195ns)]][[role blue 1.70[br](13359068ns)]]] +[[gcd (permutations of Fibonacci numbers)][[role green 1.00[br](4067225231ns)]][[role green 1.08[br](4386735265ns)]][[role red 4.75[br](19329382899ns)]][[role blue 1.93[br](7850681530ns)]][[role blue 1.90[br](7708396164ns)]][[role green 1.04[br](4231899027ns)]]] +[[gcd (random prime number products)][[role blue 1.27[br](1581415ns)]][[role green 1.00[br](1243668ns)]][[role red 7.91[br](9831772ns)]][[role blue 1.70[br](2114775ns)]][[role red 3.45[br](4294739ns)]][[role green 1.00[br](1245471ns)]]] +[[gcd (uniform random numbers)][[role green 1.00[br](10845788ns)]][[role blue 1.26[br](13713724ns)]][[role red 4.11[br](44625137ns)]][[role red 2.25[br](24360370ns)]][[role blue 1.67[br](18100420ns)]][[role green 1.19[br](12859732ns)]]] +[[gcd (Trivial cases)][[role green 1.14[br](644ns)]][[role green 1.00[br](565ns)]][[role red 4.98[br](2812ns)]][[role red 4.64[br](2621ns)]][[role blue 1.73[br](980ns)]][[role green 1.15[br](647ns)]]] +[[gcd (adjacent Fibonacci numbers)][[role green 1.00[br](17186167ns)]][[role red 2.44[br](41861352ns)]][[role red 3.98[br](68425931ns)]][[role red 2.23[br](38284219ns)]][[role blue 1.56[br](26755034ns)]][[role blue 1.95[br](33477468ns)]]] +[[gcd (permutations of Fibonacci numbers)][[role blue 1.64[br](8226882537ns)]][[role green 1.03[br](5195847139ns)]][[role red 7.47[br](37520762454ns)]][[role red 2.12[br](10640326024ns)]][[role red 2.89[br](14533607689ns)]][[role green 1.00[br](5022876982ns)]]] +[[gcd (random prime number products)][[role blue 1.23[br](1627487ns)]][[role green 1.00[br](1322335ns)]][[role red 7.94[br](10496834ns)]][[role blue 1.82[br](2406752ns)]][[role red 3.37[br](4461261ns)]][[role green 1.02[br](1343775ns)]]] +[[gcd (uniform random numbers)][[role green 1.00[br](32451969ns)]][[role green 1.10[br](35543655ns)]][[role red 3.55[br](115155205ns)]][[role red 2.01[br](65156734ns)]][[role blue 1.43[br](46259709ns)]][[role green 1.03[br](33493171ns)]]] +[[gcd (Trivial cases)][[role blue 1.46[br](161ns)]][[role blue 1.35[br](148ns)]][[role green 1.00[br](110ns)]][[role blue 1.42[br](156ns)]][[role green 1.02[br](112ns)]][[role blue 1.23[br](135ns)]]] +[[gcd (adjacent Fibonacci numbers)][[role blue 1.43[br](20054ns)]][[role red 7.90[br](110522ns)]][[role green 1.00[br](13990ns)]][[role blue 1.42[br](19927ns)]][[role green 1.11[br](15489ns)]][[role red 6.02[br](84223ns)]]] +[[gcd (permutations of Fibonacci numbers)][[role green 1.16[br](1706761ns)]][[role blue 1.28[br](1892450ns)]][[role red 2.65[br](3915173ns)]][[role green 1.16[br](1718303ns)]][[role blue 1.97[br](2909805ns)]][[role green 1.00[br](1477319ns)]]] +[[gcd (random prime number products)][[role green 1.00[br](405449ns)]][[role blue 1.39[br](562829ns)]][[role blue 1.81[br](734508ns)]][[role green 1.01[br](408757ns)]][[role blue 1.30[br](527805ns)]][[role green 1.04[br](422687ns)]]] +[[gcd (uniform random numbers)][[role green 1.13[br](800534ns)]][[role blue 1.41[br](1002100ns)]][[role blue 1.43[br](1016520ns)]][[role green 1.11[br](790908ns)]][[role green 1.00[br](711010ns)]][[role green 1.06[br](755843ns)]]] +[[gcd (Trivial cases)][[role blue 1.88[br](152ns)]][[role blue 1.21[br](98ns)]][[role blue 1.46[br](118ns)]][[role blue 1.75[br](142ns)]][[role blue 1.48[br](120ns)]][[role green 1.00[br](81ns)]]] +[[gcd (adjacent Fibonacci numbers)][[role green 1.08[br](3560ns)]][[role red 6.50[br](21428ns)]][[role green 1.00[br](3299ns)]][[role green 1.06[br](3481ns)]][[role blue 1.23[br](4074ns)]][[role red 4.06[br](13399ns)]]] +[[gcd (permutations of Fibonacci numbers)][[role blue 1.26[br](200999ns)]][[role blue 1.66[br](265917ns)]][[role red 2.75[br](439667ns)]][[role blue 1.24[br](197917ns)]][[role red 2.32[br](370746ns)]][[role green 1.00[br](159839ns)]]] +[[gcd (random prime number products)][[role blue 1.25[br](218611ns)]][[role blue 1.58[br](276521ns)]][[role red 2.23[br](391315ns)]][[role green 1.14[br](200690ns)]][[role blue 1.79[br](313229ns)]][[role green 1.00[br](175307ns)]]] +[[gcd (uniform random numbers)][[role blue 1.35[br](362872ns)]][[role blue 1.50[br](401677ns)]][[role blue 1.90[br](510064ns)]][[role blue 1.33[br](357968ns)]][[role blue 1.47[br](394095ns)]][[role green 1.00[br](268295ns)]]] +[[gcd (Trivial cases)][[role blue 1.65[br](137ns)]][[role green 1.11[br](92ns)]][[role blue 1.41[br](117ns)]][[role blue 1.54[br](128ns)]][[role blue 1.46[br](121ns)]][[role green 1.00[br](83ns)]]] +[[gcd (adjacent Fibonacci numbers)][[role green 1.14[br](859ns)]][[role red 6.80[br](5139ns)]][[role green 1.00[br](756ns)]][[role green 1.15[br](866ns)]][[role blue 1.35[br](1020ns)]][[role red 4.17[br](3155ns)]]] +[[gcd (permutations of Fibonacci numbers)][[role green 1.01[br](12759ns)]][[role red 3.33[br](42011ns)]][[role blue 1.27[br](16050ns)]][[role green 1.00[br](12623ns)]][[role red 2.17[br](27411ns)]][[role blue 1.80[br](22712ns)]]] +[[gcd (random prime number products)][[role blue 1.22[br](101653ns)]][[role blue 1.95[br](161889ns)]][[role red 2.33[br](193556ns)]][[role green 1.19[br](98879ns)]][[role blue 1.85[br](153556ns)]][[role green 1.00[br](83031ns)]]] +[[gcd (uniform random numbers)][[role blue 1.34[br](169127ns)]][[role blue 1.66[br](208641ns)]][[role red 2.06[br](259536ns)]][[role blue 1.36[br](170992ns)]][[role blue 1.59[br](199734ns)]][[role green 1.00[br](125927ns)]]] +[[gcd (Trivial cases)][[role blue 1.85[br](165ns)]][[role blue 1.25[br](111ns)]][[role blue 1.49[br](133ns)]][[role blue 1.90[br](169ns)]][[role blue 1.63[br](145ns)]][[role green 1.00[br](89ns)]]] +[[gcd (adjacent Fibonacci numbers)][[role green 1.09[br](3472ns)]][[role red 6.86[br](21847ns)]][[role green 1.00[br](3184ns)]][[role green 1.08[br](3428ns)]][[role blue 1.29[br](4110ns)]][[role red 4.22[br](13439ns)]]] +[[gcd (permutations of Fibonacci numbers)][[role green 1.19[br](201037ns)]][[role blue 1.62[br](273197ns)]][[role red 2.74[br](463170ns)]][[role blue 1.21[br](204339ns)]][[role red 2.36[br](398909ns)]][[role green 1.00[br](168891ns)]]] +[[gcd (random prime number products)][[role blue 1.23[br](215380ns)]][[role blue 1.57[br](276143ns)]][[role red 2.22[br](389655ns)]][[role green 1.16[br](204160ns)]][[role blue 1.77[br](311616ns)]][[role green 1.00[br](175753ns)]]] +[[gcd (uniform random numbers)][[role blue 1.31[br](360158ns)]][[role blue 1.48[br](407011ns)]][[role blue 1.85[br](510333ns)]][[role blue 1.31[br](360097ns)]][[role blue 1.42[br](389754ns)]][[role green 1.00[br](275392ns)]]] +] +] + [template table_gcd_method_comparison_with_Clang_version_3_8_0_trunk_256686_on_linux[] [table:table_gcd_method_comparison_with_Clang_version_3_8_0_trunk_256686_on_linux gcd method comparison with Clang version 3.8.0 (trunk 256686) on linux [[Function][Stein_gcd @@ -1570,42 +1625,48 @@ boost 1.61][Euclid_gcd boost 1.61][Stein_gcd_textbook boost 1.61][gcd_euclid_textbook boost 1.61][mixed_binary_gcd -boost 1.61]] -[[gcd (Trivial cases)][[role red 3.05[br](2653ns)]][[role green 1.00[br](871ns)]][[role blue 1.44[br](1254ns)]][[role green 1.01[br](882ns)]][[role blue 1.92[br](1669ns)]]] -[[gcd (adjacent Fibonacci numbers)][[role red 2.03[br](59670883ns)]][[role red 2.16[br](63320661ns)]][[role green 1.00[br](29370585ns)]][[role blue 1.86[br](54668476ns)]][[role blue 1.38[br](40663816ns)]]] -[[gcd (permutations of Fibonacci numbers)][[role red 15.51[br](33644126589ns)]][[role green 1.00[br](2169788957ns)]][[role red 7.78[br](16883236272ns)]][[role green 1.10[br](2378290598ns)]][[role red 2.64[br](5721817992ns)]]] -[[gcd (random prime number products)][[role red 5.56[br](7426321ns)]][[role green 1.06[br](1420925ns)]][[role red 3.18[br](4254380ns)]][[role green 1.00[br](1336372ns)]][[role blue 1.61[br](2149489ns)]]] -[[gcd (uniform random numbers)][[role red 3.03[br](275000359ns)]][[role blue 1.20[br](109316990ns)]][[role blue 1.36[br](123200308ns)]][[role green 1.00[br](90757472ns)]][[role red 2.11[br](191066461ns)]]] -[[gcd (Trivial cases)][[role red 3.56[br](2100ns)]][[role green 1.00[br](590ns)]][[role blue 1.52[br](896ns)]][[role green 1.01[br](594ns)]][[role red 2.47[br](1460ns)]]] -[[gcd (adjacent Fibonacci numbers)][[role blue 1.87[br](25292952ns)]][[role green 1.05[br](14156133ns)]][[role green 1.04[br](14011069ns)]][[role green 1.00[br](13517673ns)]][[role blue 1.40[br](18914822ns)]]] -[[gcd (permutations of Fibonacci numbers)][[role red 3.23[br](13662865260ns)]][[role green 1.06[br](4469548580ns)]][[role blue 1.76[br](7471801261ns)]][[role green 1.00[br](4236351208ns)]][[role blue 1.85[br](7828273663ns)]]] -[[gcd (random prime number products)][[role red 5.65[br](7151179ns)]][[role green 1.01[br](1279095ns)]][[role red 3.25[br](4106910ns)]][[role green 1.00[br](1264825ns)]][[role blue 1.70[br](2152290ns)]]] -[[gcd (uniform random numbers)][[role red 2.45[br](32310613ns)]][[role green 1.06[br](14059302ns)]][[role blue 1.35[br](17793742ns)]][[role green 1.00[br](13204360ns)]][[role blue 1.84[br](24264232ns)]]] -[[gcd (Trivial cases)][[role red 3.43[br](2210ns)]][[role green 1.00[br](644ns)]][[role blue 1.55[br](1000ns)]][[role green 1.03[br](662ns)]][[role red 2.10[br](1355ns)]]] -[[gcd (adjacent Fibonacci numbers)][[role blue 1.88[br](48927775ns)]][[role blue 1.42[br](37027792ns)]][[role green 1.00[br](26031785ns)]][[role blue 1.30[br](33931511ns)]][[role blue 1.28[br](33404007ns)]]] -[[gcd (permutations of Fibonacci numbers)][[role red 5.53[br](28125905824ns)]][[role green 1.08[br](5505436279ns)]][[role red 2.89[br](14713059756ns)]][[role green 1.00[br](5084759818ns)]][[role blue 1.85[br](9420550833ns)]]] -[[gcd (random prime number products)][[role red 5.48[br](7364662ns)]][[role green 1.01[br](1351079ns)]][[role red 3.28[br](4407547ns)]][[role green 1.00[br](1344003ns)]][[role blue 1.58[br](2123434ns)]]] -[[gcd (uniform random numbers)][[role red 2.66[br](87178566ns)]][[role green 1.13[br](37150982ns)]][[role blue 1.39[br](45679514ns)]][[role green 1.00[br](32787132ns)]][[role blue 1.88[br](61528205ns)]]] -[[gcd (Trivial cases)][[role green 1.00[br](119ns)]][[role blue 1.39[br](166ns)]][[role blue 1.41[br](168ns)]][[role green 1.17[br](139ns)]][[role green 1.13[br](134ns)]]] -[[gcd (adjacent Fibonacci numbers)][[role green 1.00[br](8347ns)]][[role red 10.38[br](86663ns)]][[role red 3.35[br](27955ns)]][[role red 10.09[br](84227ns)]][[role red 2.28[br](19057ns)]]] -[[gcd (permutations of Fibonacci numbers)][[role red 2.35[br](3296845ns)]][[role green 1.09[br](1534499ns)]][[role red 2.64[br](3696696ns)]][[role green 1.06[br](1481449ns)]][[role green 1.00[br](1402222ns)]]] -[[gcd (random prime number products)][[role blue 1.48[br](614650ns)]][[role green 1.05[br](435946ns)]][[role blue 1.61[br](668617ns)]][[role green 1.03[br](429584ns)]][[role green 1.00[br](415667ns)]]] -[[gcd (uniform random numbers)][[role green 1.06[br](807246ns)]][[role green 1.02[br](774035ns)]][[role green 1.16[br](883077ns)]][[role green 1.00[br](763348ns)]][[role green 1.00[br](760748ns)]]] -[[gcd (Trivial cases)][[role blue 1.39[br](114ns)]][[role green 1.09[br](89ns)]][[role red 2.04[br](167ns)]][[role green 1.00[br](82ns)]][[role green 1.15[br](94ns)]]] -[[gcd (adjacent Fibonacci numbers)][[role green 1.00[br](2005ns)]][[role red 7.64[br](15319ns)]][[role red 3.75[br](7524ns)]][[role red 7.55[br](15137ns)]][[role blue 1.84[br](3694ns)]]] -[[gcd (permutations of Fibonacci numbers)][[role red 2.31[br](346174ns)]][[role green 1.19[br](177975ns)]][[role red 3.40[br](508462ns)]][[role green 1.10[br](164321ns)]][[role green 1.00[br](149731ns)]]] -[[gcd (random prime number products)][[role blue 1.82[br](317220ns)]][[role green 1.06[br](184591ns)]][[role red 2.39[br](416236ns)]][[role green 1.00[br](174283ns)]][[role green 1.13[br](196343ns)]]] -[[gcd (uniform random numbers)][[role blue 1.46[br](401554ns)]][[role green 1.01[br](277398ns)]][[role blue 1.85[br](508645ns)]][[role green 1.00[br](274854ns)]][[role green 1.18[br](325496ns)]]] -[[gcd (Trivial cases)][[role blue 1.63[br](122ns)]][[role green 1.12[br](84ns)]][[role red 2.29[br](172ns)]][[role green 1.00[br](75ns)]][[role blue 1.31[br](98ns)]]] -[[gcd (adjacent Fibonacci numbers)][[role green 1.00[br](590ns)]][[role red 6.11[br](3605ns)]][[role red 2.69[br](1588ns)]][[role red 5.51[br](3250ns)]][[role blue 1.52[br](898ns)]]] -[[gcd (permutations of Fibonacci numbers)][[role blue 1.43[br](16631ns)]][[role red 2.17[br](25211ns)]][[role red 4.08[br](47419ns)]][[role blue 1.97[br](22841ns)]][[role green 1.00[br](11611ns)]]] -[[gcd (random prime number products)][[role blue 1.55[br](144505ns)]][[role green 1.10[br](102665ns)]][[role red 2.20[br](205019ns)]][[role green 1.00[br](92984ns)]][[role green 1.09[br](101392ns)]]] -[[gcd (uniform random numbers)][[role blue 1.39[br](189654ns)]][[role green 1.08[br](146973ns)]][[role blue 1.86[br](254281ns)]][[role green 1.00[br](136708ns)]][[role green 1.13[br](154282ns)]]] -[[gcd (Trivial cases)][[role blue 1.40[br](113ns)]][[role green 1.07[br](87ns)]][[role red 2.11[br](171ns)]][[role green 1.00[br](81ns)]][[role green 1.15[br](93ns)]]] -[[gcd (adjacent Fibonacci numbers)][[role green 1.00[br](1993ns)]][[role red 6.98[br](13906ns)]][[role red 3.70[br](7384ns)]][[role red 6.68[br](13323ns)]][[role blue 1.59[br](3165ns)]]] -[[gcd (permutations of Fibonacci numbers)][[role red 2.32[br](345911ns)]][[role green 1.19[br](177891ns)]][[role red 3.44[br](512584ns)]][[role green 1.09[br](162012ns)]][[role green 1.00[br](148982ns)]]] -[[gcd (random prime number products)][[role blue 1.79[br](316605ns)]][[role green 1.06[br](187049ns)]][[role red 2.36[br](415886ns)]][[role green 1.00[br](176518ns)]][[role green 1.14[br](200933ns)]]] -[[gcd (uniform random numbers)][[role blue 1.43[br](400024ns)]][[role green 1.01[br](283292ns)]][[role blue 1.84[br](513812ns)]][[role green 1.00[br](279687ns)]][[role green 1.17[br](326341ns)]]] +boost 1.61][gcd +boost 1.64][Euclid_gcd +boost 1.64][Stein_gcd +boost 1.64][mixed_binary_gcd +boost 1.64][Stein_gcd_textbook +boost 1.64][gcd_euclid_textbook +boost 1.64]] +[[gcd (Trivial cases)][[role red 3.05[br](2653ns)]][[role green 1.00[br](871ns)]][[role blue 1.44[br](1254ns)]][[role green 1.01[br](882ns)]][[role blue 1.92[br](1669ns)]][[role red 2.53[br](2207ns)]][[role red 2.62[br](2281ns)]][[role red 11.46[br](9978ns)]][[role red 10.70[br](9316ns)]][[role red 3.48[br](3035ns)]][[role red 2.72[br](2367ns)]]] +[[gcd (adjacent Fibonacci numbers)][[role red 2.42[br](59670883ns)]][[role red 2.57[br](63320661ns)]][[role green 1.19[br](29370585ns)]][[role red 2.22[br](54668476ns)]][[role blue 1.65[br](40663816ns)]][[role green 1.00[br](24623955ns)]][[role red 4.35[br](107118158ns)]][[role red 5.35[br](131687985ns)]][[role red 3.15[br](77463382ns)]][[role red 2.14[br](52636654ns)]][[role red 5.25[br](129158187ns)]]] +[[gcd (permutations of Fibonacci numbers)][[role red 15.51[br](33644126589ns)]][[role green 1.00[br](2169788957ns)]][[role red 7.78[br](16883236272ns)]][[role green 1.10[br](2378290598ns)]][[role red 2.64[br](5721817992ns)]][[role red 5.89[br](12776783246ns)]][[role blue 1.60[br](3473198791ns)]][[role red 38.51[br](83549633852ns)]][[role red 5.64[br](12235187520ns)]][[role red 14.54[br](31558153140ns)]][[role blue 1.79[br](3883541816ns)]]] +[[gcd (random prime number products)][[role red 5.56[br](7426321ns)]][[role green 1.06[br](1420925ns)]][[role red 3.18[br](4254380ns)]][[role green 1.00[br](1336372ns)]][[role blue 1.61[br](2149489ns)]][[role blue 1.72[br](2295367ns)]][[role blue 1.97[br](2629042ns)]][[role red 16.99[br](22706002ns)]][[role red 3.66[br](4896256ns)]][[role red 6.66[br](8899615ns)]][[role red 2.47[br](3296882ns)]]] +[[gcd (uniform random numbers)][[role red 3.03[br](275000359ns)]][[role blue 1.20[br](109316990ns)]][[role blue 1.36[br](123200308ns)]][[role green 1.00[br](90757472ns)]][[role red 2.11[br](191066461ns)]][[role blue 1.36[br](123876688ns)]][[role blue 1.86[br](168555428ns)]][[role red 4.94[br](448341733ns)]][[role red 2.87[br](260414480ns)]][[role red 2.10[br](190249211ns)]][[role red 2.06[br](187300242ns)]]] +[[gcd (Trivial cases)][[role red 3.56[br](2100ns)]][[role green 1.00[br](590ns)]][[role blue 1.52[br](896ns)]][[role green 1.01[br](594ns)]][[role red 2.47[br](1460ns)]][[role blue 1.52[br](896ns)]][[role blue 1.65[br](974ns)]][[role red 8.24[br](4859ns)]][[role red 7.14[br](4211ns)]][[role red 2.36[br](1390ns)]][[role blue 1.36[br](803ns)]]] +[[gcd (adjacent Fibonacci numbers)][[role red 2.41[br](25292952ns)]][[role blue 1.35[br](14156133ns)]][[role blue 1.33[br](14011069ns)]][[role blue 1.29[br](13517673ns)]][[role blue 1.80[br](18914822ns)]][[role green 1.00[br](10509446ns)]][[role red 2.42[br](25415287ns)]][[role red 4.34[br](45569911ns)]][[role red 2.75[br](28868909ns)]][[role blue 1.69[br](17787967ns)]][[role red 2.45[br](25703761ns)]]] +[[gcd (permutations of Fibonacci numbers)][[role red 3.23[br](13662865260ns)]][[role green 1.06[br](4469548580ns)]][[role blue 1.76[br](7471801261ns)]][[role green 1.00[br](4236351208ns)]][[role blue 1.85[br](7828273663ns)]][[role blue 1.33[br](5641641009ns)]][[role red 2.00[br](8481980418ns)]][[role red 6.13[br](25958089997ns)]][[role red 3.03[br](12831671502ns)]][[role red 2.46[br](10425285342ns)]][[role red 2.00[br](8481275507ns)]]] +[[gcd (random prime number products)][[role red 5.65[br](7151179ns)]][[role green 1.01[br](1279095ns)]][[role red 3.25[br](4106910ns)]][[role green 1.00[br](1264825ns)]][[role blue 1.70[br](2152290ns)]][[role blue 1.92[br](2431940ns)]][[role blue 1.85[br](2345808ns)]][[role red 11.27[br](14248457ns)]][[role red 2.76[br](3489015ns)]][[role red 4.98[br](6301435ns)]][[role blue 1.89[br](2392981ns)]]] +[[gcd (uniform random numbers)][[role red 2.45[br](32310613ns)]][[role green 1.06[br](14059302ns)]][[role blue 1.35[br](17793742ns)]][[role green 1.00[br](13204360ns)]][[role blue 1.84[br](24264232ns)]][[role green 1.15[br](15190274ns)]][[role blue 1.97[br](26017484ns)]][[role red 4.46[br](58842348ns)]][[role red 2.79[br](36785666ns)]][[role blue 1.69[br](22326488ns)]][[role blue 1.91[br](25204278ns)]]] +[[gcd (Trivial cases)][[role red 3.43[br](2210ns)]][[role green 1.00[br](644ns)]][[role blue 1.55[br](1000ns)]][[role green 1.03[br](662ns)]][[role red 2.10[br](1355ns)]][[role blue 1.42[br](913ns)]][[role blue 1.54[br](989ns)]][[role red 7.32[br](4716ns)]][[role red 6.40[br](4122ns)]][[role red 2.12[br](1368ns)]][[role blue 1.27[br](817ns)]]] +[[gcd (adjacent Fibonacci numbers)][[role red 2.09[br](48927775ns)]][[role blue 1.58[br](37027792ns)]][[role green 1.11[br](26031785ns)]][[role blue 1.45[br](33931511ns)]][[role blue 1.43[br](33404007ns)]][[role green 1.00[br](23435290ns)]][[role red 3.12[br](73104180ns)]][[role red 3.84[br](90089949ns)]][[role red 2.43[br](56923240ns)]][[role blue 1.48[br](34693435ns)]][[role red 2.80[br](65620808ns)]]] +[[gcd (permutations of Fibonacci numbers)][[role red 5.53[br](28125905824ns)]][[role green 1.08[br](5505436279ns)]][[role red 2.89[br](14713059756ns)]][[role green 1.00[br](5084759818ns)]][[role blue 1.85[br](9420550833ns)]][[role red 2.41[br](12252843971ns)]][[role red 2.02[br](10272751458ns)]][[role red 9.61[br](48856236248ns)]][[role red 2.98[br](15149065981ns)]][[role red 3.66[br](18594373353ns)]][[role blue 1.81[br](9217862382ns)]]] +[[gcd (random prime number products)][[role red 5.48[br](7364662ns)]][[role green 1.01[br](1351079ns)]][[role red 3.28[br](4407547ns)]][[role green 1.00[br](1344003ns)]][[role blue 1.58[br](2123434ns)]][[role blue 1.89[br](2543037ns)]][[role blue 1.96[br](2636943ns)]][[role red 11.40[br](15325370ns)]][[role red 2.86[br](3841352ns)]][[role red 4.91[br](6593697ns)]][[role red 2.06[br](2763216ns)]]] +[[gcd (uniform random numbers)][[role red 2.66[br](87178566ns)]][[role green 1.13[br](37150982ns)]][[role blue 1.39[br](45679514ns)]][[role green 1.00[br](32787132ns)]][[role blue 1.88[br](61528205ns)]][[role blue 1.33[br](43591274ns)]][[role red 2.10[br](68925414ns)]][[role red 4.32[br](141511277ns)]][[role red 3.05[br](100081308ns)]][[role blue 1.87[br](61292346ns)]][[role red 2.02[br](66235861ns)]]] +[[gcd (Trivial cases)][[role green 1.00[br](119ns)]][[role blue 1.39[br](166ns)]][[role blue 1.41[br](168ns)]][[role green 1.17[br](139ns)]][[role green 1.13[br](134ns)]][[role red 2.65[br](315ns)]][[role blue 1.75[br](208ns)]][[role blue 1.97[br](235ns)]][[role red 2.41[br](287ns)]][[role red 4.06[br](483ns)]][[role blue 1.76[br](209ns)]]] +[[gcd (adjacent Fibonacci numbers)][[role green 1.00[br](8347ns)]][[role red 10.38[br](86663ns)]][[role red 3.35[br](27955ns)]][[role red 10.09[br](84227ns)]][[role red 2.28[br](19057ns)]][[role red 4.08[br](34080ns)]][[role red 18.55[br](154835ns)]][[role red 2.17[br](18097ns)]][[role red 3.96[br](33018ns)]][[role red 6.98[br](58232ns)]][[role red 18.59[br](155185ns)]]] +[[gcd (permutations of Fibonacci numbers)][[role red 2.35[br](3296845ns)]][[role green 1.09[br](1534499ns)]][[role red 2.64[br](3696696ns)]][[role green 1.06[br](1481449ns)]][[role green 1.00[br](1402222ns)]][[role blue 1.84[br](2586948ns)]][[role blue 1.88[br](2640516ns)]][[role red 3.20[br](4486070ns)]][[role blue 1.83[br](2569310ns)]][[role red 5.42[br](7600105ns)]][[role blue 1.91[br](2679063ns)]]] +[[gcd (random prime number products)][[role blue 1.48[br](614650ns)]][[role green 1.05[br](435946ns)]][[role blue 1.61[br](668617ns)]][[role green 1.03[br](429584ns)]][[role green 1.00[br](415667ns)]][[role blue 1.84[br](763379ns)]][[role red 2.50[br](1038355ns)]][[role red 2.02[br](840855ns)]][[role blue 1.83[br](760952ns)]][[role red 3.40[br](1411408ns)]][[role red 2.53[br](1052873ns)]]] +[[gcd (uniform random numbers)][[role green 1.06[br](807246ns)]][[role green 1.02[br](774035ns)]][[role green 1.16[br](883077ns)]][[role green 1.00[br](763348ns)]][[role green 1.00[br](760748ns)]][[role red 2.00[br](1524748ns)]][[role red 2.62[br](1993795ns)]][[role blue 1.43[br](1087596ns)]][[role blue 1.95[br](1484810ns)]][[role red 2.37[br](1804142ns)]][[role red 2.67[br](2027528ns)]]] +[[gcd (Trivial cases)][[role blue 1.39[br](114ns)]][[role green 1.09[br](89ns)]][[role red 2.04[br](167ns)]][[role green 1.00[br](82ns)]][[role green 1.15[br](94ns)]][[role blue 1.57[br](129ns)]][[role green 1.13[br](93ns)]][[role blue 1.29[br](106ns)]][[role blue 1.51[br](124ns)]][[role red 3.16[br](259ns)]][[role blue 1.23[br](101ns)]]] +[[gcd (adjacent Fibonacci numbers)][[role green 1.00[br](2005ns)]][[role red 7.64[br](15319ns)]][[role red 3.75[br](7524ns)]][[role red 7.55[br](15137ns)]][[role blue 1.84[br](3694ns)]][[role blue 1.79[br](3585ns)]][[role red 6.95[br](13927ns)]][[role green 1.12[br](2242ns)]][[role blue 1.78[br](3577ns)]][[role red 4.04[br](8104ns)]][[role red 6.99[br](14016ns)]]] +[[gcd (permutations of Fibonacci numbers)][[role red 2.46[br](346174ns)]][[role blue 1.26[br](177975ns)]][[role red 3.61[br](508462ns)]][[role green 1.17[br](164321ns)]][[role green 1.06[br](149731ns)]][[role green 1.01[br](141952ns)]][[role blue 1.31[br](184194ns)]][[role blue 1.43[br](201433ns)]][[role green 1.00[br](140948ns)]][[role red 4.11[br](579023ns)]][[role blue 1.31[br](184313ns)]]] +[[gcd (random prime number products)][[role red 2.55[br](317220ns)]][[role blue 1.48[br](184591ns)]][[role red 3.34[br](416236ns)]][[role blue 1.40[br](174283ns)]][[role blue 1.58[br](196343ns)]][[role green 1.03[br](128583ns)]][[role blue 1.57[br](195103ns)]][[role blue 1.31[br](163491ns)]][[role green 1.00[br](124586ns)]][[role red 3.85[br](479591ns)]][[role blue 1.58[br](196783ns)]]] +[[gcd (uniform random numbers)][[role blue 1.83[br](401554ns)]][[role blue 1.26[br](277398ns)]][[role red 2.31[br](508645ns)]][[role blue 1.25[br](274854ns)]][[role blue 1.48[br](325496ns)]][[role green 1.01[br](221040ns)]][[role blue 1.36[br](298196ns)]][[role green 1.00[br](219844ns)]][[role green 1.02[br](224566ns)]][[role red 2.69[br](591153ns)]][[role blue 1.36[br](298483ns)]]] +[[gcd (Trivial cases)][[role blue 1.63[br](122ns)]][[role green 1.12[br](84ns)]][[role red 2.29[br](172ns)]][[role green 1.00[br](75ns)]][[role blue 1.31[br](98ns)]][[role blue 1.87[br](140ns)]][[role blue 1.40[br](105ns)]][[role blue 1.93[br](145ns)]][[role blue 1.96[br](147ns)]][[role red 3.35[br](251ns)]][[role blue 1.24[br](93ns)]]] +[[gcd (adjacent Fibonacci numbers)][[role green 1.00[br](590ns)]][[role red 6.11[br](3605ns)]][[role red 2.69[br](1588ns)]][[role red 5.51[br](3250ns)]][[role blue 1.52[br](898ns)]][[role red 2.14[br](1260ns)]][[role red 5.94[br](3507ns)]][[role red 2.56[br](1513ns)]][[role red 2.15[br](1267ns)]][[role red 3.42[br](2017ns)]][[role red 6.01[br](3544ns)]]] +[[gcd (permutations of Fibonacci numbers)][[role blue 1.43[br](16631ns)]][[role red 2.17[br](25211ns)]][[role red 4.08[br](47419ns)]][[role blue 1.97[br](22841ns)]][[role green 1.00[br](11611ns)]][[role blue 1.67[br](19374ns)]][[role red 2.15[br](24936ns)]][[role red 2.34[br](27203ns)]][[role blue 1.57[br](18246ns)]][[role red 4.54[br](52686ns)]][[role red 2.15[br](25006ns)]]] +[[gcd (random prime number products)][[role blue 1.75[br](144505ns)]][[role blue 1.24[br](102665ns)]][[role red 2.48[br](205019ns)]][[role green 1.13[br](92984ns)]][[role blue 1.23[br](101392ns)]][[role green 1.04[br](86096ns)]][[role green 1.17[br](96237ns)]][[role blue 1.53[br](126473ns)]][[role green 1.00[br](82541ns)]][[role red 2.82[br](232912ns)]][[role green 1.20[br](98822ns)]]] +[[gcd (uniform random numbers)][[role blue 1.46[br](189654ns)]][[role green 1.13[br](146973ns)]][[role blue 1.95[br](254281ns)]][[role green 1.05[br](136708ns)]][[role green 1.18[br](154282ns)]][[role green 1.01[br](131622ns)]][[role green 1.10[br](143161ns)]][[role green 1.09[br](142318ns)]][[role green 1.00[br](130263ns)]][[role red 2.26[br](293895ns)]][[role green 1.10[br](142885ns)]]] +[[gcd (Trivial cases)][[role blue 1.40[br](113ns)]][[role green 1.07[br](87ns)]][[role red 2.11[br](171ns)]][[role green 1.00[br](81ns)]][[role green 1.15[br](93ns)]][[role blue 1.59[br](129ns)]][[role green 1.16[br](94ns)]][[role blue 1.40[br](113ns)]][[role blue 1.58[br](128ns)]][[role red 3.17[br](257ns)]][[role blue 1.25[br](101ns)]]] +[[gcd (adjacent Fibonacci numbers)][[role green 1.00[br](1993ns)]][[role red 6.98[br](13906ns)]][[role red 3.70[br](7384ns)]][[role red 6.68[br](13323ns)]][[role blue 1.59[br](3165ns)]][[role blue 1.71[br](3414ns)]][[role red 6.80[br](13554ns)]][[role green 1.12[br](2225ns)]][[role blue 1.80[br](3580ns)]][[role red 4.23[br](8433ns)]][[role red 7.34[br](14638ns)]]] +[[gcd (permutations of Fibonacci numbers)][[role red 2.56[br](345911ns)]][[role blue 1.32[br](177891ns)]][[role red 3.80[br](512584ns)]][[role blue 1.20[br](162012ns)]][[role green 1.10[br](148982ns)]][[role green 1.04[br](140892ns)]][[role blue 1.33[br](179530ns)]][[role blue 1.43[br](193505ns)]][[role green 1.00[br](134997ns)]][[role red 4.44[br](599245ns)]][[role blue 1.41[br](190200ns)]]] +[[gcd (random prime number products)][[role red 2.48[br](316605ns)]][[role blue 1.47[br](187049ns)]][[role red 3.26[br](415886ns)]][[role blue 1.38[br](176518ns)]][[role blue 1.57[br](200933ns)]][[role green 1.01[br](128436ns)]][[role blue 1.53[br](194872ns)]][[role green 1.18[br](150531ns)]][[role green 1.00[br](127624ns)]][[role red 3.81[br](486079ns)]][[role blue 1.49[br](190453ns)]]] +[[gcd (uniform random numbers)][[role blue 1.96[br](400024ns)]][[role blue 1.39[br](283292ns)]][[role red 2.52[br](513812ns)]][[role blue 1.37[br](279687ns)]][[role blue 1.60[br](326341ns)]][[role green 1.04[br](211406ns)]][[role blue 1.39[br](284097ns)]][[role green 1.00[br](203744ns)]][[role green 1.02[br](208526ns)]][[role red 2.93[br](595972ns)]][[role blue 1.43[br](291793ns)]]] ] ] diff --git a/reporting/performance/html/index.html b/reporting/performance/html/index.html index e1cc31d40..0d3f2b482 100644 --- a/reporting/performance/html/index.html +++ b/reporting/performance/html/index.html @@ -3,7 +3,7 @@ Special Function and Distribution Performance Report - + @@ -33,7 +33,7 @@

    @@ -32923,6 +32925,12 @@ + + + + + + @@ -32955,6 +32963,36 @@ mixed_binary_gcd boost 1.61

    + +

    + gcd boost 1.64 +

    + + +

    + Euclid_gcd boost 1.64 +

    + + +

    + Stein_gcd boost 1.64 +

    + + +

    + mixed_binary_gcd boost 1.64 +

    + + +

    + Stein_gcd_textbook boost 1.64 +

    + + +

    + gcd_euclid_textbook boost 1.64 +

    + @@ -32988,6 +33026,36 @@ 1.92
    (1669ns)

    + +

    + 2.53
    (2207ns)
    +

    + + +

    + 2.62
    (2281ns)
    +

    + + +

    + 11.46
    (9978ns)
    +

    + + +

    + 10.70
    (9316ns)
    +

    + + +

    + 3.48
    (3035ns)
    +

    + + +

    + 2.72
    (2367ns)
    +

    + @@ -32998,27 +33066,57 @@

    - 2.03
    (59670883ns)
    + 2.42
    (59670883ns)

    - 2.16
    (63320661ns)
    + 2.57
    (63320661ns)

    - 1.00
    (29370585ns)
    + 1.19
    (29370585ns)

    - 1.86
    (54668476ns)
    + 2.22
    (54668476ns)

    - 1.38
    (40663816ns)
    + 1.65
    (40663816ns)
    +

    + + +

    + 1.00
    (24623955ns)
    +

    + + +

    + 4.35
    (107118158ns)
    +

    + + +

    + 5.35
    (131687985ns)
    +

    + + +

    + 3.15
    (77463382ns)
    +

    + + +

    + 2.14
    (52636654ns)
    +

    + + +

    + 5.25
    (129158187ns)

    @@ -33054,6 +33152,36 @@ 2.64
    (5721817992ns)

    + +

    + 5.89
    (12776783246ns)
    +

    + + +

    + 1.60
    (3473198791ns)
    +

    + + +

    + 38.51
    (83549633852ns)
    +

    + + +

    + 5.64
    (12235187520ns)
    +

    + + +

    + 14.54
    (31558153140ns)
    +

    + + +

    + 1.79
    (3883541816ns)
    +

    + @@ -33087,6 +33215,36 @@ 1.61
    (2149489ns)

    + +

    + 1.72
    (2295367ns)
    +

    + + +

    + 1.97
    (2629042ns)
    +

    + + +

    + 16.99
    (22706002ns)
    +

    + + +

    + 3.66
    (4896256ns)
    +

    + + +

    + 6.66
    (8899615ns)
    +

    + + +

    + 2.47
    (3296882ns)
    +

    + @@ -33119,6 +33277,36 @@ 2.11
    (191066461ns)

    + +

    + 1.36
    (123876688ns)
    +

    + + +

    + 1.86
    (168555428ns)
    +

    + + +

    + 4.94
    (448341733ns)
    +

    + + +

    + 2.87
    (260414480ns)
    +

    + + +

    + 2.10
    (190249211ns)
    +

    + + +

    + 2.06
    (187300242ns)
    +

    + @@ -33151,6 +33339,36 @@ 2.47
    (1460ns)

    + +

    + 1.52
    (896ns)
    +

    + + +

    + 1.65
    (974ns)
    +

    + + +

    + 8.24
    (4859ns)
    +

    + + +

    + 7.14
    (4211ns)
    +

    + + +

    + 2.36
    (1390ns)
    +

    + + +

    + 1.36
    (803ns)
    +

    + @@ -33160,27 +33378,57 @@

    - 1.87
    (25292952ns)
    + 2.41
    (25292952ns)

    - 1.05
    (14156133ns)
    + 1.35
    (14156133ns)

    - 1.04
    (14011069ns)
    + 1.33
    (14011069ns)

    - 1.00
    (13517673ns)
    + 1.29
    (13517673ns)

    - 1.40
    (18914822ns)
    + 1.80
    (18914822ns)
    +

    + + +

    + 1.00
    (10509446ns)
    +

    + + +

    + 2.42
    (25415287ns)
    +

    + + +

    + 4.34
    (45569911ns)
    +

    + + +

    + 2.75
    (28868909ns)
    +

    + + +

    + 1.69
    (17787967ns)
    +

    + + +

    + 2.45
    (25703761ns)

    @@ -33216,6 +33464,36 @@ 1.85
    (7828273663ns)

    + +

    + 1.33
    (5641641009ns)
    +

    + + +

    + 2.00
    (8481980418ns)
    +

    + + +

    + 6.13
    (25958089997ns)
    +

    + + +

    + 3.03
    (12831671502ns)
    +

    + + +

    + 2.46
    (10425285342ns)
    +

    + + +

    + 2.00
    (8481275507ns)
    +

    + @@ -33249,6 +33527,36 @@ 1.70
    (2152290ns)

    + +

    + 1.92
    (2431940ns)
    +

    + + +

    + 1.85
    (2345808ns)
    +

    + + +

    + 11.27
    (14248457ns)
    +

    + + +

    + 2.76
    (3489015ns)
    +

    + + +

    + 4.98
    (6301435ns)
    +

    + + +

    + 1.89
    (2392981ns)
    +

    + @@ -33281,6 +33589,36 @@ 1.84
    (24264232ns)

    + +

    + 1.15
    (15190274ns)
    +

    + + +

    + 1.97
    (26017484ns)
    +

    + + +

    + 4.46
    (58842348ns)
    +

    + + +

    + 2.79
    (36785666ns)
    +

    + + +

    + 1.69
    (22326488ns)
    +

    + + +

    + 1.91
    (25204278ns)
    +

    + @@ -33313,6 +33651,36 @@ 2.10
    (1355ns)

    + +

    + 1.42
    (913ns)
    +

    + + +

    + 1.54
    (989ns)
    +

    + + +

    + 7.32
    (4716ns)
    +

    + + +

    + 6.40
    (4122ns)
    +

    + + +

    + 2.12
    (1368ns)
    +

    + + +

    + 1.27
    (817ns)
    +

    + @@ -33322,27 +33690,57 @@

    - 1.88
    (48927775ns)
    + 2.09
    (48927775ns)

    - 1.42
    (37027792ns)
    + 1.58
    (37027792ns)

    - 1.00
    (26031785ns)
    + 1.11
    (26031785ns)

    - 1.30
    (33931511ns)
    + 1.45
    (33931511ns)

    - 1.28
    (33404007ns)
    + 1.43
    (33404007ns)
    +

    + + +

    + 1.00
    (23435290ns)
    +

    + + +

    + 3.12
    (73104180ns)
    +

    + + +

    + 3.84
    (90089949ns)
    +

    + + +

    + 2.43
    (56923240ns)
    +

    + + +

    + 1.48
    (34693435ns)
    +

    + + +

    + 2.80
    (65620808ns)

    @@ -33378,6 +33776,36 @@ 1.85
    (9420550833ns)

    + +

    + 2.41
    (12252843971ns)
    +

    + + +

    + 2.02
    (10272751458ns)
    +

    + + +

    + 9.61
    (48856236248ns)
    +

    + + +

    + 2.98
    (15149065981ns)
    +

    + + +

    + 3.66
    (18594373353ns)
    +

    + + +

    + 1.81
    (9217862382ns)
    +

    + @@ -33411,6 +33839,36 @@ 1.58
    (2123434ns)

    + +

    + 1.89
    (2543037ns)
    +

    + + +

    + 1.96
    (2636943ns)
    +

    + + +

    + 11.40
    (15325370ns)
    +

    + + +

    + 2.86
    (3841352ns)
    +

    + + +

    + 4.91
    (6593697ns)
    +

    + + +

    + 2.06
    (2763216ns)
    +

    + @@ -33443,6 +33901,36 @@ 1.88
    (61528205ns)

    + +

    + 1.33
    (43591274ns)
    +

    + + +

    + 2.10
    (68925414ns)
    +

    + + +

    + 4.32
    (141511277ns)
    +

    + + +

    + 3.05
    (100081308ns)
    +

    + + +

    + 1.87
    (61292346ns)
    +

    + + +

    + 2.02
    (66235861ns)
    +

    + @@ -33475,6 +33963,36 @@ 1.13
    (134ns)

    + +

    + 2.65
    (315ns)
    +

    + + +

    + 1.75
    (208ns)
    +

    + + +

    + 1.97
    (235ns)
    +

    + + +

    + 2.41
    (287ns)
    +

    + + +

    + 4.06
    (483ns)
    +

    + + +

    + 1.76
    (209ns)
    +

    + @@ -33507,6 +34025,36 @@ 2.28
    (19057ns)

    + +

    + 4.08
    (34080ns)
    +

    + + +

    + 18.55
    (154835ns)
    +

    + + +

    + 2.17
    (18097ns)
    +

    + + +

    + 3.96
    (33018ns)
    +

    + + +

    + 6.98
    (58232ns)
    +

    + + +

    + 18.59
    (155185ns)
    +

    + @@ -33539,6 +34087,36 @@ 1.00
    (1402222ns)

    + +

    + 1.84
    (2586948ns)
    +

    + + +

    + 1.88
    (2640516ns)
    +

    + + +

    + 3.20
    (4486070ns)
    +

    + + +

    + 1.83
    (2569310ns)
    +

    + + +

    + 5.42
    (7600105ns)
    +

    + + +

    + 1.91
    (2679063ns)
    +

    + @@ -33571,6 +34149,36 @@ 1.00
    (415667ns)

    + +

    + 1.84
    (763379ns)
    +

    + + +

    + 2.50
    (1038355ns)
    +

    + + +

    + 2.02
    (840855ns)
    +

    + + +

    + 1.83
    (760952ns)
    +

    + + +

    + 3.40
    (1411408ns)
    +

    + + +

    + 2.53
    (1052873ns)
    +

    + @@ -33603,6 +34211,36 @@ 1.00
    (760748ns)

    + +

    + 2.00
    (1524748ns)
    +

    + + +

    + 2.62
    (1993795ns)
    +

    + + +

    + 1.43
    (1087596ns)
    +

    + + +

    + 1.95
    (1484810ns)
    +

    + + +

    + 2.37
    (1804142ns)
    +

    + + +

    + 2.67
    (2027528ns)
    +

    + @@ -33635,6 +34273,36 @@ 1.15
    (94ns)

    + +

    + 1.57
    (129ns)
    +

    + + +

    + 1.13
    (93ns)
    +

    + + +

    + 1.29
    (106ns)
    +

    + + +

    + 1.51
    (124ns)
    +

    + + +

    + 3.16
    (259ns)
    +

    + + +

    + 1.23
    (101ns)
    +

    + @@ -33667,6 +34335,36 @@ 1.84
    (3694ns)

    + +

    + 1.79
    (3585ns)
    +

    + + +

    + 6.95
    (13927ns)
    +

    + + +

    + 1.12
    (2242ns)
    +

    + + +

    + 1.78
    (3577ns)
    +

    + + +

    + 4.04
    (8104ns)
    +

    + + +

    + 6.99
    (14016ns)
    +

    + @@ -33676,27 +34374,57 @@

    - 2.31
    (346174ns)
    + 2.46
    (346174ns)

    - 1.19
    (177975ns)
    + 1.26
    (177975ns)

    - 3.40
    (508462ns)
    + 3.61
    (508462ns)

    - 1.10
    (164321ns)
    + 1.17
    (164321ns)

    - 1.00
    (149731ns)
    + 1.06
    (149731ns)
    +

    + + +

    + 1.01
    (141952ns)
    +

    + + +

    + 1.31
    (184194ns)
    +

    + + +

    + 1.43
    (201433ns)
    +

    + + +

    + 1.00
    (140948ns)
    +

    + + +

    + 4.11
    (579023ns)
    +

    + + +

    + 1.31
    (184313ns)

    @@ -33708,27 +34436,57 @@

    - 1.82
    (317220ns)
    + 2.55
    (317220ns)

    - 1.06
    (184591ns)
    + 1.48
    (184591ns)

    - 2.39
    (416236ns)
    + 3.34
    (416236ns)

    - 1.00
    (174283ns)
    + 1.40
    (174283ns)

    - 1.13
    (196343ns)
    + 1.58
    (196343ns)
    +

    + + +

    + 1.03
    (128583ns)
    +

    + + +

    + 1.57
    (195103ns)
    +

    + + +

    + 1.31
    (163491ns)
    +

    + + +

    + 1.00
    (124586ns)
    +

    + + +

    + 3.85
    (479591ns)
    +

    + + +

    + 1.58
    (196783ns)

    @@ -33740,27 +34498,57 @@

    - 1.46
    (401554ns)
    + 1.83
    (401554ns)

    - 1.01
    (277398ns)
    + 1.26
    (277398ns)

    - 1.85
    (508645ns)
    + 2.31
    (508645ns)

    - 1.00
    (274854ns)
    + 1.25
    (274854ns)

    - 1.18
    (325496ns)
    + 1.48
    (325496ns)
    +

    + + +

    + 1.01
    (221040ns)
    +

    + + +

    + 1.36
    (298196ns)
    +

    + + +

    + 1.00
    (219844ns)
    +

    + + +

    + 1.02
    (224566ns)
    +

    + + +

    + 2.69
    (591153ns)
    +

    + + +

    + 1.36
    (298483ns)

    @@ -33795,6 +34583,36 @@ 1.31
    (98ns)

    + +

    + 1.87
    (140ns)
    +

    + + +

    + 1.40
    (105ns)
    +

    + + +

    + 1.93
    (145ns)
    +

    + + +

    + 1.96
    (147ns)
    +

    + + +

    + 3.35
    (251ns)
    +

    + + +

    + 1.24
    (93ns)
    +

    + @@ -33827,6 +34645,36 @@ 1.52
    (898ns)

    + +

    + 2.14
    (1260ns)
    +

    + + +

    + 5.94
    (3507ns)
    +

    + + +

    + 2.56
    (1513ns)
    +

    + + +

    + 2.15
    (1267ns)
    +

    + + +

    + 3.42
    (2017ns)
    +

    + + +

    + 6.01
    (3544ns)
    +

    + @@ -33859,6 +34707,36 @@ 1.00
    (11611ns)

    + +

    + 1.67
    (19374ns)
    +

    + + +

    + 2.15
    (24936ns)
    +

    + + +

    + 2.34
    (27203ns)
    +

    + + +

    + 1.57
    (18246ns)
    +

    + + +

    + 4.54
    (52686ns)
    +

    + + +

    + 2.15
    (25006ns)
    +

    + @@ -33868,27 +34746,57 @@

    - 1.55
    (144505ns)
    + 1.75
    (144505ns)

    - 1.10
    (102665ns)
    + 1.24
    (102665ns)

    - 2.20
    (205019ns)
    + 2.48
    (205019ns)

    - 1.00
    (92984ns)
    + 1.13
    (92984ns)

    - 1.09
    (101392ns)
    + 1.23
    (101392ns)
    +

    + + +

    + 1.04
    (86096ns)
    +

    + + +

    + 1.17
    (96237ns)
    +

    + + +

    + 1.53
    (126473ns)
    +

    + + +

    + 1.00
    (82541ns)
    +

    + + +

    + 2.82
    (232912ns)
    +

    + + +

    + 1.20
    (98822ns)

    @@ -33900,27 +34808,57 @@

    - 1.39
    (189654ns)
    + 1.46
    (189654ns)

    - 1.08
    (146973ns)
    + 1.13
    (146973ns)

    - 1.86
    (254281ns)
    + 1.95
    (254281ns)

    - 1.00
    (136708ns)
    + 1.05
    (136708ns)

    - 1.13
    (154282ns)
    + 1.18
    (154282ns)
    +

    + + +

    + 1.01
    (131622ns)
    +

    + + +

    + 1.10
    (143161ns)
    +

    + + +

    + 1.09
    (142318ns)
    +

    + + +

    + 1.00
    (130263ns)
    +

    + + +

    + 2.26
    (293895ns)
    +

    + + +

    + 1.10
    (142885ns)

    @@ -33955,6 +34893,36 @@ 1.15
    (93ns)

    + +

    + 1.59
    (129ns)
    +

    + + +

    + 1.16
    (94ns)
    +

    + + +

    + 1.40
    (113ns)
    +

    + + +

    + 1.58
    (128ns)
    +

    + + +

    + 3.17
    (257ns)
    +

    + + +

    + 1.25
    (101ns)
    +

    + @@ -33987,6 +34955,36 @@ 1.59
    (3165ns)

    + +

    + 1.71
    (3414ns)
    +

    + + +

    + 6.80
    (13554ns)
    +

    + + +

    + 1.12
    (2225ns)
    +

    + + +

    + 1.80
    (3580ns)
    +

    + + +

    + 4.23
    (8433ns)
    +

    + + +

    + 7.34
    (14638ns)
    +

    + @@ -33996,27 +34994,57 @@

    - 2.32
    (345911ns)
    + 2.56
    (345911ns)

    - 1.19
    (177891ns)
    + 1.32
    (177891ns)

    - 3.44
    (512584ns)
    + 3.80
    (512584ns)

    - 1.09
    (162012ns)
    + 1.20
    (162012ns)

    - 1.00
    (148982ns)
    + 1.10
    (148982ns)
    +

    + + +

    + 1.04
    (140892ns)
    +

    + + +

    + 1.33
    (179530ns)
    +

    + + +

    + 1.43
    (193505ns)
    +

    + + +

    + 1.00
    (134997ns)
    +

    + + +

    + 4.44
    (599245ns)
    +

    + + +

    + 1.41
    (190200ns)

    @@ -34028,27 +35056,57 @@

    - 1.79
    (316605ns)
    + 2.48
    (316605ns)

    - 1.06
    (187049ns)
    + 1.47
    (187049ns)

    - 2.36
    (415886ns)
    + 3.26
    (415886ns)

    - 1.00
    (176518ns)
    + 1.38
    (176518ns)

    - 1.14
    (200933ns)
    + 1.57
    (200933ns)
    +

    + + +

    + 1.01
    (128436ns)
    +

    + + +

    + 1.53
    (194872ns)
    +

    + + +

    + 1.18
    (150531ns)
    +

    + + +

    + 1.00
    (127624ns)
    +

    + + +

    + 3.81
    (486079ns)
    +

    + + +

    + 1.49
    (190453ns)

    @@ -34060,27 +35118,1421 @@

    - 1.43
    (400024ns)
    + 1.96
    (400024ns)

    - 1.01
    (283292ns)
    + 1.39
    (283292ns)

    - 1.84
    (513812ns)
    + 2.52
    (513812ns)

    - 1.00
    (279687ns)
    + 1.37
    (279687ns)

    - 1.17
    (326341ns)
    + 1.60
    (326341ns)
    +

    + + +

    + 1.04
    (211406ns)
    +

    + + +

    + 1.39
    (284097ns)
    +

    + + +

    + 1.00
    (203744ns)
    +

    + + +

    + 1.02
    (208526ns)
    +

    + + +

    + 2.93
    (595972ns)
    +

    + + +

    + 1.43
    (291793ns)
    +

    + + + +
    +
    +
    +
    +
    + +
    +

    Table 28. gcd method comparison with Microsoft Visual C++ version 14.1 on Windows + x64

    +
    +++++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -34091,7 +36543,7 @@
    +

    + Function +

    +
    +

    + gcd boost 1.64 +

    +
    +

    + Euclid_gcd boost 1.64 +

    +
    +

    + Stein_gcd boost 1.64 +

    +
    +

    + mixed_binary_gcd boost 1.64 +

    +
    +

    + Stein_gcd_textbook boost 1.64 +

    +
    +

    + gcd_euclid_textbook boost 1.64 +

    +
    +

    + gcd<boost::multiprecision::uint1024_t> (Trivial cases) +

    +
    +

    + 1.09
    (801ns)
    +

    +
    +

    + 1.00
    (732ns)
    +

    +
    +

    + 4.16
    (3043ns)
    +

    +
    +

    + 4.03
    (2953ns)
    +

    +
    +

    + 1.56
    (1142ns)
    +

    +
    +

    + 1.09
    (796ns)
    +

    +
    +

    + gcd<boost::multiprecision::uint1024_t> (adjacent Fibonacci + numbers) +

    +
    +

    + 1.00
    (18814466ns)
    +

    +
    +

    + 3.14
    (59009620ns)
    +

    +
    +

    + 3.99
    (75116072ns)
    +

    +
    +

    + 2.26
    (42593821ns)
    +

    +
    +

    + 1.58
    (29655430ns)
    +

    +
    +

    + 2.77
    (52174915ns)
    +

    +
    +

    + gcd<boost::multiprecision::uint1024_t> (permutations of Fibonacci + numbers) +

    +
    +

    + 4.67
    (9475590235ns)
    +

    +
    +

    + 1.07
    (2173235780ns)
    +

    +
    +

    + 22.49
    (45639139129ns)
    +

    +
    +

    + 3.14
    (6369244677ns)
    +

    +
    +

    + 8.18
    (16601284933ns)
    +

    +
    +

    + 1.00
    (2028937087ns)
    +

    +
    +

    + gcd<boost::multiprecision::uint1024_t> (random prime number + products) +

    +
    +

    + 1.20
    (1551460ns)
    +

    +
    +

    + 1.02
    (1314451ns)
    +

    +
    +

    + 7.92
    (10230767ns)
    +

    +
    +

    + 1.74
    (2243194ns)
    +

    +
    +

    + 3.36
    (4338456ns)
    +

    +
    +

    + 1.00
    (1291852ns)
    +

    +
    +

    + gcd<boost::multiprecision::uint1024_t> (uniform random numbers) +

    +
    +

    + 1.13
    (97004967ns)
    +

    +
    +

    + 1.20
    (102255110ns)
    +

    +
    +

    + 3.36
    (287286304ns)
    +

    +
    +

    + 2.23
    (190999693ns)
    +

    +
    +

    + 1.42
    (121531123ns)
    +

    +
    +

    + 1.00
    (85503149ns)
    +

    +
    +

    + gcd<boost::multiprecision::uint256_t> (Trivial cases) +

    +
    +

    + 1.15
    (575ns)
    +

    +
    +

    + 1.00
    (502ns)
    +

    +
    +

    + 4.94
    (2481ns)
    +

    +
    +

    + 4.62
    (2320ns)
    +

    +
    +

    + 1.86
    (936ns)
    +

    +
    +

    + 1.17
    (589ns)
    +

    +
    +

    + gcd<boost::multiprecision::uint256_t> (adjacent Fibonacci numbers) +

    +
    +

    + 1.00
    (7847419ns)
    +

    +
    +

    + 1.78
    (13945600ns)
    +

    +
    +

    + 4.42
    (34688200ns)
    +

    +
    +

    + 2.42
    (19021587ns)
    +

    +
    +

    + 1.84
    (14421195ns)
    +

    +
    +

    + 1.70
    (13359068ns)
    +

    +
    +

    + gcd<boost::multiprecision::uint256_t> (permutations of Fibonacci + numbers) +

    +
    +

    + 1.00
    (4067225231ns)
    +

    +
    +

    + 1.08
    (4386735265ns)
    +

    +
    +

    + 4.75
    (19329382899ns)
    +

    +
    +

    + 1.93
    (7850681530ns)
    +

    +
    +

    + 1.90
    (7708396164ns)
    +

    +
    +

    + 1.04
    (4231899027ns)
    +

    +
    +

    + gcd<boost::multiprecision::uint256_t> (random prime number + products) +

    +
    +

    + 1.27
    (1581415ns)
    +

    +
    +

    + 1.00
    (1243668ns)
    +

    +
    +

    + 7.91
    (9831772ns)
    +

    +
    +

    + 1.70
    (2114775ns)
    +

    +
    +

    + 3.45
    (4294739ns)
    +

    +
    +

    + 1.00
    (1245471ns)
    +

    +
    +

    + gcd<boost::multiprecision::uint256_t> (uniform random numbers) +

    +
    +

    + 1.00
    (10845788ns)
    +

    +
    +

    + 1.26
    (13713724ns)
    +

    +
    +

    + 4.11
    (44625137ns)
    +

    +
    +

    + 2.25
    (24360370ns)
    +

    +
    +

    + 1.67
    (18100420ns)
    +

    +
    +

    + 1.19
    (12859732ns)
    +

    +
    +

    + gcd<boost::multiprecision::uint512_t> (Trivial cases) +

    +
    +

    + 1.14
    (644ns)
    +

    +
    +

    + 1.00
    (565ns)
    +

    +
    +

    + 4.98
    (2812ns)
    +

    +
    +

    + 4.64
    (2621ns)
    +

    +
    +

    + 1.73
    (980ns)
    +

    +
    +

    + 1.15
    (647ns)
    +

    +
    +

    + gcd<boost::multiprecision::uint512_t> (adjacent Fibonacci numbers) +

    +
    +

    + 1.00
    (17186167ns)
    +

    +
    +

    + 2.44
    (41861352ns)
    +

    +
    +

    + 3.98
    (68425931ns)
    +

    +
    +

    + 2.23
    (38284219ns)
    +

    +
    +

    + 1.56
    (26755034ns)
    +

    +
    +

    + 1.95
    (33477468ns)
    +

    +
    +

    + gcd<boost::multiprecision::uint512_t> (permutations of Fibonacci + numbers) +

    +
    +

    + 1.64
    (8226882537ns)
    +

    +
    +

    + 1.03
    (5195847139ns)
    +

    +
    +

    + 7.47
    (37520762454ns)
    +

    +
    +

    + 2.12
    (10640326024ns)
    +

    +
    +

    + 2.89
    (14533607689ns)
    +

    +
    +

    + 1.00
    (5022876982ns)
    +

    +
    +

    + gcd<boost::multiprecision::uint512_t> (random prime number + products) +

    +
    +

    + 1.23
    (1627487ns)
    +

    +
    +

    + 1.00
    (1322335ns)
    +

    +
    +

    + 7.94
    (10496834ns)
    +

    +
    +

    + 1.82
    (2406752ns)
    +

    +
    +

    + 3.37
    (4461261ns)
    +

    +
    +

    + 1.02
    (1343775ns)
    +

    +
    +

    + gcd<boost::multiprecision::uint512_t> (uniform random numbers) +

    +
    +

    + 1.00
    (32451969ns)
    +

    +
    +

    + 1.10
    (35543655ns)
    +

    +
    +

    + 3.55
    (115155205ns)
    +

    +
    +

    + 2.01
    (65156734ns)
    +

    +
    +

    + 1.43
    (46259709ns)
    +

    +
    +

    + 1.03
    (33493171ns)
    +

    +
    +

    + gcd<unsigned long long> (Trivial cases) +

    +
    +

    + 1.46
    (161ns)
    +

    +
    +

    + 1.35
    (148ns)
    +

    +
    +

    + 1.00
    (110ns)
    +

    +
    +

    + 1.42
    (156ns)
    +

    +
    +

    + 1.02
    (112ns)
    +

    +
    +

    + 1.23
    (135ns)
    +

    +
    +

    + gcd<unsigned long long> (adjacent Fibonacci numbers) +

    +
    +

    + 1.43
    (20054ns)
    +

    +
    +

    + 7.90
    (110522ns)
    +

    +
    +

    + 1.00
    (13990ns)
    +

    +
    +

    + 1.42
    (19927ns)
    +

    +
    +

    + 1.11
    (15489ns)
    +

    +
    +

    + 6.02
    (84223ns)
    +

    +
    +

    + gcd<unsigned long long> (permutations of Fibonacci numbers) +

    +
    +

    + 1.16
    (1706761ns)
    +

    +
    +

    + 1.28
    (1892450ns)
    +

    +
    +

    + 2.65
    (3915173ns)
    +

    +
    +

    + 1.16
    (1718303ns)
    +

    +
    +

    + 1.97
    (2909805ns)
    +

    +
    +

    + 1.00
    (1477319ns)
    +

    +
    +

    + gcd<unsigned long long> (random prime number products) +

    +
    +

    + 1.00
    (405449ns)
    +

    +
    +

    + 1.39
    (562829ns)
    +

    +
    +

    + 1.81
    (734508ns)
    +

    +
    +

    + 1.01
    (408757ns)
    +

    +
    +

    + 1.30
    (527805ns)
    +

    +
    +

    + 1.04
    (422687ns)
    +

    +
    +

    + gcd<unsigned long long> (uniform random numbers) +

    +
    +

    + 1.13
    (800534ns)
    +

    +
    +

    + 1.41
    (1002100ns)
    +

    +
    +

    + 1.43
    (1016520ns)
    +

    +
    +

    + 1.11
    (790908ns)
    +

    +
    +

    + 1.00
    (711010ns)
    +

    +
    +

    + 1.06
    (755843ns)
    +

    +
    +

    + gcd<unsigned long> (Trivial cases) +

    +
    +

    + 1.88
    (152ns)
    +

    +
    +

    + 1.21
    (98ns)
    +

    +
    +

    + 1.46
    (118ns)
    +

    +
    +

    + 1.75
    (142ns)
    +

    +
    +

    + 1.48
    (120ns)
    +

    +
    +

    + 1.00
    (81ns)
    +

    +
    +

    + gcd<unsigned long> (adjacent Fibonacci numbers) +

    +
    +

    + 1.08
    (3560ns)
    +

    +
    +

    + 6.50
    (21428ns)
    +

    +
    +

    + 1.00
    (3299ns)
    +

    +
    +

    + 1.06
    (3481ns)
    +

    +
    +

    + 1.23
    (4074ns)
    +

    +
    +

    + 4.06
    (13399ns)
    +

    +
    +

    + gcd<unsigned long> (permutations of Fibonacci numbers) +

    +
    +

    + 1.26
    (200999ns)
    +

    +
    +

    + 1.66
    (265917ns)
    +

    +
    +

    + 2.75
    (439667ns)
    +

    +
    +

    + 1.24
    (197917ns)
    +

    +
    +

    + 2.32
    (370746ns)
    +

    +
    +

    + 1.00
    (159839ns)
    +

    +
    +

    + gcd<unsigned long> (random prime number products) +

    +
    +

    + 1.25
    (218611ns)
    +

    +
    +

    + 1.58
    (276521ns)
    +

    +
    +

    + 2.23
    (391315ns)
    +

    +
    +

    + 1.14
    (200690ns)
    +

    +
    +

    + 1.79
    (313229ns)
    +

    +
    +

    + 1.00
    (175307ns)
    +

    +
    +

    + gcd<unsigned long> (uniform random numbers) +

    +
    +

    + 1.35
    (362872ns)
    +

    +
    +

    + 1.50
    (401677ns)
    +

    +
    +

    + 1.90
    (510064ns)
    +

    +
    +

    + 1.33
    (357968ns)
    +

    +
    +

    + 1.47
    (394095ns)
    +

    +
    +

    + 1.00
    (268295ns)
    +

    +
    +

    + gcd<unsigned short> (Trivial cases) +

    +
    +

    + 1.65
    (137ns)
    +

    +
    +

    + 1.11
    (92ns)
    +

    +
    +

    + 1.41
    (117ns)
    +

    +
    +

    + 1.54
    (128ns)
    +

    +
    +

    + 1.46
    (121ns)
    +

    +
    +

    + 1.00
    (83ns)
    +

    +
    +

    + gcd<unsigned short> (adjacent Fibonacci numbers) +

    +
    +

    + 1.14
    (859ns)
    +

    +
    +

    + 6.80
    (5139ns)
    +

    +
    +

    + 1.00
    (756ns)
    +

    +
    +

    + 1.15
    (866ns)
    +

    +
    +

    + 1.35
    (1020ns)
    +

    +
    +

    + 4.17
    (3155ns)
    +

    +
    +

    + gcd<unsigned short> (permutations of Fibonacci numbers) +

    +
    +

    + 1.01
    (12759ns)
    +

    +
    +

    + 3.33
    (42011ns)
    +

    +
    +

    + 1.27
    (16050ns)
    +

    +
    +

    + 1.00
    (12623ns)
    +

    +
    +

    + 2.17
    (27411ns)
    +

    +
    +

    + 1.80
    (22712ns)
    +

    +
    +

    + gcd<unsigned short> (random prime number products) +

    +
    +

    + 1.22
    (101653ns)
    +

    +
    +

    + 1.95
    (161889ns)
    +

    +
    +

    + 2.33
    (193556ns)
    +

    +
    +

    + 1.19
    (98879ns)
    +

    +
    +

    + 1.85
    (153556ns)
    +

    +
    +

    + 1.00
    (83031ns)
    +

    +
    +

    + gcd<unsigned short> (uniform random numbers) +

    +
    +

    + 1.34
    (169127ns)
    +

    +
    +

    + 1.66
    (208641ns)
    +

    +
    +

    + 2.06
    (259536ns)
    +

    +
    +

    + 1.36
    (170992ns)
    +

    +
    +

    + 1.59
    (199734ns)
    +

    +
    +

    + 1.00
    (125927ns)
    +

    +
    +

    + gcd<unsigned> (Trivial cases) +

    +
    +

    + 1.85
    (165ns)
    +

    +
    +

    + 1.25
    (111ns)
    +

    +
    +

    + 1.49
    (133ns)
    +

    +
    +

    + 1.90
    (169ns)
    +

    +
    +

    + 1.63
    (145ns)
    +

    +
    +

    + 1.00
    (89ns)
    +

    +
    +

    + gcd<unsigned> (adjacent Fibonacci numbers) +

    +
    +

    + 1.09
    (3472ns)
    +

    +
    +

    + 6.86
    (21847ns)
    +

    +
    +

    + 1.00
    (3184ns)
    +

    +
    +

    + 1.08
    (3428ns)
    +

    +
    +

    + 1.29
    (4110ns)
    +

    +
    +

    + 4.22
    (13439ns)
    +

    +
    +

    + gcd<unsigned> (permutations of Fibonacci numbers) +

    +
    +

    + 1.19
    (201037ns)
    +

    +
    +

    + 1.62
    (273197ns)
    +

    +
    +

    + 2.74
    (463170ns)
    +

    +
    +

    + 1.21
    (204339ns)
    +

    +
    +

    + 2.36
    (398909ns)
    +

    +
    +

    + 1.00
    (168891ns)
    +

    +
    +

    + gcd<unsigned> (random prime number products) +

    +
    +

    + 1.23
    (215380ns)
    +

    +
    +

    + 1.57
    (276143ns)
    +

    +
    +

    + 2.22
    (389655ns)
    +

    +
    +

    + 1.16
    (204160ns)
    +

    +
    +

    + 1.77
    (311616ns)
    +

    +
    +

    + 1.00
    (175753ns)
    +

    +
    +

    + gcd<unsigned> (uniform random numbers) +

    +
    +

    + 1.31
    (360158ns)
    +

    +
    +

    + 1.48
    (407011ns)
    +

    +
    +

    + 1.85
    (510333ns)
    +

    +
    +

    + 1.31
    (360097ns)
    +

    +
    +

    + 1.42
    (389754ns)
    +

    +
    +

    + 1.00
    (275392ns)

    - +

    Last revised: April 07, 2016 at 18:35:15 GMT

    Last revised: April 09, 2017 at 16:45:49 GMT


    diff --git a/reporting/performance/test_gcd.cpp b/reporting/performance/test_gcd.cpp index 8e365db99..46f26eae1 100644 --- a/reporting/performance/test_gcd.cpp +++ b/reporting/performance/test_gcd.cpp @@ -169,52 +169,18 @@ T binary_textbook(T u, T v) return u + v; } -// -// The Mixed Binary Euclid Algorithm -// Sidi Mohamed Sedjelmaci -// Electronic Notes in Discrete Mathematics 35 (2009) 169–176 -// -template -T mixed_binary_gcd(T u, T v) +template +inline BOOST_CXX14_CONSTEXPR Integer gcd_default(Integer a, Integer b) BOOST_GCD_NOEXCEPT(Integer) { - using std::swap; - if(u < v) - swap(u, v); - - unsigned shifts = 0; - - if(!u) - return v; - if(!v) - return u; - - while(even(u) && even(v)) - { - u >>= 1u; - v >>= 1u; - ++shifts; - } - - while(v > 1) - { - u %= v; - v -= u; - if(!u) - return v << shifts; - if(!v) - return u << shifts; - while(even(u)) u >>= 1u; - while(even(v)) v >>= 1u; - if(u < v) - swap(u, v); - } - return (v == 1 ? v : u) << shifts; + using boost::math::gcd; + return gcd(a, b); } + template void test_type(const char* name) { - using namespace boost::math::detail; + using namespace boost::math::gcd_detail; typedef T int_type; std::vector > data; @@ -227,12 +193,13 @@ void test_type(const char* name) row_name += "> (random prime number products)"; typedef pair< function, string> f_test; - array test_functions{ { - { Stein_gcd, "Stein_gcd" } , + array test_functions{ { + { gcd_default, "gcd" }, { Euclid_gcd, "Euclid_gcd" }, + { Stein_gcd, "Stein_gcd" } , + { mixed_binary_gcd, "mixed_binary_gcd" }, { binary_textbook, "Stein_gcd_textbook" }, { euclid_textbook, "gcd_euclid_textbook" }, - { mixed_binary_gcd, "mixed_binary_gcd" } } }; for_each(begin(test_functions), end(test_functions), test_function_template(data, row_name.c_str())); @@ -325,6 +292,7 @@ N gcd_stein(N m, N n) return m << std::min(d_m, d_n); } + boost::multiprecision::cpp_int big_gcd(const boost::multiprecision::cpp_int& a, const boost::multiprecision::cpp_int& b) { return boost::multiprecision::gcd(a, b); @@ -405,13 +373,13 @@ inline typename enable_if_csize() <= 2) { if(vp->size() == 1) - *up = mixed_binary_gcd(*vp->limbs(), *up->limbs()); + *up = boost::math::gcd_detail::mixed_binary_gcd(*vp->limbs(), *up->limbs()); else { double_limb_type i, j; i = vp->limbs()[0] | (static_cast(vp->limbs()[1]) << sizeof(limb_type) * CHAR_BIT); j = (up->size() == 1) ? *up->limbs() : up->limbs()[0] | (static_cast(up->limbs()[1]) << sizeof(limb_type) * CHAR_BIT); - u = mixed_binary_gcd(i, j); + u = boost::math::gcd_detail::mixed_binary_gcd(i, j); } break; } @@ -506,4 +474,5 @@ int main() test_n_bits(0, "consecutive first 1000 fibonacci numbers", &fibonacci_numbers_cpp_int_permution_1()); test_n_bits(0, "permutations of first 1000 fibonacci numbers", &fibonacci_numbers_cpp_int_permution_2()); */ + return 0; } diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index 0555c034b..57541abca 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -102,6 +102,7 @@ run test_arcsine.cpp pch ../../test/build//boost_unit_test_framework ; run test_bernoulli.cpp ../../test/build//boost_unit_test_framework ; run test_constants.cpp ../../test/build//boost_unit_test_framework ; run test_print_info_on_type.cpp ; +run test_barycentric_rational.cpp ../../test/build//boost_unit_test_framework : : : [ requires cxx11_smart_ptr ] [ check-target-builds ../config//has_float128 "GCC libquadmath and __float128 support" : -lquadmath ] ; run test_constant_generate.cpp : : : release USE_CPP_FLOAT=1 off:no ; run test_bessel_j.cpp test_instances//test_instances pch_light ../../test/build//boost_unit_test_framework ; run test_bessel_y.cpp test_instances//test_instances pch_light ../../test/build//boost_unit_test_framework ; @@ -221,6 +222,7 @@ run test_cauchy.cpp ../../test/build//boost_unit_test_framework ; run test_cbrt.cpp test_instances//test_instances pch_light ../../test/build//boost_unit_test_framework ; run test_chi_squared.cpp ../../test/build//boost_unit_test_framework ; run test_classify.cpp pch ../../test/build//boost_unit_test_framework ; +run test_cubic_b_spline.cpp ../../test/build//boost_unit_test_framework : : : [ requires cxx11_smart_ptr ] ; run test_difference.cpp ../../test/build//boost_unit_test_framework ; run test_digamma.cpp test_instances//test_instances pch_light ../../test/build//boost_unit_test_framework ; run test_dist_overloads.cpp ../../test/build//boost_unit_test_framework ; @@ -561,6 +563,7 @@ run test_laplace.cpp ../../test/build//boost_unit_test_framework ; run test_inv_hyp.cpp pch ../../test/build//boost_unit_test_framework ; run test_laguerre.cpp test_instances//test_instances pch_light ../../test/build//boost_unit_test_framework ; run test_legendre.cpp test_instances//test_instances pch_light ../../test/build//boost_unit_test_framework ; +run legendre_stieltjes_test.cpp ../../test/build//boost_unit_test_framework : : : [ requires cxx11_auto_declarations ] ; run test_ldouble_simple.cpp ../../test/build//boost_unit_test_framework ; run test_logistic_dist.cpp ../../test/build//boost_unit_test_framework ; run test_lognormal.cpp ../../test/build//boost_unit_test_framework ; @@ -821,6 +824,10 @@ run test_long_double_support.cpp ../../test/build//boost_unit_test_framework lib compile_test_main : compile_test/main.cpp ; +run compile_test/cubic_spline_incl_test.cpp compile_test_main : : : [ requires cxx11_smart_ptr ] ; +run compile_test/barycentric_rational_incl_test.cpp compile_test_main : : : [ requires cxx11_smart_ptr ] ; +run compile_test/common_factor_rt_inc_test.cpp compile_test_main ; +run compile_test/common_factor_ct_inc_test.cpp compile_test_main ; run compile_test/compl_abs_incl_test.cpp compile_test_main ; run compile_test/compl_acos_incl_test.cpp compile_test_main ; run compile_test/compl_acosh_incl_test.cpp compile_test_main ; @@ -890,6 +897,7 @@ run compile_test/sf_hypot_incl_test.cpp compile_test_main ; run compile_test/sf_laguerre_incl_test.cpp compile_test_main ; compile compile_test/sf_lanczos_incl_test.cpp ; run compile_test/sf_legendre_incl_test.cpp compile_test_main ; +run compile_test/sf_legendre_stieltjes_incl_test.cpp compile_test_main : : : [ requires cxx11_auto_declarations ] ; run compile_test/sf_log1p_incl_test.cpp compile_test_main ; compile compile_test/sf_math_fwd_incl_test.cpp ; run compile_test/sf_modf_incl_test.cpp compile_test_main ; @@ -937,6 +945,9 @@ compile compile_test/tools_test_data_inc_test.cpp ; compile compile_test/tools_test_inc_test.cpp ; compile compile_test/tools_toms748_inc_test.cpp ; compile compile_test/trapezoidal_concept_test.cpp ; +compile compile_test/cubic_spline_concept_test.cpp : [ requires cxx11_smart_ptr ] ; +compile compile_test/barycentric_rational_concept_test.cpp : [ requires cxx11_smart_ptr ] ; +compile compile_test/sf_legendre_stieltjes_concept_test.cpp : [ requires cxx11_auto_declarations ] ; run ../test/common_factor_test.cpp ../../test/build//boost_unit_test_framework ; diff --git a/test/common_factor_test.cpp b/test/common_factor_test.cpp index 43b373fe3..264cee888 100644 --- a/test/common_factor_test.cpp +++ b/test/common_factor_test.cpp @@ -23,6 +23,10 @@ #include // for boost::mpl::list #include #include +#include +#include +#include +#include #include // for std::basic_istream #include // for std::numeric_limits @@ -117,7 +121,7 @@ typedef ::boost::mpl::list signed_test_types; + MyInt1, boost::multiprecision::cpp_int> signed_test_types; typedef ::boost::mpl::list unsigned_test_types; + MyUnsigned1, MyUnsigned2 /*, boost::multiprecision::uint256_t*/> unsigned_test_types; } // namespace @@ -268,27 +272,45 @@ BOOST_AUTO_TEST_CASE_TEMPLATE( gcd_int_test, T, signed_test_types ) { #ifndef BOOST_MSVC using boost::math::gcd; + using boost::math::gcd_evaluator; #else using namespace boost::math; #endif // Originally from Boost.Rational tests - BOOST_CHECK_EQUAL( gcd( 1, -1), static_cast( 1) ); - BOOST_CHECK_EQUAL( gcd( -1, 1), static_cast( 1) ); - BOOST_CHECK_EQUAL( gcd( 1, 1), static_cast( 1) ); - BOOST_CHECK_EQUAL( gcd( -1, -1), static_cast( 1) ); - BOOST_CHECK_EQUAL( gcd( 0, 0), static_cast( 0) ); - BOOST_CHECK_EQUAL( gcd( 7, 0), static_cast( 7) ); - BOOST_CHECK_EQUAL( gcd( 0, 9), static_cast( 9) ); - BOOST_CHECK_EQUAL( gcd( -7, 0), static_cast( 7) ); - BOOST_CHECK_EQUAL( gcd( 0, -9), static_cast( 9) ); - BOOST_CHECK_EQUAL( gcd( 42, 30), static_cast( 6) ); - BOOST_CHECK_EQUAL( gcd( 6, -9), static_cast( 3) ); - BOOST_CHECK_EQUAL( gcd(-10, -10), static_cast(10) ); - BOOST_CHECK_EQUAL( gcd(-25, -10), static_cast( 5) ); - BOOST_CHECK_EQUAL( gcd( 3, 7), static_cast( 1) ); - BOOST_CHECK_EQUAL( gcd( 8, 9), static_cast( 1) ); - BOOST_CHECK_EQUAL( gcd( 7, 49), static_cast( 7) ); + BOOST_CHECK_EQUAL( gcd( static_cast(1), static_cast(-1)), static_cast( 1) ); + BOOST_CHECK_EQUAL( gcd(static_cast(-1), static_cast(1)), static_cast( 1) ); + BOOST_CHECK_EQUAL( gcd(static_cast(1), static_cast(1)), static_cast( 1) ); + BOOST_CHECK_EQUAL( gcd(static_cast(-1), static_cast(-1)), static_cast( 1) ); + BOOST_CHECK_EQUAL( gcd(static_cast(0), static_cast(0)), static_cast( 0) ); + BOOST_CHECK_EQUAL( gcd(static_cast(7), static_cast(0)), static_cast( 7) ); + BOOST_CHECK_EQUAL( gcd(static_cast(0), static_cast(9)), static_cast( 9) ); + BOOST_CHECK_EQUAL( gcd(static_cast(-7), static_cast(0)), static_cast( 7) ); + BOOST_CHECK_EQUAL( gcd(static_cast(0), static_cast(-9)), static_cast( 9) ); + BOOST_CHECK_EQUAL( gcd(static_cast(42), static_cast(30)), static_cast( 6) ); + BOOST_CHECK_EQUAL( gcd(static_cast(6), static_cast(-9)), static_cast( 3) ); + BOOST_CHECK_EQUAL( gcd(static_cast(-10), static_cast(-10)), static_cast(10) ); + BOOST_CHECK_EQUAL( gcd(static_cast(-25), static_cast(-10)), static_cast( 5) ); + BOOST_CHECK_EQUAL( gcd(static_cast(3), static_cast(7)), static_cast( 1) ); + BOOST_CHECK_EQUAL( gcd(static_cast(8), static_cast(9)), static_cast( 1) ); + BOOST_CHECK_EQUAL( gcd(static_cast(7), static_cast(49)), static_cast( 7) ); + // Again with function object: + BOOST_CHECK_EQUAL(gcd_evaluator()(1, -1), static_cast(1)); + BOOST_CHECK_EQUAL(gcd_evaluator()(-1, 1), static_cast(1)); + BOOST_CHECK_EQUAL(gcd_evaluator()(1, 1), static_cast(1)); + BOOST_CHECK_EQUAL(gcd_evaluator()(-1, -1), static_cast(1)); + BOOST_CHECK_EQUAL(gcd_evaluator()(0, 0), static_cast(0)); + BOOST_CHECK_EQUAL(gcd_evaluator()(7, 0), static_cast(7)); + BOOST_CHECK_EQUAL(gcd_evaluator()(0, 9), static_cast(9)); + BOOST_CHECK_EQUAL(gcd_evaluator()(-7, 0), static_cast(7)); + BOOST_CHECK_EQUAL(gcd_evaluator()(0, -9), static_cast(9)); + BOOST_CHECK_EQUAL(gcd_evaluator()(42, 30), static_cast(6)); + BOOST_CHECK_EQUAL(gcd_evaluator()(6, -9), static_cast(3)); + BOOST_CHECK_EQUAL(gcd_evaluator()(-10, -10), static_cast(10)); + BOOST_CHECK_EQUAL(gcd_evaluator()(-25, -10), static_cast(5)); + BOOST_CHECK_EQUAL(gcd_evaluator()(3, 7), static_cast(1)); + BOOST_CHECK_EQUAL(gcd_evaluator()(8, 9), static_cast(1)); + BOOST_CHECK_EQUAL(gcd_evaluator()(7, 49), static_cast(7)); } // GCD on unmarked signed integer type @@ -304,22 +326,22 @@ BOOST_AUTO_TEST_CASE( gcd_unmarked_int_test ) // then does an absolute-value on the result. Signed types that are not // marked as such (due to no std::numeric_limits specialization) may be off // by a sign. - BOOST_CHECK_EQUAL( abs(gcd( 1, -1 )), MyInt2( 1) ); - BOOST_CHECK_EQUAL( abs(gcd( -1, 1 )), MyInt2( 1) ); - BOOST_CHECK_EQUAL( abs(gcd( 1, 1 )), MyInt2( 1) ); - BOOST_CHECK_EQUAL( abs(gcd( -1, -1 )), MyInt2( 1) ); - BOOST_CHECK_EQUAL( abs(gcd( 0, 0 )), MyInt2( 0) ); - BOOST_CHECK_EQUAL( abs(gcd( 7, 0 )), MyInt2( 7) ); - BOOST_CHECK_EQUAL( abs(gcd( 0, 9 )), MyInt2( 9) ); - BOOST_CHECK_EQUAL( abs(gcd( -7, 0 )), MyInt2( 7) ); - BOOST_CHECK_EQUAL( abs(gcd( 0, -9 )), MyInt2( 9) ); - BOOST_CHECK_EQUAL( abs(gcd( 42, 30 )), MyInt2( 6) ); - BOOST_CHECK_EQUAL( abs(gcd( 6, -9 )), MyInt2( 3) ); - BOOST_CHECK_EQUAL( abs(gcd( -10, -10 )), MyInt2(10) ); - BOOST_CHECK_EQUAL( abs(gcd( -25, -10 )), MyInt2( 5) ); - BOOST_CHECK_EQUAL( abs(gcd( 3, 7 )), MyInt2( 1) ); - BOOST_CHECK_EQUAL( abs(gcd( 8, 9 )), MyInt2( 1) ); - BOOST_CHECK_EQUAL( abs(gcd( 7, 49 )), MyInt2( 7) ); + BOOST_CHECK_EQUAL( abs(gcd(static_cast(1), static_cast(-1) )), MyInt2( 1) ); + BOOST_CHECK_EQUAL( abs(gcd(static_cast(-1), static_cast(1) )), MyInt2( 1) ); + BOOST_CHECK_EQUAL( abs(gcd(static_cast(1), static_cast(1) )), MyInt2( 1) ); + BOOST_CHECK_EQUAL( abs(gcd(static_cast(-1), static_cast(-1) )), MyInt2( 1) ); + BOOST_CHECK_EQUAL( abs(gcd(static_cast(0), static_cast(0) )), MyInt2( 0) ); + BOOST_CHECK_EQUAL( abs(gcd(static_cast(7), static_cast(0) )), MyInt2( 7) ); + BOOST_CHECK_EQUAL( abs(gcd(static_cast(0), static_cast(9) )), MyInt2( 9) ); + BOOST_CHECK_EQUAL( abs(gcd(static_cast(-7), static_cast(0) )), MyInt2( 7) ); + BOOST_CHECK_EQUAL( abs(gcd(static_cast(0), static_cast(-9) )), MyInt2( 9) ); + BOOST_CHECK_EQUAL( abs(gcd(static_cast(42), static_cast(30))), MyInt2( 6) ); + BOOST_CHECK_EQUAL( abs(gcd(static_cast(6), static_cast(-9) )), MyInt2( 3) ); + BOOST_CHECK_EQUAL( abs(gcd(static_cast(-10), static_cast(-10) )), MyInt2(10) ); + BOOST_CHECK_EQUAL( abs(gcd(static_cast(-25), static_cast(-10) )), MyInt2( 5) ); + BOOST_CHECK_EQUAL( abs(gcd(static_cast(3), static_cast(7) )), MyInt2( 1) ); + BOOST_CHECK_EQUAL( abs(gcd(static_cast(8), static_cast(9) )), MyInt2( 1) ); + BOOST_CHECK_EQUAL( abs(gcd(static_cast(7), static_cast(49) )), MyInt2( 7) ); } // GCD on unsigned integer types @@ -333,14 +355,14 @@ BOOST_AUTO_TEST_CASE_TEMPLATE( gcd_unsigned_test, T, unsigned_test_types ) // Note that unmarked types (i.e. have no std::numeric_limits // specialization) are treated like non/unsigned types - BOOST_CHECK_EQUAL( gcd( 1u, 1u), static_cast( 1u) ); - BOOST_CHECK_EQUAL( gcd( 0u, 0u), static_cast( 0u) ); - BOOST_CHECK_EQUAL( gcd( 7u, 0u), static_cast( 7u) ); - BOOST_CHECK_EQUAL( gcd( 0u, 9u), static_cast( 9u) ); - BOOST_CHECK_EQUAL( gcd(42u, 30u), static_cast( 6u) ); - BOOST_CHECK_EQUAL( gcd( 3u, 7u), static_cast( 1u) ); - BOOST_CHECK_EQUAL( gcd( 8u, 9u), static_cast( 1u) ); - BOOST_CHECK_EQUAL( gcd( 7u, 49u), static_cast( 7u) ); + BOOST_CHECK_EQUAL( gcd(static_cast(1u), static_cast(1u)), static_cast( 1u) ); + BOOST_CHECK_EQUAL( gcd(static_cast(0u), static_cast(0u)), static_cast( 0u) ); + BOOST_CHECK_EQUAL( gcd(static_cast(7u), static_cast(0u)), static_cast( 7u) ); + BOOST_CHECK_EQUAL( gcd(static_cast(0u), static_cast(9u)), static_cast( 9u) ); + BOOST_CHECK_EQUAL( gcd(static_cast(42u), static_cast(30u)), static_cast( 6u) ); + BOOST_CHECK_EQUAL( gcd(static_cast(3u), static_cast(7u)), static_cast( 1u) ); + BOOST_CHECK_EQUAL( gcd(static_cast(8u), static_cast(9u)), static_cast( 1u) ); + BOOST_CHECK_EQUAL( gcd(static_cast(7u), static_cast(49u)), static_cast( 7u) ); } // GCD at compile-time @@ -364,10 +386,6 @@ BOOST_AUTO_TEST_CASE( gcd_static_test ) BOOST_CHECK( (static_gcd< 7, 49>::value) == 7 ); } -// TODO: non-built-in signed and unsigned integer tests, with and without -// numeric_limits specialization; polynominal tests; note any changes if -// built-ins switch to binary-GCD algorithm - BOOST_AUTO_TEST_SUITE_END() @@ -379,27 +397,45 @@ BOOST_AUTO_TEST_CASE_TEMPLATE( lcm_int_test, T, signed_test_types ) { #ifndef BOOST_MSVC using boost::math::lcm; + using boost::math::lcm_evaluator; #else using namespace boost::math; #endif // Originally from Boost.Rational tests - BOOST_CHECK_EQUAL( lcm( 1, -1), static_cast( 1) ); - BOOST_CHECK_EQUAL( lcm( -1, 1), static_cast( 1) ); - BOOST_CHECK_EQUAL( lcm( 1, 1), static_cast( 1) ); - BOOST_CHECK_EQUAL( lcm( -1, -1), static_cast( 1) ); - BOOST_CHECK_EQUAL( lcm( 0, 0), static_cast( 0) ); - BOOST_CHECK_EQUAL( lcm( 6, 0), static_cast( 0) ); - BOOST_CHECK_EQUAL( lcm( 0, 7), static_cast( 0) ); - BOOST_CHECK_EQUAL( lcm( -5, 0), static_cast( 0) ); - BOOST_CHECK_EQUAL( lcm( 0, -4), static_cast( 0) ); - BOOST_CHECK_EQUAL( lcm( 18, 30), static_cast(90) ); - BOOST_CHECK_EQUAL( lcm( -6, 9), static_cast(18) ); - BOOST_CHECK_EQUAL( lcm(-10, -10), static_cast(10) ); - BOOST_CHECK_EQUAL( lcm( 25, -10), static_cast(50) ); - BOOST_CHECK_EQUAL( lcm( 3, 7), static_cast(21) ); - BOOST_CHECK_EQUAL( lcm( 8, 9), static_cast(72) ); - BOOST_CHECK_EQUAL( lcm( 7, 49), static_cast(49) ); + BOOST_CHECK_EQUAL( lcm(static_cast(1), static_cast(-1)), static_cast( 1) ); + BOOST_CHECK_EQUAL( lcm(static_cast(-1), static_cast(1)), static_cast( 1) ); + BOOST_CHECK_EQUAL( lcm(static_cast(1), static_cast(1)), static_cast( 1) ); + BOOST_CHECK_EQUAL( lcm(static_cast(-1), static_cast(-1)), static_cast( 1) ); + BOOST_CHECK_EQUAL( lcm(static_cast(0), static_cast(0)), static_cast( 0) ); + BOOST_CHECK_EQUAL( lcm(static_cast(6), static_cast(0)), static_cast( 0) ); + BOOST_CHECK_EQUAL( lcm(static_cast(0), static_cast(7)), static_cast( 0) ); + BOOST_CHECK_EQUAL( lcm(static_cast(-5), static_cast(0)), static_cast( 0) ); + BOOST_CHECK_EQUAL( lcm(static_cast(0), static_cast(-4)), static_cast( 0) ); + BOOST_CHECK_EQUAL( lcm(static_cast(18), static_cast(30)), static_cast(90) ); + BOOST_CHECK_EQUAL( lcm(static_cast(-6), static_cast(9)), static_cast(18) ); + BOOST_CHECK_EQUAL( lcm(static_cast(-10), static_cast(-10)), static_cast(10) ); + BOOST_CHECK_EQUAL( lcm(static_cast(25), static_cast(-10)), static_cast(50) ); + BOOST_CHECK_EQUAL( lcm(static_cast(3), static_cast(7)), static_cast(21) ); + BOOST_CHECK_EQUAL( lcm(static_cast(8), static_cast(9)), static_cast(72) ); + BOOST_CHECK_EQUAL( lcm(static_cast(7), static_cast(49)), static_cast(49) ); + // Again with function object: + BOOST_CHECK_EQUAL(lcm_evaluator()(1, -1), static_cast(1)); + BOOST_CHECK_EQUAL(lcm_evaluator()(-1, 1), static_cast(1)); + BOOST_CHECK_EQUAL(lcm_evaluator()(1, 1), static_cast(1)); + BOOST_CHECK_EQUAL(lcm_evaluator()(-1, -1), static_cast(1)); + BOOST_CHECK_EQUAL(lcm_evaluator()(0, 0), static_cast(0)); + BOOST_CHECK_EQUAL(lcm_evaluator()(6, 0), static_cast(0)); + BOOST_CHECK_EQUAL(lcm_evaluator()(0, 7), static_cast(0)); + BOOST_CHECK_EQUAL(lcm_evaluator()(-5, 0), static_cast(0)); + BOOST_CHECK_EQUAL(lcm_evaluator()(0, -4), static_cast(0)); + BOOST_CHECK_EQUAL(lcm_evaluator()(18, 30), static_cast(90)); + BOOST_CHECK_EQUAL(lcm_evaluator()(-6, 9), static_cast(18)); + BOOST_CHECK_EQUAL(lcm_evaluator()(-10, -10), static_cast(10)); + BOOST_CHECK_EQUAL(lcm_evaluator()(25, -10), static_cast(50)); + BOOST_CHECK_EQUAL(lcm_evaluator()(3, 7), static_cast(21)); + BOOST_CHECK_EQUAL(lcm_evaluator()(8, 9), static_cast(72)); + BOOST_CHECK_EQUAL(lcm_evaluator()(7, 49), static_cast(49)); } // LCM on unmarked signed integer type @@ -415,22 +451,22 @@ BOOST_AUTO_TEST_CASE( lcm_unmarked_int_test ) // then does an absolute-value on the result. Signed types that are not // marked as such (due to no std::numeric_limits specialization) may be off // by a sign. - BOOST_CHECK_EQUAL( abs(lcm( 1, -1 )), MyInt2( 1) ); - BOOST_CHECK_EQUAL( abs(lcm( -1, 1 )), MyInt2( 1) ); - BOOST_CHECK_EQUAL( abs(lcm( 1, 1 )), MyInt2( 1) ); - BOOST_CHECK_EQUAL( abs(lcm( -1, -1 )), MyInt2( 1) ); - BOOST_CHECK_EQUAL( abs(lcm( 0, 0 )), MyInt2( 0) ); - BOOST_CHECK_EQUAL( abs(lcm( 6, 0 )), MyInt2( 0) ); - BOOST_CHECK_EQUAL( abs(lcm( 0, 7 )), MyInt2( 0) ); - BOOST_CHECK_EQUAL( abs(lcm( -5, 0 )), MyInt2( 0) ); - BOOST_CHECK_EQUAL( abs(lcm( 0, -4 )), MyInt2( 0) ); - BOOST_CHECK_EQUAL( abs(lcm( 18, 30 )), MyInt2(90) ); - BOOST_CHECK_EQUAL( abs(lcm( -6, 9 )), MyInt2(18) ); - BOOST_CHECK_EQUAL( abs(lcm( -10, -10 )), MyInt2(10) ); - BOOST_CHECK_EQUAL( abs(lcm( 25, -10 )), MyInt2(50) ); - BOOST_CHECK_EQUAL( abs(lcm( 3, 7 )), MyInt2(21) ); - BOOST_CHECK_EQUAL( abs(lcm( 8, 9 )), MyInt2(72) ); - BOOST_CHECK_EQUAL( abs(lcm( 7, 49 )), MyInt2(49) ); + BOOST_CHECK_EQUAL( abs(lcm( static_cast(1), static_cast(-1) )), MyInt2( 1) ); + BOOST_CHECK_EQUAL( abs(lcm(static_cast(-1), static_cast(1) )), MyInt2( 1) ); + BOOST_CHECK_EQUAL( abs(lcm(static_cast(1), static_cast(1) )), MyInt2( 1) ); + BOOST_CHECK_EQUAL( abs(lcm(static_cast(-1), static_cast(-1) )), MyInt2( 1) ); + BOOST_CHECK_EQUAL( abs(lcm(static_cast(0), static_cast(0) )), MyInt2( 0) ); + BOOST_CHECK_EQUAL( abs(lcm(static_cast(6), static_cast(0) )), MyInt2( 0) ); + BOOST_CHECK_EQUAL( abs(lcm(static_cast(0), static_cast(7) )), MyInt2( 0) ); + BOOST_CHECK_EQUAL( abs(lcm(static_cast(-5), static_cast(0) )), MyInt2( 0) ); + BOOST_CHECK_EQUAL( abs(lcm(static_cast(0), static_cast(-4) )), MyInt2( 0) ); + BOOST_CHECK_EQUAL( abs(lcm(static_cast(18), static_cast(30) )), MyInt2(90) ); + BOOST_CHECK_EQUAL( abs(lcm(static_cast(-6), static_cast(9) )), MyInt2(18) ); + BOOST_CHECK_EQUAL( abs(lcm(static_cast(-10), static_cast(-10) )), MyInt2(10) ); + BOOST_CHECK_EQUAL( abs(lcm(static_cast(25), static_cast(-10) )), MyInt2(50) ); + BOOST_CHECK_EQUAL( abs(lcm(static_cast(3), static_cast(7) )), MyInt2(21) ); + BOOST_CHECK_EQUAL( abs(lcm(static_cast(8), static_cast(9) )), MyInt2(72) ); + BOOST_CHECK_EQUAL( abs(lcm(static_cast(7), static_cast(49) )), MyInt2(49) ); } // LCM on unsigned integer types @@ -444,14 +480,14 @@ BOOST_AUTO_TEST_CASE_TEMPLATE( lcm_unsigned_test, T, unsigned_test_types ) // Note that unmarked types (i.e. have no std::numeric_limits // specialization) are treated like non/unsigned types - BOOST_CHECK_EQUAL( lcm( 1u, 1u), static_cast( 1u) ); - BOOST_CHECK_EQUAL( lcm( 0u, 0u), static_cast( 0u) ); - BOOST_CHECK_EQUAL( lcm( 6u, 0u), static_cast( 0u) ); - BOOST_CHECK_EQUAL( lcm( 0u, 7u), static_cast( 0u) ); - BOOST_CHECK_EQUAL( lcm(18u, 30u), static_cast(90u) ); - BOOST_CHECK_EQUAL( lcm( 3u, 7u), static_cast(21u) ); - BOOST_CHECK_EQUAL( lcm( 8u, 9u), static_cast(72u) ); - BOOST_CHECK_EQUAL( lcm( 7u, 49u), static_cast(49u) ); + BOOST_CHECK_EQUAL( lcm(static_cast(1u), static_cast(1u)), static_cast( 1u) ); + BOOST_CHECK_EQUAL( lcm(static_cast(0u), static_cast(0u)), static_cast( 0u) ); + BOOST_CHECK_EQUAL( lcm(static_cast(6u), static_cast(0u)), static_cast( 0u) ); + BOOST_CHECK_EQUAL( lcm(static_cast(0u), static_cast(7u)), static_cast( 0u) ); + BOOST_CHECK_EQUAL( lcm(static_cast(18u), static_cast(30u)), static_cast(90u) ); + BOOST_CHECK_EQUAL( lcm(static_cast(3u), static_cast(7u)), static_cast(21u) ); + BOOST_CHECK_EQUAL( lcm(static_cast(8u), static_cast(9u)), static_cast(72u) ); + BOOST_CHECK_EQUAL( lcm(static_cast(7u), static_cast(49u)), static_cast(49u) ); } // LCM at compile-time @@ -477,4 +513,29 @@ BOOST_AUTO_TEST_CASE( lcm_static_test ) // TODO: see GCD to-do +BOOST_AUTO_TEST_CASE(variadics) +{ + unsigned i[] = { 44, 56, 76, 88 }; + BOOST_CHECK_EQUAL(boost::math::gcd_range(i, i + 4).first, 4); + BOOST_CHECK_EQUAL(boost::math::gcd_range(i, i + 4).second, i + 4); + BOOST_CHECK_EQUAL(boost::math::lcm_range(i, i + 4).first, 11704); + BOOST_CHECK_EQUAL(boost::math::lcm_range(i, i + 4).second, i + 4); +#ifndef BOOST_NO_CXX11_VARIADIC_TEMPLATES + BOOST_CHECK_EQUAL(boost::math::gcd(i[0], i[1], i[2], i[3]), 4); + BOOST_CHECK_EQUAL(boost::math::lcm(i[0], i[1], i[2], i[3]), 11704); +#endif +} + +// Test case from Boost.Rational, need to make sure we don't break the rational lib: +BOOST_AUTO_TEST_CASE_TEMPLATE(gcd_and_lcm_on_rationals, T, signed_test_types) +{ + typedef boost::rational rational; + BOOST_CHECK_EQUAL(boost::math::gcd(rational(1, 4), rational(1, 3)), + rational(1, 12)); + BOOST_CHECK_EQUAL(boost::math::lcm(rational(1, 4), rational(1, 3)), + rational(1)); +} + + BOOST_AUTO_TEST_SUITE_END() + diff --git a/test/compile_test/barycentric_rational_concept_test.cpp b/test/compile_test/barycentric_rational_concept_test.cpp new file mode 100644 index 000000000..2fae9046b --- /dev/null +++ b/test/compile_test/barycentric_rational_concept_test.cpp @@ -0,0 +1,15 @@ +// Copyright John Maddock 2017. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// +#include +#include + +void compile_and_link_test() +{ + boost::math::concepts::std_real_concept x[] = { 1, 2, 3 }; + boost::math::concepts::std_real_concept y[] = { 13, 15, 17 }; + boost::math::barycentric_rational s(x, y, 3, 3); + s(1.0); +} diff --git a/test/compile_test/barycentric_rational_incl_test.cpp b/test/compile_test/barycentric_rational_incl_test.cpp new file mode 100644 index 000000000..fc1e71d75 --- /dev/null +++ b/test/compile_test/barycentric_rational_incl_test.cpp @@ -0,0 +1,27 @@ +// Copyright John Maddock 2017. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// +// Basic sanity check that header +// #includes all the files that it needs to. +// + +#ifdef _MSC_VER +#pragma warning(disable:4459) +#endif + +#include +// +// Note this header includes no other headers, this is +// important if this test is to be meaningful: +// +#include "test_compile_result.hpp" + +void compile_and_link_test() +{ + double data[] = { 1, 2, 3 }; + double y[] = { 34, 56, 67 }; + boost::math::barycentric_rational s(data, y, 3, 2); + check_result(s(1.0)); +} diff --git a/test/compile_test/common_factor_ct_inc_test.cpp b/test/compile_test/common_factor_ct_inc_test.cpp new file mode 100644 index 000000000..723ba0201 --- /dev/null +++ b/test/compile_test/common_factor_ct_inc_test.cpp @@ -0,0 +1,29 @@ +// Copyright John Maddock 2017. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// +// Basic sanity check that header +// #includes all the files that it needs to. +// +#include + +template +struct static_value_check; + +template +struct static_value_check +{ + static const boost::math::static_gcd_type value = a; +}; + + +void compile_and_link_test() +{ + typedef static_value_check::value, 6> checked_type; + boost::math::static_gcd_type result = checked_type::value; + (void)result; + typedef static_value_check::value, 90> checked_type_2; + boost::math::static_gcd_type result_2 = checked_type_2::value; + (void)result_2; +} diff --git a/test/compile_test/common_factor_rt_inc_test.cpp b/test/compile_test/common_factor_rt_inc_test.cpp new file mode 100644 index 000000000..a2fb0f26c --- /dev/null +++ b/test/compile_test/common_factor_rt_inc_test.cpp @@ -0,0 +1,28 @@ +// Copyright John Maddock 2017. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// +// Basic sanity check that header +// #includes all the files that it needs to. +// +#include +// +// Note this header includes no other headers, this is +// important if this test is to be meaningful: +// +#include "test_compile_result.hpp" + +inline void check_result_imp(std::pair, std::pair) {} + + +void compile_and_link_test() +{ + int i(3), j(4); + check_result(boost::math::gcd(i, j)); + check_result(boost::math::lcm(i, j)); + + unsigned long arr[] = { 45, 56, 99, 101 }; + check_result >(boost::math::gcd_range(&arr[0], &arr[0] + 4)); + +} diff --git a/test/compile_test/cubic_spline_concept_test.cpp b/test/compile_test/cubic_spline_concept_test.cpp new file mode 100644 index 000000000..4872218aa --- /dev/null +++ b/test/compile_test/cubic_spline_concept_test.cpp @@ -0,0 +1,15 @@ +// Copyright John Maddock 2006. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// +#include +#include + +void compile_and_link_test() +{ + boost::math::concepts::std_real_concept data[] = { 1, 2, 3 }; + boost::math::cubic_b_spline s(data, 3, 2, 1), s2; + s(1.0); + s.prime(1.0); +} diff --git a/test/compile_test/cubic_spline_incl_test.cpp b/test/compile_test/cubic_spline_incl_test.cpp new file mode 100644 index 000000000..bc69f657b --- /dev/null +++ b/test/compile_test/cubic_spline_incl_test.cpp @@ -0,0 +1,22 @@ +// Copyright John Maddock 2006. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// +// Basic sanity check that header +// #includes all the files that it needs to. +// +#include +// +// Note this header includes no other headers, this is +// important if this test is to be meaningful: +// +#include "test_compile_result.hpp" + +void compile_and_link_test() +{ + double data[] = { 1, 2, 3 }; + boost::math::cubic_b_spline s(data, 3, 2, 1), s2; + check_result(s(1.0)); + check_result(s.prime(1.0)); +} diff --git a/test/compile_test/instantiate.hpp b/test/compile_test/instantiate.hpp index e3930a2dd..414c8f93a 100644 --- a/test/compile_test/instantiate.hpp +++ b/test/compile_test/instantiate.hpp @@ -222,6 +222,7 @@ void instantiate(RealType) boost::math::legendre_p(1, v1); boost::math::legendre_p(1, 0, v1); boost::math::legendre_q(1, v1); + boost::math::legendre_p_prime(1, v1); boost::math::legendre_next(2, v1, v2, v3); boost::math::legendre_next(2, 2, v1, v2, v3); boost::math::laguerre(1, v1); @@ -416,6 +417,7 @@ void instantiate(RealType) boost::math::powm1(v1 * 1, v2 + 0); boost::math::legendre_p(1, v1 * 1); boost::math::legendre_p(1, 0, v1 * 1); + boost::math::legendre_p_prime(1, v1 * 1); boost::math::legendre_q(1, v1 * 1); boost::math::legendre_next(2, v1 * 1, v2 + 0, v3 / 1); boost::math::legendre_next(2, 2, v1 * 1, v2 + 0, v3 / 1); @@ -592,6 +594,7 @@ void instantiate(RealType) boost::math::powm1(v1, v2, pol); boost::math::legendre_p(1, v1, pol); boost::math::legendre_p(1, 0, v1, pol); + boost::math::legendre_p_prime(1, v1 * 1, pol); boost::math::legendre_q(1, v1, pol); boost::math::legendre_next(2, v1, v2, v3); boost::math::legendre_next(2, 2, v1, v2, v3); @@ -787,6 +790,7 @@ void instantiate(RealType) test::powm1(v1, v2); test::legendre_p(1, v1); test::legendre_p(1, 0, v1); + test::legendre_p_prime(1, v1 * 1); test::legendre_q(1, v1); test::legendre_next(2, v1, v2, v3); test::legendre_next(2, 2, v1, v2, v3); diff --git a/test/compile_test/sf_legendre_incl_test.cpp b/test/compile_test/sf_legendre_incl_test.cpp index 48adc76b3..725868bc1 100644 --- a/test/compile_test/sf_legendre_incl_test.cpp +++ b/test/compile_test/sf_legendre_incl_test.cpp @@ -20,6 +20,11 @@ void compile_and_link_test() #ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS check_result(boost::math::legendre_p(i, l)); #endif + check_result(boost::math::legendre_p_prime(i, f)); + check_result(boost::math::legendre_p_prime(i, d)); +#ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS + check_result(boost::math::legendre_p_prime(i, l)); +#endif check_result(boost::math::legendre_p(i, i, f)); check_result(boost::math::legendre_p(i, i, d)); diff --git a/test/compile_test/sf_legendre_stieltjes_concept_test.cpp b/test/compile_test/sf_legendre_stieltjes_concept_test.cpp new file mode 100644 index 000000000..e66a83718 --- /dev/null +++ b/test/compile_test/sf_legendre_stieltjes_concept_test.cpp @@ -0,0 +1,13 @@ +// Copyright John Maddock 2006. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// +// Basic sanity check that header +// #includes all the files that it needs to. +// + +#include +#include + +template class boost::math::legendre_stieltjes; diff --git a/test/compile_test/sf_legendre_stieltjes_incl_test.cpp b/test/compile_test/sf_legendre_stieltjes_incl_test.cpp new file mode 100644 index 000000000..dd2e24d91 --- /dev/null +++ b/test/compile_test/sf_legendre_stieltjes_incl_test.cpp @@ -0,0 +1,26 @@ +// Copyright John Maddock 2006. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// +// Basic sanity check that header +// #includes all the files that it needs to. +// +#include +// +// Note this header includes no other headers, this is +// important if this test is to be meaningful: +// +#include "test_compile_result.hpp" + +void compile_and_link_test() +{ + boost::math::legendre_stieltjes lsf(3); + boost::math::legendre_stieltjes lsd(3); + check_result(lsf(f)); + check_result(lsd(d)); +#ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS + boost::math::legendre_stieltjes lsl(3); + check_result(lsl(l)); +#endif +} diff --git a/test/legendre_stieltjes_test.cpp b/test/legendre_stieltjes_test.cpp new file mode 100644 index 000000000..80e6e832c --- /dev/null +++ b/test/legendre_stieltjes_test.cpp @@ -0,0 +1,141 @@ +// Copyright Nick Thompson 2017. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +#define BOOST_TEST_MAIN + +#include +#include +#include +#include +#include + + +using boost::math::legendre_stieltjes; +using boost::math::legendre_p; +using boost::multiprecision::cpp_bin_float_quad; + + +template +void test_legendre_stieltjes() +{ + std::cout << std::setprecision(std::numeric_limits::digits10); + using std::sqrt; + using std::abs; + using boost::math::constants::third; + using boost::math::constants::half; + + Real tol = std::numeric_limits::epsilon(); + legendre_stieltjes ls1(1); + legendre_stieltjes ls2(2); + legendre_stieltjes ls3(3); + legendre_stieltjes ls4(4); + legendre_stieltjes ls5(5); + legendre_stieltjes ls8(8); + Real x = -1; + while(x <= 1) + { + BOOST_CHECK_CLOSE_FRACTION(ls1(x), x, tol); + BOOST_CHECK_CLOSE_FRACTION(ls1.prime(x), 1, tol); + + Real p2 = legendre_p(2, x); + BOOST_CHECK_CLOSE_FRACTION(ls2(x), p2 - 2/static_cast(5), tol); + BOOST_CHECK_CLOSE_FRACTION(ls2.prime(x), 3*x, tol); + + Real p3 = legendre_p(3, x); + BOOST_CHECK_CLOSE_FRACTION(ls3(x), p3 - 9*x/static_cast(14), 100*tol); + BOOST_CHECK_CLOSE_FRACTION(ls3.prime(x), 15*x*x*half() -3*half()-9/static_cast(14), 100*tol); + + Real p4 = legendre_p(4, x); + //-20P_2(x)/27 + 14P_0(x)/891 + Real E4 = p4 - 20*p2/static_cast(27) + 14/static_cast(891); + BOOST_CHECK_CLOSE_FRACTION(ls4(x), E4, 250*tol); + BOOST_CHECK_CLOSE_FRACTION(ls4.prime(x), 35*x*(9*x*x -5)/static_cast(18), 250*tol); + + Real p5 = legendre_p(5, x); + Real E5 = p5 - 35*p3/static_cast(44) + 135*x/static_cast(12584); + BOOST_CHECK_CLOSE_FRACTION(ls5(x), E5, 29000*tol); + Real E5prime = (315*(123 + 143*x*x*(11*x*x-9)))/static_cast(12584); + BOOST_CHECK_CLOSE_FRACTION(ls5.prime(x), E5prime, 29000*tol); + x += 1/static_cast(1 << 9); + } + + // Test norm: + // E_1 = x + Real expected_norm_sq = 2*third(); + BOOST_CHECK_CLOSE_FRACTION(expected_norm_sq, ls1.norm_sq(), tol); + + // E_2 = P[sub 2](x) - 2P[sup 0](x)/5 + expected_norm_sq = 2/static_cast(5) + 8/static_cast(25); + BOOST_CHECK_CLOSE_FRACTION(expected_norm_sq, ls2.norm_sq(), tol); + + // E_3 = P[sub 3](x) - 9P[sub 1]/14 + expected_norm_sq = 2/static_cast(7) + 9*9*2*third()/static_cast(14*14); + BOOST_CHECK_CLOSE_FRACTION(expected_norm_sq, ls3.norm_sq(), tol); + + // E_4 = P[sub 4](x) -20P[sub 2](x)/27 + 14P[sub 0](x)/891 + expected_norm_sq = static_cast(2)/static_cast(9) + static_cast(20*20*2)/static_cast(27*27*5) + 14*14*2/static_cast(891*891); + BOOST_CHECK_CLOSE_FRACTION(expected_norm_sq, ls4.norm_sq(), tol); + + // E_5 = P[sub 5](x) - 35P[sub 3](x)/44 + 135P[sub 1](x)/12584 + expected_norm_sq = 2/static_cast(11) + (35*35/static_cast(44*44))*(2/static_cast(7)) + (135*135/static_cast(12584*12584))*2*third(); + BOOST_CHECK_CLOSE_FRACTION(expected_norm_sq, ls5.norm_sq(), tol); + + // Only zero of E1 is 0: + std::vector zeros = ls1.zeros(); + BOOST_CHECK(zeros.size() == 1); + BOOST_CHECK_SMALL(zeros[0], tol); + BOOST_CHECK_SMALL(ls1(zeros[0]), tol); + + zeros = ls2.zeros(); + BOOST_CHECK(zeros.size() == 1); + BOOST_CHECK_CLOSE_FRACTION(zeros[0], sqrt(3/static_cast(5)), tol); + BOOST_CHECK_SMALL(ls2(zeros[0]), tol); + + zeros = ls3.zeros(); + BOOST_CHECK(zeros.size() == 2); + BOOST_CHECK_SMALL(zeros[0], tol); + BOOST_CHECK_CLOSE_FRACTION(zeros[1], sqrt(6/static_cast(7)), tol); + + + zeros = ls4.zeros(); + BOOST_CHECK(zeros.size() == 2); + Real expected = sqrt( (55 - 2*sqrt(static_cast(330)))/static_cast(11) )/static_cast(3); + BOOST_CHECK_CLOSE_FRACTION(zeros[0], expected, tol); + + expected = sqrt( (55 + 2*sqrt(static_cast(330)))/static_cast(11) )/static_cast(3); + BOOST_CHECK_CLOSE_FRACTION(zeros[1], expected, 10*tol); + + + zeros = ls5.zeros(); + BOOST_CHECK(zeros.size() == 3); + BOOST_CHECK_SMALL(zeros[0], tol); + + expected = sqrt( ( 195 - sqrt(static_cast(6045)) )/static_cast(286)); + BOOST_CHECK_CLOSE_FRACTION(zeros[1], expected, tol); + + expected = sqrt( ( 195 + sqrt(static_cast(6045)) )/static_cast(286)); + BOOST_CHECK_CLOSE_FRACTION(zeros[2], expected, tol); + + + for (size_t i = 6; i < 50; ++i) + { + legendre_stieltjes En(i); + zeros = En.zeros(); + for(auto const & zero : zeros) + { + BOOST_CHECK_SMALL(En(zero), 50*tol); + } + } +} + + +BOOST_AUTO_TEST_CASE(LegendreStieltjesZeros) +{ + test_legendre_stieltjes(); + test_legendre_stieltjes(); + test_legendre_stieltjes(); + //test_legendre_stieltjes(); +} diff --git a/test/test_barycentric_rational.cpp b/test/test_barycentric_rational.cpp new file mode 100644 index 000000000..7c6036c79 --- /dev/null +++ b/test/test_barycentric_rational.cpp @@ -0,0 +1,249 @@ +#define BOOST_TEST_MODULE barycentric_rational + +#include +#include +#include +#include +#include +#include +#include + +#ifdef BOOST_HAS_FLOAT128 +#include +#endif + +using boost::multiprecision::cpp_bin_float_50; + +template +void test_interpolation_condition() +{ + std::cout << "Testing interpolation condition for barycentric interpolation on type " << boost::typeindex::type_id().pretty_name() << "\n"; + std::random_device rd; + std::mt19937 gen(rd()); + boost::random::uniform_real_distribution dis(0.1f, 1); + std::vector x(500); + std::vector y(500); + x[0] = dis(gen); + y[0] = dis(gen); + for (size_t i = 1; i < x.size(); ++i) + { + x[i] = x[i-1] + dis(gen); + y[i] = dis(gen); + } + + boost::math::barycentric_rational interpolator(x.data(), y.data(), y.size()); + + for (size_t i = 0; i < x.size(); ++i) + { + auto z = interpolator(x[i]); + BOOST_CHECK_CLOSE(z, y[i], 100*std::numeric_limits::epsilon()); + } +} + +template +void test_interpolation_condition_high_order() +{ + std::cout << "Testing interpolation condition in high order for barycentric interpolation on type " << boost::typeindex::type_id().pretty_name() << "\n"; + std::random_device rd; + std::mt19937 gen(rd()); + boost::random::uniform_real_distribution dis(0.1f, 1); + std::vector x(500); + std::vector y(500); + x[0] = dis(gen); + y[0] = dis(gen); + for (size_t i = 1; i < x.size(); ++i) + { + x[i] = x[i-1] + dis(gen); + y[i] = dis(gen); + } + + // Order 5 approximation: + boost::math::barycentric_rational interpolator(x.data(), y.data(), y.size(), 5); + + for (size_t i = 0; i < x.size(); ++i) + { + auto z = interpolator(x[i]); + BOOST_CHECK_CLOSE(z, y[i], 100*std::numeric_limits::epsilon()); + } +} + + +template +void test_constant() +{ + std::cout << "Testing that constants are interpolated correctly using barycentric interpolation on type " << boost::typeindex::type_id().pretty_name() << "\n"; + + std::random_device rd; + std::mt19937 gen(rd()); + boost::random::uniform_real_distribution dis(0.1f, 1); + std::vector x(500); + std::vector y(500); + Real constant = -8; + x[0] = dis(gen); + y[0] = constant; + for (size_t i = 1; i < x.size(); ++i) + { + x[i] = x[i-1] + dis(gen); + y[i] = y[0]; + } + + boost::math::barycentric_rational interpolator(x.data(), y.data(), y.size()); + + for (size_t i = 0; i < x.size(); ++i) + { + // Don't evaluate the constant at x[i]; that's already tested in the interpolation condition test. + auto z = interpolator(x[i] + dis(gen)); + BOOST_CHECK_CLOSE(z, constant, 100*sqrt(std::numeric_limits::epsilon())); + } +} + +template +void test_constant_high_order() +{ + std::cout << "Testing that constants are interpolated correctly in high order using barycentric interpolation on type " << boost::typeindex::type_id().pretty_name() << "\n"; + + std::random_device rd; + std::mt19937 gen(rd()); + boost::random::uniform_real_distribution dis(0.1f, 1); + std::vector x(500); + std::vector y(500); + Real constant = 5; + x[0] = dis(gen); + y[0] = constant; + for (size_t i = 1; i < x.size(); ++i) + { + x[i] = x[i-1] + dis(gen); + y[i] = y[0]; + } + + // Set interpolation order to 7: + boost::math::barycentric_rational interpolator(x.data(), y.data(), y.size(), 7); + + for (size_t i = 0; i < x.size(); ++i) + { + auto z = interpolator(x[i] + dis(gen)); + BOOST_CHECK_CLOSE(z, constant, 1000*sqrt(std::numeric_limits::epsilon())); + } +} + + +template +void test_runge() +{ + std::cout << "Testing interpolation of Runge's 1/(1+25x^2) function using barycentric interpolation on type " << boost::typeindex::type_id().pretty_name() << "\n"; + + std::random_device rd; + std::mt19937 gen(rd()); + boost::random::uniform_real_distribution dis(0.005f, 0.01f); + std::vector x(500); + std::vector y(500); + x[0] = -2; + y[0] = 1/(1+25*x[0]*x[0]); + for (size_t i = 1; i < x.size(); ++i) + { + x[i] = x[i-1] + dis(gen); + y[i] = 1/(1+25*x[i]*x[i]); + } + + boost::math::barycentric_rational interpolator(x.data(), y.data(), y.size(), 5); + + for (size_t i = 0; i < x.size(); ++i) + { + auto t = x[i] + dis(gen); + auto z = interpolator(t); + BOOST_CHECK_CLOSE(z, 1/(1+25*t*t), 0.01); + } +} + +template +void test_weights() +{ + std::cout << "Testing weights are calculated correctly using barycentric interpolation on type " << boost::typeindex::type_id().pretty_name() << "\n"; + + std::random_device rd; + std::mt19937 gen(rd()); + boost::random::uniform_real_distribution dis(0.005, 0.01); + std::vector x(500); + std::vector y(500); + x[0] = -2; + y[0] = 1/(1+25*x[0]*x[0]); + for (size_t i = 1; i < x.size(); ++i) + { + x[i] = x[i-1] + dis(gen); + y[i] = 1/(1+25*x[i]*x[i]); + } + + boost::math::detail::barycentric_rational_imp interpolator(x.data(), x.data() + x.size(), y.data(), 0); + + for (size_t i = 0; i < x.size(); ++i) + { + auto w = interpolator.weight(i); + if (i % 2 == 0) + { + BOOST_CHECK_CLOSE(w, 1, 0.00001); + } + else + { + BOOST_CHECK_CLOSE(w, -1, 0.00001); + } + } + + // d = 1: + interpolator = boost::math::detail::barycentric_rational_imp(x.data(), x.data() + x.size(), y.data(), 1); + + for (size_t i = 1; i < x.size() -1; ++i) + { + auto w = interpolator.weight(i); + auto w_expect = 1/(x[i] - x[i - 1]) + 1/(x[i+1] - x[i]); + if (i % 2 == 0) + { + BOOST_CHECK_CLOSE(w, -w_expect, 0.00001); + } + else + { + BOOST_CHECK_CLOSE(w, w_expect, 0.00001); + } + } + +} + + +BOOST_AUTO_TEST_CASE(barycentric_rational) +{ + test_weights(); + test_constant(); + test_constant(); + test_constant(); + test_constant(); + + test_constant_high_order(); + test_constant_high_order(); + test_constant_high_order(); + test_constant_high_order(); + + test_interpolation_condition(); + test_interpolation_condition(); + test_interpolation_condition(); + test_interpolation_condition(); + + test_interpolation_condition_high_order(); + test_interpolation_condition_high_order(); + test_interpolation_condition_high_order(); + test_interpolation_condition_high_order(); + + test_runge(); + test_runge(); + test_runge(); + test_runge(); + + #ifdef __GNUC__ + #ifndef __clang__ + test_interpolation_condition(); + test_constant(); + test_constant_high_order(); + test_interpolation_condition_high_order(); + test_runge(); + #endif + #endif + +} diff --git a/test/test_common_factor_gmpxx.cpp b/test/test_common_factor_gmpxx.cpp index e5d1188b3..7f1299958 100644 --- a/test/test_common_factor_gmpxx.cpp +++ b/test/test_common_factor_gmpxx.cpp @@ -7,8 +7,8 @@ #include #include -template mpz_class boost::math::gcd(const mpz_class&, const mpz_class&); -template mpz_class boost::math::lcm(const mpz_class&, const mpz_class&); +template mpz_class boost::integer::gcd(const mpz_class&, const mpz_class&); +template mpz_class boost::integer::lcm(const mpz_class&, const mpz_class&); int main() { diff --git a/test/test_cubic_b_spline.cpp b/test/test_cubic_b_spline.cpp new file mode 100644 index 000000000..49ec104ca --- /dev/null +++ b/test/test_cubic_b_spline.cpp @@ -0,0 +1,338 @@ +#define BOOST_TEST_MODULE test_cubic_b_spline + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using boost::multiprecision::cpp_bin_float_50; +using boost::math::constants::third; +using boost::math::constants::half; + +template +void test_b3_spline() +{ + std::cout << "Testing evaluation of spline basis functions on type " << boost::typeindex::type_id().pretty_name() << "\n"; + // Outside the support: + Real eps = std::numeric_limits::epsilon(); + BOOST_CHECK_SMALL(boost::math::detail::b3_spline(2.5), (Real) 0); + BOOST_CHECK_SMALL(boost::math::detail::b3_spline(-2.5), (Real) 0); + BOOST_CHECK_SMALL(boost::math::detail::b3_spline_prime(2.5), (Real) 0); + BOOST_CHECK_SMALL(boost::math::detail::b3_spline_prime(-2.5), (Real) 0); + + // On the boundary of support: + BOOST_CHECK_SMALL(boost::math::detail::b3_spline(2), (Real) 0); + BOOST_CHECK_SMALL(boost::math::detail::b3_spline(-2), (Real) 0); + BOOST_CHECK_SMALL(boost::math::detail::b3_spline_prime(2), (Real) 0); + BOOST_CHECK_SMALL(boost::math::detail::b3_spline_prime(-2), (Real) 0); + + // Special values: + BOOST_CHECK_CLOSE(boost::math::detail::b3_spline(-1), third()*half(), eps); + BOOST_CHECK_CLOSE(boost::math::detail::b3_spline( 1), third()*half(), eps); + BOOST_CHECK_CLOSE(boost::math::detail::b3_spline(0), 2*third(), eps); + + BOOST_CHECK_CLOSE(boost::math::detail::b3_spline_prime(-1), half(), eps); + BOOST_CHECK_CLOSE(boost::math::detail::b3_spline_prime( 1), -half(), eps); + BOOST_CHECK_SMALL(boost::math::detail::b3_spline_prime(0), eps); + + // Properties: B3 is an even function, B3' is an odd function. + for (size_t i = 1; i < 200; ++i) + { + Real arg = i*0.01; + BOOST_CHECK_CLOSE(boost::math::detail::b3_spline(arg), boost::math::detail::b3_spline(arg), eps); + BOOST_CHECK_CLOSE(boost::math::detail::b3_spline_prime(-arg), -boost::math::detail::b3_spline_prime(arg), eps); + } + +} +/* + * This test ensures that the interpolant s(x_j) = f(x_j) at all grid points. + */ +template +void test_interpolation_condition() +{ + using std::sqrt; + std::cout << "Testing interpolation condition for cubic b splines on type " << boost::typeindex::type_id().pretty_name() << "\n"; + std::random_device rd; + std::mt19937 gen(rd()); + boost::random::uniform_real_distribution dis(1, 10); + std::vector v(5000); + for (size_t i = 0; i < v.size(); ++i) + { + v[i] = dis(gen); + } + + Real step = 0.01; + Real a = 5; + boost::math::cubic_b_spline spline(v.data(), v.size(), a, step); + + for (size_t i = 0; i < v.size(); ++i) + { + Real y = spline(i*step + a); + // This seems like a very large tolerance, but I don't know of any other interpolators + // that will be able to do much better on random data. + BOOST_CHECK_CLOSE(y, v[i], 10000*sqrt(std::numeric_limits::epsilon())); + } + +} + + +template +void test_constant_function() +{ + std::cout << "Testing that constants are interpolated correctly by cubic b splines on type " << boost::typeindex::type_id().pretty_name() << "\n"; + std::vector v(500); + Real constant = 50.2; + for (size_t i = 0; i < v.size(); ++i) + { + v[i] = 50.2; + } + + Real step = 0.02; + Real a = 5; + boost::math::cubic_b_spline spline(v.data(), v.size(), a, step); + + for (size_t i = 0; i < v.size(); ++i) + { + // Do not test at interpolation point; we already know it works there: + Real y = spline(i*step + a + 0.001); + BOOST_CHECK_CLOSE(y, constant, 10*std::numeric_limits::epsilon()); + Real y_prime = spline.prime(i*step + a + 0.002); + BOOST_CHECK_SMALL(y_prime, 5000*std::numeric_limits::epsilon()); + } + + // Test that correctly specified left and right-derivatives work properly: + spline = boost::math::cubic_b_spline(v.data(), v.size(), a, step, 0, 0); + + for (size_t i = 0; i < v.size(); ++i) + { + Real y = spline(i*step + a + 0.002); + BOOST_CHECK_CLOSE(y, constant, std::numeric_limits::epsilon()); + Real y_prime = spline.prime(i*step + a + 0.002); + BOOST_CHECK_SMALL(y_prime, std::numeric_limits::epsilon()); + } + + // + // Again with iterator constructor: + // + boost::math::cubic_b_spline spline2(v.begin(), v.end(), a, step); + + for (size_t i = 0; i < v.size(); ++i) + { + // Do not test at interpolation point; we already know it works there: + Real y = spline2(i*step + a + 0.001); + BOOST_CHECK_CLOSE(y, constant, 10 * std::numeric_limits::epsilon()); + Real y_prime = spline2.prime(i*step + a + 0.002); + BOOST_CHECK_SMALL(y_prime, 5000 * std::numeric_limits::epsilon()); + } + + // Test that correctly specified left and right-derivatives work properly: + spline2 = boost::math::cubic_b_spline(v.begin(), v.end(), a, step, 0, 0); + + for (size_t i = 0; i < v.size(); ++i) + { + Real y = spline2(i*step + a + 0.002); + BOOST_CHECK_CLOSE(y, constant, std::numeric_limits::epsilon()); + Real y_prime = spline2.prime(i*step + a + 0.002); + BOOST_CHECK_SMALL(y_prime, std::numeric_limits::epsilon()); + } +} + + +template +void test_affine_function() +{ + using std::sqrt; + std::cout << "Testing that affine functions are interpolated correctly by cubic b splines on type " << boost::typeindex::type_id().pretty_name() << "\n"; + std::vector v(500); + Real a = 10; + Real b = 8; + Real step = 0.005; + + auto f = [a, b](Real x) { return a*x + b; }; + for (size_t i = 0; i < v.size(); ++i) + { + v[i] = f(i*step); + } + + boost::math::cubic_b_spline spline(v.data(), v.size(), 0, step); + + for (size_t i = 0; i < v.size() - 1; ++i) + { + Real arg = i*step + 0.0001; + Real y = spline(arg); + BOOST_CHECK_CLOSE(y, f(arg), sqrt(std::numeric_limits::epsilon())); + Real y_prime = spline.prime(arg); + BOOST_CHECK_CLOSE(y_prime, a, 100*sqrt(std::numeric_limits::epsilon())); + } + + // Test that correctly specified left and right-derivatives work properly: + spline = boost::math::cubic_b_spline(v.data(), v.size(), 0, step, a, a); + + for (size_t i = 0; i < v.size() - 1; ++i) + { + Real arg = i*step + 0.0001; + Real y = spline(arg); + BOOST_CHECK_CLOSE(y, f(arg), sqrt(std::numeric_limits::epsilon())); + Real y_prime = spline.prime(arg); + BOOST_CHECK_CLOSE(y_prime, a, 100*sqrt(std::numeric_limits::epsilon())); + } +} + + +template +void test_quadratic_function() +{ + using std::sqrt; + std::cout << "Testing that quadratic functions are interpolated correctly by cubic b splines on type " << boost::typeindex::type_id().pretty_name() << "\n"; + std::vector v(500); + Real a = 1.2; + Real b = -3.4; + Real c = -8.6; + Real step = 0.01; + + auto f = [a, b, c](Real x) { return a*x*x + b*x + c; }; + for (size_t i = 0; i < v.size(); ++i) + { + v[i] = f(i*step); + } + + boost::math::cubic_b_spline spline(v.data(), v.size(), 0, step); + + for (size_t i = 0; i < v.size() -1; ++i) + { + Real arg = i*step + 0.001; + Real y = spline(arg); + BOOST_CHECK_CLOSE(y, f(arg), 0.1); + Real y_prime = spline.prime(arg); + BOOST_CHECK_CLOSE(y_prime, 2*a*arg + b, 2.0); + } +} + + +template +void test_trig_function() +{ + std::cout << "Testing that sine functions are interpolated correctly by cubic b splines on type " << boost::typeindex::type_id().pretty_name() << "\n"; + std::mt19937 gen; + std::vector v(500); + Real x0 = 1; + Real step = 0.125; + + for (size_t i = 0; i < v.size(); ++i) + { + v[i] = sin(x0 + step * i); + } + + boost::math::cubic_b_spline spline(v.data(), v.size(), x0, step); + + boost::random::uniform_real_distribution absissa(x0, x0 + 499 * step); + + for (size_t i = 0; i < v.size(); ++i) + { + Real x = absissa(gen); + Real y = spline(x); + BOOST_CHECK_CLOSE(y, sin(x), 1.0); + auto y_prime = spline.prime(x); + BOOST_CHECK_CLOSE(y_prime, cos(x), 2.0); + } +} + +template +void test_copy_move() +{ + std::cout << "Testing that copy/move operation succeed on cubic b spline\n"; + std::vector v(500); + Real x0 = 1; + Real step = 0.125; + + for (size_t i = 0; i < v.size(); ++i) + { + v[i] = sin(x0 + step * i); + } + + boost::math::cubic_b_spline spline(v.data(), v.size(), x0, step); + + + // Default constructor should compile so that splines can be member variables: + boost::math::cubic_b_spline d; + d = boost::math::cubic_b_spline(v.data(), v.size(), x0, step); + BOOST_CHECK_CLOSE(d(x0), sin(x0), 0.01); + // Passing to lambda should compile: + auto f = [=](Real x) { return d(x); }; + // Make sure this variable is used. + BOOST_CHECK_CLOSE(f(x0), sin(x0), 0.01); + + // Move operations should compile. + auto s = std::move(spline); + + // Copy operations should compile: + boost::math::cubic_b_spline c = d; + BOOST_CHECK_CLOSE(c(x0), sin(x0), 0.01); + + // Test with std::bind: + auto h = std::bind(&boost::math::cubic_b_spline::operator(), &s, std::placeholders::_1); + BOOST_CHECK_CLOSE(h(x0), sin(x0), 0.01); +} + +template +void test_outside_interval() +{ + std::cout << "Testing that the spline can be evaluated outside the interpolation interval\n"; + std::vector v(400); + Real x0 = 1; + Real step = 0.125; + + for (size_t i = 0; i < v.size(); ++i) + { + v[i] = sin(x0 + step * i); + } + + boost::math::cubic_b_spline spline(v.data(), v.size(), x0, step); + + // There's no test here; it simply does it's best to be an extrapolator. + // + std::ostream cnull(0); + cnull << spline(0); + cnull << spline(2000); +} + +BOOST_AUTO_TEST_CASE(test_cubic_b_spline) +{ + test_b3_spline(); + test_b3_spline(); + test_b3_spline(); + test_b3_spline(); + + test_interpolation_condition(); + test_interpolation_condition(); + test_interpolation_condition(); + test_interpolation_condition(); + + test_constant_function(); + test_constant_function(); + test_constant_function(); + test_constant_function(); + + test_affine_function(); + test_affine_function(); + test_affine_function(); + test_affine_function(); + + test_quadratic_function(); + test_quadratic_function(); + test_quadratic_function(); + test_affine_function(); + + test_trig_function(); + test_trig_function(); + test_trig_function(); + test_trig_function(); + + test_copy_move(); + test_outside_interval(); +} diff --git a/test/test_legendre.cpp b/test/test_legendre.cpp index 2d5c93a1b..3a0490d5f 100644 --- a/test/test_legendre.cpp +++ b/test/test_legendre.cpp @@ -192,6 +192,7 @@ void expected_results() << BOOST_STDLIB << ", " << BOOST_PLATFORM << std::endl; } + BOOST_AUTO_TEST_CASE( test_main ) { BOOST_MATH_CONTROL_FP; @@ -217,8 +218,14 @@ BOOST_AUTO_TEST_CASE( test_main ) "not available at all, or because they are too inaccurate for these tests " "to pass." << std::endl; #endif - + + test_legendre_p_prime(); + test_legendre_p_prime(); + test_legendre_p_prime(); + + int ulp_distance = test_legendre_p_zeros_double_ulp(1, 100); + BOOST_CHECK(ulp_distance <= 2); + test_legendre_p_zeros(); + test_legendre_p_zeros(); + test_legendre_p_zeros(); } - - - diff --git a/test/test_legendre.hpp b/test/test_legendre.hpp index f5e57ae84..ffb8d2bc9 100644 --- a/test/test_legendre.hpp +++ b/test/test_legendre.hpp @@ -13,7 +13,9 @@ #include #include #include +#include #include +#include #include #include "functor.hpp" @@ -182,3 +184,184 @@ void test_spots(T, const char* t) BOOST_CHECK_CLOSE_FRACTION(::boost::math::legendre_q(40, static_cast(0.5L)), static_cast(0.1493671665503550095010454949479907886011L), tolerance); } +template +void test_legendre_p_prime() +{ + T tolerance = 100*boost::math::tools::epsilon(); + T x = -1; + while (x <= 1) + { + // P_0'(x) = 0 + BOOST_CHECK_SMALL(::boost::math::legendre_p_prime(0, x), tolerance); + // Reflection formula for P_{-1}(x) = P_{0}(x): + BOOST_CHECK_SMALL(::boost::math::legendre_p_prime(-1, x), tolerance); + + // P_1(x) = x, so P_1'(x) = 1: + BOOST_CHECK_CLOSE_FRACTION(::boost::math::legendre_p_prime(1, x), static_cast(1), tolerance); + BOOST_CHECK_CLOSE_FRACTION(::boost::math::legendre_p_prime(-2, x), static_cast(1), tolerance); + + // P_2(x) = 3x^2/2 + k => P_2'(x) = 3x + BOOST_CHECK_CLOSE_FRACTION(::boost::math::legendre_p_prime(2, x), 3*x, tolerance); + BOOST_CHECK_CLOSE_FRACTION(::boost::math::legendre_p_prime(-3, x), 3*x, tolerance); + + // P_3(x) = (5x^3 - 3x)/2 => P_3'(x) = (15x^2 - 3)/2: + T xsq = x*x; + BOOST_CHECK_CLOSE_FRACTION(::boost::math::legendre_p_prime(3, x), (15*xsq - 3)/2, tolerance); + BOOST_CHECK_CLOSE_FRACTION(::boost::math::legendre_p_prime(-4, x), (15*xsq -3)/2, tolerance); + + // P_4(x) = (35x^4 - 30x^2 +3)/8 => P_4'(x) = (5x/2)*(7x^2 - 3) + T expected = 5*x*(7*xsq - 3)/2; + BOOST_CHECK_CLOSE_FRACTION(::boost::math::legendre_p_prime(4, x), expected, tolerance); + BOOST_CHECK_CLOSE_FRACTION(::boost::math::legendre_p_prime(-5, x), expected, tolerance); + + // P_5(x) = (63x^5 - 70x^3 + 15x)/8 => P_5'(x) = (315*x^4 - 210*x^2 + 15)/8 + T x4 = xsq*xsq; + expected = (315*x4 - 210*xsq + 15)/8; + BOOST_CHECK_CLOSE_FRACTION(::boost::math::legendre_p_prime(5, x), expected, tolerance); + BOOST_CHECK_CLOSE_FRACTION(::boost::math::legendre_p_prime(-6, x), expected, tolerance); + + // P_6(x) = (231x^6 -315*x^4 +105x^2 -5)/16 => P_6'(x) = (6*231*x^5 - 4*315*x^3 + 105x)/16 + expected = 21*x*(33*x4 - 30*xsq + 5)/8; + BOOST_CHECK_CLOSE_FRACTION(::boost::math::legendre_p_prime(6, x), expected, tolerance); + BOOST_CHECK_CLOSE_FRACTION(::boost::math::legendre_p_prime(-7, x), expected, tolerance); + + // Mathematica: D[LegendreP[7, x],x] + T x6 = x4*xsq; + expected = 7*(429*x6 -495*x4 + 135*xsq - 5)/16; + BOOST_CHECK_CLOSE_FRACTION(::boost::math::legendre_p_prime(7, x), expected, tolerance); + BOOST_CHECK_CLOSE_FRACTION(::boost::math::legendre_p_prime(-8, x), expected, tolerance); + + // Mathematica: D[LegendreP[8, x],x] + // The naive polynomial evaluation algorithm is going to get worse from here out, so this will be enough. + expected = 9*x*(715*x6 - 1001*x4 + 385*xsq - 35)/16; + BOOST_CHECK_CLOSE_FRACTION(::boost::math::legendre_p_prime(8, x), expected, tolerance); + BOOST_CHECK_CLOSE_FRACTION(::boost::math::legendre_p_prime(-9, x), expected, tolerance); + + x += static_cast(1)/static_cast(pow(2, 4)); + } + + int n = 0; + while (n < 5000) + { + T expected = n*(n+1)*boost::math::constants::half(); + BOOST_CHECK_CLOSE_FRACTION(::boost::math::legendre_p_prime(n, (T) 1), expected, tolerance); + BOOST_CHECK_CLOSE_FRACTION(::boost::math::legendre_p_prime(-n - 1, (T) 1), expected, tolerance); + if (n & 1) + { + BOOST_CHECK_CLOSE_FRACTION(::boost::math::legendre_p_prime(n, (T) -1), expected, tolerance); + BOOST_CHECK_CLOSE_FRACTION(::boost::math::legendre_p_prime(-n - 1, (T) -1), expected, tolerance); + } + else + { + BOOST_CHECK_CLOSE_FRACTION(::boost::math::legendre_p_prime(n, (T) -1), -expected, tolerance); + BOOST_CHECK_CLOSE_FRACTION(::boost::math::legendre_p_prime(-n - 1, (T) -1), -expected, tolerance); + } + ++n; + } +} + +template +void test_legendre_p_zeros() +{ + std::cout << "Testing Legendre zeros on type " << boost::typeindex::type_id().pretty_name() << "\n"; + using std::sqrt; + using std::abs; + using boost::math::legendre_p_zeros; + using boost::math::legendre_p; + using boost::math::constants::third; + Real tol = std::numeric_limits::epsilon(); + + // Check the trivial cases: + std::vector zeros = legendre_p_zeros(1); + BOOST_ASSERT(zeros.size() == 1); + BOOST_CHECK_SMALL(zeros[0], tol); + + zeros = legendre_p_zeros(2); + BOOST_ASSERT(zeros.size() == 1); + BOOST_CHECK_CLOSE_FRACTION(zeros[0], (Real) 1/ sqrt(static_cast(3)), tol); + + zeros = legendre_p_zeros(3); + BOOST_ASSERT(zeros.size() == 2); + BOOST_CHECK_SMALL(zeros[0], tol); + BOOST_CHECK_CLOSE_FRACTION(zeros[1], sqrt(static_cast(3)/static_cast(5)), tol); + + zeros = legendre_p_zeros(4); + BOOST_ASSERT(zeros.size() == 2); + BOOST_CHECK_CLOSE_FRACTION(zeros[0], sqrt( (15-2*sqrt(static_cast(30)))/static_cast(35) ), tol); + BOOST_CHECK_CLOSE_FRACTION(zeros[1], sqrt( (15+2*sqrt(static_cast(30)))/static_cast(35) ), tol); + + + zeros = legendre_p_zeros(5); + BOOST_ASSERT(zeros.size() == 3); + BOOST_CHECK_SMALL(zeros[0], tol); + BOOST_CHECK_CLOSE_FRACTION(zeros[1], third()*sqrt( (35 - 2*sqrt(static_cast(70)))/static_cast(7) ), 2*tol); + BOOST_CHECK_CLOSE_FRACTION(zeros[2], third()*sqrt( (35 + 2*sqrt(static_cast(70)))/static_cast(7) ), 2*tol); + + // Don't take the tolerances too seriously. + // The other test shows that the zeros are estimated more accurately than the function! + for (int n = 6; n < 130; ++n) + { + zeros = legendre_p_zeros(n); + if (n & 1) + { + BOOST_CHECK(zeros.size() == (n-1)/2 +1); + BOOST_CHECK_SMALL(zeros[0], tol); + } + else + { + // Zero is not a zero of the odd Legendre polynomials + BOOST_CHECK(zeros.size() == n/2); + BOOST_CHECK(zeros[0] > 0); + BOOST_CHECK_SMALL(legendre_p(n, zeros[0]), 550*tol); + } + Real previous_zero = zeros[0]; + for (int k = 1; k < zeros.size(); ++k) + { + Real next_zero = zeros[k]; + BOOST_CHECK(next_zero > previous_zero); + + std::string err = "Tolerance failed for (n, k) = (" + boost::lexical_cast(n) + "," + boost::lexical_cast(k) + ")\n"; + if (n < 40) + { + BOOST_CHECK_MESSAGE( abs(legendre_p(n, next_zero)) < 100*tol, + err); + } + else + { + BOOST_CHECK_MESSAGE( abs(legendre_p(n, next_zero)) < 1000*tol, + err); + } + previous_zero = next_zero; + } + // The zeros of orthogonal polynomials are contained strictly in (a, b). + BOOST_CHECK(previous_zero < 1); + } + return; +} + +int test_legendre_p_zeros_double_ulp(int min_x, int max_n) +{ + std::cout << "Testing ULP distance for Legendre zeros.\n"; + using std::abs; + using boost::math::legendre_p_zeros; + using boost::math::float_distance; + using boost::multiprecision::cpp_bin_float_quad; + + double max_float_distance = 0; + for (int n = min_x; n < max_n; ++n) + { + std::vector double_zeros = legendre_p_zeros(n); + std::vector quad_zeros = legendre_p_zeros(n); + BOOST_ASSERT(quad_zeros.size() == double_zeros.size()); + for (int k = 0; k < (int)double_zeros.size(); ++k) + { + double d = abs(float_distance(double_zeros[k], quad_zeros[k].convert_to())); + if (d > max_float_distance) + { + max_float_distance = d; + } + } + } + + return (int) max_float_distance; +} diff --git a/test/test_polynomial.cpp b/test/test_polynomial.cpp index 892991400..6982389b7 100644 --- a/test/test_polynomial.cpp +++ b/test/test_polynomial.cpp @@ -17,8 +17,11 @@ #include #include +using namespace boost::math; using namespace boost::math::tools; using namespace std; +using boost::integer::gcd_detail::Euclid_gcd; +using boost::math::tools::subresultant_gcd; template struct answer @@ -146,38 +149,183 @@ BOOST_AUTO_TEST_CASE( test_division_over_ufd ) } -BOOST_AUTO_TEST_CASE( test_gcd ) +template +struct FM2GP_Ex_8_3__1 { - /* NOTE: Euclidean gcd is not yet customized to return THE greatest - * common polynomial divisor. If d is THE greatest common divisior of u and - * v, then gcd(u, v) will return d or -d according to the algorithm. - * By convention, it should return d, as for example Maxima and Wolfram - * Alpha do. - * This test is an example of the fact that it returns -d. - */ - boost::array const d8 = {{105, 278, -88, -56, 16}}; - boost::array const d6 = {{70, 232, -44, -64, 16}}; - boost::array const d2 = {{-35, 24, -4}}; - polynomial const u(d8.begin(), d8.end()); - polynomial const v(d6.begin(), d6.end()); - polynomial const w(d2.begin(), d2.end()); - polynomial const d = boost::math::gcd(u, v); - BOOST_CHECK_EQUAL(w, d); -} + polynomial x; + polynomial y; + polynomial z; + + FM2GP_Ex_8_3__1() + { + boost::array const x_data = {{105, 278, -88, -56, 16}}; + boost::array const y_data = {{70, 232, -44, -64, 16}}; + boost::array const z_data = {{35, -24, 4}}; + x = polynomial(x_data.begin(), x_data.end()); + y = polynomial(y_data.begin(), y_data.end()); + z = polynomial(z_data.begin(), z_data.end()); + } +}; + +template +struct FM2GP_Ex_8_3__2 +{ + polynomial x; + polynomial y; + polynomial z; + + FM2GP_Ex_8_3__2() + { + boost::array const x_data = {{1, -6, -8, 6, 7}}; + boost::array const y_data = {{1, -5, -2, 15, 11}}; + boost::array const z_data = {{1, 2, 1}}; + x = polynomial(x_data.begin(), x_data.end()); + y = polynomial(y_data.begin(), y_data.end()); + z = polynomial(z_data.begin(), z_data.end()); + } +}; + + +template +struct FM2GP_mixed +{ + polynomial x; + polynomial y; + polynomial z; + + FM2GP_mixed() + { + boost::array const x_data = {{-2.2, -3.3, 0, 1}}; + boost::array const y_data = {{-4.4, 0, 1}}; + boost::array const z_data= {{-2, 1}}; + x = polynomial(x_data.begin(), x_data.end()); + y = polynomial(y_data.begin(), y_data.end()); + z = polynomial(z_data.begin(), z_data.end()); + } +}; + + +template +struct FM2GP_trivial +{ + polynomial x; + polynomial y; + polynomial z; + + FM2GP_trivial() + { + boost::array const x_data = {{-2, -3, 0, 1}}; + boost::array const y_data = {{-4, 0, 1}}; + boost::array const z_data= {{-2, 1}}; + x = polynomial(x_data.begin(), x_data.end()); + y = polynomial(y_data.begin(), y_data.end()); + z = polynomial(z_data.begin(), z_data.end()); + } +}; // Sanity checks to make sure I didn't break it. -typedef boost::mpl::list sp_integral_test_types; +typedef boost::mpl::list large_sp_integral_test_types; + +typedef boost::mpl::list< #if !BOOST_WORKAROUND(BOOST_MSVC, <= 1500) - , boost::multiprecision::cpp_int + boost::multiprecision::cpp_int #endif -> integral_test_types; -typedef boost::mpl::list mp_integral_test_types; + +typedef boost::mpl::joint_view integral_test_types; +typedef boost::mpl::joint_view large_integral_test_types; + +typedef boost::mpl::list non_integral_test_types; + typedef boost::mpl::joint_view all_test_types; + +template +void normalize(polynomial &p) +{ + if (leading_coefficient(p) < T(0)) + std::transform(p.data().begin(), p.data().end(), p.data().begin(), std::negate()); +} + +/** + * Note that we do not expect 'pure' gcd algorithms to normalize the result. + * However, the usual public interface function gcd() will do that. + */ + +BOOST_AUTO_TEST_SUITE(test_subresultant_gcd) + +// This test is just to show that gcd>(u, v) is defined (and works) when T is integral and multiprecision. +BOOST_FIXTURE_TEST_CASE_TEMPLATE( gcd_interface, T, mp_integral_test_types, FM2GP_Ex_8_3__1 ) +{ + typedef FM2GP_Ex_8_3__1 fixture_type; + polynomial w; + w = gcd(fixture_type::x, fixture_type::y); + normalize(w); + BOOST_CHECK_EQUAL(w, fixture_type::z); + w = gcd(fixture_type::y, fixture_type::x); + normalize(w); + BOOST_CHECK_EQUAL(w, fixture_type::z); +} + +// This test is just to show that gcd>(u, v) is defined (and works) when T is floating point. +BOOST_FIXTURE_TEST_CASE_TEMPLATE( gcd_float_interface, T, non_integral_test_types, FM2GP_Ex_8_3__1 ) +{ + typedef FM2GP_Ex_8_3__1 fixture_type; + polynomial w; + w = gcd(fixture_type::x, fixture_type::y); + normalize(w); + BOOST_CHECK_EQUAL(w, fixture_type::z); + w = gcd(fixture_type::y, fixture_type::x); + normalize(w); + BOOST_CHECK_EQUAL(w, fixture_type::z); +} + +// The following tests call subresultant_gcd explicitly to remove any ambiguity +// and to permit testing on single-precision integral types. +BOOST_FIXTURE_TEST_CASE_TEMPLATE( Ex_8_3__1, T, large_integral_test_types, FM2GP_Ex_8_3__1 ) +{ + typedef FM2GP_Ex_8_3__1 fixture_type; + polynomial w; + w = subresultant_gcd(fixture_type::x, fixture_type::y); + normalize(w); + BOOST_CHECK_EQUAL(w, fixture_type::z); + w = subresultant_gcd(fixture_type::y, fixture_type::x); + normalize(w); + BOOST_CHECK_EQUAL(w, fixture_type::z); +} + +BOOST_FIXTURE_TEST_CASE_TEMPLATE( Ex_8_3__2, T, large_integral_test_types, FM2GP_Ex_8_3__2 ) +{ + typedef FM2GP_Ex_8_3__2 fixture_type; + polynomial w; + w = subresultant_gcd(fixture_type::x, fixture_type::y); + normalize(w); + BOOST_CHECK_EQUAL(w, fixture_type::z); + w = subresultant_gcd(fixture_type::y, fixture_type::x); + normalize(w); + BOOST_CHECK_EQUAL(w, fixture_type::z); +} + +BOOST_FIXTURE_TEST_CASE_TEMPLATE( trivial_int, T, large_integral_test_types, FM2GP_trivial ) +{ + typedef FM2GP_trivial fixture_type; + polynomial w; + w = subresultant_gcd(fixture_type::x, fixture_type::y); + normalize(w); + BOOST_CHECK_EQUAL(w, fixture_type::z); + w = subresultant_gcd(fixture_type::y, fixture_type::x); + normalize(w); + BOOST_CHECK_EQUAL(w, fixture_type::z); +} + +BOOST_AUTO_TEST_SUITE_END() + + BOOST_AUTO_TEST_CASE_TEMPLATE( test_addition, T, all_test_types ) { polynomial const a(d3a.begin(), d3a.end()); @@ -243,6 +391,25 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(test_non_integral_arithmetic_relations, T, non_int BOOST_CHECK_EQUAL(a * T(0.5), a / T(2)); } +BOOST_AUTO_TEST_CASE_TEMPLATE(test_cont_and_pp, T, integral_test_types) +{ + boost::array, 4> const q={{ + polynomial(d8.begin(), d8.end()), + polynomial(d8b.begin(), d8b.end()), + polynomial(d3a.begin(), d3a.end()), + polynomial(d3b.begin(), d3b.end()) + }}; + for (std::size_t i = 0; i < q.size(); i++) + { + BOOST_CHECK_EQUAL(q[i], content(q[i]) * primitive_part(q[i])); + BOOST_CHECK_EQUAL(primitive_part(q[i]), primitive_part(q[i], content(q[i]))); + } + + polynomial const zero; + BOOST_CHECK_EQUAL(primitive_part(zero), zero); + BOOST_CHECK_EQUAL(content(zero), T(0)); +} + BOOST_AUTO_TEST_CASE_TEMPLATE( test_self_multiply_assign, T, all_test_types ) { polynomial a(d3a.begin(), d3a.end()); @@ -260,6 +427,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE( test_self_multiply_assign, T, all_test_types ) BOOST_CHECK_EQUAL(a, b*b*b*b); } + BOOST_AUTO_TEST_CASE_TEMPLATE(test_right_shift, T, all_test_types ) { polynomial a(d8b.begin(), d8b.end()); @@ -307,9 +475,11 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(test_odd_even, T, all_test_types) BOOST_CHECK_EQUAL(even(b), true); } - +// NOTE: Slightly unexpected: this unit test passes even when T = char. BOOST_AUTO_TEST_CASE_TEMPLATE( test_pow, T, all_test_types ) { + if (std::numeric_limits::digits < 32) + return; // Invokes undefined behaviour polynomial a(d3a.begin(), d3a.end()); polynomial const one(T(1)); boost::array const d3a_sqr = {{100, -120, -44, 108, -20, -24, 9}}; @@ -350,3 +520,12 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(test_set_zero, T, all_test_types) a.set_zero(); // Ensure that setting zero to zero is a no-op. BOOST_CHECK_EQUAL(a, zero); } + + +BOOST_AUTO_TEST_CASE_TEMPLATE(test_leading_coefficient, T, all_test_types) +{ + polynomial const zero; + BOOST_CHECK_EQUAL(leading_coefficient(zero), T(0)); + polynomial a(d0a.begin(), d0a.end()); + BOOST_CHECK_EQUAL(leading_coefficient(a), T(d0a.back())); +}