diff --git a/include/kyosu/types/cayley_dickson.hpp b/include/kyosu/types/cayley_dickson.hpp index e323e8ba..e38db55f 100644 --- a/include/kyosu/types/cayley_dickson.hpp +++ b/include/kyosu/types/cayley_dickson.hpp @@ -183,11 +183,15 @@ namespace kyosu } // TODO: Move to tag_invoke when EVE catch up on this front - template - KYOSU_FORCEINLINE constexpr auto tagged_dispatch(Tag const&, eve::as> const&) noexcept + template + KYOSU_FORCEINLINE constexpr auto tagged_dispatch(Tag const&, eve::as const&) noexcept { eve::detail::callable_object cst; - return cayley_dickson( cst(eve::as{}) ); + auto val = cst( eve::as>{} ); + using val_t = std::remove_cvref_t; + + if constexpr(!eve::floating_value) return val; + else return as_cayley_dickson_n_t::static_size,val_t>(val); } template diff --git a/test/unit/infra/as_cayley_dickinson.cpp b/test/unit/infra/as_cayley_dickinson.cpp index 9a19c20f..e9cbe52a 100644 --- a/test/unit/infra/as_cayley_dickinson.cpp +++ b/test/unit/infra/as_cayley_dickinson.cpp @@ -8,117 +8,117 @@ #include #include -// TTS_CASE( "Check as_cayley_dickson_n with scalar reals") -// { -// TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<2, std::int32_t > ), kyosu::complex ); -// TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<2, float > ), kyosu::complex ); -// TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<2, std::int64_t > ), kyosu::complex ); -// TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<2, double > ), kyosu::complex ); -// TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<4, std::int32_t > ), kyosu::quaternion ); -// TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<4, float > ), kyosu::quaternion ); -// TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<4, std::int64_t > ), kyosu::quaternion); -// TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<4, double > ), kyosu::quaternion); -// TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<8, std::int32_t > ), kyosu::octonion ); -// TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<8, float > ), kyosu::octonion ); -// TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<8, std::int64_t > ), kyosu::octonion ); -// TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<8, double > ), kyosu::octonion ); -// }; +TTS_CASE( "Check as_cayley_dickson_n with scalar reals") +{ + TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<2, std::int32_t > ), kyosu::complex_t ); + TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<2, float > ), kyosu::complex_t ); + TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<2, std::int64_t > ), kyosu::complex_t ); + TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<2, double > ), kyosu::complex_t ); + TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<4, std::int32_t > ), kyosu::quaternion_t ); + TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<4, float > ), kyosu::quaternion_t ); + TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<4, std::int64_t > ), kyosu::quaternion_t); + TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<4, double > ), kyosu::quaternion_t); + TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<8, std::int32_t > ), kyosu::octonion_t ); + TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<8, float > ), kyosu::octonion_t ); + TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<8, std::int64_t > ), kyosu::octonion_t ); + TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<8, double > ), kyosu::octonion_t ); +}; -// TTS_CASE( "Check as_cayley_dickson_n with scalar non-reals") -// { -// TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<2, kyosu::complex > ), kyosu::complex ); -// TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<2, kyosu::complex > ), kyosu::complex ); -// TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<4, kyosu::complex > ), kyosu::quaternion ); -// TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<4, kyosu::complex > ), kyosu::quaternion); -// TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<8, kyosu::complex > ), kyosu::octonion ); -// TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<8, kyosu::complex > ), kyosu::octonion ); +TTS_CASE( "Check as_cayley_dickson_n with scalar non-reals") +{ + TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<2, kyosu::complex_t > ), kyosu::complex_t ); + TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<2, kyosu::complex_t > ), kyosu::complex_t ); + TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<4, kyosu::complex_t > ), kyosu::quaternion_t ); + TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<4, kyosu::complex_t > ), kyosu::quaternion_t); + TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<8, kyosu::complex_t > ), kyosu::octonion_t ); + TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<8, kyosu::complex_t > ), kyosu::octonion_t ); -// TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<2, kyosu::quaternion > ), kyosu::complex ); -// TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<2, kyosu::quaternion > ), kyosu::complex ); -// TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<4, kyosu::quaternion > ), kyosu::quaternion ); -// TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<4, kyosu::quaternion > ), kyosu::quaternion); -// TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<8, kyosu::quaternion > ), kyosu::octonion ); -// TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<8, kyosu::quaternion > ), kyosu::octonion ); + TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<2, kyosu::quaternion_t > ), kyosu::complex_t ); + TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<2, kyosu::quaternion_t > ), kyosu::complex_t ); + TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<4, kyosu::quaternion_t > ), kyosu::quaternion_t ); + TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<4, kyosu::quaternion_t > ), kyosu::quaternion_t); + TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<8, kyosu::quaternion_t > ), kyosu::octonion_t ); + TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<8, kyosu::quaternion_t > ), kyosu::octonion_t ); -// TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<2, kyosu::octonion > ), kyosu::complex ); -// TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<2, kyosu::octonion > ), kyosu::complex ); -// TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<4, kyosu::octonion > ), kyosu::quaternion ); -// TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<4, kyosu::octonion > ), kyosu::quaternion); -// TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<8, kyosu::octonion > ), kyosu::octonion ); -// TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<8, kyosu::octonion > ), kyosu::octonion ); -// }; + TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<2, kyosu::octonion_t > ), kyosu::complex_t ); + TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<2, kyosu::octonion_t > ), kyosu::complex_t ); + TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<4, kyosu::octonion_t > ), kyosu::quaternion_t ); + TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<4, kyosu::octonion_t > ), kyosu::quaternion_t); + TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<8, kyosu::octonion_t > ), kyosu::octonion_t ); + TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<8, kyosu::octonion_t > ), kyosu::octonion_t ); +}; -// TTS_CASE( "Check as_cayley_dickson_n with mixed scalar") -// { -// using kyosu::complex; -// using kyosu::quaternion; -// TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<2, complex , complex> ), complex ); -// TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<2, complex , int > ), complex ); -// TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<2, complex , std::int64_t > ), complex ); -// TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<2, complex , float > ), complex ); -// TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<2, complex , double > ), complex ); +TTS_CASE( "Check as_cayley_dickson_n with mixed scalar") +{ + using kyosu::complex_t; + using kyosu::quaternion_t; + TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<2, complex_t , complex_t> ), complex_t ); + TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<2, complex_t , int > ), complex_t ); + TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<2, complex_t , std::int64_t > ), complex_t ); + TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<2, complex_t , float > ), complex_t ); + TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<2, complex_t , double > ), complex_t ); -// TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<2, complex , complex> ), complex ); -// TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<2, int , complex> ), complex ); -// TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<2, std::int64_t , complex> ), complex ); -// TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<2, float , complex> ), complex ); -// TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<2, double , complex> ), complex ); + TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<2, complex_t , complex_t> ), complex_t ); + TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<2, int , complex_t> ), complex_t ); + TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<2, std::int64_t , complex_t> ), complex_t ); + TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<2, float , complex_t> ), complex_t ); + TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<2, double , complex_t> ), complex_t ); -// TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<2, complex, complex>), complex ); -// TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<2, complex, int > ), complex ); -// TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<2, complex, std::int64_t > ), complex ); -// TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<2, complex, float > ), complex ); -// TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<2, complex, double > ), complex ); + TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<2, complex_t, complex_t>), complex_t ); + TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<2, complex_t, int > ), complex_t ); + TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<2, complex_t, std::int64_t > ), complex_t ); + TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<2, complex_t, float > ), complex_t ); + TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<2, complex_t, double > ), complex_t ); -// TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<2, complex, complex> ), complex ); -// TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<2, int , complex> ), complex ); -// TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<2, std::int64_t , complex> ), complex ); -// TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<2, float , complex> ), complex ); -// TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<2, double , complex> ), complex ); + TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<2, complex_t, complex_t> ), complex_t ); + TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<2, int , complex_t> ), complex_t ); + TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<2, std::int64_t , complex_t> ), complex_t ); + TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<2, float , complex_t> ), complex_t ); + TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<2, double , complex_t> ), complex_t ); -// TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<4, complex, quaternion> ), quaternion ); -// }; + TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<4, complex_t, quaternion_t> ), quaternion_t ); +}; -// TTS_CASE( "Check as_cayley_dickson_n on SIMD reals") -// { -// using eve::wide; +TTS_CASE( "Check as_cayley_dickson_n on SIMD reals") +{ + using eve::wide; -// TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<2, wide> ), wide >); -// TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<2, wide> ), wide >); -// TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<2, wide> ), wide >); -// TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<2, wide> ), wide >); -// TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<4, wide> ), wide >); -// TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<4, wide> ), wide >); -// TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<4, wide> ), wide>); -// TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<4, wide> ), wide>); -// TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<8, wide> ), wide >); -// TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<8, wide> ), wide >); -// TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<8, wide> ), wide >); -// TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<8, wide> ), wide >); -// }; + TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<2, wide> ), wide >); + TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<2, wide> ), wide >); + TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<2, wide> ), wide >); + TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<2, wide> ), wide >); + TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<4, wide> ), wide >); + TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<4, wide> ), wide >); + TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<4, wide> ), wide>); + TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<4, wide> ), wide>); + TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<8, wide> ), wide >); + TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<8, wide> ), wide >); + TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<8, wide> ), wide >); + TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<8, wide> ), wide >); +}; -// TTS_CASE( "Check as_cayley_dickson_n on SIMD non-reals") -// { -// using eve::wide; +TTS_CASE( "Check as_cayley_dickson_n on SIMD non-reals") +{ + using eve::wide; -// TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<2, wide >> ), wide >); -// TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<2, wide >> ), wide >); -// TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<2, wide >> ), wide >); -// TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<2, wide >> ), wide >); -// TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<2, wide >> ), wide >); -// TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<2, wide >> ), wide >); + TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<2, wide >> ), wide >); + TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<2, wide >> ), wide >); + TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<2, wide >> ), wide >); + TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<2, wide >> ), wide >); + TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<2, wide >> ), wide >); + TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<2, wide >> ), wide >); -// TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<4, wide >> ), wide >); -// TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<4, wide >> ), wide>); -// TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<4, wide >> ), wide >); -// TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<4, wide >> ), wide>); -// TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<4, wide >> ), wide >); -// TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<4, wide >> ), wide>); + TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<4, wide >> ), wide >); + TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<4, wide >> ), wide>); + TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<4, wide >> ), wide >); + TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<4, wide >> ), wide>); + TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<4, wide >> ), wide >); + TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<4, wide >> ), wide>); -// TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<8, wide >> ), wide >); -// TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<8, wide >> ), wide>); -// TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<8, wide >> ), wide >); -// TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<8, wide >> ), wide>); -// TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<8, wide >> ), wide >); -// TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<8, wide >> ), wide>); -// }; + TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<8, wide >> ), wide >); + TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<8, wide >> ), wide>); + TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<8, wide >> ), wide >); + TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<8, wide >> ), wide>); + TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<8, wide >> ), wide >); + TTS_TYPE_IS((kyosu::as_cayley_dickson_n_t<8, wide >> ), wide>); +}; diff --git a/test/unit/infra/as_real.cpp b/test/unit/infra/as_real_type.cpp similarity index 81% rename from test/unit/infra/as_real.cpp rename to test/unit/infra/as_real_type.cpp index 05760341..a7cfde69 100644 --- a/test/unit/infra/as_real.cpp +++ b/test/unit/infra/as_real_type.cpp @@ -8,13 +8,13 @@ #include #include -TTS_CASE_TPL( "Check as_real behavior on real types", kyosu::real_types) +TTS_CASE_TPL( "Check as_real_type_t behavior on real types", kyosu::real_types) (tts::type) { TTS_TYPE_IS(kyosu::as_real_type_t, T); }; -TTS_CASE_TPL( "Check as_real behavior on non-real types", kyosu::real_types) +TTS_CASE_TPL( "Check as_real_type_t behavior on non-real types", kyosu::real_types) (tts::type) { TTS_TYPE_IS(kyosu::as_real_type_t> , T); diff --git a/test/unit/infra/constants.cpp b/test/unit/infra/constants.cpp new file mode 100644 index 00000000..2f65cd60 --- /dev/null +++ b/test/unit/infra/constants.cpp @@ -0,0 +1,50 @@ +//====================================================================================================================== +/* + Kyosu - Complex Without Complexes + Copyright : KYOSU Contributors & Maintainers + SPDX-License-Identifier: BSL-1.0 +*/ +//====================================================================================================================== +#include +#include + +TTS_CASE_TPL( "Check as_real behavior on real types", kyosu::real_types) +(tts::type) +{ + T x = {}; + + TTS_EQUAL(eve::half(kyosu::as_real{}), T{0.5}); + TTS_EQUAL(eve::half(kyosu::as_real(x)), T{0.5}); +}; + +TTS_CASE_TPL( "Check as_real behavior on non-real types", kyosu::real_types) +(tts::type) +{ + kyosu::complex_t cx = {}; + kyosu::quaternion_t qx = {}; + kyosu::octonion_t ox = {}; + + TTS_EQUAL(eve::half(kyosu::as_real>{}), T{0.5}); + TTS_EQUAL(eve::half(kyosu::as_real>{}), T{0.5}); + TTS_EQUAL(eve::half(kyosu::as_real>{}), T{0.5}); + + TTS_EQUAL(eve::half(kyosu::as_real(cx)), T{0.5}); + TTS_EQUAL(eve::half(kyosu::as_real(qx)), T{0.5}); + TTS_EQUAL(eve::half(kyosu::as_real(ox)), T{0.5}); +}; + +TTS_CASE_TPL( "Check as behavior on non-real types", kyosu::real_types) +(tts::type) +{ + kyosu::complex_t cx = {}; + kyosu::quaternion_t qx = {}; + kyosu::octonion_t ox = {}; + + TTS_EQUAL(eve::half(kyosu::as>{}) , kyosu::complex_t(0.5)); + TTS_EQUAL(eve::half(kyosu::as>{}), kyosu::quaternion_t{0.5}); + TTS_EQUAL(eve::half(kyosu::as>{}) , kyosu::octonion_t{0.5}); + + TTS_EQUAL(eve::half(kyosu::as(cx)),kyosu::complex_t(0.5)); + TTS_EQUAL(eve::half(kyosu::as(qx)),kyosu::quaternion_t{0.5}); + TTS_EQUAL(eve::half(kyosu::as(ox)),kyosu::octonion_t{0.5}); +};