Skip to content

Commit

Permalink
First wave of fixes due to cocnept changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jfalcou committed Dec 7, 2023
1 parent d33aa4e commit 3687495
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion include/kyosu/types/impl/arithmetic.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ namespace kyosu::_
using r_t = kyosu::as_cayley_dickson_t<C0,C1>;
using er_t = decltype(kyosu::abs(r_t{}));

if constexpr(eve::floating_value<C1> || eve::floating_value<C0>)
if constexpr(eve::floating_ordered_value<C1> || eve::floating_ordered_value<C0>)
{
return kyosu::real(c0)*kyosu::real(c1);
}
Expand Down
8 changes: 4 additions & 4 deletions include/kyosu/types/impl/math.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ namespace kyosu::_
else if constexpr((dimension_v<C0> <= 2) && (dimension_v<C1> <= 2))
{
r_t r;
if constexpr(eve::floating_value<C0> && kyosu::concepts::complex<C1>) // c1 is complex c0 is real
if constexpr(eve::floating_ordered_value<C0> && kyosu::concepts::complex<C1>) // c1 is complex c0 is real
{
auto [rc1, ic1] = c1;
auto lgac0 = eve::log_abs(c0);
Expand All @@ -372,7 +372,7 @@ namespace kyosu::_
r = kyosu::if_else(isposc0, r1, r2);
}
}
else if constexpr(eve::floating_value<C1> ) // c0 is complex c1 is real
else if constexpr(eve::floating_ordered_value<C1> ) // c0 is complex c1 is real
{
auto lc0 = kyosu::log_abs(c0);
auto argc0 = kyosu::arg(c0);
Expand Down Expand Up @@ -400,11 +400,11 @@ namespace kyosu::_
}
else
{
if constexpr(eve::floating_value<C1>) //c0 cayley c1 real
if constexpr(eve::floating_ordered_value<C1>) //c0 cayley c1 real
{
return cayley_extend(pow, c0, c1);
}
else if constexpr(eve::floating_value<C0>)//c1 cayley c0 real
else if constexpr(eve::floating_ordered_value<C0>)//c1 cayley c0 real
{
return cayley_extend_rev(pow, c0, c1);
}
Expand Down
10 changes: 5 additions & 5 deletions include/kyosu/types/impl/reals.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@

namespace kyosu::_
{
template<eve::floating_value T>
template<eve::floating_ordered_value T>
constexpr auto complex_(EVE_EXPECTS(eve::cpu_), T r) noexcept { return as_cayley_dickson_n_t<2,T>(r, 0); }

template<eve::floating_value T0, eve::floating_value T1>
template<eve::floating_ordered_value T0, eve::floating_ordered_value T1>
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};
Expand All @@ -23,16 +23,16 @@ namespace kyosu::_

//=========================================================================================================================

template<eve::floating_value T>
template<eve::floating_ordered_value T>
constexpr auto quaternion_(EVE_EXPECTS(eve::cpu_), T r) noexcept { return as_cayley_dickson_n_t<4,T>(r, 0, 0, 0); }

template<eve::floating_value T0, eve::floating_value T1>
template<eve::floating_ordered_value T0, eve::floating_ordered_value T1>
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<eve::floating_value T0, eve::floating_value T1, eve::floating_value T2, eve::floating_value T3>
template<eve::floating_ordered_value T0, eve::floating_ordered_value T1, eve::floating_ordered_value T2, eve::floating_ordered_value T3>
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};
Expand Down

0 comments on commit 3687495

Please sign in to comment.