Commit Graph

505 Commits

Author SHA1 Message Date
John Maddock
9edbdc0ca4 Enable optimisations in the GMP and MPFR backends for mixed mode arithmetic.
Allow mixed arithmetic between two different expression templates.
Change docs to indicate mixed arithmetic is allowed and rebuild.

[SVN r80397]
2012-09-04 17:18:18 +00:00
John Maddock
ce3354335c Allow mixed precision binary operations.
Add tests for basic mixed precision usage.

[SVN r80394]
2012-09-04 08:20:26 +00:00
John Maddock
c7230f94ff Extra test cases for more complete coverage.
Added test coverage makefile.
Fixed errors from extra test cases.
Rename a few traits.

[SVN r80328]
2012-08-31 11:57:55 +00:00
John Maddock
1e00790703 Rename mp_number_archetype.
Update docs with explicit conversion info.
Regenerate docs.

[SVN r80261]
2012-08-27 12:30:53 +00:00
John Maddock
d9901b5144 Fix remaining GCC C++11 failures.
Fix buggy test cases.

[SVN r80166]
2012-08-24 11:08:44 +00:00
John Maddock
6157674972 Fix rational_adapter's implicit/explicit constructors.
Add converting constructors for trivial cpp_int's and test.
Both fix GCC errors.

[SVN r80120]
2012-08-21 18:17:57 +00:00
John Maddock
af9e0c2fe7 Add more explicit constructors and tests for them.
Centralise digits10 to digits2 conversions.

[SVN r80112]
2012-08-21 14:42:15 +00:00
John Maddock
1f35bfe581 Make some gmp constructors explicit.
Add tests to verify that explicit conversions fail.
Fix failures inside number.hpp.

[SVN r80083]
2012-08-19 16:39:24 +00:00
John Maddock
b892e3f5ab Big breaking change - make lossy construction explicit.
[SVN r80058]
2012-08-16 08:13:51 +00:00
John Maddock
6fe80f07de Much improved concept docs.
Regenerate docs.
Make some cpp_int specific routines generic instead.
Changed divide-by-zero to be an overflow error.

[SVN r79952]
2012-08-10 08:37:37 +00:00
John Maddock
e2ef393c23 Big search and replace rename, removing mp_ prefix.
[SVN r79932]
2012-08-08 18:14:50 +00:00
John Maddock
8807532ee4 Added explicit conversion operators.
Moved some files into /detail/

[SVN r79926]
2012-08-08 16:12:33 +00:00
John Maddock
3bcbb056e7 Add better error checking for moved-from types.
[SVN r79913]
2012-08-07 17:55:32 +00:00
John Maddock
c8c3610cdc Fix uBlas tests and failures resulting from them.
[SVN r79902]
2012-08-07 11:47:25 +00:00
John Maddock
821afe64fb Add uBlas interoperability tests.
Add file include tests.

[SVN r79894]
2012-08-07 08:10:07 +00:00
John Maddock
2fb7c1a044 Fix Linux x64 C++0x build issues.
[SVN r79854]
2012-08-02 17:14:17 +00:00
John Maddock
8a54889f35 Update comparison operators for better efficiency.
Rework delaunay performance test to use less disk space.

[SVN r79848]
2012-08-02 12:27:00 +00:00
John Maddock
c79fb41526 Rework comparison operators - note that existing backends are made less efficient by this at present.
[SVN r79823]
2012-07-31 18:14:14 +00:00
John Maddock
64fe0089d3 Refactor concept checks for faster compilers.
Add constexpr construction test.

[SVN r79724]
2012-07-24 18:03:54 +00:00
John Maddock
281c667b71 Update frontend to allow direct construction of backend.
Improve construction times for cpp_int from integers.
Allow constexpr construction.
Allow fixed precision cpp_int's with small bit counts.

