Skip to content

Commit

Permalink
Adapt bessel functors to new functor style
Browse files Browse the repository at this point in the history
  • Loading branch information
jtlap authored Jan 14, 2024
1 parent 9ff3b42 commit df15ea6
Show file tree
Hide file tree
Showing 42 changed files with 1,723 additions and 1,746 deletions.
22 changes: 21 additions & 1 deletion include/eve/module/bessel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,24 @@
//!
//! @}
//==================================================================================================
#include <eve/module/bessel/regular/bessel.hpp>
#include <eve/module/bessel/regular/airy_ai.hpp>
#include <eve/module/bessel/regular/airy_bi.hpp>
#include <eve/module/bessel/regular/airy.hpp>
#include <eve/module/bessel/regular/cyl_bessel_i0.hpp>
#include <eve/module/bessel/regular/cyl_bessel_i1.hpp>
#include <eve/module/bessel/regular/cyl_bessel_in.hpp>
#include <eve/module/bessel/regular/cyl_bessel_j0.hpp>
#include <eve/module/bessel/regular/cyl_bessel_j1.hpp>
#include <eve/module/bessel/regular/cyl_bessel_jn.hpp>
#include <eve/module/bessel/regular/cyl_bessel_k0.hpp>
#include <eve/module/bessel/regular/cyl_bessel_k1.hpp>
#include <eve/module/bessel/regular/cyl_bessel_kn.hpp>
#include <eve/module/bessel/regular/cyl_bessel_y0.hpp>
#include <eve/module/bessel/regular/cyl_bessel_y1.hpp>
#include <eve/module/bessel/regular/cyl_bessel_yn.hpp>
#include <eve/module/bessel/regular/sph_bessel_j0.hpp>
#include <eve/module/bessel/regular/sph_bessel_j1.hpp>
#include <eve/module/bessel/regular/sph_bessel_jn.hpp>
#include <eve/module/bessel/regular/sph_bessel_y0.hpp>
#include <eve/module/bessel/regular/sph_bessel_y1.hpp>
#include <eve/module/bessel/regular/sph_bessel_yn.hpp>
17 changes: 14 additions & 3 deletions include/eve/module/bessel/regular/airy.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,21 @@
//==================================================================================================
#pragma once

#include <eve/detail/overload.hpp>
#include <eve/arch.hpp>
#include <eve/traits/overload.hpp>
#include <eve/module/core/decorator/core.hpp>

namespace eve
{
template<typename Options>
struct airy_t : elementwise_callable<airy_t, Options>
{
template<eve::floating_ordered_value T>
EVE_FORCEINLINE
auto operator()(T a) const noexcept { return EVE_DISPATCH_CALL(a); }

EVE_CALLABLE_OBJECT(airy_t, airy_);
};

//================================================================================================
//! @addtogroup bessel
Expand Down Expand Up @@ -49,8 +60,8 @@ namespace eve
//!
//! @godbolt{doc/bessel/regular/airy.cpp}
//! @}

EVE_MAKE_CALLABLE(airy_, airy);
//================================================================================================
inline constexpr auto airy = functor<airy_t>;
}

#include <eve/module/bessel/regular/impl/airy.hpp>
16 changes: 14 additions & 2 deletions include/eve/module/bessel/regular/airy_ai.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,22 @@
//==================================================================================================
#pragma once

#include <eve/detail/overload.hpp>
#include <eve/arch.hpp>
#include <eve/traits/overload.hpp>
#include <eve/module/core/decorator/core.hpp>

namespace eve
{
template<typename Options>
struct airy_ai_t : elementwise_callable<airy_ai_t, Options>
{
template<eve::floating_ordered_value T>
EVE_FORCEINLINE
T operator()(T a) const noexcept { return EVE_DISPATCH_CALL(a); }

EVE_CALLABLE_OBJECT(airy_ai_t, airy_ai_);
};

//================================================================================================
//! @addtogroup bessel
//! @{
Expand Down Expand Up @@ -50,7 +62,7 @@ namespace eve
//! @godbolt{doc/bessel/regular/airy_ai.cpp}
//! @}
//================================================================================================
EVE_MAKE_CALLABLE(airy_ai_, airy_ai);
inline constexpr auto airy_ai = functor<airy_ai_t>;
}

#include <eve/module/bessel/regular/impl/airy_ai.hpp>
17 changes: 14 additions & 3 deletions include/eve/module/bessel/regular/airy_bi.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,22 @@
//==================================================================================================
#pragma once

#include <eve/detail/overload.hpp>
#include <eve/arch.hpp>
#include <eve/traits/overload.hpp>
#include <eve/module/core/decorator/core.hpp>

