From 1cf73a09fc153fab65287e928e207e23667464be Mon Sep 17 00:00:00 2001 From: Joel Falcou Date: Thu, 7 Dec 2023 18:40:36 +0100 Subject: [PATCH] Fix missing ordered_value checks --- include/kyosu/functions/lpnorm.hpp | 2 +- include/kyosu/types/cayley_dickson.hpp | 2 +- include/kyosu/types/impl/arithmetic.hpp | 2 +- include/kyosu/types/impl/math.hpp | 10 +++++----- include/kyosu/types/impl/reals.hpp | 10 +++++----- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/include/kyosu/functions/lpnorm.hpp b/include/kyosu/functions/lpnorm.hpp index 15fc99fd..b65db870 100644 --- a/include/kyosu/functions/lpnorm.hpp +++ b/include/kyosu/functions/lpnorm.hpp @@ -56,7 +56,7 @@ namespace kyosu //! @code //! namespace kyosu //! { -//! template< floating_value P, typename T, typename ... Ts> auto lpnorm(P p, T z,Ts ... zs ) const noexcept +//! template< floating_ordered_value P, typename T, typename ... Ts> auto lpnorm(P p, T z,Ts ... zs ) const noexcept //! } //! @endcode //! diff --git a/include/kyosu/types/cayley_dickson.hpp b/include/kyosu/types/cayley_dickson.hpp index 3630a4be..2054bd0d 100644 --- a/include/kyosu/types/cayley_dickson.hpp +++ b/include/kyosu/types/cayley_dickson.hpp @@ -191,7 +191,7 @@ namespace kyosu auto val = cst( eve::as>{} ); using val_t = std::remove_cvref_t; - if constexpr(!eve::floating_value) return val; + if constexpr(!eve::floating_ordered_value) return val; else return as_cayley_dickson_n_t::static_size,val_t>(val); } diff --git a/include/kyosu/types/impl/arithmetic.hpp b/include/kyosu/types/impl/arithmetic.hpp index fce999ce..553572b1 100644 --- a/include/kyosu/types/impl/arithmetic.hpp +++ b/include/kyosu/types/impl/arithmetic.hpp @@ -247,7 +247,7 @@ namespace kyosu::_ using r_t = kyosu::as_cayley_dickson_t; using er_t = decltype(kyosu::abs(r_t{})); - if constexpr(eve::floating_value || eve::floating_value) + if constexpr(eve::floating_ordered_value || eve::floating_ordered_value) { return kyosu::real(c0)*kyosu::real(c1); } diff --git a/include/kyosu/types/impl/math.hpp b/include/kyosu/types/impl/math.hpp index 30c730ee..98e60391 100644 --- a/include/kyosu/types/impl/math.hpp +++ b/include/kyosu/types/impl/math.hpp @@ -285,7 +285,7 @@ namespace kyosu::_ } } - template + template KYOSU_FORCEINLINE constexpr auto dispatch(eve::tag_of const&, T const & p, Cs const &... zs) noexcept { @@ -352,7 +352,7 @@ namespace kyosu::_ else if constexpr((dimension_v <= 2) && (dimension_v <= 2)) { r_t r; - if constexpr(eve::floating_value && kyosu::concepts::complex) // c1 is complex c0 is real + if constexpr(eve::floating_ordered_value && kyosu::concepts::complex) // c1 is complex c0 is real { auto [rc1, ic1] = c1; auto lgac0 = eve::log_abs(c0); @@ -372,7 +372,7 @@ namespace kyosu::_ r = kyosu::if_else(isposc0, r1, r2); } } - else if constexpr(eve::floating_value ) // c0 is complex c1 is real + else if constexpr(eve::floating_ordered_value ) // c0 is complex c1 is real { auto lc0 = kyosu::log_abs(c0); auto argc0 = kyosu::arg(c0); @@ -400,11 +400,11 @@ namespace kyosu::_ } else { - if constexpr(eve::floating_value) //c0 cayley c1 real + if constexpr(eve::floating_ordered_value) //c0 cayley c1 real { return cayley_extend(pow, c0, c1); } - else if constexpr(eve::floating_value)//c1 cayley c0 real + else if constexpr(eve::floating_ordered_value)//c1 cayley c0 real { return cayley_extend_rev(pow, c0, c1); } diff --git a/include/kyosu/types/impl/reals.hpp b/include/kyosu/types/impl/reals.hpp index a068150c..5898f95d 100644 --- a/include/kyosu/types/impl/reals.hpp +++ b/include/kyosu/types/impl/reals.hpp @@ -9,10 +9,10 @@ namespace kyosu::_ { - template + template constexpr auto complex_(EVE_EXPECTS(eve::cpu_), T r) noexcept { return as_cayley_dickson_n_t<2,T>(r, 0); } - template + template constexpr auto complex_(EVE_EXPECTS(eve::cpu_), T0 r, T1 i) noexcept -> as_cayley_dickson_n_t<2,decltype(eve::add(r, i))> { return as_cayley_dickson_n_t<2, decltype(eve::add(r, i))>{r, i}; @@ -23,16 +23,16 @@ namespace kyosu::_ //========================================================================================================================= - template + template constexpr auto quaternion_(EVE_EXPECTS(eve::cpu_), T r) noexcept { return as_cayley_dickson_n_t<4,T>(r, 0, 0, 0); } - template + template constexpr auto quaternion_(EVE_EXPECTS(eve::cpu_), T0 r, T1 i) noexcept -> as_cayley_dickson_n_t<4, decltype(eve::add(r, i))> { return as_cayley_dickson_n_t<4, decltype(eve::add(r, i))>{r, i, 0, 0}; } - template + template constexpr auto quaternion_(EVE_EXPECTS(eve::cpu_), T0 r, T1 i, T2 j, T3 k) noexcept -> as_cayley_dickson_n_t<4, decltype(eve::add(r, i, j, k))> { return as_cayley_dickson_n_t<4, decltype(eve::add(r, i, j, k))>{r, i, j, k};