[SVN r79692]
2012-07-23 08:57:44 +00:00
John Maddock
19ee491c55 Add noexcept support/markup where possible.
[SVN r79331]
2012-07-07 11:16:28 +00:00
John Maddock
26905dc5ea Fix non ET operators to return by value (not rvalue refs as that's unsafe - thanks to Howard Hinnant for the test case).
Fix move constructors to actually move!
Add move test case.
Add better move support throughout the lib.

[SVN r79224]
2012-07-02 08:08:28 +00:00
John Maddock
1a4e3af5c8 Fix Linux x64 errors
[SVN r79165]
2012-06-29 11:53:25 +00:00
John Maddock
f09ead8e37 Some file renaming and fixes from Steven Watanabe's comments.
[SVN r79141]
2012-06-27 18:25:10 +00:00
Vicente J. Botet Escriba
cd741c1249 Multiprecision: added error log
[SVN r78803]
2012-06-03 20:51:41 +00:00
John Maddock
ebd7502fdc Enhance pow and powm tests.
Quash some warnings.
Fix the IO tests on GCC.

[SVN r78423]
2012-05-11 17:19:13 +00:00
John Maddock
a8c73aea66 Change non-member functions to be protected by enable_if based on the type of the number.
Extend expression templates to 4 arguments.
Add pow and powm functions for integer types.
Update docs to match.

[SVN r78401]
2012-05-10 09:20:26 +00:00
John Maddock
d2bc0f90f7 Change non-member functions to use enable_if so they're restricted to the number type to which they apply (better error messages). Enhance concept checks to check things which weren't previously tested.
[SVN r78321]
2012-05-04 08:20:33 +00:00
Christopher Kormanyos
9ee0022c77 Re-factor cpp_dec_float class constants.
Extend cpp_dec_float low-digit range from 30 to 9.
Removed temporary storage from cpp_dec_float multiply routine.
Extended tests to 9, 18 and (sqrt test) to 1000 digits.

[SVN r78097]
2012-04-20 20:05:49 +00:00
John Maddock
462bec3925 Fix ldexp/frexp in default_ops.hpp. Improve 64-bit platform detection in cpp_int_core.hpp. Get examples building with GCC
[SVN r77971]
2012-04-14 16:51:02 +00:00
John Maddock
d4a2c46ac6 Update examples, reorganise docs, temporarily remove HTML before rebuilding.
Enhance test cases, including enabling loopback testing on cpp_dec_float io.

[SVN r77948]
2012-04-13 15:38:28 +00:00
John Maddock
426430a233 Fix MPFR error rates on Linux x86 64
[SVN r77782]
2012-04-05 17:19:57 +00:00
John Maddock
68a4a87438 Add string versions of constants for faster (and more accurate) constant initialization.
[SVN r77758]
2012-04-04 17:04:00 +00:00
John Maddock
3913771ea0 Change cpp_dec_float string conversion to generate a better error message when conversion fails.
Add generic inter-conversions and tests for them.
Fix bug in cpp_int convert_to.

[SVN r77630]
2012-03-29 18:00:06 +00:00
John Maddock
ec3cf57c91 Add licence and copyright.
[SVN r77624]
2012-03-29 12:15:05 +00:00
John Maddock
ead32b9563 Squash some MSVC level 4 compiler warnings.
[SVN r77623]
2012-03-29 09:12:08 +00:00
John Maddock
4c6065717b Add a few more integer specific bit-fiddling functions.
Fix some bugs in cpp_int left shift code.
Document some missing backend API's, and update docs.

[SVN r77583]
2012-03-27 11:45:01 +00:00
John Maddock
6ead744223 Fix fixed precision ints to work with non obvious bit counts.
[SVN r77473]
2012-03-22 11:54:15 +00:00
John Maddock
8433c69175 Disable expression templates for fixed precision types.
Restrict integer functions to integer types.
Improve Miller Rabin performance by filtering out small primes etc.
Improve Miller Rabin tests.
Change mp_int to tom_int to avoid conflict with global ::mp_Int type.

[SVN r77471]
2012-03-22 10:29:30 +00:00
John Maddock
24cff33935 Update Miller Rabin test to use small prime filtering.
Add some new integer type operations.
Update performance tests to match.

[SVN r77451]
2012-03-21 09:19:57 +00:00
John Maddock
2349943cdb Fix some GMP int errors, and simplify modulus code.
Fix some cpp_int errors.
Improve cpp_int tests.

[SVN r77362]
2012-03-17 19:43:26 +00:00
John Maddock
45a08da90e Add simple version of the Miller Rabin test
[SVN r77353]
2012-03-17 09:18:20 +00:00
John Maddock
d82fa61c81 Mostly remove references to fixed_int.
Update docs.

[SVN r77335]
2012-03-14 18:23:44 +00:00
John Maddock
e1b23af8f5 Add files missing from last commit, and add new examples to tests.
[SVN r77324]
2012-03-13 18:40:52 +00:00
John Maddock
7bed8d02f9 Add support for disabling expression templates via a second template parameter to mp_number.
Begin to update docs to reflect new cpp_int code.

[SVN r77323]
2012-03-13 18:30:18 +00:00
John Maddock
5caa15f798 Reorganisation: rename methods "eval_foo" rather than "foo" to avoid conflict with classes of the same name (GCC bug).
Move backends into sub-namespaces to avoid namespace pollution.

[SVN r77312]
2012-03-12 09:18:44 +00:00
John Maddock
b42208c5df Fix several division algorithm bugs.
Add cpp_rational to performance tests.
Add modular arithmetic test to test cases.

[SVN r77303]
2012-03-11 16:43:31 +00:00
John Maddock
5500ad3ea8 Add support for fixed precision and unsigned cpp_int's.
[SVN r77260]
2012-03-08 10:34:37 +00:00
John Maddock
bea3707326 Add initial version of an arbitrary precision integer type.
Hook up some more fixed_int tests.

[SVN r77141]
2012-02-29 13:05:51 +00:00
John Maddock
8d6dedf4b0 Complete renaming of cpp_float to cpp_dec_float.
Rebuild docs.

[SVN r77037]
2012-02-16 09:36:26 +00:00
John Maddock
380d627359 Big search and replace: change cpp_float to cpp_dec_float.
Also fix up some numeric_limits test failures.

[SVN r77032]
2012-02-15 13:09:45 +00:00
John Maddock
d69424adad Fix bug in fixed_int::convert_to with negative numbers.
Fix bug in fixed_int shift operator when shifting by 0.
Add preliminary gcd/lcm support for integer types.
Add static asserts to floating-point only functions.

[SVN r76706]
2012-01-26 10:11:10 +00:00
John Maddock
4b844fc60c Improve performance of fixed_int divide and string conversion.
Add mixed integer ops to fixed_int.
Improve fixed_int test cases.
Add improved default forwarding functions that preserve arithmetic type arguments.
Fix some operator overloads.
Update performance tests.

[SVN r76639]
2012-01-22 19:12:37 +00:00
John Maddock
a53f46637e Fix Linux 64 failures
[SVN r76593]
2012-01-20 17:15:22 +00:00
John Maddock
3c13b7a4d1 Add missing file.
Fix some inconsistent uses of long long and intmax_t.

[SVN r76573]
2012-01-18 12:16:20 +00:00
John Maddock
66b67a1c09 Refactor SF tests for much faster compile times.
[SVN r76545]
2012-01-16 18:26:50 +00:00
John Maddock
a97c3bd896 Update docs to include fixed_int.hpp.
Remove 64-bit versions of fixed_int typedefs - better to use boost::int64_t instead.

[SVN r76433]
2012-01-12 13:56:22 +00:00
John Maddock
036dc2bacc Rename files.
[SVN r76429]
2012-01-12 12:06:27 +00:00
John Maddock
db83a1c4ad Tentative rename of packed_cpp_int to fixed_int.
[SVN r76428]
2012-01-12 11:55:09 +00:00
John Maddock
44d5a3e394 Change tests for faster compile times.
[SVN r76412]
2012-01-11 19:09:49 +00:00
John Maddock
8c28b89dfc Fix GCC failures and generally improve performance of packed_cpp_int.
[SVN r76409]
2012-01-11 11:53:49 +00:00
John Maddock
99707d8925 Switch to faster division code and add better test case for packed int's.
[SVN r76398]
2012-01-10 13:20:29 +00:00
John Maddock
b607dc2c47 Move file.
[SVN r76253]
2012-01-01 11:46:48 +00:00
John Maddock
30310e4a52 Another Boost.Rational fix.
Add tentative version of a fixed width, bit-packed 2's complement integer type.

[SVN r76234]
2011-12-30 18:21:08 +00:00
John Maddock
d7578f242c Add numerator/denominator accessor functions to rational_adapter.hpp.
Define predefined rational number type for libtommath.
Add rational number specific tests to test_arithmetic.cpp.
Document rational_adapter and related stuff, regenerate docs.

[SVN r76130]
2011-12-24 13:13:16 +00:00
John Maddock
c32e35aace Fix File IO and string conversion for rational_adapter, and update tests accordingly.
[SVN r76129]
2011-12-24 11:59:25 +00:00
John Maddock
b9ea00966f Fix modulus operations for negative numbers that should yield zero results (and update tests to match).
Fix boost::rational comparison operator support.
Fix GCC failures in test_rational_io.cpp.
Add adapter for rational types.

[SVN r76128]
2011-12-24 10:07:32 +00:00
John Maddock
a2dc3b968c Fix remaining Boost.Rational support issues and add rational number IO test.
[SVN r76121]
2011-12-23 17:13:29 +00:00
John Maddock
6e3ab5380b Add tests for Boost.Math special functions, and fix whatever errors came up in running those tests.
Add workaround for compilers that don't have a std::abs(long long).

[SVN r76079]
2011-12-20 16:19:55 +00:00
John Maddock
018ac8cd6c Begin adding tests taken from Boost.Math and fix the issues they flag up.
[SVN r75832]
2011-12-06 19:03:41 +00:00
John Maddock
fdcc1a5034 Document libtommath support, add error checking to tommath bitwise operators.
[SVN r75746]
2011-11-30 12:08:59 +00:00
John Maddock
d76492ddaa Suppress some GCC warnings.
[SVN r75723]
2011-11-29 12:27:40 +00:00
John Maddock
4a9845ac7e Fix and test integer formatted output.
[SVN r75716]
2011-11-28 19:24:20 +00:00
John Maddock
7143af0191 Fix IO of infinities and NaN's.
Add IO round trip test and adjust max_digits10 accordingly.

[SVN r75714]
2011-11-28 16:28:31 +00:00
John Maddock
ffc6bcedc9 Fix float IO and add test.
[SVN r75707]
2011-11-28 09:13:12 +00:00
John Maddock
ecead4525a Suppress MSVC warnings in tests.
Add support for std::ios_base::fmtflags in string formatting.
Fix the errors that result from above change!

[SVN r75586]
2011-11-21 09:52:32 +00:00
John Maddock
cd31fbde7a Fix operator>> for mp_number.
Add template inter-conversions on cpp_float.
Adjust precision of test reporting.

[SVN r75520]
2011-11-17 18:08:51 +00:00
John Maddock
b653174c77 Add enhanced testing support.
Remove throw statements for BOOST_THROW_EXCEPTION.
Remove throw() qualifiers: they're a dis-optimization.

[SVN r75511]
2011-11-16 17:36:40 +00:00
John Maddock
050ae32c44 Add initial libtommath support.
Fix use of noexcept.
Remove dead files.

[SVN r75505]
2011-11-16 09:40:05 +00:00
John Maddock
0c413f7352 Change real_types to float_types.
[SVN r75489]
2011-11-14 13:39:10 +00:00
John Maddock
b85306e076 Fix remaining cpp_float bugs.
Fix use of expression templates in conditional expressions.

[SVN r75485]
2011-11-14 12:19:17 +00:00
John Maddock
40d1b2f1dd Add sqrt tests.
Fix remaining cpp_float failures.

[SVN r75478]
2011-11-13 17:36:39 +00:00
John Maddock
c8eda6845e Search and replace - rename mp_float cpp_float.
[SVN r75453]
2011-11-12 13:15:33 +00:00
John Maddock
47724a4221 Fixes for bugs in mp_float.
Fix constant initialization.
Add some instrumentation code.
Make mp_exp constructor explicit.
Remove some dead code.
Note mp_float division has outstanding bugs still!!

[SVN r75452]
2011-11-12 12:15:04 +00:00
John Maddock
0c4dde52ee Get the rounding functions working and tested, update docs to match.
[SVN r75425]
2011-11-09 17:37:40 +00:00
John Maddock
b36be1f5c3 Tighten up and test the architypes.
[SVN r75404]
2011-11-08 12:50:21 +00:00
John Maddock
6e009f3029 Fix gcc warnings and errors.
Update docs.

[SVN r75284]
2011-11-03 11:06:05 +00:00
John Maddock
1c6577b5a6 Add conversion tests and update docs.
[SVN r75279]
2011-11-02 18:15:00 +00:00
John Maddock
79d630a068 Fix benchmark to build with new code.
[SVN r75169]
2011-10-29 17:41:31 +00:00
John Maddock
6372f8b638 Get mp_float passing all the tests, fix some bugs in acos and atan implementations.
[SVN r75166]
2011-10-29 11:57:54 +00:00
John Maddock
ad66feecbe Add numeric_limits support for mp_float.
[SVN r75134]
2011-10-27 16:46:46 +00:00
John Maddock
b0ac20f391 Add port of e_float as a backend.
[SVN r75129]
2011-10-27 12:43:41 +00:00
John Maddock
9124ccb4c1 Enable native atan2 for mpfr.
[SVN r75095]
2011-10-23 16:03:29 +00:00
John Maddock
fc1eb9303f Get the tests passing with gcc on Linux.
[SVN r75094]
2011-10-23 15:49:27 +00:00
John Maddock
c34e9f654f Big search and replace namespace and class renaming: get rid of last references to "big_number" and "real".
[SVN r75093]
2011-10-23 11:23:13 +00:00
John Maddock
628c8cd62f Added atan2, plus missing file.
[SVN r75090]
2011-10-22 17:32:01 +00:00
John Maddock
636fdc2e5d Tidy up the tests with boilerplate relative error calculation.
Fix eval_ldexp for mpf_t.
Fix power and log calculations.
Add acos.
Get all the tests passing.

[SVN r75070]
2011-10-20 18:16:46 +00:00
John Maddock
8cf2a83683 Add sin/cos/tan/asin functions.
[SVN r75053]
2011-10-18 18:10:20 +00:00
John Maddock
5f15eaa679 Added pow, exp, log, sinh, cosh and tanh support.
[SVN r74781]
2011-10-07 18:14:34 +00:00
John Maddock
d6b9a6e980 Change log to give correct answer for log(1) and to not subtract towards the correct answer when that answer is small. Also improves series convergence.
[SVN r74736]
2011-10-05 11:26:31 +00:00
John Maddock
7be44c1683 Add log function and tests.
[SVN r74700]
2011-10-04 16:46:25 +00:00
John Maddock
b8a60ca6ca Rename "big_number*" to "mp_number*".
[SVN r74671]
2011-10-03 17:15:55 +00:00
John Maddock
e0309c8492 More file renames to remove "big_" prefixes.
[SVN r74670]
2011-10-03 17:03:28 +00:00
John Maddock
01173bc59c Changed namespace to "multiprecision".
Added some numberic constant calculations.
Added exp function support and test case.

[SVN r74669]
2011-10-03 16:56:24 +00:00
John Maddock
73960e2a46 Giant file and directory rename: changed directory name from math to multiprecision and updated code to match.
[SVN r74579]
2011-09-26 17:00:44 +00:00