namespace eve
{
template<typename Options>
struct airy_bi_t : elementwise_callable<airy_bi_t, Options>
{
template<eve::floating_ordered_value T>
EVE_FORCEINLINE
T operator()(T a) const noexcept { return EVE_DISPATCH_CALL(a); }

EVE_CALLABLE_OBJECT(airy_bi_t, airy_bi_);
};

//================================================================================================
//! @addtogroup bessel
//! @{
Expand Down Expand Up @@ -53,8 +65,7 @@ namespace eve
//! @godbolt{doc/bessel/regular/airy_bi.cpp}
//! @}
//================================================================================================

EVE_MAKE_CALLABLE(airy_bi_, airy_bi);
inline constexpr auto airy_bi = functor<airy_bi_t>;
}

#include <eve/module/bessel/regular/impl/airy_bi.hpp>
30 changes: 0 additions & 30 deletions include/eve/module/bessel/regular/bessel.hpp

This file was deleted.

17 changes: 15 additions & 2 deletions include/eve/module/bessel/regular/cyl_bessel_i0.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,22 @@
//==================================================================================================
#pragma once

#include <eve/detail/overload.hpp>
#include <eve/arch.hpp>
#include <eve/traits/overload.hpp>
#include <eve/module/core/decorator/core.hpp>

namespace eve
{
template<typename Options>
struct cyl_bessel_i0_t : elementwise_callable<cyl_bessel_i0_t, Options>
{
template<eve::floating_ordered_value T>
EVE_FORCEINLINE
eve::common_value_t<T> operator()(T a) const noexcept { return EVE_DISPATCH_CALL(a); }

EVE_CALLABLE_OBJECT(cyl_bessel_i0_t, cyl_bessel_i0_);
};

//================================================================================================
//! @addtogroup bessel
//! @{
Expand Down Expand Up @@ -50,7 +62,8 @@ namespace eve
//! @godbolt{doc/bessel/regular/cyl_bessel_i0.cpp}
//! @}
//================================================================================================
EVE_MAKE_CALLABLE(cyl_bessel_i0_, cyl_bessel_i0);
inline constexpr auto cyl_bessel_i0 = functor<cyl_bessel_i0_t>;
}


#include <eve/module/bessel/regular/impl/cyl_bessel_i0.hpp>
19 changes: 16 additions & 3 deletions include/eve/module/bessel/regular/cyl_bessel_i1.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,23 @@
//==================================================================================================
#pragma once

#include <eve/detail/overload.hpp>
#include <eve/arch.hpp>
#include <eve/traits/overload.hpp>
#include <eve/module/core/decorator/core.hpp>

namespace eve
{
//================================================================================================
template<typename Options>
struct cyl_bessel_i1_t : elementwise_callable<cyl_bessel_i1_t, Options>
{
template<eve::floating_ordered_value T>
EVE_FORCEINLINE
eve::common_value_t<T> operator()(T a) const noexcept { return EVE_DISPATCH_CALL(a); }

EVE_CALLABLE_OBJECT(cyl_bessel_i1_t, cyl_bessel_i1_);
};

//================================================================================================
//! @addtogroup bessel
//! @{
//! @var cyl_bessel_i1
Expand Down Expand Up @@ -50,7 +62,8 @@ namespace eve
//! @godbolt{doc/bessel/regular/cyl_bessel_i1.cpp}
//! @}
//================================================================================================
EVE_MAKE_CALLABLE(cyl_bessel_i1_, cyl_bessel_i1);
inline constexpr auto cyl_bessel_i1 = functor<cyl_bessel_i1_t>;

}

#include <eve/module/bessel/regular/impl/cyl_bessel_i1.hpp>
15 changes: 13 additions & 2 deletions include/eve/module/bessel/regular/cyl_bessel_in.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,21 @@
//==================================================================================================
#pragma once

#include <eve/detail/overload.hpp>
#include <eve/arch.hpp>
#include <eve/traits/overload.hpp>
#include <eve/module/core/decorator/core.hpp>

namespace eve
{
template<typename Options>
struct cyl_bessel_in_t : elementwise_callable<cyl_bessel_in_t, Options>
{
template<eve::ordered_value N, eve::floating_ordered_value T>
as_wide_as_t<T, N> operator()(N n, T x) const { return EVE_DISPATCH_CALL(n, x); }

EVE_CALLABLE_OBJECT(cyl_bessel_in_t, cyl_bessel_in_);
};

//================================================================================================
//! @addtogroup bessel
//! @{
Expand Down Expand Up @@ -53,7 +64,7 @@ namespace eve
//! @godbolt{doc/bessel/regular/cyl_bessel_in.cpp}
//! @}
//================================================================================================
EVE_MAKE_CALLABLE(cyl_bessel_in_, cyl_bessel_in);
inline constexpr auto cyl_bessel_in = functor<cyl_bessel_in_t>;
}

#include <eve/module/bessel/regular/impl/cyl_bessel_in.hpp>
16 changes: 14 additions & 2 deletions include/eve/module/bessel/regular/cyl_bessel_j0.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,22 @@
//==================================================================================================
#pragma once

#include <eve/detail/overload.hpp>
#include <eve/arch.hpp>
#include <eve/traits/overload.hpp>
#include <eve/module/core/decorator/core.hpp>

