From d431abba3b36d2e264083f56f0ea8d53119bddbd Mon Sep 17 00:00:00 2001 From: Tyler Veness Date: Sun, 3 Dec 2023 16:40:08 -0800 Subject: [PATCH] [upstream_utils] Fix GCEM namespace usage and add hypot(x, y, z) (#6002) --- ...-functions-if-not-constant-evaluated.patch | 1232 +++++++++++++++-- .../gcem_patches/0002-Add-hypot-x-y-z.patch | 135 ++ upstream_utils/update_gcem.py | 5 +- .../native/thirdparty/gcem/include/gcem.hpp | 129 +- .../thirdparty/gcem/include/gcem_incl/abs.hpp | 5 + .../gcem/include/gcem_incl/acos.hpp | 5 + .../gcem/include/gcem_incl/acosh.hpp | 5 + .../gcem/include/gcem_incl/asin.hpp | 5 + .../gcem/include/gcem_incl/asinh.hpp | 4 + .../gcem/include/gcem_incl/atan.hpp | 5 + .../gcem/include/gcem_incl/atan2.hpp | 5 + .../gcem/include/gcem_incl/atanh.hpp | 5 + .../gcem/include/gcem_incl/beta.hpp | 5 + .../gcem/include/gcem_incl/binomial_coef.hpp | 7 +- .../gcem/include/gcem_incl/ceil.hpp | 5 + .../gcem/include/gcem_incl/copysign.hpp | 5 + .../thirdparty/gcem/include/gcem_incl/cos.hpp | 5 + .../gcem/include/gcem_incl/cosh.hpp | 5 + .../thirdparty/gcem/include/gcem_incl/erf.hpp | 5 + .../gcem/include/gcem_incl/erf_inv.hpp | 4 + .../thirdparty/gcem/include/gcem_incl/exp.hpp | 5 + .../gcem/include/gcem_incl/expm1.hpp | 5 + .../gcem/include/gcem_incl/factorial.hpp | 5 + .../gcem/include/gcem_incl/find_exponent.hpp | 5 + .../gcem/include/gcem_incl/find_fraction.hpp | 5 + .../gcem/include/gcem_incl/find_whole.hpp | 5 + .../gcem/include/gcem_incl/floor.hpp | 5 + .../gcem/include/gcem_incl/fmod.hpp | 5 + .../thirdparty/gcem/include/gcem_incl/gcd.hpp | 5 + .../gcem/include/gcem_incl/hypot.hpp | 90 +- .../include/gcem_incl/incomplete_beta.hpp | 5 + .../include/gcem_incl/incomplete_beta_inv.hpp | 5 + .../include/gcem_incl/incomplete_gamma.hpp | 5 + .../gcem_incl/incomplete_gamma_inv.hpp | 5 + .../gcem/include/gcem_incl/inv_sqrt.hpp | 5 + .../gcem/include/gcem_incl/is_even.hpp | 5 + .../gcem/include/gcem_incl/is_finite.hpp | 5 + .../gcem/include/gcem_incl/is_inf.hpp | 5 + .../gcem/include/gcem_incl/is_nan.hpp | 5 + .../gcem/include/gcem_incl/is_odd.hpp | 5 + .../gcem/include/gcem_incl/lbeta.hpp | 5 + .../thirdparty/gcem/include/gcem_incl/lcm.hpp | 5 + .../gcem/include/gcem_incl/lgamma.hpp | 5 + .../gcem/include/gcem_incl/lmgamma.hpp | 5 + .../thirdparty/gcem/include/gcem_incl/log.hpp | 5 + .../gcem/include/gcem_incl/log10.hpp | 5 + .../gcem/include/gcem_incl/log1p.hpp | 5 + .../gcem/include/gcem_incl/log2.hpp | 5 + .../include/gcem_incl/log_binomial_coef.hpp | 7 +- .../gcem/include/gcem_incl/mantissa.hpp | 5 + .../thirdparty/gcem/include/gcem_incl/max.hpp | 5 + .../thirdparty/gcem/include/gcem_incl/min.hpp | 5 + .../gcem/include/gcem_incl/neg_zero.hpp | 5 + .../thirdparty/gcem/include/gcem_incl/pow.hpp | 5 + .../gcem/include/gcem_incl/pow_integral.hpp | 5 + .../quadrature/gauss_legendre_30.hpp | 5 + .../quadrature/gauss_legendre_50.hpp | 5 + .../gcem/include/gcem_incl/round.hpp | 5 + .../thirdparty/gcem/include/gcem_incl/sgn.hpp | 5 + .../gcem/include/gcem_incl/signbit.hpp | 5 + .../thirdparty/gcem/include/gcem_incl/sin.hpp | 5 + .../gcem/include/gcem_incl/sinh.hpp | 5 + .../gcem/include/gcem_incl/sqrt.hpp | 5 + .../thirdparty/gcem/include/gcem_incl/tan.hpp | 5 + .../gcem/include/gcem_incl/tanh.hpp | 5 + .../gcem/include/gcem_incl/tgamma.hpp | 5 + .../gcem/include/gcem_incl/trunc.hpp | 5 + 67 files changed, 1685 insertions(+), 218 deletions(-) create mode 100644 upstream_utils/gcem_patches/0002-Add-hypot-x-y-z.patch diff --git a/upstream_utils/gcem_patches/0001-Call-std-functions-if-not-constant-evaluated.patch b/upstream_utils/gcem_patches/0001-Call-std-functions-if-not-constant-evaluated.patch index afea15ef9a..b7742f0e2b 100644 --- a/upstream_utils/gcem_patches/0001-Call-std-functions-if-not-constant-evaluated.patch +++ b/upstream_utils/gcem_patches/0001-Call-std-functions-if-not-constant-evaluated.patch @@ -1,62 +1,257 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Tyler Veness Date: Sun, 26 Nov 2023 18:09:12 -0800 -Subject: [PATCH] Call std functions if not constant-evaluated +Subject: [PATCH 1/2] Call std functions if not constant-evaluated +The subheaders now have namespace declarations so C++ standard library +headers can be included in the global namespace. Doing otherwise can +cause ambiguous declarations of cmath functions. --- - include/gcem_incl/abs.hpp | 7 +++++++ - include/gcem_incl/acos.hpp | 7 +++++++ - include/gcem_incl/acosh.hpp | 7 +++++++ - include/gcem_incl/asin.hpp | 7 +++++++ - include/gcem_incl/asinh.hpp | 7 +++++++ - include/gcem_incl/atan.hpp | 7 +++++++ - include/gcem_incl/atan2.hpp | 7 +++++++ - include/gcem_incl/atanh.hpp | 7 +++++++ - include/gcem_incl/beta.hpp | 11 +++++++++++ - include/gcem_incl/ceil.hpp | 7 +++++++ - include/gcem_incl/copysign.hpp | 7 +++++++ - include/gcem_incl/cos.hpp | 7 +++++++ - include/gcem_incl/cosh.hpp | 7 +++++++ - include/gcem_incl/erf.hpp | 7 +++++++ - include/gcem_incl/exp.hpp | 7 +++++++ - include/gcem_incl/expm1.hpp | 7 +++++++ - include/gcem_incl/floor.hpp | 7 +++++++ - include/gcem_incl/fmod.hpp | 7 +++++++ - include/gcem_incl/hypot.hpp | 7 +++++++ - include/gcem_incl/lgamma.hpp | 7 +++++++ - include/gcem_incl/log.hpp | 7 +++++++ - include/gcem_incl/log10.hpp | 7 +++++++ - include/gcem_incl/log1p.hpp | 7 +++++++ - include/gcem_incl/log2.hpp | 7 +++++++ - include/gcem_incl/max.hpp | 7 +++++++ - include/gcem_incl/min.hpp | 7 +++++++ - include/gcem_incl/pow.hpp | 7 +++++++ - include/gcem_incl/round.hpp | 7 +++++++ - include/gcem_incl/signbit.hpp | 7 +++++++ - include/gcem_incl/sin.hpp | 7 +++++++ - include/gcem_incl/sinh.hpp | 7 +++++++ - include/gcem_incl/sqrt.hpp | 7 +++++++ - include/gcem_incl/tan.hpp | 7 +++++++ - include/gcem_incl/tanh.hpp | 7 +++++++ - include/gcem_incl/tgamma.hpp | 7 +++++++ - include/gcem_incl/trunc.hpp | 7 +++++++ - 36 files changed, 256 insertions(+) + include/gcem.hpp | 151 +++++++++--------- + include/gcem_incl/abs.hpp | 12 ++ + include/gcem_incl/acos.hpp | 12 ++ + include/gcem_incl/acosh.hpp | 12 ++ + include/gcem_incl/asin.hpp | 12 ++ + include/gcem_incl/asinh.hpp | 11 ++ + include/gcem_incl/atan.hpp | 12 ++ + include/gcem_incl/atan2.hpp | 12 ++ + include/gcem_incl/atanh.hpp | 12 ++ + include/gcem_incl/beta.hpp | 16 ++ + include/gcem_incl/binomial_coef.hpp | 7 +- + include/gcem_incl/ceil.hpp | 12 ++ + include/gcem_incl/copysign.hpp | 12 ++ + include/gcem_incl/cos.hpp | 12 ++ + include/gcem_incl/cosh.hpp | 12 ++ + include/gcem_incl/erf.hpp | 12 ++ + include/gcem_incl/erf_inv.hpp | 4 + + include/gcem_incl/exp.hpp | 12 ++ + include/gcem_incl/expm1.hpp | 12 ++ + include/gcem_incl/factorial.hpp | 5 + + include/gcem_incl/find_exponent.hpp | 5 + + include/gcem_incl/find_fraction.hpp | 5 + + include/gcem_incl/find_whole.hpp | 5 + + include/gcem_incl/floor.hpp | 12 ++ + include/gcem_incl/fmod.hpp | 12 ++ + include/gcem_incl/gcd.hpp | 5 + + include/gcem_incl/hypot.hpp | 12 ++ + include/gcem_incl/incomplete_beta.hpp | 5 + + include/gcem_incl/incomplete_beta_inv.hpp | 5 + + include/gcem_incl/incomplete_gamma.hpp | 5 + + include/gcem_incl/incomplete_gamma_inv.hpp | 5 + + include/gcem_incl/inv_sqrt.hpp | 5 + + include/gcem_incl/is_even.hpp | 5 + + include/gcem_incl/is_finite.hpp | 5 + + include/gcem_incl/is_inf.hpp | 5 + + include/gcem_incl/is_nan.hpp | 5 + + include/gcem_incl/is_odd.hpp | 5 + + include/gcem_incl/lbeta.hpp | 5 + + include/gcem_incl/lcm.hpp | 5 + + include/gcem_incl/lgamma.hpp | 12 ++ + include/gcem_incl/lmgamma.hpp | 5 + + include/gcem_incl/log.hpp | 12 ++ + include/gcem_incl/log10.hpp | 12 ++ + include/gcem_incl/log1p.hpp | 12 ++ + include/gcem_incl/log2.hpp | 12 ++ + include/gcem_incl/log_binomial_coef.hpp | 7 +- + include/gcem_incl/mantissa.hpp | 5 + + include/gcem_incl/max.hpp | 12 ++ + include/gcem_incl/min.hpp | 12 ++ + include/gcem_incl/neg_zero.hpp | 5 + + include/gcem_incl/pow.hpp | 12 ++ + include/gcem_incl/pow_integral.hpp | 5 + + .../quadrature/gauss_legendre_30.hpp | 5 + + .../quadrature/gauss_legendre_50.hpp | 5 + + include/gcem_incl/round.hpp | 12 ++ + include/gcem_incl/sgn.hpp | 5 + + include/gcem_incl/signbit.hpp | 12 ++ + include/gcem_incl/sin.hpp | 12 ++ + include/gcem_incl/sinh.hpp | 12 ++ + include/gcem_incl/sqrt.hpp | 12 ++ + include/gcem_incl/tan.hpp | 12 ++ + include/gcem_incl/tanh.hpp | 12 ++ + include/gcem_incl/tgamma.hpp | 12 ++ + include/gcem_incl/trunc.hpp | 12 ++ + 64 files changed, 645 insertions(+), 79 deletions(-) +diff --git a/include/gcem.hpp b/include/gcem.hpp +index 650d05d894786b123aefbc6d88c93604164d56d2..8ea7b2a279ecf4dcf684a39ee7e96db84e61a421 100644 +--- a/include/gcem.hpp ++++ b/include/gcem.hpp +@@ -23,82 +23,79 @@ + + #include "gcem_incl/gcem_options.hpp" + +-namespace gcem +-{ +- #include "gcem_incl/quadrature/gauss_legendre_50.hpp" +- +- #include "gcem_incl/is_inf.hpp" +- #include "gcem_incl/is_nan.hpp" +- #include "gcem_incl/is_finite.hpp" +- +- #include "gcem_incl/signbit.hpp" +- #include "gcem_incl/copysign.hpp" +- #include "gcem_incl/neg_zero.hpp" +- #include "gcem_incl/sgn.hpp" +- +- #include "gcem_incl/abs.hpp" +- #include "gcem_incl/ceil.hpp" +- #include "gcem_incl/floor.hpp" +- #include "gcem_incl/trunc.hpp" +- #include "gcem_incl/is_odd.hpp" +- #include "gcem_incl/is_even.hpp" +- #include "gcem_incl/max.hpp" +- #include "gcem_incl/min.hpp" +- #include "gcem_incl/sqrt.hpp" +- #include "gcem_incl/inv_sqrt.hpp" +- #include "gcem_incl/hypot.hpp" +- +- #include "gcem_incl/find_exponent.hpp" +- #include "gcem_incl/find_fraction.hpp" +- #include "gcem_incl/find_whole.hpp" +- #include "gcem_incl/mantissa.hpp" +- #include "gcem_incl/round.hpp" +- #include "gcem_incl/fmod.hpp" +- +- #include "gcem_incl/pow_integral.hpp" +- #include "gcem_incl/exp.hpp" +- #include "gcem_incl/expm1.hpp" +- #include "gcem_incl/log.hpp" +- #include "gcem_incl/log1p.hpp" +- #include "gcem_incl/log2.hpp" +- #include "gcem_incl/log10.hpp" +- #include "gcem_incl/pow.hpp" +- +- #include "gcem_incl/gcd.hpp" +- #include "gcem_incl/lcm.hpp" +- +- #include "gcem_incl/tan.hpp" +- #include "gcem_incl/cos.hpp" +- #include "gcem_incl/sin.hpp" +- +- #include "gcem_incl/atan.hpp" +- #include "gcem_incl/atan2.hpp" +- #include "gcem_incl/acos.hpp" +- #include "gcem_incl/asin.hpp" +- +- #include "gcem_incl/tanh.hpp" +- #include "gcem_incl/cosh.hpp" +- #include "gcem_incl/sinh.hpp" +- +- #include "gcem_incl/atanh.hpp" +- #include "gcem_incl/acosh.hpp" +- #include "gcem_incl/asinh.hpp" +- +- #include "gcem_incl/binomial_coef.hpp" +- #include "gcem_incl/lgamma.hpp" +- #include "gcem_incl/tgamma.hpp" +- #include "gcem_incl/factorial.hpp" +- #include "gcem_incl/lbeta.hpp" +- #include "gcem_incl/beta.hpp" +- #include "gcem_incl/lmgamma.hpp" +- #include "gcem_incl/log_binomial_coef.hpp" +- +- #include "gcem_incl/erf.hpp" +- #include "gcem_incl/erf_inv.hpp" +- #include "gcem_incl/incomplete_beta.hpp" +- #include "gcem_incl/incomplete_beta_inv.hpp" +- #include "gcem_incl/incomplete_gamma.hpp" +- #include "gcem_incl/incomplete_gamma_inv.hpp" +-} ++#include "gcem_incl/quadrature/gauss_legendre_50.hpp" ++ ++#include "gcem_incl/is_inf.hpp" ++#include "gcem_incl/is_nan.hpp" ++#include "gcem_incl/is_finite.hpp" ++ ++#include "gcem_incl/signbit.hpp" ++#include "gcem_incl/copysign.hpp" ++#include "gcem_incl/neg_zero.hpp" ++#include "gcem_incl/sgn.hpp" ++ ++#include "gcem_incl/abs.hpp" ++#include "gcem_incl/ceil.hpp" ++#include "gcem_incl/floor.hpp" ++#include "gcem_incl/trunc.hpp" ++#include "gcem_incl/is_odd.hpp" ++#include "gcem_incl/is_even.hpp" ++#include "gcem_incl/max.hpp" ++#include "gcem_incl/min.hpp" ++#include "gcem_incl/sqrt.hpp" ++#include "gcem_incl/inv_sqrt.hpp" ++#include "gcem_incl/hypot.hpp" ++ ++#include "gcem_incl/find_exponent.hpp" ++#include "gcem_incl/find_fraction.hpp" ++#include "gcem_incl/find_whole.hpp" ++#include "gcem_incl/mantissa.hpp" ++#include "gcem_incl/round.hpp" ++#include "gcem_incl/fmod.hpp" ++ ++#include "gcem_incl/pow_integral.hpp" ++#include "gcem_incl/exp.hpp" ++#include "gcem_incl/expm1.hpp" ++#include "gcem_incl/log.hpp" ++#include "gcem_incl/log1p.hpp" ++#include "gcem_incl/log2.hpp" ++#include "gcem_incl/log10.hpp" ++#include "gcem_incl/pow.hpp" ++ ++#include "gcem_incl/gcd.hpp" ++#include "gcem_incl/lcm.hpp" ++ ++#include "gcem_incl/tan.hpp" ++#include "gcem_incl/cos.hpp" ++#include "gcem_incl/sin.hpp" ++ ++#include "gcem_incl/atan.hpp" ++#include "gcem_incl/atan2.hpp" ++#include "gcem_incl/acos.hpp" ++#include "gcem_incl/asin.hpp" ++ ++#include "gcem_incl/tanh.hpp" ++#include "gcem_incl/cosh.hpp" ++#include "gcem_incl/sinh.hpp" ++ ++#include "gcem_incl/atanh.hpp" ++#include "gcem_incl/acosh.hpp" ++#include "gcem_incl/asinh.hpp" ++ ++#include "gcem_incl/binomial_coef.hpp" ++#include "gcem_incl/lgamma.hpp" ++#include "gcem_incl/tgamma.hpp" ++#include "gcem_incl/factorial.hpp" ++#include "gcem_incl/lbeta.hpp" ++#include "gcem_incl/beta.hpp" ++#include "gcem_incl/lmgamma.hpp" ++#include "gcem_incl/log_binomial_coef.hpp" ++ ++#include "gcem_incl/erf.hpp" ++#include "gcem_incl/erf_inv.hpp" ++#include "gcem_incl/incomplete_beta.hpp" ++#include "gcem_incl/incomplete_beta_inv.hpp" ++#include "gcem_incl/incomplete_gamma.hpp" ++#include "gcem_incl/incomplete_gamma_inv.hpp" + + #endif diff --git a/include/gcem_incl/abs.hpp b/include/gcem_incl/abs.hpp -index 6d7b66d91bc9f4d0c05fd0c3dd1571b552d8a19a..32ee89494c088a51862f00aecadeb180c0159997 100644 +index 6d7b66d91bc9f4d0c05fd0c3dd1571b552d8a19a..8e8330b198a206ea4f422d6782c66fe92bdd6522 100644 --- a/include/gcem_incl/abs.hpp +++ b/include/gcem_incl/abs.hpp -@@ -21,6 +21,9 @@ +@@ -21,6 +21,12 @@ #ifndef _gcem_abs_HPP #define _gcem_abs_HPP +#include +#include ++ ++namespace gcem ++{ + /** * Compile-time absolute value function * -@@ -34,12 +37,16 @@ T +@@ -34,12 +40,18 @@ T abs(const T x) noexcept { @@ -70,24 +265,29 @@ index 6d7b66d91bc9f4d0c05fd0c3dd1571b552d8a19a..32ee89494c088a51862f00aecadeb180 + } else { + return std::abs(x); + } ++} ++ } #endif diff --git a/include/gcem_incl/acos.hpp b/include/gcem_incl/acos.hpp -index a47003d61d8ab2fb7dd0226410e1457809a73458..c40006de7f3747c8eb2678dc5c1187d6f72a30e3 100644 +index a47003d61d8ab2fb7dd0226410e1457809a73458..2e24d2acb61b5a5b647e707950cded8850b0ea66 100644 --- a/include/gcem_incl/acos.hpp +++ b/include/gcem_incl/acos.hpp -@@ -25,6 +25,9 @@ +@@ -25,6 +25,12 @@ #ifndef _gcem_acos_HPP #define _gcem_acos_HPP +#include +#include ++ ++namespace gcem ++{ + namespace internal { -@@ -78,7 +81,11 @@ return_t +@@ -78,7 +84,13 @@ return_t acos(const T x) noexcept { @@ -96,24 +296,29 @@ index a47003d61d8ab2fb7dd0226410e1457809a73458..c40006de7f3747c8eb2678dc5c1187d6 + } else { + return std::acos(x); + } ++} ++ } #endif diff --git a/include/gcem_incl/acosh.hpp b/include/gcem_incl/acosh.hpp -index 8767200778168aeb409f16945b2ceac75b69158d..edf71db655bacd376174fdf212312ec201dc48a6 100644 +index 8767200778168aeb409f16945b2ceac75b69158d..778c36cad6ebd849696aaa68d2697a5145a410a3 100644 --- a/include/gcem_incl/acosh.hpp +++ b/include/gcem_incl/acosh.hpp -@@ -25,6 +25,9 @@ +@@ -25,6 +25,12 @@ #ifndef _gcem_acosh_HPP #define _gcem_acosh_HPP +#include +#include ++ ++namespace gcem ++{ + namespace internal { -@@ -62,7 +65,11 @@ return_t +@@ -62,7 +68,13 @@ return_t acosh(const T x) noexcept { @@ -122,24 +327,29 @@ index 8767200778168aeb409f16945b2ceac75b69158d..edf71db655bacd376174fdf212312ec2 + } else { + return std::acosh(x); + } ++} ++ } #endif diff --git a/include/gcem_incl/asin.hpp b/include/gcem_incl/asin.hpp -index 6a79e87df435c7e60b140b7c7133b22deea7fd73..57840d4b1a0dba4943662b2cf2979ec14ace16f0 100644 +index 6a79e87df435c7e60b140b7c7133b22deea7fd73..39784aa10eb07ea9328ab819a1f396dd036719b4 100644 --- a/include/gcem_incl/asin.hpp +++ b/include/gcem_incl/asin.hpp -@@ -25,6 +25,9 @@ +@@ -25,6 +25,12 @@ #ifndef _gcem_asin_HPP #define _gcem_asin_HPP +#include +#include ++ ++namespace gcem ++{ + namespace internal { -@@ -76,7 +79,11 @@ return_t +@@ -76,7 +82,13 @@ return_t asin(const T x) noexcept { @@ -148,24 +358,29 @@ index 6a79e87df435c7e60b140b7c7133b22deea7fd73..57840d4b1a0dba4943662b2cf2979ec1 + } else { + return std::asin(x); + } ++} ++ } #endif diff --git a/include/gcem_incl/asinh.hpp b/include/gcem_incl/asinh.hpp -index a5f3ff62a0208d350f4027d736ce3fc035c16ded..7e5190289abe60eb591a4f43db41370b10892949 100644 +index a5f3ff62a0208d350f4027d736ce3fc035c16ded..0a5969369a7a7856e41de1d891d571d5dd3c481f 100644 --- a/include/gcem_incl/asinh.hpp +++ b/include/gcem_incl/asinh.hpp -@@ -25,6 +25,9 @@ +@@ -25,6 +25,12 @@ #ifndef _gcem_asinh_HPP #define _gcem_asinh_HPP +#include +#include ++ ++namespace gcem ++{ + namespace internal { -@@ -59,7 +62,11 @@ return_t +@@ -59,8 +65,13 @@ return_t asinh(const T x) noexcept { @@ -176,22 +391,27 @@ index a5f3ff62a0208d350f4027d736ce3fc035c16ded..7e5190289abe60eb591a4f43db41370b + } } ++} + #endif diff --git a/include/gcem_incl/atan.hpp b/include/gcem_incl/atan.hpp -index 3f46974c07920fca6396e42e93261d8167a27eb1..9ebd33e65d06d14d5091e60f660e1769835f4ade 100644 +index 3f46974c07920fca6396e42e93261d8167a27eb1..19b9d4e10d75b067527133060d3b07719f6cfb4c 100644 --- a/include/gcem_incl/atan.hpp +++ b/include/gcem_incl/atan.hpp -@@ -29,6 +29,9 @@ +@@ -29,6 +29,12 @@ #ifndef _gcem_atan_HPP #define _gcem_atan_HPP +#include +#include ++ ++namespace gcem ++{ + namespace internal { -@@ -149,7 +152,11 @@ return_t +@@ -149,7 +155,13 @@ return_t atan(const T x) noexcept { @@ -200,24 +420,29 @@ index 3f46974c07920fca6396e42e93261d8167a27eb1..9ebd33e65d06d14d5091e60f660e1769 + } else { + return std::atan(x); + } ++} ++ } #endif diff --git a/include/gcem_incl/atan2.hpp b/include/gcem_incl/atan2.hpp -index 5ca55b79c8e11569511fb6d4842c74be50c70c67..d3abcd88c9e0c1e0f3f62659934cb101b8478214 100644 +index 5ca55b79c8e11569511fb6d4842c74be50c70c67..07a02cf4a2e134705b514a1031d1d7f47294bdf1 100644 --- a/include/gcem_incl/atan2.hpp +++ b/include/gcem_incl/atan2.hpp -@@ -25,6 +25,9 @@ +@@ -25,6 +25,12 @@ #ifndef _gcem_atan2_HPP #define _gcem_atan2_HPP +#include +#include ++ ++namespace gcem ++{ + namespace internal { -@@ -82,7 +85,11 @@ common_return_t +@@ -82,7 +88,13 @@ common_return_t atan2(const T1 y, const T2 x) noexcept { @@ -226,24 +451,29 @@ index 5ca55b79c8e11569511fb6d4842c74be50c70c67..d3abcd88c9e0c1e0f3f62659934cb101 + } else { + return std::atan2(y, x); + } ++} ++ } #endif diff --git a/include/gcem_incl/atanh.hpp b/include/gcem_incl/atanh.hpp -index dfb4dc312d479e2c6dd837d2391bc658e3b678ed..753d469857e5d618c447887f03991a76ab9043a5 100644 +index dfb4dc312d479e2c6dd837d2391bc658e3b678ed..5c4475bead1034c1b5b1583ad3050a85d380d629 100644 --- a/include/gcem_incl/atanh.hpp +++ b/include/gcem_incl/atanh.hpp -@@ -25,6 +25,9 @@ +@@ -25,6 +25,12 @@ #ifndef _gcem_atanh_HPP #define _gcem_atanh_HPP +#include +#include ++ ++namespace gcem ++{ + namespace internal { -@@ -73,7 +76,11 @@ return_t +@@ -73,7 +79,13 @@ return_t atanh(const T x) noexcept { @@ -252,24 +482,29 @@ index dfb4dc312d479e2c6dd837d2391bc658e3b678ed..753d469857e5d618c447887f03991a76 + } else { + return std::atanh(x); + } ++} ++ } #endif diff --git a/include/gcem_incl/beta.hpp b/include/gcem_incl/beta.hpp -index e43d4fcd9a10e37e16652351ec7092cb7200f808..b7da514a255b71714766deeee87906e4af3bef09 100644 +index e43d4fcd9a10e37e16652351ec7092cb7200f808..3439af1b57e0135eb1c53a15d14dbbbfbe57bc13 100644 --- a/include/gcem_incl/beta.hpp +++ b/include/gcem_incl/beta.hpp -@@ -21,6 +21,9 @@ +@@ -21,6 +21,12 @@ #ifndef _gcem_beta_HPP #define _gcem_beta_HPP +#include +#include ++ ++namespace gcem ++{ + /** * Compile-time beta function * -@@ -36,7 +39,15 @@ common_return_t +@@ -36,7 +42,17 @@ common_return_t beta(const T1 a, const T2 b) noexcept { @@ -282,24 +517,52 @@ index e43d4fcd9a10e37e16652351ec7092cb7200f808..b7da514a255b71714766deeee87906e4 return exp( lbeta(a,b) ); +#endif + } ++} ++ } #endif +diff --git a/include/gcem_incl/binomial_coef.hpp b/include/gcem_incl/binomial_coef.hpp +index 0fc17f384d708b4bd81905d49b20f8037c4701ae..a1f764b97b78cbaf8fb66117dab374dc55f04d49 100644 +--- a/include/gcem_incl/binomial_coef.hpp ++++ b/include/gcem_incl/binomial_coef.hpp +@@ -21,6 +21,9 @@ + #ifndef _gcem_binomial_coef_HPP + #define _gcem_binomial_coef_HPP + ++namespace gcem ++{ ++ + namespace internal + { + +@@ -88,4 +91,6 @@ noexcept + return internal::binomial_coef_type_check(n,k); + } + +-#endif +\ No newline at end of file ++} ++ ++#endif diff --git a/include/gcem_incl/ceil.hpp b/include/gcem_incl/ceil.hpp -index ff1097bac2f53c3f6a4b3d4bfc612e0fcd34a63b..257ff0550c50f3ac5e82b1d08905e1a13a5c88ed 100644 +index ff1097bac2f53c3f6a4b3d4bfc612e0fcd34a63b..2611e6560bfefc4efe782849c88d74bc3ebf9d76 100644 --- a/include/gcem_incl/ceil.hpp +++ b/include/gcem_incl/ceil.hpp -@@ -21,6 +21,9 @@ +@@ -21,6 +21,12 @@ #ifndef _gcem_ceil_HPP #define _gcem_ceil_HPP +#include +#include ++ ++namespace gcem ++{ + namespace internal { -@@ -124,7 +127,11 @@ return_t +@@ -124,7 +130,13 @@ return_t ceil(const T x) noexcept { @@ -308,24 +571,29 @@ index ff1097bac2f53c3f6a4b3d4bfc612e0fcd34a63b..257ff0550c50f3ac5e82b1d08905e1a1 + } else { + return std::ceil(x); + } ++} ++ } #endif diff --git a/include/gcem_incl/copysign.hpp b/include/gcem_incl/copysign.hpp -index c1741f7f321110ff3cf52cb9035d5f2dca5f0ffc..eecfea21a2dd431243a55c3bcdebc5f7ddbb2297 100644 +index c1741f7f321110ff3cf52cb9035d5f2dca5f0ffc..d1181995c7d0fd92668c766f7fd9288c17312159 100644 --- a/include/gcem_incl/copysign.hpp +++ b/include/gcem_incl/copysign.hpp -@@ -21,6 +21,9 @@ +@@ -21,6 +21,12 @@ #ifndef _gcem_copysign_HPP #define _gcem_copysign_HPP +#include +#include ++ ++namespace gcem ++{ + /** * Compile-time copy sign function * -@@ -35,7 +38,11 @@ T1 +@@ -35,7 +41,13 @@ T1 copysign(const T1 x, const T2 y) noexcept { @@ -334,24 +602,29 @@ index c1741f7f321110ff3cf52cb9035d5f2dca5f0ffc..eecfea21a2dd431243a55c3bcdebc5f7 + } else { + return std::copysign(x, y); + } ++} ++ } #endif diff --git a/include/gcem_incl/cos.hpp b/include/gcem_incl/cos.hpp -index 82f4c609f5268d19771e281987ed1653e81ef173..9c8181bb991508d79c5fc427c6e5c4c1ae0b46fa 100644 +index 82f4c609f5268d19771e281987ed1653e81ef173..be73b55e3f2023538d33eedc78c9ed3e93014384 100644 --- a/include/gcem_incl/cos.hpp +++ b/include/gcem_incl/cos.hpp -@@ -25,6 +25,9 @@ +@@ -25,6 +25,12 @@ #ifndef _gcem_cos_HPP #define _gcem_cos_HPP +#include +#include ++ ++namespace gcem ++{ + namespace internal { -@@ -77,7 +80,11 @@ return_t +@@ -77,7 +83,13 @@ return_t cos(const T x) noexcept { @@ -360,24 +633,29 @@ index 82f4c609f5268d19771e281987ed1653e81ef173..9c8181bb991508d79c5fc427c6e5c4c1 + } else { + return std::cos(x); + } ++} ++ } #endif diff --git a/include/gcem_incl/cosh.hpp b/include/gcem_incl/cosh.hpp -index fc89c0d06482a687442998da511eb1e7b17f95d5..225c37a011857725ff77af8e0ff3cd3d779843e4 100644 +index fc89c0d06482a687442998da511eb1e7b17f95d5..53e5bb12641b4f13d43aee7a77c0d02bf845688a 100644 --- a/include/gcem_incl/cosh.hpp +++ b/include/gcem_incl/cosh.hpp -@@ -25,6 +25,9 @@ +@@ -25,6 +25,12 @@ #ifndef _gcem_cosh_HPP #define _gcem_cosh_HPP +#include +#include ++ ++namespace gcem ++{ + namespace internal { -@@ -59,7 +62,11 @@ return_t +@@ -59,7 +65,13 @@ return_t cosh(const T x) noexcept { @@ -386,24 +664,29 @@ index fc89c0d06482a687442998da511eb1e7b17f95d5..225c37a011857725ff77af8e0ff3cd3d + } else { + return std::cosh(x); + } ++} ++ } #endif diff --git a/include/gcem_incl/erf.hpp b/include/gcem_incl/erf.hpp -index d0bc83ada14af7a4b50262541c8558016823303a..ee5386325b1cde9a447c384488afb837358c5fef 100644 +index d0bc83ada14af7a4b50262541c8558016823303a..319669d7f0d0bfd0cd91e3bd94e9bbd0c92c66ea 100644 --- a/include/gcem_incl/erf.hpp +++ b/include/gcem_incl/erf.hpp -@@ -25,6 +25,9 @@ +@@ -25,6 +25,12 @@ #ifndef _gcem_erf_HPP #define _gcem_erf_HPP +#include +#include ++ ++namespace gcem ++{ + namespace internal { -@@ -137,7 +140,11 @@ return_t +@@ -137,7 +143,13 @@ return_t erf(const T x) noexcept { @@ -412,24 +695,50 @@ index d0bc83ada14af7a4b50262541c8558016823303a..ee5386325b1cde9a447c384488afb837 + } else { + return std::erf(x); + } ++} ++ } + #endif +diff --git a/include/gcem_incl/erf_inv.hpp b/include/gcem_incl/erf_inv.hpp +index 412d686be268dd7668ca517e10e5e4be4263f0d7..c4f0d9d5abb46172fda7c6702bc31561f5680a37 100644 +--- a/include/gcem_incl/erf_inv.hpp ++++ b/include/gcem_incl/erf_inv.hpp +@@ -28,6 +28,9 @@ + #ifndef _gcem_erf_inv_HPP + #define _gcem_erf_inv_HPP + ++namespace gcem ++{ ++ + namespace internal + { + +@@ -260,5 +263,6 @@ noexcept + return internal::erf_inv_begin( static_cast>(p) ); + } + ++} + #endif diff --git a/include/gcem_incl/exp.hpp b/include/gcem_incl/exp.hpp -index 595ffc2a6202d763560fd879f27fcef32c6b2d64..acbda39377fbf9936a439e71dd760fb6203bd138 100644 +index 595ffc2a6202d763560fd879f27fcef32c6b2d64..1708542df5153aeb6c2366078f32660ea002d51c 100644 --- a/include/gcem_incl/exp.hpp +++ b/include/gcem_incl/exp.hpp -@@ -25,6 +25,9 @@ +@@ -25,6 +25,12 @@ #ifndef _gcem_exp_HPP #define _gcem_exp_HPP +#include +#include ++ ++namespace gcem ++{ + namespace internal { -@@ -124,7 +127,11 @@ return_t +@@ -124,7 +130,13 @@ return_t exp(const T x) noexcept { @@ -438,24 +747,29 @@ index 595ffc2a6202d763560fd879f27fcef32c6b2d64..acbda39377fbf9936a439e71dd760fb6 + } else { + return std::exp(x); + } ++} ++ } #endif diff --git a/include/gcem_incl/expm1.hpp b/include/gcem_incl/expm1.hpp -index 70c9ecf5a4a241bfef617e6e4ee0000a80978355..edecd394cfc54e32713d7ed381db6fa8e0057983 100644 +index 70c9ecf5a4a241bfef617e6e4ee0000a80978355..6adddc929aff7c87395a6b78070c65646ad61f2f 100644 --- a/include/gcem_incl/expm1.hpp +++ b/include/gcem_incl/expm1.hpp -@@ -25,6 +25,9 @@ +@@ -25,6 +25,12 @@ #ifndef _gcem_expm1_HPP #define _gcem_expm1_HPP +#include +#include ++ ++namespace gcem ++{ + namespace internal { -@@ -70,7 +73,11 @@ return_t +@@ -70,7 +76,13 @@ return_t expm1(const T x) noexcept { @@ -464,24 +778,113 @@ index 70c9ecf5a4a241bfef617e6e4ee0000a80978355..edecd394cfc54e32713d7ed381db6fa8 + } else { + return std::expm1(x); + } ++} ++ } + #endif +diff --git a/include/gcem_incl/factorial.hpp b/include/gcem_incl/factorial.hpp +index ffb9c824751a572c0982e11b9cddbe40cb567a3f..977e6970e4479ab39e65affbdd400827d29e7809 100644 +--- a/include/gcem_incl/factorial.hpp ++++ b/include/gcem_incl/factorial.hpp +@@ -25,6 +25,9 @@ + #ifndef _gcem_factorial_HPP + #define _gcem_factorial_HPP + ++namespace gcem ++{ ++ + namespace internal + { + +@@ -95,4 +98,6 @@ noexcept + return internal::factorial_recur(x); + } + ++} ++ + #endif +diff --git a/include/gcem_incl/find_exponent.hpp b/include/gcem_incl/find_exponent.hpp +index 200e4e9be1558a61ed608be290bde5a6921363ea..4ffbcf294e61aa847d3e769e50ad9c3eddd8927a 100644 +--- a/include/gcem_incl/find_exponent.hpp ++++ b/include/gcem_incl/find_exponent.hpp +@@ -25,6 +25,9 @@ + #ifndef _gcem_find_exponent_HPP + #define _gcem_find_exponent_HPP + ++namespace gcem ++{ ++ + namespace internal + { + +@@ -54,4 +57,6 @@ noexcept + + } + ++} ++ + #endif +diff --git a/include/gcem_incl/find_fraction.hpp b/include/gcem_incl/find_fraction.hpp +index 5ed3d269ab54b3c90b3d681b76e8420e89e4527f..76893135383e5f6f5993d335c7b232114fdd90e3 100644 +--- a/include/gcem_incl/find_fraction.hpp ++++ b/include/gcem_incl/find_fraction.hpp +@@ -25,6 +25,9 @@ + #ifndef _gcem_find_fraction_HPP + #define _gcem_find_fraction_HPP + ++namespace gcem ++{ ++ + namespace internal + { + +@@ -43,4 +46,6 @@ noexcept + + } + ++} ++ + #endif +diff --git a/include/gcem_incl/find_whole.hpp b/include/gcem_incl/find_whole.hpp +index d19363219871803f8cfeafadb0a88189d2f98f0e..561050e91f9e43faf4d80fd08b7e63537b622422 100644 +--- a/include/gcem_incl/find_whole.hpp ++++ b/include/gcem_incl/find_whole.hpp +@@ -25,6 +25,9 @@ + #ifndef _gcem_find_whole_HPP + #define _gcem_find_whole_HPP + ++namespace gcem ++{ ++ + namespace internal + { + +@@ -43,4 +46,6 @@ noexcept + + } + ++} ++ #endif diff --git a/include/gcem_incl/floor.hpp b/include/gcem_incl/floor.hpp -index 8b260ff8a10fb8b9d048307c7d9b18a7e91900c1..e35592a391e03934a45a943ffb92ae3c264d768c 100644 +index 8b260ff8a10fb8b9d048307c7d9b18a7e91900c1..3b3b86a12aa49e1c51957d170744a65690aeefdc 100644 --- a/include/gcem_incl/floor.hpp +++ b/include/gcem_incl/floor.hpp -@@ -21,6 +21,9 @@ +@@ -21,6 +21,12 @@ #ifndef _gcem_floor_HPP #define _gcem_floor_HPP +#include +#include ++ ++namespace gcem ++{ + namespace internal { -@@ -124,7 +127,11 @@ return_t +@@ -124,7 +130,13 @@ return_t floor(const T x) noexcept { @@ -490,24 +893,29 @@ index 8b260ff8a10fb8b9d048307c7d9b18a7e91900c1..e35592a391e03934a45a943ffb92ae3c + } else { + return std::floor(x); + } ++} ++ } #endif diff --git a/include/gcem_incl/fmod.hpp b/include/gcem_incl/fmod.hpp -index 02459efd4b3a016939a306c9fd1a7ead12ff123b..2f503140e354e05d03dadd2077b60879f80acd61 100644 +index 02459efd4b3a016939a306c9fd1a7ead12ff123b..58c454455edf132c078779ec15e254c96228b514 100644 --- a/include/gcem_incl/fmod.hpp +++ b/include/gcem_incl/fmod.hpp -@@ -21,6 +21,9 @@ +@@ -21,6 +21,12 @@ #ifndef _gcem_fmod_HPP #define _gcem_fmod_HPP +#include +#include ++ ++namespace gcem ++{ + namespace internal { -@@ -64,7 +67,11 @@ common_return_t +@@ -64,7 +70,13 @@ common_return_t fmod(const T1 x, const T2 y) noexcept { @@ -516,24 +924,50 @@ index 02459efd4b3a016939a306c9fd1a7ead12ff123b..2f503140e354e05d03dadd2077b60879 + } else { + return std::fmod(x, y); + } ++} ++ } + #endif +diff --git a/include/gcem_incl/gcd.hpp b/include/gcem_incl/gcd.hpp +index 1e277fbab61a06a20758f55d2c71ca57037f9d57..c5b14a22aafe7738dd14d120cab4dc6b31a5ad91 100644 +--- a/include/gcem_incl/gcd.hpp ++++ b/include/gcem_incl/gcd.hpp +@@ -21,6 +21,9 @@ + #ifndef _gcem_gcd_HPP + #define _gcem_gcd_HPP + ++namespace gcem ++{ ++ + namespace internal + { + +@@ -79,4 +82,6 @@ noexcept + return internal::gcd_type_check(a,b); + } + ++} ++ #endif diff --git a/include/gcem_incl/hypot.hpp b/include/gcem_incl/hypot.hpp -index 01ad4e9212547c649113e50954a73ee9f7394334..c51a5b42e57520b94d50b497ec4aa4bb33b0b774 100644 +index 01ad4e9212547c649113e50954a73ee9f7394334..00e10f899ace8f0da925fa9e46fa3f79f7e83aa0 100644 --- a/include/gcem_incl/hypot.hpp +++ b/include/gcem_incl/hypot.hpp -@@ -27,6 +27,9 @@ +@@ -27,6 +27,12 @@ #ifndef _gcem_hypot_HPP #define _gcem_hypot_HPP +#include +#include ++ ++namespace gcem ++{ + namespace internal { -@@ -84,7 +87,11 @@ common_return_t +@@ -84,7 +90,13 @@ common_return_t hypot(const T1 x, const T2 y) noexcept { @@ -542,24 +976,281 @@ index 01ad4e9212547c649113e50954a73ee9f7394334..c51a5b42e57520b94d50b497ec4aa4bb + } else { + return std::hypot(x, y); + } ++} ++ } + #endif +diff --git a/include/gcem_incl/incomplete_beta.hpp b/include/gcem_incl/incomplete_beta.hpp +index dbb9f60341b09102b137de2b9ded75280a315d57..681cc59953f0f2b1bd3603216286edce06ce46cc 100644 +--- a/include/gcem_incl/incomplete_beta.hpp ++++ b/include/gcem_incl/incomplete_beta.hpp +@@ -27,6 +27,9 @@ + #ifndef _gcem_incomplete_beta_HPP + #define _gcem_incomplete_beta_HPP + ++namespace gcem ++{ ++ + namespace internal + { + +@@ -191,4 +194,6 @@ noexcept + return internal::incomplete_beta_type_check(a,b,z); + } + ++} ++ + #endif +diff --git a/include/gcem_incl/incomplete_beta_inv.hpp b/include/gcem_incl/incomplete_beta_inv.hpp +index 9f575a360427d8b4ba9ebb940c2baf7ee242251c..3878d37db3bbef56e14bc053b9577b4f96c6c63c 100644 +--- a/include/gcem_incl/incomplete_beta_inv.hpp ++++ b/include/gcem_incl/incomplete_beta_inv.hpp +@@ -25,6 +25,9 @@ + #ifndef _gcem_incomplete_beta_inv_HPP + #define _gcem_incomplete_beta_inv_HPP + ++namespace gcem ++{ ++ + namespace internal + { + +@@ -349,4 +352,6 @@ noexcept + return internal::incomplete_beta_inv_type_check(a,b,p); + } + ++} ++ + #endif +diff --git a/include/gcem_incl/incomplete_gamma.hpp b/include/gcem_incl/incomplete_gamma.hpp +index 9ee4146de0aacffee1f418bd91069c921e0a6a29..0432b7d3c6f75a726847c9d84d52e387df16f618 100644 +--- a/include/gcem_incl/incomplete_gamma.hpp ++++ b/include/gcem_incl/incomplete_gamma.hpp +@@ -25,6 +25,9 @@ + #ifndef _gcem_incomplete_gamma_HPP + #define _gcem_incomplete_gamma_HPP + ++namespace gcem ++{ ++ + namespace internal + { + +@@ -244,4 +247,6 @@ noexcept + return internal::incomplete_gamma_type_check(a,x); + } + ++} ++ + #endif +diff --git a/include/gcem_incl/incomplete_gamma_inv.hpp b/include/gcem_incl/incomplete_gamma_inv.hpp +index e5976d08fddb5eb83ad40d200c5973d8ce2d6a36..6b1575b89c8e7284aee55882d12f1ee308d0cba3 100644 +--- a/include/gcem_incl/incomplete_gamma_inv.hpp ++++ b/include/gcem_incl/incomplete_gamma_inv.hpp +@@ -25,6 +25,9 @@ + #ifndef _gcem_incomplete_gamma_inv_HPP + #define _gcem_incomplete_gamma_inv_HPP + ++namespace gcem ++{ ++ + namespace internal + { + +@@ -268,4 +271,6 @@ noexcept + return internal::incomplete_gamma_inv_type_check(a,p); + } + ++} ++ + #endif +diff --git a/include/gcem_incl/inv_sqrt.hpp b/include/gcem_incl/inv_sqrt.hpp +index d0e33fb743b09e7c72506599414f7a4e0e7e5058..466e76fc5e844ba4b3c6be1a6a2a5f20b4e3607f 100644 +--- a/include/gcem_incl/inv_sqrt.hpp ++++ b/include/gcem_incl/inv_sqrt.hpp +@@ -25,6 +25,9 @@ + #ifndef _gcem_inv_sqrt_HPP + #define _gcem_inv_sqrt_HPP + ++namespace gcem ++{ ++ + namespace internal + { + +@@ -85,4 +88,6 @@ noexcept + return internal::inv_sqrt_check( static_cast>(x) ); + } + ++} ++ + #endif +diff --git a/include/gcem_incl/is_even.hpp b/include/gcem_incl/is_even.hpp +index de0641d85299a77380ba204e5e1d88538106468f..5aff6a3fa634d84b3fad6c831e3bb93797daee37 100644 +--- a/include/gcem_incl/is_even.hpp ++++ b/include/gcem_incl/is_even.hpp +@@ -25,6 +25,9 @@ + #ifndef _gcem_is_even_HPP + #define _gcem_is_even_HPP + ++namespace gcem ++{ ++ + namespace internal + { + +@@ -38,4 +41,6 @@ noexcept + + } + ++} ++ + #endif +diff --git a/include/gcem_incl/is_finite.hpp b/include/gcem_incl/is_finite.hpp +index b632fa34728ea66b595be68d48185474c3fe775e..805cbc4ab6708a51c95186801a1b0b02e0083e92 100644 +--- a/include/gcem_incl/is_finite.hpp ++++ b/include/gcem_incl/is_finite.hpp +@@ -25,6 +25,9 @@ + #ifndef _gcem_is_finite_HPP + #define _gcem_is_finite_HPP + ++namespace gcem ++{ ++ + namespace internal + { + +@@ -75,4 +78,6 @@ noexcept + + } + ++} ++ + #endif +diff --git a/include/gcem_incl/is_inf.hpp b/include/gcem_incl/is_inf.hpp +index 568614f8efa0e25fad4f87e1b71080849127378d..fdc31de71a3e73fda17216fb29e962c9f8a00958 100644 +--- a/include/gcem_incl/is_inf.hpp ++++ b/include/gcem_incl/is_inf.hpp +@@ -25,6 +25,9 @@ + #ifndef _gcem_is_inf_HPP + #define _gcem_is_inf_HPP + ++namespace gcem ++{ ++ + namespace internal + { + +@@ -169,4 +172,6 @@ noexcept + + } + ++} ++ + #endif +diff --git a/include/gcem_incl/is_nan.hpp b/include/gcem_incl/is_nan.hpp +index a3fcbc6c7cf6593965bee84b0eda0fc148f8f7ff..74092e6b087e47df45f70c6fcb5e62da53317f29 100644 +--- a/include/gcem_incl/is_nan.hpp ++++ b/include/gcem_incl/is_nan.hpp +@@ -25,6 +25,9 @@ + #ifndef _gcem_is_nan_HPP + #define _gcem_is_nan_HPP + ++namespace gcem ++{ ++ + namespace internal + { + +@@ -77,4 +80,6 @@ noexcept + + } + ++} ++ + #endif +diff --git a/include/gcem_incl/is_odd.hpp b/include/gcem_incl/is_odd.hpp +index a74a8d34f20da4a060b000b58fe7abd5b53f38b0..a76802f7ffc9b0faecae4f64c981ea76116e7c2a 100644 +--- a/include/gcem_incl/is_odd.hpp ++++ b/include/gcem_incl/is_odd.hpp +@@ -25,6 +25,9 @@ + #ifndef _gcem_is_odd_HPP + #define _gcem_is_odd_HPP + ++namespace gcem ++{ ++ + namespace internal + { + +@@ -39,4 +42,6 @@ noexcept + + } + ++} ++ + #endif +diff --git a/include/gcem_incl/lbeta.hpp b/include/gcem_incl/lbeta.hpp +index 60c87b4f53ec120121f1755635531dc4cc5ab26c..78f6849e72f56c35896e7e00ed9c3227a98114ba 100644 +--- a/include/gcem_incl/lbeta.hpp ++++ b/include/gcem_incl/lbeta.hpp +@@ -21,6 +21,9 @@ + #ifndef _gcem_lbeta_HPP + #define _gcem_lbeta_HPP + ++namespace gcem ++{ ++ + /** + * Compile-time log-beta function + * +@@ -39,4 +42,6 @@ noexcept + return( (lgamma(a) + lgamma(b)) - lgamma(a+b) ); + } + ++} ++ + #endif +diff --git a/include/gcem_incl/lcm.hpp b/include/gcem_incl/lcm.hpp +index a7ca7766f8906c1d26c071146aba3543880d8dd9..aa1f3397309a8a4517fed63d954737e043e28d1b 100644 +--- a/include/gcem_incl/lcm.hpp ++++ b/include/gcem_incl/lcm.hpp +@@ -21,6 +21,9 @@ + #ifndef _gcem_lcm_HPP + #define _gcem_lcm_HPP + ++namespace gcem ++{ ++ + namespace internal + { + +@@ -62,4 +65,6 @@ noexcept + return internal::lcm_type_check(a,b); + } + ++} ++ #endif diff --git a/include/gcem_incl/lgamma.hpp b/include/gcem_incl/lgamma.hpp -index 507c6d4c91423b31be55426f494f67b0cb085c9f..7c11fe56ad1156eb51ab9d9acbe0a4406a9e6c4e 100644 +index 507c6d4c91423b31be55426f494f67b0cb085c9f..e349ee88dba2d23982a6d4485bc33da076c70e22 100644 --- a/include/gcem_incl/lgamma.hpp +++ b/include/gcem_incl/lgamma.hpp -@@ -28,6 +28,9 @@ +@@ -28,6 +28,12 @@ #ifndef _gcem_lgamma_HPP #define _gcem_lgamma_HPP +#include +#include ++ ++namespace gcem ++{ + namespace internal { -@@ -129,7 +132,11 @@ return_t +@@ -129,7 +135,13 @@ return_t lgamma(const T x) noexcept { @@ -568,24 +1259,50 @@ index 507c6d4c91423b31be55426f494f67b0cb085c9f..7c11fe56ad1156eb51ab9d9acbe0a440 + } else { + return std::lgamma(x); + } ++} ++ } + #endif +diff --git a/include/gcem_incl/lmgamma.hpp b/include/gcem_incl/lmgamma.hpp +index 58915dc1e1a2edbbfdea58b57137cd22aaf4b717..b009de18e71c4360b55d0c1d80763f140190706f 100644 +--- a/include/gcem_incl/lmgamma.hpp ++++ b/include/gcem_incl/lmgamma.hpp +@@ -25,6 +25,9 @@ + #ifndef _gcem_lmgamma_HPP + #define _gcem_lmgamma_HPP + ++namespace gcem ++{ ++ + namespace internal + { + +@@ -70,4 +73,6 @@ noexcept + return internal::lmgamma_recur(static_cast>(a),p); + } + ++} ++ #endif diff --git a/include/gcem_incl/log.hpp b/include/gcem_incl/log.hpp -index c2e24b006c2fdd01196b189220f35ca982d8bf9e..b9f1f02cedbacf88538626dda43729bc75495b1f 100644 +index c2e24b006c2fdd01196b189220f35ca982d8bf9e..15577c8bacca3f4d0036997a2a34603ff56b4b24 100644 --- a/include/gcem_incl/log.hpp +++ b/include/gcem_incl/log.hpp -@@ -25,6 +25,9 @@ +@@ -25,6 +25,12 @@ #ifndef _gcem_log_HPP #define _gcem_log_HPP +#include +#include ++ ++namespace gcem ++{ + namespace internal { -@@ -180,7 +183,11 @@ return_t +@@ -180,7 +186,13 @@ return_t log(const T x) noexcept { @@ -594,24 +1311,29 @@ index c2e24b006c2fdd01196b189220f35ca982d8bf9e..b9f1f02cedbacf88538626dda43729bc + } else { + return std::log(x); + } ++} ++ } #endif diff --git a/include/gcem_incl/log10.hpp b/include/gcem_incl/log10.hpp -index cda8894fdd62054f11ec4c3c3e6402c3752e0dd7..0d4ff3ecb0f7a1314c35197e51e75a78c3128b74 100644 +index cda8894fdd62054f11ec4c3c3e6402c3752e0dd7..0e9a4dbdf58e2ed077e2f682706d98e71d794d67 100644 --- a/include/gcem_incl/log10.hpp +++ b/include/gcem_incl/log10.hpp -@@ -25,6 +25,9 @@ +@@ -25,6 +25,12 @@ #ifndef _gcem_log10_HPP #define _gcem_log10_HPP +#include +#include ++ ++namespace gcem ++{ + namespace internal { -@@ -53,7 +56,11 @@ return_t +@@ -53,7 +59,13 @@ return_t log10(const T x) noexcept { @@ -620,24 +1342,29 @@ index cda8894fdd62054f11ec4c3c3e6402c3752e0dd7..0d4ff3ecb0f7a1314c35197e51e75a78 + } else { + return std::log10(x); + } ++} ++ } #endif diff --git a/include/gcem_incl/log1p.hpp b/include/gcem_incl/log1p.hpp -index ccd08b8cb8799f2d4d34d5634dbc2fcabb3fd5b3..b7e6cd534dedb8f55c7a3e9dd03af15d6a19837f 100644 +index ccd08b8cb8799f2d4d34d5634dbc2fcabb3fd5b3..ed41daf39ec7e7062dc1da51ef0b0e106b56cf4e 100644 --- a/include/gcem_incl/log1p.hpp +++ b/include/gcem_incl/log1p.hpp -@@ -25,6 +25,9 @@ +@@ -25,6 +25,12 @@ #ifndef _gcem_log1p_HPP #define _gcem_log1p_HPP +#include +#include ++ ++namespace gcem ++{ + namespace internal { -@@ -74,7 +77,11 @@ return_t +@@ -74,7 +80,13 @@ return_t log1p(const T x) noexcept { @@ -646,24 +1373,29 @@ index ccd08b8cb8799f2d4d34d5634dbc2fcabb3fd5b3..b7e6cd534dedb8f55c7a3e9dd03af15d + } else { + return std::log1p(x); + } ++} ++ } #endif diff --git a/include/gcem_incl/log2.hpp b/include/gcem_incl/log2.hpp -index a97fed4c7236f816fa07ac2494f243adbac6742b..37196152d060f7380ff57e084b2b2e119c69587d 100644 +index a97fed4c7236f816fa07ac2494f243adbac6742b..f8dc729f4f08348b8cc046468f40cfc84f1c9cb2 100644 --- a/include/gcem_incl/log2.hpp +++ b/include/gcem_incl/log2.hpp -@@ -25,6 +25,9 @@ +@@ -25,6 +25,12 @@ #ifndef _gcem_log2_HPP #define _gcem_log2_HPP +#include +#include ++ ++namespace gcem ++{ + namespace internal { -@@ -53,7 +56,11 @@ return_t +@@ -53,7 +59,13 @@ return_t log2(const T x) noexcept { @@ -672,24 +1404,73 @@ index a97fed4c7236f816fa07ac2494f243adbac6742b..37196152d060f7380ff57e084b2b2e11 + } else { + return std::log2(x); + } ++} ++ } + #endif +diff --git a/include/gcem_incl/log_binomial_coef.hpp b/include/gcem_incl/log_binomial_coef.hpp +index 2bcaadd8bc1c64744eb082955522339d48589aec..c4ba2fa3de9f4f77ac772d24c1432fc93cc51840 100644 +--- a/include/gcem_incl/log_binomial_coef.hpp ++++ b/include/gcem_incl/log_binomial_coef.hpp +@@ -21,6 +21,9 @@ + #ifndef _gcem_log_binomial_coef_HPP + #define _gcem_log_binomial_coef_HPP + ++namespace gcem ++{ ++ + namespace internal + { + +@@ -62,4 +65,6 @@ noexcept + return internal::log_binomial_coef_type_check(n,k); + } + +-#endif +\ No newline at end of file ++} ++ ++#endif +diff --git a/include/gcem_incl/mantissa.hpp b/include/gcem_incl/mantissa.hpp +index af23ea21d247327fa224370544e5f4410eac214b..4c95110d627568577440e5e662e72fdeffd95ade 100644 +--- a/include/gcem_incl/mantissa.hpp ++++ b/include/gcem_incl/mantissa.hpp +@@ -25,6 +25,9 @@ + #ifndef _gcem_mantissa_HPP + #define _gcem_mantissa_HPP + ++namespace gcem ++{ ++ + namespace internal + { + +@@ -44,4 +47,6 @@ noexcept + + } + ++} ++ #endif diff --git a/include/gcem_incl/max.hpp b/include/gcem_incl/max.hpp -index ddc3e4e6caff1a781e662a3ded8909cb703729ab..94cd379d87cfa514bec3ce32470d09d1ea8aa7d5 100644 +index ddc3e4e6caff1a781e662a3ded8909cb703729ab..9f3901b4b19eb35331cd22be16c5b3a1ab5f65d6 100644 --- a/include/gcem_incl/max.hpp +++ b/include/gcem_incl/max.hpp -@@ -21,6 +21,9 @@ +@@ -21,6 +21,12 @@ #ifndef _gcem_max_HPP #define _gcem_max_HPP +#include +#include ++ ++namespace gcem ++{ + /** * Compile-time pairwise maximum function * -@@ -35,7 +38,11 @@ common_t +@@ -35,7 +41,13 @@ common_t max(const T1 x, const T2 y) noexcept { @@ -698,24 +1479,29 @@ index ddc3e4e6caff1a781e662a3ded8909cb703729ab..94cd379d87cfa514bec3ce32470d09d1 + } else { + return std::max(x, y); + } ++} ++ } #endif diff --git a/include/gcem_incl/min.hpp b/include/gcem_incl/min.hpp -index 5ce70b38e6d243267a053ec33fae31e59f6a359f..998601a4cc7864d0fc4466444a71090ad43917bd 100644 +index 5ce70b38e6d243267a053ec33fae31e59f6a359f..a35bcf6e2cb65f8712b873d3ef2827aca2d4d0f0 100644 --- a/include/gcem_incl/min.hpp +++ b/include/gcem_incl/min.hpp -@@ -21,6 +21,9 @@ +@@ -21,6 +21,12 @@ #ifndef _gcem_min_HPP #define _gcem_min_HPP +#include +#include ++ ++namespace gcem ++{ + /** * Compile-time pairwise minimum function * -@@ -35,7 +38,11 @@ common_t +@@ -35,7 +41,13 @@ common_t min(const T1 x, const T2 y) noexcept { @@ -724,24 +1510,49 @@ index 5ce70b38e6d243267a053ec33fae31e59f6a359f..998601a4cc7864d0fc4466444a71090a + } else { + return std::min(x, y); + } ++} ++ } #endif +diff --git a/include/gcem_incl/neg_zero.hpp b/include/gcem_incl/neg_zero.hpp +index 79d24a4dd56f4c361774135bc9450c71a9f61627..90923035419d8b7a88ca46c9dcb3294f601312fb 100644 +--- a/include/gcem_incl/neg_zero.hpp ++++ b/include/gcem_incl/neg_zero.hpp +@@ -22,6 +22,9 @@ + * extract signbit for signed zeros + */ + ++namespace gcem ++{ ++ + namespace internal + { + +@@ -35,3 +38,5 @@ noexcept + } + + } ++ ++} diff --git a/include/gcem_incl/pow.hpp b/include/gcem_incl/pow.hpp -index 3891edef0e8f1e7b64e8632f46e87fd39bdba162..35b2a9aa173d4d201dbe6d642a58b0ac6b53b684 100644 +index 3891edef0e8f1e7b64e8632f46e87fd39bdba162..372166d40644ec5403d9308b5325a36a78ad2589 100644 --- a/include/gcem_incl/pow.hpp +++ b/include/gcem_incl/pow.hpp -@@ -25,6 +25,9 @@ +@@ -25,6 +25,12 @@ #ifndef _gcem_pow_HPP #define _gcem_pow_HPP +#include +#include ++ ++namespace gcem ++{ + namespace internal { -@@ -76,7 +79,11 @@ common_t +@@ -76,7 +82,13 @@ common_t pow(const T1 base, const T2 exp_term) noexcept { @@ -750,24 +1561,90 @@ index 3891edef0e8f1e7b64e8632f46e87fd39bdba162..35b2a9aa173d4d201dbe6d642a58b0ac + } else { + return std::pow(base, exp_term); + } ++} ++ } #endif +diff --git a/include/gcem_incl/pow_integral.hpp b/include/gcem_incl/pow_integral.hpp +index 4e671557071e6377721f3ca721a7b5875f2ffd83..589d16406576bb637963aae33e40aeddf164079a 100644 +--- a/include/gcem_incl/pow_integral.hpp ++++ b/include/gcem_incl/pow_integral.hpp +@@ -25,6 +25,9 @@ + #ifndef _gcem_pow_integral_HPP + #define _gcem_pow_integral_HPP + ++namespace gcem ++{ ++ + namespace internal + { + +@@ -125,4 +128,6 @@ noexcept + + } + ++} ++ + #endif +diff --git a/include/gcem_incl/quadrature/gauss_legendre_30.hpp b/include/gcem_incl/quadrature/gauss_legendre_30.hpp +index 295f43d9522dcdd7cae358dfc5b6382cfa7bd782..a80d2bb6f9b0dbc9936f3ed3e4f3770b4c307b7d 100644 +--- a/include/gcem_incl/quadrature/gauss_legendre_30.hpp ++++ b/include/gcem_incl/quadrature/gauss_legendre_30.hpp +@@ -22,6 +22,9 @@ + * Gauss-Legendre quadrature: 30 points + */ + ++namespace gcem ++{ ++ + static const long double gauss_legendre_30_points[30] = \ + { + -0.05147184255531769583302521316672L, +@@ -89,3 +92,5 @@ static const long double gauss_legendre_30_weights[30] = \ + 0.00796819249616660561546588347467L, + 0.00796819249616660561546588347467L\ + }; ++ ++} +diff --git a/include/gcem_incl/quadrature/gauss_legendre_50.hpp b/include/gcem_incl/quadrature/gauss_legendre_50.hpp +index d4e448c56e923876f2f8627df4caa5d29eb1c501..85244daf1057aa2f07979a19765bcec3865950e2 100644 +--- a/include/gcem_incl/quadrature/gauss_legendre_50.hpp ++++ b/include/gcem_incl/quadrature/gauss_legendre_50.hpp +@@ -22,6 +22,9 @@ + * Gauss-Legendre quadrature: 50 points + */ + ++namespace gcem ++{ ++ + static const long double gauss_legendre_50_points[50] = \ + { + -0.03109833832718887611232898966595L, +@@ -129,3 +132,5 @@ static const long double gauss_legendre_50_weights[50] = \ + 0.00290862255315514095840072434286L, + 0.00290862255315514095840072434286L\ + }; ++ ++} diff --git a/include/gcem_incl/round.hpp b/include/gcem_incl/round.hpp -index 9ac4a09f0a9e7b09a303795d30ccee32ebe841b1..d7c1300b142062c4947c7df31757772f1b8c8cb0 100644 +index 9ac4a09f0a9e7b09a303795d30ccee32ebe841b1..10fae649f89b0320e4f38f87fa8f8ffb41d75b9f 100644 --- a/include/gcem_incl/round.hpp +++ b/include/gcem_incl/round.hpp -@@ -21,6 +21,9 @@ +@@ -21,6 +21,12 @@ #ifndef _gcem_round_HPP #define _gcem_round_HPP +#include +#include ++ ++namespace gcem ++{ + namespace internal { -@@ -119,7 +122,11 @@ return_t +@@ -119,7 +125,13 @@ return_t round(const T x) noexcept { @@ -776,24 +1653,50 @@ index 9ac4a09f0a9e7b09a303795d30ccee32ebe841b1..d7c1300b142062c4947c7df31757772f + } else { + return std::round(x); + } ++} ++ } + #endif +diff --git a/include/gcem_incl/sgn.hpp b/include/gcem_incl/sgn.hpp +index e2eec9e80b57e73396f3cf7f335692d88dcd752b..4c4adfa5a8d9da0e04c55195ec596ce58f63c0a8 100644 +--- a/include/gcem_incl/sgn.hpp ++++ b/include/gcem_incl/sgn.hpp +@@ -21,6 +21,9 @@ + #ifndef _gcem_sgn_HPP + #define _gcem_sgn_HPP + ++namespace gcem ++{ ++ + /** + * Compile-time sign function + * +@@ -42,4 +45,6 @@ noexcept + 0 ); + } + ++} ++ #endif diff --git a/include/gcem_incl/signbit.hpp b/include/gcem_incl/signbit.hpp -index 282e24403345dccfa8bf580112c129b43df5aa6d..c13c6f3265e81c7280f4dd4db454e4262278d7a5 100644 +index 282e24403345dccfa8bf580112c129b43df5aa6d..40ec1dd157a687112f8258f76ea2ceb62d8ae22f 100644 --- a/include/gcem_incl/signbit.hpp +++ b/include/gcem_incl/signbit.hpp -@@ -21,6 +21,9 @@ +@@ -21,6 +21,12 @@ #ifndef _gcem_signbit_HPP #define _gcem_signbit_HPP +#include +#include ++ ++namespace gcem ++{ + /** * Compile-time sign bit detection function * -@@ -34,11 +37,15 @@ bool +@@ -34,11 +40,17 @@ bool signbit(const T x) noexcept { @@ -806,24 +1709,29 @@ index 282e24403345dccfa8bf580112c129b43df5aa6d..c13c6f3265e81c7280f4dd4db454e426 + } else { + return std::signbit(x); + } ++} ++ } #endif diff --git a/include/gcem_incl/sin.hpp b/include/gcem_incl/sin.hpp -index 56c8dcaf62dc22207ee7f41ec84d272e4535ab4e..203ea5d9723cc135bd024466a392aabce0896cdb 100644 +index 56c8dcaf62dc22207ee7f41ec84d272e4535ab4e..c7c17600db0c8cb862c433183139d1f727fcea8b 100644 --- a/include/gcem_incl/sin.hpp +++ b/include/gcem_incl/sin.hpp -@@ -27,6 +27,9 @@ +@@ -27,6 +27,12 @@ #ifndef _gcem_sin_HPP #define _gcem_sin_HPP +#include +#include ++ ++namespace gcem ++{ + namespace internal { -@@ -79,7 +82,11 @@ return_t +@@ -79,7 +85,13 @@ return_t sin(const T x) noexcept { @@ -832,24 +1740,29 @@ index 56c8dcaf62dc22207ee7f41ec84d272e4535ab4e..203ea5d9723cc135bd024466a392aabc + } else { + return std::sin(x); + } ++} ++ } #endif diff --git a/include/gcem_incl/sinh.hpp b/include/gcem_incl/sinh.hpp -index fe3ecdd0e719856c8bcc0e8d692d93c98c496942..337ee3d576ec4def690f8f3e2720d74a6b155744 100644 +index fe3ecdd0e719856c8bcc0e8d692d93c98c496942..9174d5d64a0622b56efac56fbfdc44994f78e78d 100644 --- a/include/gcem_incl/sinh.hpp +++ b/include/gcem_incl/sinh.hpp -@@ -25,6 +25,9 @@ +@@ -25,6 +25,12 @@ #ifndef _gcem_sinh_HPP #define _gcem_sinh_HPP +#include +#include ++ ++namespace gcem ++{ + namespace internal { -@@ -59,7 +62,11 @@ return_t +@@ -59,7 +65,13 @@ return_t sinh(const T x) noexcept { @@ -858,24 +1771,29 @@ index fe3ecdd0e719856c8bcc0e8d692d93c98c496942..337ee3d576ec4def690f8f3e2720d74a + } else { + return std::sinh(x); + } ++} ++ } #endif diff --git a/include/gcem_incl/sqrt.hpp b/include/gcem_incl/sqrt.hpp -index 1b2753c99ede5189fc2272080828c83ca63a184c..f65070a5ea4c8681d1d7ad99acd82644c6ddee5f 100644 +index 1b2753c99ede5189fc2272080828c83ca63a184c..201d89fa0df5680ceb53ec3aabb20213b4326325 100644 --- a/include/gcem_incl/sqrt.hpp +++ b/include/gcem_incl/sqrt.hpp -@@ -25,6 +25,9 @@ +@@ -25,6 +25,12 @@ #ifndef _gcem_sqrt_HPP #define _gcem_sqrt_HPP +#include +#include ++ ++namespace gcem ++{ + namespace internal { -@@ -103,7 +106,11 @@ return_t +@@ -103,7 +109,13 @@ return_t sqrt(const T x) noexcept { @@ -884,24 +1802,29 @@ index 1b2753c99ede5189fc2272080828c83ca63a184c..f65070a5ea4c8681d1d7ad99acd82644 + } else { + return std::sqrt(x); + } ++} ++ } #endif diff --git a/include/gcem_incl/tan.hpp b/include/gcem_incl/tan.hpp -index 386cce0f412107f65183031b3458455059f55d54..354c302a50c7a0b2b31e8288c9dab363ceac9cbe 100644 +index 386cce0f412107f65183031b3458455059f55d54..08c12d4ea07ee06d1bd25bfd7cea2c3204a72e6c 100644 --- a/include/gcem_incl/tan.hpp +++ b/include/gcem_incl/tan.hpp -@@ -25,6 +25,9 @@ +@@ -25,6 +25,12 @@ #ifndef _gcem_tan_HPP #define _gcem_tan_HPP +#include +#include ++ ++namespace gcem ++{ + namespace internal { -@@ -134,7 +137,11 @@ return_t +@@ -134,7 +140,13 @@ return_t tan(const T x) noexcept { @@ -910,24 +1833,29 @@ index 386cce0f412107f65183031b3458455059f55d54..354c302a50c7a0b2b31e8288c9dab363 + } else { + return std::tan(x); + } ++} ++ } #endif diff --git a/include/gcem_incl/tanh.hpp b/include/gcem_incl/tanh.hpp -index 30b431886601ec9f77ca9a93a6ca62b3cabd9e57..15d47b4a258f7ac4b49164ab48058dff6db28c92 100644 +index 30b431886601ec9f77ca9a93a6ca62b3cabd9e57..f25dabdb0f075d5597530cb9c1c41d0ba02e3783 100644 --- a/include/gcem_incl/tanh.hpp +++ b/include/gcem_incl/tanh.hpp -@@ -25,6 +25,9 @@ +@@ -25,6 +25,12 @@ #ifndef _gcem_tanh_HPP #define _gcem_tanh_HPP +#include +#include ++ ++namespace gcem ++{ + namespace internal { -@@ -83,7 +86,11 @@ return_t +@@ -83,7 +89,13 @@ return_t tanh(const T x) noexcept { @@ -936,24 +1864,29 @@ index 30b431886601ec9f77ca9a93a6ca62b3cabd9e57..15d47b4a258f7ac4b49164ab48058dff + } else { + return std::tanh(x); + } ++} ++ } #endif diff --git a/include/gcem_incl/tgamma.hpp b/include/gcem_incl/tgamma.hpp -index deffd3a8e77c34a9ebfd5209ee32594dc5b241e2..a3bf41de5b9dc104661bbc8a574d45d587f10061 100644 +index deffd3a8e77c34a9ebfd5209ee32594dc5b241e2..1d9fceecf8f9e062f2f1fa6080091b64cf533849 100644 --- a/include/gcem_incl/tgamma.hpp +++ b/include/gcem_incl/tgamma.hpp -@@ -25,6 +25,9 @@ +@@ -25,6 +25,12 @@ #ifndef _gcem_tgamma_HPP #define _gcem_tgamma_HPP +#include +#include ++ ++namespace gcem ++{ + namespace internal { -@@ -74,7 +77,11 @@ return_t +@@ -74,7 +80,13 @@ return_t tgamma(const T x) noexcept { @@ -962,24 +1895,29 @@ index deffd3a8e77c34a9ebfd5209ee32594dc5b241e2..a3bf41de5b9dc104661bbc8a574d45d5 + } else { + return std::tgamma(x); + } ++} ++ } #endif diff --git a/include/gcem_incl/trunc.hpp b/include/gcem_incl/trunc.hpp -index af3f448915f0f9a1b5f2d843596331f7874a6da5..979265725c95d57c66e51fe2a86de34691cbb391 100644 +index af3f448915f0f9a1b5f2d843596331f7874a6da5..f7a31ce7271339626127d6ca80dfb936fe53cc03 100644 --- a/include/gcem_incl/trunc.hpp +++ b/include/gcem_incl/trunc.hpp -@@ -21,6 +21,9 @@ +@@ -21,6 +21,12 @@ #ifndef _gcem_trunc_HPP #define _gcem_trunc_HPP +#include +#include ++ ++namespace gcem ++{ + namespace internal { -@@ -115,7 +118,11 @@ return_t +@@ -115,7 +121,13 @@ return_t trunc(const T x) noexcept { @@ -988,6 +1926,8 @@ index af3f448915f0f9a1b5f2d843596331f7874a6da5..979265725c95d57c66e51fe2a86de346 + } else { + return std::trunc(x); + } ++} ++ } #endif diff --git a/upstream_utils/gcem_patches/0002-Add-hypot-x-y-z.patch b/upstream_utils/gcem_patches/0002-Add-hypot-x-y-z.patch new file mode 100644 index 0000000000..4757239d37 --- /dev/null +++ b/upstream_utils/gcem_patches/0002-Add-hypot-x-y-z.patch @@ -0,0 +1,135 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Tyler Veness +Date: Sun, 3 Dec 2023 14:03:58 -0800 +Subject: [PATCH 2/2] Add hypot(x, y, z) + +--- + include/gcem_incl/hypot.hpp | 85 +++++++++++++++++++++++++++++++++++-- + 1 file changed, 82 insertions(+), 3 deletions(-) + +diff --git a/include/gcem_incl/hypot.hpp b/include/gcem_incl/hypot.hpp +index 00e10f899ace8f0da925fa9e46fa3f79f7e83aa0..13ea80c49d374c23434c1f9859bb6474184dc420 100644 +--- a/include/gcem_incl/hypot.hpp ++++ b/include/gcem_incl/hypot.hpp +@@ -27,6 +27,7 @@ + #ifndef _gcem_hypot_HPP + #define _gcem_hypot_HPP + ++#include + #include + #include + +@@ -39,10 +40,29 @@ namespace internal + template + constexpr + T +-hypot_compute(const T x, const T ydx) ++hypot_compute(const T x, const T y) + noexcept + { +- return abs(x) * sqrt( T(1) + (ydx * ydx) ); ++ T a = std::max(abs(x), abs(y)); ++ if (a) { ++ return a * sqrt((x / a) * (x / a) + (y / a) * (y / a)); ++ } else { ++ return {}; ++ } ++} ++ ++template ++constexpr ++T ++hypot_compute(const T x, const T y, const T z) ++noexcept ++{ ++ T a = std::max({abs(x), abs(y), abs(z)}); ++ if (a) { ++ return a * sqrt((x / a) * (x / a) + (y / a) * (y / a) + (z / a) * (z / a)); ++ } else { ++ return {}; ++ } + } + + template +@@ -62,7 +82,35 @@ noexcept + GCLIM::min() > abs(y) ? \ + abs(x) : + // else +- hypot_compute(x, y/x) ); ++ hypot_compute(x, y) ); ++} ++ ++template ++constexpr ++T ++hypot_vals_check(const T x, const T y, const T z) ++noexcept ++{ ++ return( any_nan(x, y, z) ? \ ++ GCLIM::quiet_NaN() : ++ // ++ any_inf(x,y,z) ? \ ++ GCLIM::infinity() : ++ // indistinguishable from zero or one ++ GCLIM::min() > abs(x) && GCLIM::min() > abs(y) ? \ ++ abs(z) : ++ GCLIM::min() > abs(x) && GCLIM::min() > abs(z) ? \ ++ abs(y) : ++ GCLIM::min() > abs(y) && GCLIM::min() > abs(z) ? \ ++ abs(x) : ++ GCLIM::min() > abs(x) ? \ ++ hypot_vals_check(y, z) : ++ GCLIM::min() > abs(y) ? \ ++ hypot_vals_check(x, z) : ++ GCLIM::min() > abs(z) ? \ ++ hypot_vals_check(x, y) : ++ // else ++ hypot_compute(x, y, z) ); + } + + template> +@@ -74,6 +122,15 @@ noexcept + return hypot_vals_check(static_cast(x),static_cast(y)); + } + ++template> ++constexpr ++TC ++hypot_type_check(const T1 x, const T2 y, const T3 z) ++noexcept ++{ ++ return hypot_vals_check(static_cast(x),static_cast(y),static_cast(z)); ++} ++ + } + + /** +@@ -97,6 +154,28 @@ noexcept + } + } + ++/** ++ * Compile-time Pythagorean addition function ++ * ++ * @param x a real-valued input. ++ * @param y a real-valued input. ++ * @param z a real-valued input. ++ * @return Computes \f$ x \oplus y \oplus z = \sqrt{x^2 + y^2 + z^2} \f$. ++ */ ++ ++template ++constexpr ++common_return_t ++hypot(const T1 x, const T2 y, const T3 z) ++noexcept ++{ ++ if (std::is_constant_evaluated()) { ++ return internal::hypot_type_check(x,y,z); ++ } else { ++ return std::hypot(x, y, z); ++ } ++} ++ + } + + #endif diff --git a/upstream_utils/update_gcem.py b/upstream_utils/update_gcem.py index cc123d495b..a198e9731c 100755 --- a/upstream_utils/update_gcem.py +++ b/upstream_utils/update_gcem.py @@ -19,7 +19,10 @@ def main(): # Apply patches to upstream Git repo os.chdir(upstream_root) - for f in ["0001-Call-std-functions-if-not-constant-evaluated.patch"]: + for f in [ + "0001-Call-std-functions-if-not-constant-evaluated.patch", + "0002-Add-hypot-x-y-z.patch", + ]: git_am(os.path.join(wpilib_root, "upstream_utils/gcem_patches", f)) # Delete old install diff --git a/wpimath/src/main/native/thirdparty/gcem/include/gcem.hpp b/wpimath/src/main/native/thirdparty/gcem/include/gcem.hpp index 650d05d894..8ea7b2a279 100644 --- a/wpimath/src/main/native/thirdparty/gcem/include/gcem.hpp +++ b/wpimath/src/main/native/thirdparty/gcem/include/gcem.hpp @@ -23,82 +23,79 @@ #include "gcem_incl/gcem_options.hpp" -namespace gcem -{ - #include "gcem_incl/quadrature/gauss_legendre_50.hpp" +#include "gcem_incl/quadrature/gauss_legendre_50.hpp" - #include "gcem_incl/is_inf.hpp" - #include "gcem_incl/is_nan.hpp" - #include "gcem_incl/is_finite.hpp" - - #include "gcem_incl/signbit.hpp" - #include "gcem_incl/copysign.hpp" - #include "gcem_incl/neg_zero.hpp" - #include "gcem_incl/sgn.hpp" +#include "gcem_incl/is_inf.hpp" +#include "gcem_incl/is_nan.hpp" +#include "gcem_incl/is_finite.hpp" - #include "gcem_incl/abs.hpp" - #include "gcem_incl/ceil.hpp" - #include "gcem_incl/floor.hpp" - #include "gcem_incl/trunc.hpp" - #include "gcem_incl/is_odd.hpp" - #include "gcem_incl/is_even.hpp" - #include "gcem_incl/max.hpp" - #include "gcem_incl/min.hpp" - #include "gcem_incl/sqrt.hpp" - #include "gcem_incl/inv_sqrt.hpp" - #include "gcem_incl/hypot.hpp" +#include "gcem_incl/signbit.hpp" +#include "gcem_incl/copysign.hpp" +#include "gcem_incl/neg_zero.hpp" +#include "gcem_incl/sgn.hpp" - #include "gcem_incl/find_exponent.hpp" - #include "gcem_incl/find_fraction.hpp" - #include "gcem_incl/find_whole.hpp" - #include "gcem_incl/mantissa.hpp" - #include "gcem_incl/round.hpp" - #include "gcem_incl/fmod.hpp" +#include "gcem_incl/abs.hpp" +#include "gcem_incl/ceil.hpp" +#include "gcem_incl/floor.hpp" +#include "gcem_incl/trunc.hpp" +#include "gcem_incl/is_odd.hpp" +#include "gcem_incl/is_even.hpp" +#include "gcem_incl/max.hpp" +#include "gcem_incl/min.hpp" +#include "gcem_incl/sqrt.hpp" +#include "gcem_incl/inv_sqrt.hpp" +#include "gcem_incl/hypot.hpp" - #include "gcem_incl/pow_integral.hpp" - #include "gcem_incl/exp.hpp" - #include "gcem_incl/expm1.hpp" - #include "gcem_incl/log.hpp" - #include "gcem_incl/log1p.hpp" - #include "gcem_incl/log2.hpp" - #include "gcem_incl/log10.hpp" - #include "gcem_incl/pow.hpp" +#include "gcem_incl/find_exponent.hpp" +#include "gcem_incl/find_fraction.hpp" +#include "gcem_incl/find_whole.hpp" +#include "gcem_incl/mantissa.hpp" +#include "gcem_incl/round.hpp" +#include "gcem_incl/fmod.hpp" - #include "gcem_incl/gcd.hpp" - #include "gcem_incl/lcm.hpp" +#include "gcem_incl/pow_integral.hpp" +#include "gcem_incl/exp.hpp" +#include "gcem_incl/expm1.hpp" +#include "gcem_incl/log.hpp" +#include "gcem_incl/log1p.hpp" +#include "gcem_incl/log2.hpp" +#include "gcem_incl/log10.hpp" +#include "gcem_incl/pow.hpp" - #include "gcem_incl/tan.hpp" - #include "gcem_incl/cos.hpp" - #include "gcem_incl/sin.hpp" +#include "gcem_incl/gcd.hpp" +#include "gcem_incl/lcm.hpp" - #include "gcem_incl/atan.hpp" - #include "gcem_incl/atan2.hpp" - #include "gcem_incl/acos.hpp" - #include "gcem_incl/asin.hpp" +#include "gcem_incl/tan.hpp" +#include "gcem_incl/cos.hpp" +#include "gcem_incl/sin.hpp" - #include "gcem_incl/tanh.hpp" - #include "gcem_incl/cosh.hpp" - #include "gcem_incl/sinh.hpp" +#include "gcem_incl/atan.hpp" +#include "gcem_incl/atan2.hpp" +#include "gcem_incl/acos.hpp" +#include "gcem_incl/asin.hpp" - #include "gcem_incl/atanh.hpp" - #include "gcem_incl/acosh.hpp" - #include "gcem_incl/asinh.hpp" +#include "gcem_incl/tanh.hpp" +#include "gcem_incl/cosh.hpp" +#include "gcem_incl/sinh.hpp" - #include "gcem_incl/binomial_coef.hpp" - #include "gcem_incl/lgamma.hpp" - #include "gcem_incl/tgamma.hpp" - #include "gcem_incl/factorial.hpp" - #include "gcem_incl/lbeta.hpp" - #include "gcem_incl/beta.hpp" - #include "gcem_incl/lmgamma.hpp" - #include "gcem_incl/log_binomial_coef.hpp" +#include "gcem_incl/atanh.hpp" +#include "gcem_incl/acosh.hpp" +#include "gcem_incl/asinh.hpp" - #include "gcem_incl/erf.hpp" - #include "gcem_incl/erf_inv.hpp" - #include "gcem_incl/incomplete_beta.hpp" - #include "gcem_incl/incomplete_beta_inv.hpp" - #include "gcem_incl/incomplete_gamma.hpp" - #include "gcem_incl/incomplete_gamma_inv.hpp" -} +#include "gcem_incl/binomial_coef.hpp" +#include "gcem_incl/lgamma.hpp" +#include "gcem_incl/tgamma.hpp" +#include "gcem_incl/factorial.hpp" +#include "gcem_incl/lbeta.hpp" +#include "gcem_incl/beta.hpp" +#include "gcem_incl/lmgamma.hpp" +#include "gcem_incl/log_binomial_coef.hpp" + +#include "gcem_incl/erf.hpp" +#include "gcem_incl/erf_inv.hpp" +#include "gcem_incl/incomplete_beta.hpp" +#include "gcem_incl/incomplete_beta_inv.hpp" +#include "gcem_incl/incomplete_gamma.hpp" +#include "gcem_incl/incomplete_gamma_inv.hpp" #endif diff --git a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/abs.hpp b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/abs.hpp index 32ee89494c..8e8330b198 100644 --- a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/abs.hpp +++ b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/abs.hpp @@ -24,6 +24,9 @@ #include #include +namespace gcem +{ + /** * Compile-time absolute value function * @@ -49,4 +52,6 @@ noexcept } } +} + #endif diff --git a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/acos.hpp b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/acos.hpp index c40006de7f..2e24d2acb6 100644 --- a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/acos.hpp +++ b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/acos.hpp @@ -28,6 +28,9 @@ #include #include +namespace gcem +{ + namespace internal { @@ -88,4 +91,6 @@ noexcept } } +} + #endif diff --git a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/acosh.hpp b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/acosh.hpp index edf71db655..778c36cad6 100644 --- a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/acosh.hpp +++ b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/acosh.hpp @@ -28,6 +28,9 @@ #include #include +namespace gcem +{ + namespace internal { @@ -72,4 +75,6 @@ noexcept } } +} + #endif diff --git a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/asin.hpp b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/asin.hpp index 57840d4b1a..39784aa10e 100644 --- a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/asin.hpp +++ b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/asin.hpp @@ -28,6 +28,9 @@ #include #include +namespace gcem +{ + namespace internal { @@ -86,4 +89,6 @@ noexcept } } +} + #endif diff --git a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/asinh.hpp b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/asinh.hpp index 7e5190289a..0a5969369a 100644 --- a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/asinh.hpp +++ b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/asinh.hpp @@ -28,6 +28,9 @@ #include #include +namespace gcem +{ + namespace internal { @@ -69,5 +72,6 @@ noexcept } } +} #endif diff --git a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/atan.hpp b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/atan.hpp index 9ebd33e65d..19b9d4e10d 100644 --- a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/atan.hpp +++ b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/atan.hpp @@ -32,6 +32,9 @@ #include #include +namespace gcem +{ + namespace internal { @@ -159,4 +162,6 @@ noexcept } } +} + #endif diff --git a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/atan2.hpp b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/atan2.hpp index d3abcd88c9..07a02cf4a2 100644 --- a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/atan2.hpp +++ b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/atan2.hpp @@ -28,6 +28,9 @@ #include #include +namespace gcem +{ + namespace internal { @@ -92,4 +95,6 @@ noexcept } } +} + #endif diff --git a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/atanh.hpp b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/atanh.hpp index 753d469857..5c4475bead 100644 --- a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/atanh.hpp +++ b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/atanh.hpp @@ -28,6 +28,9 @@ #include #include +namespace gcem +{ + namespace internal { @@ -83,4 +86,6 @@ noexcept } } +} + #endif diff --git a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/beta.hpp b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/beta.hpp index b7da514a25..3439af1b57 100644 --- a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/beta.hpp +++ b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/beta.hpp @@ -24,6 +24,9 @@ #include #include +namespace gcem +{ + /** * Compile-time beta function * @@ -50,4 +53,6 @@ noexcept } } +} + #endif diff --git a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/binomial_coef.hpp b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/binomial_coef.hpp index 0fc17f384d..a1f764b97b 100644 --- a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/binomial_coef.hpp +++ b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/binomial_coef.hpp @@ -21,6 +21,9 @@ #ifndef _gcem_binomial_coef_HPP #define _gcem_binomial_coef_HPP +namespace gcem +{ + namespace internal { @@ -88,4 +91,6 @@ noexcept return internal::binomial_coef_type_check(n,k); } -#endif \ No newline at end of file +} + +#endif diff --git a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/ceil.hpp b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/ceil.hpp index 257ff0550c..2611e6560b 100644 --- a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/ceil.hpp +++ b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/ceil.hpp @@ -24,6 +24,9 @@ #include #include +namespace gcem +{ + namespace internal { @@ -134,4 +137,6 @@ noexcept } } +} + #endif diff --git a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/copysign.hpp b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/copysign.hpp index eecfea21a2..d1181995c7 100644 --- a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/copysign.hpp +++ b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/copysign.hpp @@ -24,6 +24,9 @@ #include #include +namespace gcem +{ + /** * Compile-time copy sign function * @@ -45,4 +48,6 @@ noexcept } } +} + #endif diff --git a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/cos.hpp b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/cos.hpp index 9c8181bb99..be73b55e3f 100644 --- a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/cos.hpp +++ b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/cos.hpp @@ -28,6 +28,9 @@ #include #include +namespace gcem +{ + namespace internal { @@ -87,4 +90,6 @@ noexcept } } +} + #endif diff --git a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/cosh.hpp b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/cosh.hpp index 225c37a011..53e5bb1264 100644 --- a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/cosh.hpp +++ b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/cosh.hpp @@ -28,6 +28,9 @@ #include #include +namespace gcem +{ + namespace internal { @@ -69,4 +72,6 @@ noexcept } } +} + #endif diff --git a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/erf.hpp b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/erf.hpp index ee5386325b..319669d7f0 100644 --- a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/erf.hpp +++ b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/erf.hpp @@ -28,6 +28,9 @@ #include #include +namespace gcem +{ + namespace internal { @@ -147,4 +150,6 @@ noexcept } } +} + #endif diff --git a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/erf_inv.hpp b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/erf_inv.hpp index 412d686be2..c4f0d9d5ab 100644 --- a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/erf_inv.hpp +++ b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/erf_inv.hpp @@ -28,6 +28,9 @@ #ifndef _gcem_erf_inv_HPP #define _gcem_erf_inv_HPP +namespace gcem +{ + namespace internal { @@ -260,5 +263,6 @@ noexcept return internal::erf_inv_begin( static_cast>(p) ); } +} #endif diff --git a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/exp.hpp b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/exp.hpp index acbda39377..1708542df5 100644 --- a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/exp.hpp +++ b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/exp.hpp @@ -28,6 +28,9 @@ #include #include +namespace gcem +{ + namespace internal { @@ -134,4 +137,6 @@ noexcept } } +} + #endif diff --git a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/expm1.hpp b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/expm1.hpp index edecd394cf..6adddc929a 100644 --- a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/expm1.hpp +++ b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/expm1.hpp @@ -28,6 +28,9 @@ #include #include +namespace gcem +{ + namespace internal { @@ -80,4 +83,6 @@ noexcept } } +} + #endif diff --git a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/factorial.hpp b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/factorial.hpp index ffb9c82475..977e6970e4 100644 --- a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/factorial.hpp +++ b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/factorial.hpp @@ -25,6 +25,9 @@ #ifndef _gcem_factorial_HPP #define _gcem_factorial_HPP +namespace gcem +{ + namespace internal { @@ -95,4 +98,6 @@ noexcept return internal::factorial_recur(x); } +} + #endif diff --git a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/find_exponent.hpp b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/find_exponent.hpp index 200e4e9be1..4ffbcf294e 100644 --- a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/find_exponent.hpp +++ b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/find_exponent.hpp @@ -25,6 +25,9 @@ #ifndef _gcem_find_exponent_HPP #define _gcem_find_exponent_HPP +namespace gcem +{ + namespace internal { @@ -54,4 +57,6 @@ noexcept } +} + #endif diff --git a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/find_fraction.hpp b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/find_fraction.hpp index 5ed3d269ab..7689313538 100644 --- a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/find_fraction.hpp +++ b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/find_fraction.hpp @@ -25,6 +25,9 @@ #ifndef _gcem_find_fraction_HPP #define _gcem_find_fraction_HPP +namespace gcem +{ + namespace internal { @@ -43,4 +46,6 @@ noexcept } +} + #endif diff --git a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/find_whole.hpp b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/find_whole.hpp index d193632198..561050e91f 100644 --- a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/find_whole.hpp +++ b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/find_whole.hpp @@ -25,6 +25,9 @@ #ifndef _gcem_find_whole_HPP #define _gcem_find_whole_HPP +namespace gcem +{ + namespace internal { @@ -43,4 +46,6 @@ noexcept } +} + #endif diff --git a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/floor.hpp b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/floor.hpp index e35592a391..3b3b86a12a 100644 --- a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/floor.hpp +++ b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/floor.hpp @@ -24,6 +24,9 @@ #include #include +namespace gcem +{ + namespace internal { @@ -134,4 +137,6 @@ noexcept } } +} + #endif diff --git a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/fmod.hpp b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/fmod.hpp index 2f503140e3..58c454455e 100644 --- a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/fmod.hpp +++ b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/fmod.hpp @@ -24,6 +24,9 @@ #include #include +namespace gcem +{ + namespace internal { @@ -74,4 +77,6 @@ noexcept } } +} + #endif diff --git a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/gcd.hpp b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/gcd.hpp index 1e277fbab6..c5b14a22aa 100644 --- a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/gcd.hpp +++ b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/gcd.hpp @@ -21,6 +21,9 @@ #ifndef _gcem_gcd_HPP #define _gcem_gcd_HPP +namespace gcem +{ + namespace internal { @@ -79,4 +82,6 @@ noexcept return internal::gcd_type_check(a,b); } +} + #endif diff --git a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/hypot.hpp b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/hypot.hpp index c51a5b42e5..13ea80c49d 100644 --- a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/hypot.hpp +++ b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/hypot.hpp @@ -27,19 +27,42 @@ #ifndef _gcem_hypot_HPP #define _gcem_hypot_HPP +#include #include #include +namespace gcem +{ + namespace internal { template constexpr T -hypot_compute(const T x, const T ydx) +hypot_compute(const T x, const T y) noexcept { - return abs(x) * sqrt( T(1) + (ydx * ydx) ); + T a = std::max(abs(x), abs(y)); + if (a) { + return a * sqrt((x / a) * (x / a) + (y / a) * (y / a)); + } else { + return {}; + } +} + +template +constexpr +T +hypot_compute(const T x, const T y, const T z) +noexcept +{ + T a = std::max({abs(x), abs(y), abs(z)}); + if (a) { + return a * sqrt((x / a) * (x / a) + (y / a) * (y / a) + (z / a) * (z / a)); + } else { + return {}; + } } template @@ -59,7 +82,35 @@ noexcept GCLIM::min() > abs(y) ? \ abs(x) : // else - hypot_compute(x, y/x) ); + hypot_compute(x, y) ); +} + +template +constexpr +T +hypot_vals_check(const T x, const T y, const T z) +noexcept +{ + return( any_nan(x, y, z) ? \ + GCLIM::quiet_NaN() : + // + any_inf(x,y,z) ? \ + GCLIM::infinity() : + // indistinguishable from zero or one + GCLIM::min() > abs(x) && GCLIM::min() > abs(y) ? \ + abs(z) : + GCLIM::min() > abs(x) && GCLIM::min() > abs(z) ? \ + abs(y) : + GCLIM::min() > abs(y) && GCLIM::min() > abs(z) ? \ + abs(x) : + GCLIM::min() > abs(x) ? \ + hypot_vals_check(y, z) : + GCLIM::min() > abs(y) ? \ + hypot_vals_check(x, z) : + GCLIM::min() > abs(z) ? \ + hypot_vals_check(x, y) : + // else + hypot_compute(x, y, z) ); } template> @@ -71,6 +122,15 @@ noexcept return hypot_vals_check(static_cast(x),static_cast(y)); } +template> +constexpr +TC +hypot_type_check(const T1 x, const T2 y, const T3 z) +noexcept +{ + return hypot_vals_check(static_cast(x),static_cast(y),static_cast(z)); +} + } /** @@ -94,4 +154,28 @@ noexcept } } +/** + * Compile-time Pythagorean addition function + * + * @param x a real-valued input. + * @param y a real-valued input. + * @param z a real-valued input. + * @return Computes \f$ x \oplus y \oplus z = \sqrt{x^2 + y^2 + z^2} \f$. + */ + +template +constexpr +common_return_t +hypot(const T1 x, const T2 y, const T3 z) +noexcept +{ + if (std::is_constant_evaluated()) { + return internal::hypot_type_check(x,y,z); + } else { + return std::hypot(x, y, z); + } +} + +} + #endif diff --git a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/incomplete_beta.hpp b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/incomplete_beta.hpp index dbb9f60341..681cc59953 100644 --- a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/incomplete_beta.hpp +++ b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/incomplete_beta.hpp @@ -27,6 +27,9 @@ #ifndef _gcem_incomplete_beta_HPP #define _gcem_incomplete_beta_HPP +namespace gcem +{ + namespace internal { @@ -191,4 +194,6 @@ noexcept return internal::incomplete_beta_type_check(a,b,z); } +} + #endif diff --git a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/incomplete_beta_inv.hpp b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/incomplete_beta_inv.hpp index 9f575a3604..3878d37db3 100644 --- a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/incomplete_beta_inv.hpp +++ b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/incomplete_beta_inv.hpp @@ -25,6 +25,9 @@ #ifndef _gcem_incomplete_beta_inv_HPP #define _gcem_incomplete_beta_inv_HPP +namespace gcem +{ + namespace internal { @@ -349,4 +352,6 @@ noexcept return internal::incomplete_beta_inv_type_check(a,b,p); } +} + #endif diff --git a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/incomplete_gamma.hpp b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/incomplete_gamma.hpp index 9ee4146de0..0432b7d3c6 100644 --- a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/incomplete_gamma.hpp +++ b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/incomplete_gamma.hpp @@ -25,6 +25,9 @@ #ifndef _gcem_incomplete_gamma_HPP #define _gcem_incomplete_gamma_HPP +namespace gcem +{ + namespace internal { @@ -244,4 +247,6 @@ noexcept return internal::incomplete_gamma_type_check(a,x); } +} + #endif diff --git a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/incomplete_gamma_inv.hpp b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/incomplete_gamma_inv.hpp index e5976d08fd..6b1575b89c 100644 --- a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/incomplete_gamma_inv.hpp +++ b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/incomplete_gamma_inv.hpp @@ -25,6 +25,9 @@ #ifndef _gcem_incomplete_gamma_inv_HPP #define _gcem_incomplete_gamma_inv_HPP +namespace gcem +{ + namespace internal { @@ -268,4 +271,6 @@ noexcept return internal::incomplete_gamma_inv_type_check(a,p); } +} + #endif diff --git a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/inv_sqrt.hpp b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/inv_sqrt.hpp index d0e33fb743..466e76fc5e 100644 --- a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/inv_sqrt.hpp +++ b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/inv_sqrt.hpp @@ -25,6 +25,9 @@ #ifndef _gcem_inv_sqrt_HPP #define _gcem_inv_sqrt_HPP +namespace gcem +{ + namespace internal { @@ -85,4 +88,6 @@ noexcept return internal::inv_sqrt_check( static_cast>(x) ); } +} + #endif diff --git a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/is_even.hpp b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/is_even.hpp index de0641d852..5aff6a3fa6 100644 --- a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/is_even.hpp +++ b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/is_even.hpp @@ -25,6 +25,9 @@ #ifndef _gcem_is_even_HPP #define _gcem_is_even_HPP +namespace gcem +{ + namespace internal { @@ -38,4 +41,6 @@ noexcept } +} + #endif diff --git a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/is_finite.hpp b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/is_finite.hpp index b632fa3472..805cbc4ab6 100644 --- a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/is_finite.hpp +++ b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/is_finite.hpp @@ -25,6 +25,9 @@ #ifndef _gcem_is_finite_HPP #define _gcem_is_finite_HPP +namespace gcem +{ + namespace internal { @@ -75,4 +78,6 @@ noexcept } +} + #endif diff --git a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/is_inf.hpp b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/is_inf.hpp index 568614f8ef..fdc31de71a 100644 --- a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/is_inf.hpp +++ b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/is_inf.hpp @@ -25,6 +25,9 @@ #ifndef _gcem_is_inf_HPP #define _gcem_is_inf_HPP +namespace gcem +{ + namespace internal { @@ -169,4 +172,6 @@ noexcept } +} + #endif diff --git a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/is_nan.hpp b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/is_nan.hpp index a3fcbc6c7c..74092e6b08 100644 --- a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/is_nan.hpp +++ b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/is_nan.hpp @@ -25,6 +25,9 @@ #ifndef _gcem_is_nan_HPP #define _gcem_is_nan_HPP +namespace gcem +{ + namespace internal { @@ -77,4 +80,6 @@ noexcept } +} + #endif diff --git a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/is_odd.hpp b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/is_odd.hpp index a74a8d34f2..a76802f7ff 100644 --- a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/is_odd.hpp +++ b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/is_odd.hpp @@ -25,6 +25,9 @@ #ifndef _gcem_is_odd_HPP #define _gcem_is_odd_HPP +namespace gcem +{ + namespace internal { @@ -39,4 +42,6 @@ noexcept } +} + #endif diff --git a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/lbeta.hpp b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/lbeta.hpp index 60c87b4f53..78f6849e72 100644 --- a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/lbeta.hpp +++ b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/lbeta.hpp @@ -21,6 +21,9 @@ #ifndef _gcem_lbeta_HPP #define _gcem_lbeta_HPP +namespace gcem +{ + /** * Compile-time log-beta function * @@ -39,4 +42,6 @@ noexcept return( (lgamma(a) + lgamma(b)) - lgamma(a+b) ); } +} + #endif diff --git a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/lcm.hpp b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/lcm.hpp index a7ca7766f8..aa1f339730 100644 --- a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/lcm.hpp +++ b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/lcm.hpp @@ -21,6 +21,9 @@ #ifndef _gcem_lcm_HPP #define _gcem_lcm_HPP +namespace gcem +{ + namespace internal { @@ -62,4 +65,6 @@ noexcept return internal::lcm_type_check(a,b); } +} + #endif diff --git a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/lgamma.hpp b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/lgamma.hpp index 7c11fe56ad..e349ee88db 100644 --- a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/lgamma.hpp +++ b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/lgamma.hpp @@ -31,6 +31,9 @@ #include #include +namespace gcem +{ + namespace internal { @@ -139,4 +142,6 @@ noexcept } } +} + #endif diff --git a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/lmgamma.hpp b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/lmgamma.hpp index 58915dc1e1..b009de18e7 100644 --- a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/lmgamma.hpp +++ b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/lmgamma.hpp @@ -25,6 +25,9 @@ #ifndef _gcem_lmgamma_HPP #define _gcem_lmgamma_HPP +namespace gcem +{ + namespace internal { @@ -70,4 +73,6 @@ noexcept return internal::lmgamma_recur(static_cast>(a),p); } +} + #endif diff --git a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/log.hpp b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/log.hpp index b9f1f02ced..15577c8bac 100644 --- a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/log.hpp +++ b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/log.hpp @@ -28,6 +28,9 @@ #include #include +namespace gcem +{ + namespace internal { @@ -190,4 +193,6 @@ noexcept } } +} + #endif diff --git a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/log10.hpp b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/log10.hpp index 0d4ff3ecb0..0e9a4dbdf5 100644 --- a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/log10.hpp +++ b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/log10.hpp @@ -28,6 +28,9 @@ #include #include +namespace gcem +{ + namespace internal { @@ -63,4 +66,6 @@ noexcept } } +} + #endif diff --git a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/log1p.hpp b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/log1p.hpp index b7e6cd534d..ed41daf39e 100644 --- a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/log1p.hpp +++ b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/log1p.hpp @@ -28,6 +28,9 @@ #include #include +namespace gcem +{ + namespace internal { @@ -84,4 +87,6 @@ noexcept } } +} + #endif diff --git a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/log2.hpp b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/log2.hpp index 37196152d0..f8dc729f4f 100644 --- a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/log2.hpp +++ b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/log2.hpp @@ -28,6 +28,9 @@ #include #include +namespace gcem +{ + namespace internal { @@ -63,4 +66,6 @@ noexcept } } +} + #endif diff --git a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/log_binomial_coef.hpp b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/log_binomial_coef.hpp index 2bcaadd8bc..c4ba2fa3de 100644 --- a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/log_binomial_coef.hpp +++ b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/log_binomial_coef.hpp @@ -21,6 +21,9 @@ #ifndef _gcem_log_binomial_coef_HPP #define _gcem_log_binomial_coef_HPP +namespace gcem +{ + namespace internal { @@ -62,4 +65,6 @@ noexcept return internal::log_binomial_coef_type_check(n,k); } -#endif \ No newline at end of file +} + +#endif diff --git a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/mantissa.hpp b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/mantissa.hpp index af23ea21d2..4c95110d62 100644 --- a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/mantissa.hpp +++ b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/mantissa.hpp @@ -25,6 +25,9 @@ #ifndef _gcem_mantissa_HPP #define _gcem_mantissa_HPP +namespace gcem +{ + namespace internal { @@ -44,4 +47,6 @@ noexcept } +} + #endif diff --git a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/max.hpp b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/max.hpp index 94cd379d87..9f3901b4b1 100644 --- a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/max.hpp +++ b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/max.hpp @@ -24,6 +24,9 @@ #include #include +namespace gcem +{ + /** * Compile-time pairwise maximum function * @@ -45,4 +48,6 @@ noexcept } } +} + #endif diff --git a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/min.hpp b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/min.hpp index 998601a4cc..a35bcf6e2c 100644 --- a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/min.hpp +++ b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/min.hpp @@ -24,6 +24,9 @@ #include #include +namespace gcem +{ + /** * Compile-time pairwise minimum function * @@ -45,4 +48,6 @@ noexcept } } +} + #endif diff --git a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/neg_zero.hpp b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/neg_zero.hpp index 79d24a4dd5..9092303541 100644 --- a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/neg_zero.hpp +++ b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/neg_zero.hpp @@ -22,6 +22,9 @@ * extract signbit for signed zeros */ +namespace gcem +{ + namespace internal { @@ -35,3 +38,5 @@ noexcept } } + +} diff --git a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/pow.hpp b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/pow.hpp index 35b2a9aa17..372166d406 100644 --- a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/pow.hpp +++ b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/pow.hpp @@ -28,6 +28,9 @@ #include #include +namespace gcem +{ + namespace internal { @@ -86,4 +89,6 @@ noexcept } } +} + #endif diff --git a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/pow_integral.hpp b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/pow_integral.hpp index 4e67155707..589d164065 100644 --- a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/pow_integral.hpp +++ b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/pow_integral.hpp @@ -25,6 +25,9 @@ #ifndef _gcem_pow_integral_HPP #define _gcem_pow_integral_HPP +namespace gcem +{ + namespace internal { @@ -125,4 +128,6 @@ noexcept } +} + #endif diff --git a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/quadrature/gauss_legendre_30.hpp b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/quadrature/gauss_legendre_30.hpp index 295f43d952..a80d2bb6f9 100644 --- a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/quadrature/gauss_legendre_30.hpp +++ b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/quadrature/gauss_legendre_30.hpp @@ -22,6 +22,9 @@ * Gauss-Legendre quadrature: 30 points */ +namespace gcem +{ + static const long double gauss_legendre_30_points[30] = \ { -0.05147184255531769583302521316672L, @@ -89,3 +92,5 @@ static const long double gauss_legendre_30_weights[30] = \ 0.00796819249616660561546588347467L, 0.00796819249616660561546588347467L\ }; + +} diff --git a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/quadrature/gauss_legendre_50.hpp b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/quadrature/gauss_legendre_50.hpp index d4e448c56e..85244daf10 100644 --- a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/quadrature/gauss_legendre_50.hpp +++ b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/quadrature/gauss_legendre_50.hpp @@ -22,6 +22,9 @@ * Gauss-Legendre quadrature: 50 points */ +namespace gcem +{ + static const long double gauss_legendre_50_points[50] = \ { -0.03109833832718887611232898966595L, @@ -129,3 +132,5 @@ static const long double gauss_legendre_50_weights[50] = \ 0.00290862255315514095840072434286L, 0.00290862255315514095840072434286L\ }; + +} diff --git a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/round.hpp b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/round.hpp index d7c1300b14..10fae649f8 100644 --- a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/round.hpp +++ b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/round.hpp @@ -24,6 +24,9 @@ #include #include +namespace gcem +{ + namespace internal { @@ -129,4 +132,6 @@ noexcept } } +} + #endif diff --git a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/sgn.hpp b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/sgn.hpp index e2eec9e80b..4c4adfa5a8 100644 --- a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/sgn.hpp +++ b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/sgn.hpp @@ -21,6 +21,9 @@ #ifndef _gcem_sgn_HPP #define _gcem_sgn_HPP +namespace gcem +{ + /** * Compile-time sign function * @@ -42,4 +45,6 @@ noexcept 0 ); } +} + #endif diff --git a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/signbit.hpp b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/signbit.hpp index c13c6f3265..40ec1dd157 100644 --- a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/signbit.hpp +++ b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/signbit.hpp @@ -24,6 +24,9 @@ #include #include +namespace gcem +{ + /** * Compile-time sign bit detection function * @@ -48,4 +51,6 @@ noexcept } } +} + #endif diff --git a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/sin.hpp b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/sin.hpp index 203ea5d972..c7c17600db 100644 --- a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/sin.hpp +++ b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/sin.hpp @@ -30,6 +30,9 @@ #include #include +namespace gcem +{ + namespace internal { @@ -89,4 +92,6 @@ noexcept } } +} + #endif diff --git a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/sinh.hpp b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/sinh.hpp index 337ee3d576..9174d5d64a 100644 --- a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/sinh.hpp +++ b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/sinh.hpp @@ -28,6 +28,9 @@ #include #include +namespace gcem +{ + namespace internal { @@ -69,4 +72,6 @@ noexcept } } +} + #endif diff --git a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/sqrt.hpp b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/sqrt.hpp index f65070a5ea..201d89fa0d 100644 --- a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/sqrt.hpp +++ b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/sqrt.hpp @@ -28,6 +28,9 @@ #include #include +namespace gcem +{ + namespace internal { @@ -113,4 +116,6 @@ noexcept } } +} + #endif diff --git a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/tan.hpp b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/tan.hpp index 354c302a50..08c12d4ea0 100644 --- a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/tan.hpp +++ b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/tan.hpp @@ -28,6 +28,9 @@ #include #include +namespace gcem +{ + namespace internal { @@ -144,4 +147,6 @@ noexcept } } +} + #endif diff --git a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/tanh.hpp b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/tanh.hpp index 15d47b4a25..f25dabdb0f 100644 --- a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/tanh.hpp +++ b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/tanh.hpp @@ -28,6 +28,9 @@ #include #include +namespace gcem +{ + namespace internal { @@ -93,4 +96,6 @@ noexcept } } +} + #endif diff --git a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/tgamma.hpp b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/tgamma.hpp index a3bf41de5b..1d9fceecf8 100644 --- a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/tgamma.hpp +++ b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/tgamma.hpp @@ -28,6 +28,9 @@ #include #include +namespace gcem +{ + namespace internal { @@ -84,4 +87,6 @@ noexcept } } +} + #endif diff --git a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/trunc.hpp b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/trunc.hpp index 979265725c..f7a31ce727 100644 --- a/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/trunc.hpp +++ b/wpimath/src/main/native/thirdparty/gcem/include/gcem_incl/trunc.hpp @@ -24,6 +24,9 @@ #include #include +namespace gcem +{ + namespace internal { @@ -125,4 +128,6 @@ noexcept } } +} + #endif