diff --git a/examples/chapter04_04/target/micros/avr/make/avr_flags.gmk b/examples/chapter04_04/target/micros/avr/make/avr_flags.gmk
index 5713636b5..3c8533379 100644
--- a/examples/chapter04_04/target/micros/avr/make/avr_flags.gmk
+++ b/examples/chapter04_04/target/micros/avr/make/avr_flags.gmk
@@ -10,7 +10,7 @@
# ------------------------------------------------------------------------------
ifneq ($(MAKE),make)
-GCC_VERSION = 13.2.0
+GCC_VERSION = 14.2.0
endif
GCC_TARGET = avr
GCC_PREFIX = avr
@@ -24,7 +24,7 @@ TGT_ALLFLAGS = -O2
-finline-limit=32 \
-fsigned-char
-ifeq ($(GCC_VERSION),13.2.0)
+ifeq ($(GCC_VERSION),14.2.0)
TGT_ALLFLAGS := $(TGT_ALLFLAGS) \
-mdouble=32 \
-mlong-double=64
diff --git a/examples/chapter16_08/chapter16_08.vcxproj b/examples/chapter16_08/chapter16_08.vcxproj
index 8f6e9ee6c..0a07f5c90 100644
--- a/examples/chapter16_08/chapter16_08.vcxproj
+++ b/examples/chapter16_08/chapter16_08.vcxproj
@@ -54,12 +54,12 @@
- $(SolutionDir)\src;$(SolutionDir)\src\mcal\win32;C:\boost\boost_1_85_0;$(IncludePath)
+ $(SolutionDir)\src;$(SolutionDir)\src\mcal\win32;C:\boost\boost_1_86_0;$(IncludePath)
$(SolutionDir)$(Configuration)\
$(Configuration)\
- $(SolutionDir)\src;$(SolutionDir)\src\mcal\win32;C:\boost\boost_1_85_0;$(IncludePath)
+ $(SolutionDir)\src;$(SolutionDir)\src\mcal\win32;C:\boost\boost_1_86_0;$(IncludePath)
$(SolutionDir)$(Configuration)\
$(Configuration)\
@@ -246,15 +246,27 @@
true
true
+
+ true
+ true
+
+
+ true
+ true
+
+
+ true
+ true
+
+
-
true
@@ -492,6 +504,14 @@
true
true
+
+ true
+ true
+
+
+ true
+ true
+
true
true
@@ -568,6 +588,10 @@
true
true
+
+ true
+ true
+
true
true
@@ -588,6 +612,10 @@
true
true
+
+ true
+ true
+
diff --git a/examples/chapter16_08/chapter16_08.vcxproj.filters b/examples/chapter16_08/chapter16_08.vcxproj.filters
index 9f122d58f..4b9f1b577 100644
--- a/examples/chapter16_08/chapter16_08.vcxproj.filters
+++ b/examples/chapter16_08/chapter16_08.vcxproj.filters
@@ -198,11 +198,17 @@
src\mcal\win32
+
+ src\util\STL\impl\avr
+
+
+ src\util\STL\impl
+
+
+ src\util\STL\impl
+
-
- src\util\STL\impl\avr
-
src\os
@@ -212,18 +218,6 @@
src\os
-
- src\util\STL\impl
-
-
- src\util\STL\impl
-
-
- src\util\STL\impl
-
-
- src\util\STL
-
src\util\STL_C++XX_stdfloat
@@ -464,9 +458,6 @@
src\math\wide_integer\miller_rabin
-
- src\math\wide_integer\miller_rabin
-
src\math\wide_integer\miller_rabin
@@ -521,126 +512,156 @@
src\mcal_led
-
+
+ src\math\test
+
+
+ src\math\wide_integer\miller_rabin
+
+
+ src\util\STL\impl\avr
+
+
src\util\STL\impl
src\util\STL\impl
+
+ src\util\STL\impl
+
+
+ src\util\STL\impl
+
src\util\STL\impl
-
- src\math\test
+
+ src\util\STL\impl
+
+
+ src\util\STL
-
+
+ src\util\STL_C++XX_stdfloat
+
+
src\util\STL
-
+
src\util\STL
-
+
src\util\STL
-
+
src\util\STL
-
+
src\util\STL
-
+
src\util\STL
-
+
src\util\STL
-
+
src\util\STL
-
+
src\util\STL
-
+
src\util\STL
-
+
src\util\STL
-
+
src\util\STL
-
+
src\util\STL
-
+
src\util\STL
-
+
src\util\STL
-
+
src\util\STL
-
+
src\util\STL
-
+
src\util\STL
-
+
src\util\STL
-
+
src\util\STL
-
+
src\util\STL
-
+
src\util\STL
-
+
src\util\STL
-
+
src\util\STL
-
+
src\util\STL
-
+
src\util\STL
-
- src\util\STL_C++XX_stdfloat
+
+ src\util\STL
-
+
src\util\STL
-
+
src\util\STL
-
+
src\util\STL
-
+
src\util\STL
-
+
src\util\STL
-
+
src\util\STL
-
+
+ src\util\STL
+
+
+ src\util\STL
+
+
src\util\STL
src\util\STL
-
+
+ src\util\STL
+
+
src\util\STL
diff --git a/examples/chapter16_08/src/math/test/math_test_independent_test_system_base.h b/examples/chapter16_08/src/math/test/math_test_independent_test_system_base.h
index a026112b1..86a7e48f2 100644
--- a/examples/chapter16_08/src/math/test/math_test_independent_test_system_base.h
+++ b/examples/chapter16_08/src/math/test/math_test_independent_test_system_base.h
@@ -12,15 +12,15 @@
namespace WIDE_INTEGER_NAMESPACE { namespace math { namespace test {
- class independent_test_system_base : private util::noncopyable
+ class independent_test_system_base : private ::util::noncopyable
{
public:
- virtual ~independent_test_system_base() noexcept { }
+ virtual ~independent_test_system_base() noexcept = default;
virtual bool is_prime(const char* const pstr_prime_candidate) const = 0;
protected:
- independent_test_system_base() noexcept { }
+ independent_test_system_base() noexcept = default;
};
} // namespace test
diff --git a/examples/chapter16_08/src/math/test/math_test_independent_test_system_boost.h b/examples/chapter16_08/src/math/test/math_test_independent_test_system_boost.h
index 1fc5f0dcf..6e463bae7 100644
--- a/examples/chapter16_08/src/math/test/math_test_independent_test_system_boost.h
+++ b/examples/chapter16_08/src/math/test/math_test_independent_test_system_boost.h
@@ -18,38 +18,45 @@
namespace WIDE_INTEGER_NAMESPACE { namespace math { namespace test {
+ template
class independent_test_system_boost : public math::test::independent_test_system_base
{
private:
- using uint128_t = boost::multiprecision::uint128_t;
+ static constexpr unsigned boost_uint_digits { Width2 };
+
+ using boost_uint_backend_type =
+ boost::multiprecision::cpp_int_backend;
+
+ using boost_uint_type = boost::multiprecision::number;
+
+ using random_engine_type = std::mt19937_64;
public:
- independent_test_system_boost() noexcept
- : my_gen (std::clock()),
- my_seed_count(0U) { }
+ independent_test_system_boost() noexcept = default;
- virtual ~independent_test_system_boost() noexcept { }
+ ~independent_test_system_boost() noexcept override { }
- virtual bool is_prime(const char* const pstr_prime_candidate) const override
+ auto is_prime(const char* const pstr_prime_candidate) const -> bool override
{
- const uint128_t p(std::string("0x") + pstr_prime_candidate);
+ const boost_uint_type p { std::string("0x") + pstr_prime_candidate };
- const bool is_prime_says_boost_miller_rabin =
- boost::multiprecision::miller_rabin_test(p, 25, my_gen);
+ const bool is_prime_says_boost_miller_rabin = boost::multiprecision::miller_rabin_test(p, 25, my_gen);
++my_seed_count;
if((my_seed_count % 0x1000U) == 0U)
{
- my_gen.seed(std::clock());
+ my_gen.seed(static_cast(std::clock()));
}
return is_prime_says_boost_miller_rabin;
}
private:
- mutable std::mt19937 my_gen;
- mutable std::uint32_t my_seed_count;
+ mutable random_engine_type my_gen { static_cast(std::clock()) };
+ mutable std::uint32_t my_seed_count { };
};
} // namespace test
diff --git a/examples/chapter16_08/src/math/wide_integer/miller_rabin/miller_rabin_base.h b/examples/chapter16_08/src/math/wide_integer/miller_rabin/miller_rabin_base.h
index b935ac667..aaaa9c0e4 100644
--- a/examples/chapter16_08/src/math/wide_integer/miller_rabin/miller_rabin_base.h
+++ b/examples/chapter16_08/src/math/wide_integer/miller_rabin/miller_rabin_base.h
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////////
-// Copyright Christopher Kormanyos 2020 - 2022.
+// Copyright Christopher Kormanyos 2020 - 2024.
// 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)
@@ -8,16 +8,7 @@
#ifndef MILLER_RABIN_BASE_2020_05_30_H_
#define MILLER_RABIN_BASE_2020_05_30_H_
- #define WIDE_INTEGER_DISABLE_IOSTREAM
- #define WIDE_INTEGER_DISABLE_TO_STRING
- #define WIDE_INTEGER_DISABLE_FLOAT_INTEROP
- #define WIDE_INTEGER_DISABLE_IMPLEMENT_UTIL_DYNAMIC_ARRAY
- #define WIDE_INTEGER_DISABLE_TRIVIAL_COPY_AND_STD_LAYOUT_CHECKS
-
- // Note that -DWIDE_INTEGER_NAMESPACE=ckormanyos is defined
- // on the compiler command line.
-
- #include