Andrey Semashev
bc9b0e6177
Implemented integer_log2 in terms of countl_zero from Boost.Core.
...
This allows to use compiler intrinsics and specialized hardware
instructions to compute log2, which results in better performance.
Also, added tests for the generic implementation using Boost.Multiprecision
integers.
Closes https://github.com/boostorg/integer/issues/31 .
2022-01-16 15:20:37 +03:00
Andrey Semashev
16ef530fcf
Use up to date includes for lightweight_test.hpp.
2021-12-21 20:45:00 +03:00
Andrey Semashev
a832e8fe65
Added a test for integer_log2.
2021-12-21 20:36:24 +03:00
jzmaddock
2ca7c7b6e3
Fixes for cxx11 changes to dependencies:
...
Make Multiprecision tests depend on <type_traits> and BOOST_NO_CXX11_HDR_TYPE_TRAITS.
Use specific Boost.Random headers and not <boost/random.hpp> as the latter pulls in some of Boost.Math which has now moved to C++11.
2021-02-18 18:29:03 +00:00
Andrey Semashev
092d94c833
Converted all links to www.boost.org to https.
...
Closes https://github.com/boostorg/integer/pull/25 .
2021-01-20 11:34:42 +03:00
Andrey Semashev
831869a51f
Added checks for C++11 features required by Boost.Multiprecision.
...
As of 2021, Boost.Multiprecision does not support C++03 and fails tests
of Boost.Integer. To mitigate, we replicate the preprocessor checks of
Boost.Multiprecision to disable its use in Boost.Integer tests in C++03
mode.
2021-01-11 15:27:10 +03:00
Andrey Semashev
54dcfa677d
Added a workaround for C++20 ostream having deleted operator<< for wchar_t.
2020-05-23 20:05:02 +03:00
Edward Diener
6cb625550f
Change to run MP testing in integer for Embarcadero C++ clang-based compilers.
2020-04-11 12:37:31 -04:00
Edward Diener
c7a22c9bac
Embarcadero C++ clang-based compilers can not handle multiprecision comparisons in lightwieght tests, but gives a linker error. This has been reported to Embarcadero as a bug.
2020-04-10 11:56:41 -04:00
Edward Diener
52c02d1237
Change __BORLANDC__ to BOOST_BORLANDC, which is defined in Boost config for the Embarcadero non-clang-based compilers.
2020-03-29 08:30:32 -04:00
Tinko Bartels
63f14838a0
Fix a broken link to the Microsoft KB.
2019-04-23 21:29:53 +02:00
Andrey Semashev
33c165552c
Fixed incorrect loop termination in lcm_range.
...
lcm_range used to incorrectly terminate on value of 1. Instead, it should
terminate on 0 since any further elements of the range no longer affect
the result of the function.
Also, added tests for the gcd_range and lcm_range functions verifying
that they terminate their loops at the correct points.
2019-03-26 01:55:18 +03:00
Nick
289939a640
Merge branch 'develop' into remove_optional
2018-12-04 10:57:02 -07:00
Nick Thompson
51b259da19
Return integer with zero signaling common factor rather than boost::optional<Z>.
2018-12-04 10:55:03 -07:00
Andrey Semashev
4bc1a5eb75
Extracted DISABLE_MP_TESTS macro definition to a common header.
2018-11-05 22:56:03 +03:00
Andrey Semashev
682d4ac66b
Fixed tests not compiling on MSVC 8, added missing includes.
2018-11-04 01:00:57 +03:00
Andrey Semashev
2f634ca78b
Added missing includes, remove C++11 requirement, other code cleanup.
...
Also, use Boost.Swap instead of the direct unqualified call to std::swap
and boost::enable_if_c instead of std::enable_if.
2018-11-03 23:10:44 +03:00
Nick Thompson
3599683975
#include <boost/config.hpp>
2018-11-01 12:11:09 -06:00
Nick Thompson
b3680b77fd
Disable tests for gcc < version 5
2018-11-01 12:02:18 -06:00
Nick Thompson
a7da90a79e
Make changes suggested by reviewer.
2018-10-29 13:10:02 -06:00
Nick Thompson
df7adb52ca
Use std::enable_if to enable SFINAE rather than static_assert
2018-10-29 11:58:18 -06:00
Nick Thompson
6c58aa9a48
Merge remote-tracking branch 'upstream/develop' into develop
2018-10-29 08:53:12 -06:00
Nick Thompson
cd60c4c9f9
[CI SKIP] Disable multiprecision in certain compilers.
2018-10-29 08:52:20 -06:00
Andrey Semashev
7c5def9d39
Disable Boost.Multiprecision tests for gcc 4.7 in C++11 mode.
...
The compiler fails in Boost.TypeTraits which is used in Boost.Multiprecision.
2018-10-29 12:25:55 +03:00
Andrey Semashev
835ac98a23
Fail libgmpxx detection on Linux if libstdc++ is not used as the std library.
...
libgmpxx was built against libstdc++, so if the application uses e.g. libc++,
linking fails because of the standard symbols mismatch.
2018-10-29 12:07:06 +03:00
Nick Thompson
f76d776698
Define main when gcc version is < 5.
2018-10-28 23:28:28 -06:00
Nick Thompson
c4c3373708
Don't run tests on gcc 4 and earlier; not worth the pain.
2018-10-28 22:40:36 -06:00
Nick Thompson
bbb1da275b
Merge master; fix Jamfile
2018-10-28 21:14:31 -06:00
Nick Thompson
de0d24733b
Remove dependency on boost/typeindex in tests.
2018-10-26 19:23:11 -06:00
Nick Thompson
0c6ec8088d
Just use asserts, omg.
2018-10-26 18:42:39 -06:00
Nick Thompson
cdefe039ee
I'm flailing with this one.
2018-10-26 17:51:31 -06:00
Nick Thompson
f6525ae186
(Hopefully) green up build by giving path to Boost.Test.
2018-10-26 17:11:28 -06:00
Nick Thompson
e0646cb7ec
Add template argument to green up build. Remove discrete log as we do not have an overflow-resistant mul_mod in boost.
2018-10-26 16:58:30 -06:00
Nick Thompson
2d463f3ee7
a*p % m may overflow, do not perform naive multiplication in unit tests or undefined behavior may result. [CI SKIP]
2018-10-26 11:19:43 -06:00
Nick Thompson
87e5b365d8
Return custom struct from extended Euclidean algorithm rather than tuple. Reduce number of operations for tests to reduce CI system workload. Disable discrete log tests until we have time to figure out why they are failing.
2018-10-25 09:38:16 -06:00
Nick Thompson
ada03a59d7
Remove dependency on boost.format, remove unfettered use of auto in order to move towards C++03 compatibility, use BOOST_THROW_EXCEPTION.
2018-10-24 14:29:22 -06:00
Nick Thompson
faa61cd911
[ci skip] It is *not* the case that a discrete log exists when the base and modulus are coprime. Take 4^x = 2 mod 5 as a counterexample. Change API accordingly.
2018-02-10 17:51:59 -06:00
Nick Thompson
b3966428c4
[ci skip] Add test of short int to see if there's any obvious places for overflow (none are obvious, but no guarantees they still aren't there). Print basic information about the test to console so that failures are easier to track down.
2018-02-10 13:56:11 -06:00
Nick Thompson
8c415f77b1
[ci skip] Use less verbose naming. Add asserts as verfication of algorithms is a negligible fraction of total runtime. Use boost::multiprecision::powm and boost::multiprecision::sqrt rather than one-offs.
2018-02-09 17:19:26 -06:00
Nick Thompson
fc4d657201
[ci skip] Modular exponentiation, modular multiplicative inverse, extended Euclidean algorithm, discrete logarithm.
2018-01-28 14:47:14 -06:00
jzmaddock
10026d9b6f
Disable some tests on older compilers that we know won't pass.
2017-06-09 19:47:18 +01:00
John Maddock
0c956331a0
Fix gmp test failures
2017-05-09 19:52:20 +01:00
jzmaddock
943d63e309
Fix use of check-target-builds in Jamfile.
2017-05-09 18:03:03 +01:00
jzmaddock
7ccb820893
Test mpz_class when available.
...
And fix errors compiling with that type.
2017-05-07 13:15:15 +01:00
jzmaddock
9c75396c05
Fix more explicit instantiations in test cases.
2017-04-26 19:11:18 +01:00
jzmaddock
395735a193
Add tests for multiprecision types and fix test program to still compile.
2017-04-26 18:24:09 +01:00
jzmaddock
beb6871864
Switch over to using new Boost.Math version of gcd/lcm.
...
Please refer to the Boost.Math revision log for details of changes, but in summary:
* New version of gcd/lcm internals by Jeremy Murphy include mixed-binary algorithm and better selection logic.
* Support is now included for gcd's of polynomials.
* Full C++14 constexpr support.
2017-04-23 13:01:09 +01:00
jzmaddock
f650385f65
Disable test case that causes msvc internal error.
2017-03-30 18:50:57 +01:00
jzmaddock
39d9701857
Enable one more noexcept test
2017-03-28 19:30:48 +01:00
jzmaddock
13b36d8432
Add tests for C++14 support.
2017-03-28 19:06:13 +01:00