-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
65 changed files
with
3,627 additions
and
1,817 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
//====================================================================================================================== | ||
/* | ||
Kyosu - Complex Without Complexes | ||
Copyright : KYOSU Contributors & Maintainers | ||
SPDX-License-Identifier: BSL-1.0 | ||
*/ | ||
//====================================================================================================================== | ||
#pragma once | ||
|
||
auto cayley_extend(auto f, auto z, auto... rs) | ||
{ | ||
auto p = kyosu::pure(z); | ||
auto az = kyosu::abs(p); | ||
auto c = f(kyosu::complex(kyosu::real(z), az), rs...); | ||
return kyosu::real(c) + kyosu::ipart(c)*kyosu::sign(p); | ||
} | ||
|
||
auto cayley_extend_rev(auto f, auto z1, auto z2) | ||
{ | ||
auto p = kyosu::pure(z2); | ||
auto az2 = kyosu::abs(p); | ||
auto c = f(z1, kyosu::complex(kyosu::real(z2), az2)); | ||
return kyosu::real(c) + kyosu::ipart(c)*kyosu::sign(p); | ||
} | ||
|
||
auto cayley_extend2(auto f, auto z, auto... rs) | ||
{ | ||
auto p = kyosu::pure(z); | ||
auto az = kyosu::abs(p); | ||
auto [c1, c2] = f(kyosu::complex(kyosu::real(z), az), rs...); | ||
auto s = kyosu::sign(p); | ||
return kumi::tuple{ kyosu::real(c1) + kyosu::ipart(c1)*s | ||
, kyosu::real(c2) + kyosu::ipart(c2)*s}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
//====================================================================================================================== | ||
/* | ||
Kyosu - Complex Without Complexes | ||
Copyright: KYOSU Contributors & Maintainers | ||
SPDX-License-Identifier: BSL-1.0 | ||
*/ | ||
//====================================================================================================================== | ||
#pragma once | ||
|
||
#include <kyosu/details/invoke.hpp> | ||
#include <eve/module/bessel.hpp> | ||
|
||
namespace kyosu::tags | ||
{ | ||
struct callable_cyl_bessel_i0: eve::elementwise | ||
{ | ||
using callable_tag_type = callable_cyl_bessel_i0; | ||
|
||
KYOSU_DEFERS_CALLABLE(cyl_bessel_i0_); | ||
|
||
template<eve::floating_ordered_value T> | ||
static KYOSU_FORCEINLINE auto deferred_call(auto, T const& v) noexcept { return eve::cyl_bessel_i0(v); } | ||
|
||
template<typename T> | ||
KYOSU_FORCEINLINE auto operator()(T const& target) const noexcept -> decltype(eve::tag_invoke(*this, target)) | ||
{ | ||
return eve::tag_invoke(*this, target); | ||
} | ||
|
||
template<typename... T> | ||
eve::unsupported_call<callable_cyl_bessel_i0(T&&...)> operator()(T&&... x) const | ||
requires(!requires { eve::tag_invoke(*this, KYOSU_FWD(x)...); }) = delete; | ||
}; | ||
} | ||
|
||
namespace kyosu | ||
{ | ||
//====================================================================================================================== | ||
//! @addtogroup functions | ||
//! @{ | ||
//! @var cyl_bessel_i0 | ||
//! @brief Computes the Bessel function of the first kind, | ||
//! \f$ J_0(x)=\frac1{\pi }\int _{0}^{\pi}\cos(x\sin \tau) | ||
//! \,\mathrm {d} \tau \f$ extended to the complex plane and cayley_dickson values. | ||
//! | ||
//! In the real field, it is the solution of \f$ x^{2}y''+xy'+x^2y=0\f$ for which \f$ y(0) = 1\f$. | ||
//! | ||
//! @code | ||
//! #include <kyosu/functions.hpp> | ||
//! @endcode | ||
//! | ||
//! @groupheader{Callable Signatures} | ||
//! | ||
//! @code | ||
//! namespace kyosu | ||
//! { | ||
//! template<kyosu::concepts::cayley_dickson T> constexpr auto cyl_bessel_i0(T z) noexcept; | ||
//! template<eve::floating_ordered_value T> constexpr T cyl_bessel_i0(T z) noexcept; | ||
//! } | ||
//! @endcode | ||
//! | ||
//! **Parameters** | ||
//! | ||
//! * `z`: Value to process. | ||
//! | ||
//! **Return value** | ||
//! | ||
//! * return the cylindrical \f$J_0(z)\f$. | ||
//! | ||
//! @groupheader{Example} | ||
//! | ||
//! @godbolt{doc/cyl_bessel_i0.cpp} | ||
//! @} | ||
//====================================================================================================================== | ||
inline constexpr tags::callable_cyl_bessel_i0 cyl_bessel_i0 = {}; | ||
} |
Oops, something went wrong.