From dafaf1b06d8902936cb3cda1c7cfea8edd328e3a Mon Sep 17 00:00:00 2001 From: jtlap Date: Tue, 26 Sep 2023 13:25:10 +0200 Subject: [PATCH] pow bad constexpr --- include/kyosu/types/impl/math.hpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/include/kyosu/types/impl/math.hpp b/include/kyosu/types/impl/math.hpp index 2ac73b3b..ccdd7200 100644 --- a/include/kyosu/types/impl/math.hpp +++ b/include/kyosu/types/impl/math.hpp @@ -379,7 +379,7 @@ namespace kyosu::_ return kyosu::if_else(eve::is_ltz(c1), kyosu::rec(tmp), tmp); } } - else if constexpr(kyosu::concepts::complex || kyosu::concepts::complex) + 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 @@ -412,7 +412,9 @@ namespace kyosu::_ } else if constexpr( kyosu::concepts::complex)// c0 and c1 are complex { - auto [rc1, ic1] = c1; +// auto rc1 = real(c1); +// auto ic1 = imag(c1); + auto [rc1, ic1] = c1; auto lc0 = kyosu::log_abs(c0); auto argc0 = kyosu::arg(c0); auto rho = eve::exp(eve::pedantic(eve::diff_of_prod)(lc0, rc1, ic1, argc0)); @@ -421,7 +423,7 @@ namespace kyosu::_ auto realc0 = is_real(c0); if(eve::any(realc0)) { - auto rr = complex(kyosu::pow(real(c0), c1)); + auto rr = kyosu::pow(real(c0), c1); r = kyosu::if_else(realc0, rr, r); } }