namespace eve
{
template<typename Options>
struct cyl_bessel_j0_t : elementwise_callable<cyl_bessel_j0_t, Options>
{
template<eve::floating_ordered_value T>
EVE_FORCEINLINE
eve::common_value_t<T> operator()(T a) const noexcept { return EVE_DISPATCH_CALL(a); }

EVE_CALLABLE_OBJECT(cyl_bessel_j0_t, cyl_bessel_j0_);
};

//================================================================================================
//! @addtogroup bessel
//! @{
Expand Down Expand Up @@ -51,7 +63,7 @@ namespace eve
//! @godbolt{doc/bessel/regular/cyl_bessel_j0.cpp}
//! @}
//================================================================================================
EVE_MAKE_CALLABLE(cyl_bessel_j0_, cyl_bessel_j0);
inline constexpr auto cyl_bessel_j0 = functor<cyl_bessel_j0_t>;
}

#include <eve/module/bessel/regular/impl/cyl_bessel_j0.hpp>
16 changes: 14 additions & 2 deletions include/eve/module/bessel/regular/cyl_bessel_j1.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,22 @@
//==================================================================================================
#pragma once

#include <eve/detail/overload.hpp>
#include <eve/arch.hpp>
#include <eve/traits/overload.hpp>
#include <eve/module/core/decorator/core.hpp>

namespace eve
{
template<typename Options>
struct cyl_bessel_j1_t : elementwise_callable<cyl_bessel_j1_t, Options>
{
template<eve::floating_ordered_value T>
EVE_FORCEINLINE
eve::common_value_t<T> operator()(T a) const noexcept { return EVE_DISPATCH_CALL(a); }

EVE_CALLABLE_OBJECT(cyl_bessel_j1_t, cyl_bessel_j1_);
};

//================================================================================================
//! @addtogroup bessel
//! @{
Expand Down Expand Up @@ -50,7 +62,7 @@ namespace eve
//! @godbolt{doc/bessel/regular/cyl_bessel_j1.cpp}
//! @}
//================================================================================================
EVE_MAKE_CALLABLE(cyl_bessel_j1_, cyl_bessel_j1);
inline constexpr auto cyl_bessel_j1 = functor<cyl_bessel_j1_t>;
}

#include <eve/module/bessel/regular/impl/cyl_bessel_j1.hpp>
16 changes: 14 additions & 2 deletions include/eve/module/bessel/regular/cyl_bessel_jn.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,21 @@
//==================================================================================================
#pragma once

#include <eve/detail/overload.hpp>
#include <eve/arch.hpp>
#include <eve/traits/overload.hpp>
#include <eve/module/core/decorator/core.hpp>

namespace eve
{
template<typename Options>
struct cyl_bessel_jn_t : elementwise_callable<cyl_bessel_jn_t, Options>
{
template<eve::ordered_value N, eve::floating_ordered_value T>
as_wide_as_t<T, N> operator()(N n, T x) const { return EVE_DISPATCH_CALL(n, x); }

EVE_CALLABLE_OBJECT(cyl_bessel_jn_t, cyl_bessel_jn_);
};

//================================================================================================
//! @addtogroup bessel
//! @{
Expand Down Expand Up @@ -54,7 +65,8 @@ namespace eve
//! @godbolt{doc/bessel/regular/cyl_bessel_jn.cpp}
//! @}
//================================================================================================
EVE_MAKE_CALLABLE(cyl_bessel_jn_, cyl_bessel_jn);
inline constexpr auto cyl_bessel_jn = functor<cyl_bessel_jn_t>;
}


#include <eve/module/bessel/regular/impl/cyl_bessel_jn.hpp>
17 changes: 15 additions & 2 deletions include/eve/module/bessel/regular/cyl_bessel_k0.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,22 @@
//==================================================================================================
#pragma once

#include <eve/detail/overload.hpp>
#include <eve/arch.hpp>
#include <eve/traits/overload.hpp>
#include <eve/module/core/decorator/core.hpp>

namespace eve
{
template<typename Options>
struct cyl_bessel_k0_t : elementwise_callable<cyl_bessel_k0_t, Options>
{
template<eve::floating_ordered_value T>
EVE_FORCEINLINE
eve::common_value_t<T> operator()(T a) const noexcept { return EVE_DISPATCH_CALL(a); }

EVE_CALLABLE_OBJECT(cyl_bessel_k0_t, cyl_bessel_k0_);
};

//================================================================================================
//! @addtogroup bessel
//! @{
Expand Down Expand Up @@ -51,7 +63,8 @@ namespace eve
//! @godbolt{doc/bessel/regular/cyl_bessel_k0.cpp}
//! @}
//================================================================================================
EVE_MAKE_CALLABLE(cyl_bessel_k0_, cyl_bessel_k0);
inline constexpr auto cyl_bessel_k0 = functor<cyl_bessel_k0_t>;
}


#include <eve/module/bessel/regular/impl/cyl_bessel_k0.hpp>
Loading

0 comments on commit df15ea6

Please sign in to comment.