From 87073856a7f18b365c0670d87b2380942705dd9d Mon Sep 17 00:00:00 2001 From: Chip Hogg Date: Sat, 12 Mar 2022 18:50:01 +0000 Subject: [PATCH] Try upping the basis size further We are well into a regime of diminishing returns, but we'd better start by seeing if the easy thing works. Besides, setting this to 7 trips the step limit in _generating_ the algorithm! --- src/core/include/units/magnitude.h | 2 +- test/unit_test/static/prime_test.cpp | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/core/include/units/magnitude.h b/src/core/include/units/magnitude.h index 5f01a0fa..fbe93316 100644 --- a/src/core/include/units/magnitude.h +++ b/src/core/include/units/magnitude.h @@ -33,7 +33,7 @@ namespace units { namespace detail { // Higher numbers use fewer trial divisions, at the price of more storage space. -using Factorizer = WheelFactorizer<4>; +using Factorizer = WheelFactorizer<6>; } // namespace detail /** diff --git a/test/unit_test/static/prime_test.cpp b/test/unit_test/static/prime_test.cpp index ab852974..cfb57273 100644 --- a/test/unit_test/static/prime_test.cpp +++ b/test/unit_test/static/prime_test.cpp @@ -50,6 +50,7 @@ static_assert(WheelFactorizer<2>::coprimes_in_first_wheel.size() == 2); static_assert(WheelFactorizer<3>::coprimes_in_first_wheel.size() == 8); static_assert(WheelFactorizer<4>::coprimes_in_first_wheel.size() == 48); static_assert(WheelFactorizer<5>::coprimes_in_first_wheel.size() == 480); +static_assert(WheelFactorizer<6>::coprimes_in_first_wheel.size() == 5760); static_assert(WheelFactorizer<3>::coprimes_in_first_wheel[0] == 1); static_assert(WheelFactorizer<3>::coprimes_in_first_wheel[1] == 7);