Skip to content

Commit

Permalink
airy ai ok
Browse files Browse the repository at this point in the history
  • Loading branch information
jtlap committed Dec 15, 2023
1 parent 914acca commit f7e1fd0
Show file tree
Hide file tree
Showing 9 changed files with 792 additions and 28 deletions.
5 changes: 5 additions & 0 deletions include/kyosu/functions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@
#include <kyosu/functions/acospi.hpp>
#include <kyosu/functions/acot.hpp>
#include <kyosu/functions/acotpi.hpp>

#include <kyosu/functions/airy.hpp>
#include <kyosu/functions/airy_ai.hpp>
#include <kyosu/functions/airy_bi.hpp>

#include <kyosu/functions/atanpi.hpp>
#include <kyosu/functions/acoth.hpp>
#include <kyosu/functions/arg.hpp>
Expand Down
77 changes: 77 additions & 0 deletions include/kyosu/functions/airy.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
//======================================================================================================================
/*
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_airy: eve::elementwise
{
using callable_tag_type = callable_airy;

KYOSU_DEFERS_CALLABLE(airy_);

template<eve::floating_ordered_value T>
static KYOSU_FORCEINLINE auto deferred_call(auto, T const& v) noexcept
{
return eve::airy(v);
}

template<typename T>
KYOSU_FORCEINLINE auto operator()(T const & target0) const noexcept
-> decltype(eve::tag_invoke(*this, target0))
{
return eve::tag_invoke(*this, target0);
}

template<typename... T>
eve::unsupported_call<callable_airy(T&&...)> operator()(T&&... x) const
requires(!requires { eve::tag_invoke(*this, KYOSU_FWD(x)...); }) = delete;
};
}

namespace kyosu
{
//======================================================================================================================
//! @addtogroup functions
//! @{
//! @var airy
//! @brief Computes simultaneously the airy functions \f$Ai\f$ and \f$Bi\f$.
//!
//! @code
//! #include <kyosu/functions.hpp>
//! @endcode
//!
//! @groupheader{Callable Signatures}
//!
//! @code
//! namespace kyosu
//! {
//! template<eve::floating_ordered_value T> constexpr auto airy(T z) noexcept;
//!
//! template<kyosu::concepts::cayley_dickson T> constexpr auto airy(T z) noexcept;
//! }
//! @endcode
//!
//! **Parameters**
//!
//! * `z`: Value to process.
//!
//! **Return value**
//!
//! * returns a kumi pair containing \f$\{Ai(z)\}f$ and \f$\{Bi(z)\}f$.
//!
//! @groupheader{Example}
//!
//! @godbolt{doc/airy.cpp}
//! @}
//======================================================================================================================
inline constexpr tags::callable_airy airy = {};
}
77 changes: 77 additions & 0 deletions include/kyosu/functions/airy_ai.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
//======================================================================================================================
/*
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_airy_ai: eve::elementwise
{
using callable_tag_type = callable_airy_ai;

KYOSU_DEFERS_CALLABLE(airy_ai_);

template<eve::floating_ordered_value T>
static KYOSU_FORCEINLINE auto deferred_call(auto, T const& v) noexcept
{
return eve::airy_ai(v);
}

template<typename T>
KYOSU_FORCEINLINE auto operator()(T const & target0) const noexcept
-> decltype(eve::tag_invoke(*this, target0))
{
return eve::tag_invoke(*this, target0);
}

template<typename... T>
eve::unsupported_call<callable_airy_ai(T&&...)> operator()(T&&... x) const
requires(!requires { eve::tag_invoke(*this, KYOSU_FWD(x)...); }) = delete;
};
}

namespace kyosu
{
//======================================================================================================================
//! @addtogroup functions
//! @{
//! @var airy_ai
//! @brief Computes the airy function \f$Ai\f$,
//!
//! @code
//! #include <kyosu/functions.hpp>
//! @endcode
//!
//! @groupheader{Callable Signatures}
//!
//! @code
//! namespace kyosu
//! {
//! template<eve::floating_ordered_value T> constexpr auto airy_ai(T z) noexcept;
//!
//! template<kyosu::concepts::cayley_dickson T> constexpr auto airy_ai(T z) noexcept;
//! }
//! @endcode
//!
//! **Parameters**
//!
//! * `z`: Value to process.
//!
//! **Return value**
//!
//! * returns \f$\{Ai(z)\}f$.
//!
//! @groupheader{Example}
//!
//! @godbolt{doc/airy_ai.cpp}
//! @}
//======================================================================================================================
inline constexpr tags::callable_airy_ai airy_ai = {};
}
77 changes: 77 additions & 0 deletions include/kyosu/functions/airy_bi.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
//======================================================================================================================
/*
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_airy_bi: eve::elementwise
{
using callable_tag_type = callable_airy_bi;

KYOSU_DEFERS_CALLABLE(airy_bi_);

template<eve::floating_ordered_value T>
static KYOSU_FORCEINLINE auto deferred_call(auto, T const& v) noexcept
{
return eve::airy_bi(v);
}

template<typename T>
KYOSU_FORCEINLINE auto operator()(T const & target0) const noexcept
-> decltype(eve::tag_invoke(*this, target0))
{
return eve::tag_invoke(*this, target0);
}

template<typename... T>
eve::unsupported_call<callable_airy_bi(T&&...)> operator()(T&&... x) const
requires(!requires { eve::tag_invoke(*this, KYOSU_FWD(x)...); }) = delete;
};
}

namespace kyosu
{
//======================================================================================================================
//! @addtogroup functions
//! @{
//! @var airy_bi
//! @brief Computes the airy function \f$Bi\f$,
//!
//! @code
//! #include <kyosu/functions.hpp>
//! @endcode
//!
//! @groupheader{Callable Signatures}
//!
//! @code
//! namespace kyosu
//! {
//! template<eve::floating_ordered_value T> constexpr auto airy_bi(T z) noexcept;
//!
//! template<kyosu::concepts::cayley_dickson T> constexpr auto airy_bi(T z) noexcept;
//! }
//! @endcode
//!
//! **Parameters**
//!
//! * `z`: Value to process.
//!
//! **Return value**
//!
//! * returns \f$\{Bi(z)\}f$.
//!
//! @groupheader{Example}
//!
//! @godbolt{doc/airy_bi.cpp}
//! @}
//======================================================================================================================
inline constexpr tags::callable_airy_bi airy_bi = {};
}
2 changes: 2 additions & 0 deletions include/kyosu/types/impl/bessel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,3 +111,5 @@
#include <kyosu/types/impl/besselr/cb_jyr.hpp>
#include <kyosu/types/impl/besselr/cb_h.hpp>
#include <kyosu/types/impl/besselr/cb_ikr.hpp>
// airy functions
#include <kyosu/types/impl/besselr/airy.hpp>
Loading

0 comments on commit f7e1fd0

Please sign in to comment.