jzmaddock
cbb0cce89b
Disable initializer_list support for GCC-4.4 as it doesn't fully support the new syntax and there appears to be no workaround.
2016-07-15 01:24:18 +01:00
jzmaddock
2934670e51
Disable some tests for older msvc compilers.
2016-07-11 18:31:51 +01:00
Jeremy W. Murphy
94526e54c7
Merge branch 'develop' into polynomial_zero
...
# Conflicts:
# test/test_polynomial.cpp
2016-05-15 21:03:12 +10:00
Kolya Matteo
42249f03e7
Simplify one and zero polynomial declarations
2016-05-13 09:06:36 -04:00
Jeremy W. Murphy
e608dc6657
Rename clear() to set_zero().
2016-05-13 18:27:31 +10:00
Kolya Matteo
c7d7a0ce6e
Add unit tests for polynomial pow
2016-05-11 15:05:13 -04:00
Jeremy W. Murphy
a737a3f5c2
operator bool() and clear(): test for zero and set to zero respectively.
...
Checking for zero or non-zero and setting to zero are common operations,
so fast implementations
2016-05-11 14:02:16 +10:00
jzmaddock
c9bf1df944
Merge branch 'polynomial_shift' of https://github.com/jeremy-murphy/math into develop
...
# Resolved Conflicts:
# test/test_polynomial.cpp
2016-05-09 18:29:22 +01:00
jzmaddock
cace9b59de
Merge branch 'gcd' into develop
...
# Resolved Conflicts:
# test/test_polynomial.cpp
2016-05-09 18:15:54 +01:00
Jeremy W. Murphy
a822400320
Merge branch 'develop' into polynomial_shift
...
# Conflicts:
# test/test_polynomial.cpp
2016-05-07 18:27:46 +10:00
Kolya Matteo
3d3a1f8d2a
Add tests for polynomial normalization with initializer lists (so the highest-degree term is nonzero)
2016-05-02 14:06:18 -04:00
Kolya Matteo
ece2283833
Add polynomial self-multiply-assign test case
2016-05-02 13:46:06 -04:00
Jeremy W. Murphy
e963c67af2
Normalize after left-shift assignment to prevent denormalized zeroes.
2016-04-10 01:27:36 +10:00
jzmaddock
11500b787b
Merge branch 'polynomial_shift' of https://github.com/jeremy-murphy/math into gcd
...
# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.
2016-04-06 17:58:21 +01:00
Jeremy W. Murphy
238cd6078b
polynomial: odd/even predicates.
...
We use the definition of odd and even consistent with considering x as the
smallest prime factor. That is, an even polynomial has a constant of zero.
2016-03-28 16:04:27 +11:00
Jeremy W. Murphy
e9da8a10bf
polynomial: Left and right shift operators.
...
Shifting adds or removes a factor of x in the same way that shifting adds
or removes a factor of 2 to integers.
2016-03-27 22:03:33 +11:00
jzmaddock
65f7440c2f
Minor fixes for polynomial division:
...
* Use Boost.Config macros not direct checks on C++ version.
* Use dedicated integer power function - fixes VC10 build failure, also prevents loss of digits when integer type is wider than double.
2016-03-02 19:37:46 +00:00
Jeremy W. Murphy
93a0ff967d
Use the strictly correct brace initializer_list construction.
2016-03-02 13:38:36 +11:00
Jeremy W. Murphy
7969de6fae
Add C++11 initializer_list constructor and assignment to polynomial class.
2016-01-31 19:04:37 +11:00
Jeremy W. Murphy
0e4bfc9f8e
Test cpp_int, cpp_rational, cpp_bin_float_single and cpp_dec_float_50.
2016-01-16 14:54:00 +11:00
Jeremy W. Murphy
99e6e2c3cb
A better and more instructive unit test for gcd.
2015-12-11 11:58:33 +11:00
Jeremy W. Murphy
c313aed73b
Explicitly cast right-hand argument to avoid MSVC C2666.
2015-11-28 09:00:21 +11:00
Jeremy W. Murphy
292bfc6752
Denormalize zero in multiplication to fit algorithmic requirements.
...
Fixes bug introduced by normalizing zero to the empty set.
2015-11-20 11:33:00 +11:00
Jeremy W. Murphy
e459241687
Use a different polynomial to test arithmetic relations.
...
This one appears to reveal a bug in operator *=.
2015-11-19 09:08:27 +11:00
Jeremy W. Murphy
e6e1e9440b
Make the single-argument constructor explicit.
...
Prevent unexpected conversion to polynomial!
2015-11-18 12:15:35 +11:00
Jeremy W. Murphy
cca7e08d3f
Make an explicit note of which unit tests currently fail.
2015-11-17 10:17:30 +11:00
Jeremy W. Murphy
87268a735a
Division of polynomials over integers.
...
Test int and double throughout most of test suite.
2015-11-16 00:41:37 +11:00
Jeremy W. Murphy
94e961ec7c
Division and modulus by a number.
...
Test that multiplication by 0.5 is equal to division by 2.
2015-11-09 00:43:29 +11:00
Jeremy Murphy
6ee7f90bf8
Typedef the coefficient type.
2015-11-04 20:15:38 +11:00
Jeremy W. Murphy
ac2943e053
Unit tests for arithmetic in general, especially for zero.
2015-11-03 23:59:29 +11:00
Jeremy W. Murphy
5cbeac0297
Update unit test; enable in Jamfile.
2015-11-01 16:11:53 +11:00
Jeremy W. Murphy
03de702ee5
Unit testing...
2015-10-28 22:27:13 +11:00
Jeremy W. Murphy
f8fc1e4e35
Start making a unit test.
2015-10-27 10:35:06 +11:00