From a9e1c984ed3bce365d34d6378e1e41c4d6371d41 Mon Sep 17 00:00:00 2001 From: jtlap Date: Sun, 12 Nov 2023 13:45:15 +0100 Subject: [PATCH] comments suppression and adding some doc --- doc/index.md | 15 ++- include/kyosu/functions/cyl_bessel_i1.hpp | 2 +- include/kyosu/functions/cyl_seq.hpp | 105 ------------------- include/kyosu/functions/from_angle_axis.hpp | 4 - include/kyosu/types/impl/detail/bessel_h.hpp | 32 ------ include/kyosu/types/impl/detail/bessel_k.hpp | 2 - 6 files changed, 11 insertions(+), 149 deletions(-) delete mode 100644 include/kyosu/functions/cyl_seq.hpp diff --git a/doc/index.md b/doc/index.md index 87031da1..66a05526 100644 --- a/doc/index.md +++ b/doc/index.md @@ -106,7 +106,7 @@ Operators --------- Operators (as said before) `+`, `-`, `*` and `/` can be used in infix form and can mix cayley-dickson values of - different dimensinalities. Of course the biggest dimensionlity is recovered in the output. + different dimensionalities. Of course the biggest dimensionlity is recovered in the output. Prefix forms are also provided as `add`, `sub`, `multiply` and `div`. Also plus and minus for unary versions. @@ -115,10 +115,9 @@ The left division sometimes necessary if the dimensionality is greater than 2 is Functions --------- -Most **KYOSU** callables are usable with all cayley_dickson types. The exception being mainly special -complex functions and rotation related quaternion usage. +Most **KYOSU** callables are usable with all cayley_dickson types. The exceptions mainly being rotation related quaternion usage. -@warning: **EVE** callables that correspond to mathematical functions that +@warning **EVE** callables that correspond to mathematical functions that are only defined on a proper part of the real axis as, for example, `acos` DOES NOT ever provide the same result if called in **EVE** or **KYOSU** context. @@ -163,8 +162,14 @@ complex functions and rotation related quaternion usage. | [sqr](@ref kyosu::sqr ) | [sqr_abs](@ref kyosu::sqr_abs ) | [sqrt](@ref kyosu::sqrt ) | [tan](@ref kyosu::tan ) | [tanpi](@ref kyosu::tanpi ) | | [tanh](@ref kyosu::tanh ) | [to_polar](@ref kyosu::to_polar ) | [tgamma](@ref kyosu::tgamma ) | [trunc](@ref kyosu::trunc ) | [zeta](@ref kyosu::zeta ) | + * Bessel functions - * callables usable with quaternion complex and real only + They deserve a separate list to avoid verbosity: + + * cylindrical Bessel functions: cyl_bessel_xxx are all defined for xxx being j0, j1, jn, y0, y1, yn, i0, i1, in, h1_0, h1_1, h1n, h2_0, h2_1, h2n, k1, k0, kn. + * spherical Bessel functions: sph_bessel_xxx are all defined for xxx being j0, j1, jn, y0, y1, yn, i1_0, i1_1, i1n, i2_0, i2_1, i2n, h1_0, h1_1, h1n, h2_0, h2_1 h2n, k1, k0, kn. + + * Callables usable with quaternion complex and real only These functions are related to \f$\mathbb{R}^3\f$ rotations diff --git a/include/kyosu/functions/cyl_bessel_i1.hpp b/include/kyosu/functions/cyl_bessel_i1.hpp index ecbfe37c..ba089334 100644 --- a/include/kyosu/functions/cyl_bessel_i1.hpp +++ b/include/kyosu/functions/cyl_bessel_i1.hpp @@ -40,7 +40,7 @@ namespace kyosu //! @{ //! @var cyl_bessel_i1 //! @brief Computes the modified Bessel function of the first kind, -//! \f$ I_1(x)= _iJ_1(ix) \f$ extended to the complex plane and cayley_dickson algebras. +//! \f$ I_1(x)= iJ_1(ix) \f$ extended to the complex plane and cayley_dickson algebras. //! //! It is the solution of \f$ x^{2}y''+xy'+x^2y=0\f$ for which \f$ y(0) = 0\f$. //! diff --git a/include/kyosu/functions/cyl_seq.hpp b/include/kyosu/functions/cyl_seq.hpp deleted file mode 100644 index 39b1d4d7..00000000 --- a/include/kyosu/functions/cyl_seq.hpp +++ /dev/null @@ -1,105 +0,0 @@ -//====================================================================================================================== -/* - Kyosu - Complex Without Complexes - Copyright: KYOSU Contributors & Maintainers - SPDX-License-Identifier: BSL-1.0 -*/ -//====================================================================================================================== -#pragma once - -#include -#include - -namespace kyosu::tags -{ - struct callable_cyl_seq: eve::elementwise - { - using callable_tag_type = callable_cyl_seq; - - KYOSU_DEFERS_CALLABLE(cyl_seq_); - - template - static KYOSU_FORCEINLINE void deferred_call(auto, CB cb, int nn, T const& z, Ra & cbs) noexcept - { -// if (nn == 0) { -// *std::begin(cbs) = cb(nn, z); -// return; -// } -// size_t n = eve::abs(n); -// auto rz = rec(z); -// EVE_ASSERT(js.size() >= n+1, "js has not room enough"); -// auto rs = kyosu::_::R(n, z); -// int i = n-1; - -// auto cur = std::rbegin(cbs); -// *cur = cb(n, z); -// while (i >= 0) -// { -// auto tmp = *cur; -// --cur; -// *cur = tmp*rs; -// rs = 2*(i--)*rz-kyosu::rec(rs); -// } -// cur = std::begin(cbs); -// if ( eve::is_ltz(nn)){ -// cur = ++std::begin(cbs); -// for(size_t i=1; i <= n; i+= 2, std::advance(cur, 2)) *cur = -*cur; -// } - } - - template - KYOSU_FORCEINLINE auto operator()(CB f, N const & target0, T const& target1, Ra& target2) const noexcept - -> decltype(eve::tag_invoke(*this, f, target0, target1, target2)) - { - return eve::tag_invoke(*this, f, target0, target1, target2); - } - - template - eve::unsupported_call operator()(T&&... x) const - requires(!requires { eve::tag_invoke(*this, KYOSU_FWD(x)...); }) = delete; - }; -} - -namespace kyosu -{ -//====================================================================================================================== -//! @addtogroup functions -//! @{ -//! @var cyl_seq -//! @brief Computes a sequence of bessel function values. -//! -//! @code -//! #include -//! @endcode -//! -//! @groupheader{Callable Signatures} -//! -//! @code -//! namespace kyosu -//! { -//! template constexpr auto cyl_seq(auto f, size_t n, T z, auto& cbs) noexcept; -//! template constexpr auto cyl_seq(auto f, size_t n, T z, auto& cbs) noexcept; -//! template constexpr T cyl_seq(auto f, size_t n, T z, auto& cbs) noexcept; -//! } -//! @endcode -//! -//! **Parameters** -//! -//! * 'f': any function of two parameters n and z which is a linear combination with constant coefficients -//! of \f$J_n\f$ \f$Y_n\f$, \f$H_n^{(1)} or \f$ f$H_n^{(2)}\f$. -//! If T is floating or complex f can be replaced by the evaluation f(n, z). -//! * 'n': positive integer. -//! * `z`: Value to process. -//! * `cbs`: bidirectionnal range which will contain the output sequence \f$(f(i, z))_[i = 0, ..., n}\f$ -//! -//! **Return value** -//! -//! * no return value. -//! -//! @groupheader{Example} -//! -//! @godbolt{doc/cyl_seq.cpp} -//! @} -//====================================================================================================================== -inline constexpr tags::callable_cyl_seq cyl_seq = {}; -} diff --git a/include/kyosu/functions/from_angle_axis.hpp b/include/kyosu/functions/from_angle_axis.hpp index 4ea32a40..64658ef0 100644 --- a/include/kyosu/functions/from_angle_axis.hpp +++ b/include/kyosu/functions/from_angle_axis.hpp @@ -26,10 +26,6 @@ namespace kyosu::tags { auto fn = callable_from_angle_axis{}; return fn(angle, axis, normalize); -// using e_t = decltype(axis[0]+angle); -// auto q = quaternion(e_t(0), e_t(axis[0]), e_t(axis[1]), e_t(axis[2])); -// auto [s, c] = eve::sincos(angle*eve::half(eve::as(angle))); -// return c+s*q; } template diff --git a/include/kyosu/types/impl/detail/bessel_h.hpp b/include/kyosu/types/impl/detail/bessel_h.hpp index 9976f41b..0f3173aa 100644 --- a/include/kyosu/types/impl/detail/bessel_h.hpp +++ b/include/kyosu/types/impl/detail/bessel_h.hpp @@ -72,38 +72,6 @@ namespace kyosu::_ { using u_t = eve::underlying_type_t; return eve::sign_alternate(u_t(n))*sph_bessel_h2n(n, -z); - // auto imzge0 = eve::is_gez(imag(z)); -// using u_t = eve::underlying_type_t; -// auto i = complex(u_t(0), u_t(1)); -// auto rz = rec(z); -// auto iz = complex(-ipart(z), real(z)); -// auto h0 = -i*exp(iz)/z; -// if(n == 0) return h0; -// auto h1 = (rz-i)*h0; -// if(n == 1) return h1; - -// auto br_imzge0 = [&h0, &h1, rz, n](){ -// std::cout << "icitte" << std::endl; -// auto h2 = h1; -// for(int i=1; i < n; ++i) -// { -// auto f = (2*i+1)*rz; -// h2 = f*h1-h0; -// h0 = h1; -// h1 = h2; -// } -// return h2; -// }; - -// auto br_imzlt0 = [n, z](){ -// std::cout << "latte" << std::endl; -// return eve::sign_alternate(u_t(n))*sph_bessel_h2n(n, -z);// 2*sph_bessel_jn(n, z)-sph_bessel_h2n(n, z); -// }; - -// auto res = br_imzge0(); -// if (eve::all(imzge0)) return res; -// auto res1 = br_imzlt0(); -// return if_else(imzge0, res, res1); } } else diff --git a/include/kyosu/types/impl/detail/bessel_k.hpp b/include/kyosu/types/impl/detail/bessel_k.hpp index faccf94a..043a2138 100644 --- a/include/kyosu/types/impl/detail/bessel_k.hpp +++ b/include/kyosu/types/impl/detail/bessel_k.hpp @@ -29,8 +29,6 @@ namespace kyosu::_ auto epio2 = exp_ipi(eve::half(eve::as())); auto empio2 = exp_ipi(eve::mhalf(eve::as())); auto argzlt0 = eve::is_ltz(argz); -// auto z1 = if_else(argzlt0, z, zero(as(z))); -// auto z2 = if_else(argzlt0, zero(as(z)), z); auto r = if_else(argzlt0 , cpi*cyl_bessel_h1n(n, z*epio2) , cmi*cyl_bessel_h2n(n, z*empio2));