Skip to content

Commit

Permalink
New style functor for elliptic
Browse files Browse the repository at this point in the history
  • Loading branch information
jtlap authored Jan 19, 2024
1 parent 226df22 commit f4b6766
Show file tree
Hide file tree
Showing 16 changed files with 694 additions and 788 deletions.
25 changes: 21 additions & 4 deletions include/eve/module/elliptic/regular/ellint_1.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,27 @@
//==================================================================================================
#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 ellint_1_t : elementwise_callable<ellint_1_t, Options>
{
template<eve::floating_ordered_value T>
constexpr EVE_FORCEINLINE
T operator()(T a) const noexcept { return EVE_DISPATCH_CALL(a); }

template<eve::floating_ordered_value T0, eve::floating_ordered_value T1>
constexpr EVE_FORCEINLINE
eve::common_value_t<T0, T1> operator()(T0 a, T1 b) const noexcept { return EVE_DISPATCH_CALL(a, b); }

EVE_CALLABLE_OBJECT(ellint_1_t, ellint_1_);
};


//================================================================================================
//! @addtogroup elliptic
//! @{
Expand All @@ -35,10 +52,10 @@ namespace eve
//! namespace eve
//! {
//! template< eve::floating_ordered_value T >
//! T ellint_1(T k) noexcept; //1
//! constexpr T ellint_1(T k) noexcept; //1
//!
//! template< eve::floating_ordered_value T, eve::floating_ordered_value U >
//! eve::common_value_t<T, U> ellint_1(T phi, U k) noexcept; //2
//! constexpr eve::common_value_t<T, U> ellint_1(T phi, U k) noexcept; //2
//! }
//! @endcode
//!
Expand All @@ -63,7 +80,7 @@ namespace eve
//! @godbolt{doc/elliptic/regular/ellint_1.cpp}
//! @}
//================================================================================================
EVE_MAKE_CALLABLE(ellint_1_, ellint_1);
inline constexpr auto ellint_1 = functor<ellint_1_t>;
}

#include <eve/module/elliptic/regular/impl/ellint_1.hpp>
25 changes: 21 additions & 4 deletions include/eve/module/elliptic/regular/ellint_2.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,26 @@
//==================================================================================================
#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 ellint_2_t : elementwise_callable<ellint_2_t, Options>
{
template<eve::floating_ordered_value T>
constexpr EVE_FORCEINLINE
T operator()(T a) const noexcept { return EVE_DISPATCH_CALL(a); }

template<eve::floating_ordered_value T0, eve::floating_ordered_value T1>
constexpr EVE_FORCEINLINE
eve::common_value_t<T0, T1> operator()(T0 a, T1 b) const noexcept { return EVE_DISPATCH_CALL(a, b); }

EVE_CALLABLE_OBJECT(ellint_2_t, ellint_2_);
};

//================================================================================================
//! @addtogroup elliptic
//! @{
Expand All @@ -37,10 +53,10 @@ namespace eve
//! namespace eve
//! {
//! template< eve::floating_ordered_value T >
//! T ellint_2(T k) noexcept; //1
//! constexpr T ellint_2(T k) noexcept; //1
//!
//! template< eve::floating_ordered_value T, eve::floating_ordered_value U >
//! eve::common_value_t<T, U> ellint_2(T phi, U k) noexcept; //2
//! constexpr eve::common_value_t<T, U> ellint_2(T phi, U k) noexcept; //2
//! }
//! @endcode
//!
Expand All @@ -66,7 +82,8 @@ namespace eve
//! @godbolt{doc/elliptic/regular/ellint_2.cpp}
//! @}
//================================================================================================
EVE_MAKE_CALLABLE(ellint_2_, ellint_2);
inline constexpr auto ellint_2 = functor<ellint_2_t>;

}

#include <eve/module/elliptic/regular/impl/ellint_2.hpp>
25 changes: 21 additions & 4 deletions include/eve/module/elliptic/regular/ellint_d.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,27 @@
//==================================================================================================
#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 ellint_d_t : elementwise_callable<ellint_d_t, Options>
{
template<eve::floating_ordered_value T>
constexpr EVE_FORCEINLINE
T operator()(T a) const noexcept { return EVE_DISPATCH_CALL(a); }

template<eve::floating_ordered_value T0, eve::floating_ordered_value T1>
constexpr EVE_FORCEINLINE
eve::common_value_t<T0, T1> operator()(T0 a, T1 b) const noexcept { return EVE_DISPATCH_CALL(a, b); }

EVE_CALLABLE_OBJECT(ellint_d_t, ellint_d_);
};


//================================================================================================
//! @addtogroup elliptic
//! @{
Expand All @@ -37,10 +54,10 @@ namespace eve
//! namespace eve
//! {
//! template< eve::floating_ordered_value T >
//! T ellint_d(T k) noexcept; //1
//! constexpr T ellint_d(T k) noexcept; //1
//!
//! template< eve::floating_ordered_value T, eve::floating_ordered_value U >
//! eve::common_value_t<T, U> ellint_d(T phi, U k) noexcept; //2
//! constexpr eve::common_value_t<T, U> ellint_d(T phi, U k) noexcept; //2
//! }
//! @endcode
//!
Expand All @@ -66,7 +83,7 @@ namespace eve
//! @godbolt{doc/elliptic/regular/ellint_d.cpp}
//! @}
//================================================================================================
EVE_MAKE_CALLABLE(ellint_d_, ellint_d);
inline constexpr auto ellint_d = functor<ellint_d_t>;
}

#include <eve/module/elliptic/regular/impl/ellint_d.hpp>
18 changes: 15 additions & 3 deletions include/eve/module/elliptic/regular/ellint_rc.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 ellint_rc_t : elementwise_callable<ellint_rc_t, Options>
{
template<eve::floating_ordered_value T0, eve::floating_ordered_value T1>
constexpr EVE_FORCEINLINE
eve::common_value_t<T0, T1> operator()(T0 a, T1 b) const noexcept { return EVE_DISPATCH_CALL(a, b); }

EVE_CALLABLE_OBJECT(ellint_rc_t, ellint_rc_);
};

//================================================================================================
//! @addtogroup elliptic
//! @{
Expand All @@ -30,7 +42,7 @@ namespace eve
//! @code
//! namespace eve
//! {
//! template< eve::floating_ordered_value T, eve::floating_ordered_value U >
//! constexpr template< eve::floating_ordered_value T, eve::floating_ordered_value U >
//! eve::common_value_t<T, U> ellint_rc(T x, U y) noexcept;
//! }
//! @endcode
Expand All @@ -49,7 +61,7 @@ namespace eve
//! @godbolt{doc/elliptic/regular/ellint_rc.cpp}
//! @}
//================================================================================================
EVE_MAKE_CALLABLE(ellint_rc_, ellint_rc);
inline constexpr auto ellint_rc = functor<ellint_rc_t>;
}

#include <eve/module/elliptic/regular/impl/ellint_rc.hpp>
18 changes: 15 additions & 3 deletions include/eve/module/elliptic/regular/ellint_rd.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 ellint_rd_t : elementwise_callable<ellint_rd_t, Options, raw_option>
{
template<eve::floating_ordered_value T0, eve::floating_ordered_value T1, eve::floating_ordered_value T2>
constexpr EVE_FORCEINLINE
eve::common_value_t<T0, T1, T2> operator()(T0 a, T1 b, T2 c) const noexcept { return EVE_DISPATCH_CALL(a, b, c); }

EVE_CALLABLE_OBJECT(ellint_rd_t, ellint_rd_);
};

//================================================================================================
//! @addtogroup elliptic
//! @{
Expand All @@ -34,7 +46,7 @@ namespace eve
//! template< eve::floating_ordered_value T
//! , eve::floating_ordered_value U
//! , eve::floating_ordered_value V >
//! eve::common_value_t<T, U, V> ellint_rc(T x, U y, V z) noexcept;
//! constexpr eve::common_value_t<T, U, V> ellint_rd(T x, U y, V z) noexcept;
//! }
//! @endcode
//!
Expand All @@ -54,7 +66,7 @@ namespace eve
//! @godbolt{doc/elliptic/regular/ellint_rc.cpp}
//! @}
//================================================================================================
EVE_MAKE_CALLABLE(ellint_rd_, ellint_rd);
inline constexpr auto ellint_rd = functor<ellint_rd_t>;
}

#include <eve/module/elliptic/regular/impl/ellint_rd.hpp>
18 changes: 15 additions & 3 deletions include/eve/module/elliptic/regular/ellint_rf.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 ellint_rf_t : elementwise_callable<ellint_rf_t, Options, raw_option>
{
template<eve::floating_ordered_value T0, eve::floating_ordered_value T1, eve::floating_ordered_value T2>
constexpr EVE_FORCEINLINE
eve::common_value_t<T0, T1, T2> operator()(T0 a, T1 b, T2 c) const noexcept { return EVE_DISPATCH_CALL(a, b, c); }

EVE_CALLABLE_OBJECT(ellint_rf_t, ellint_rf_);
};

//================================================================================================
//! @addtogroup elliptic
//! @{
Expand All @@ -34,7 +46,7 @@ namespace eve
//! template< eve::floating_ordered_value T
//! , eve::floating_ordered_value U
//! , eve::floating_ordered_value V >
//! eve::common_value_t<T, U, V> ellint_rf(T x, U y, V z) noexcept;
//! constexpr eve::common_value_t<T, U, V> ellint_rf(T x, U y, V z) noexcept;
//! }
//! @endcode
//!
Expand All @@ -53,7 +65,7 @@ namespace eve
//! @godbolt{doc/elliptic/regular/ellint_rc.cpp}
//! @}
//================================================================================================
EVE_MAKE_CALLABLE(ellint_rf_, ellint_rf);
inline constexpr auto ellint_rf = functor<ellint_rf_t>;
}

#include <eve/module/elliptic/regular/impl/ellint_rf.hpp>
18 changes: 15 additions & 3 deletions include/eve/module/elliptic/regular/ellint_rg.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 ellint_rg_t : elementwise_callable<ellint_rg_t, Options, raw_option>
{
template<eve::floating_ordered_value T0, eve::floating_ordered_value T1, eve::floating_ordered_value T2>
constexpr EVE_FORCEINLINE
eve::common_value_t<T0, T1, T2> operator()(T0 a, T1 b, T2 c) const noexcept { return EVE_DISPATCH_CALL(a, b, c); }

EVE_CALLABLE_OBJECT(ellint_rg_t, ellint_rg_);
};

//================================================================================================
//! @addtogroup elliptic
//! @{
Expand All @@ -35,7 +47,7 @@ namespace eve
//! template< eve::floating_ordered_value T
//! , eve::floating_ordered_value U
//! , eve::floating_ordered_value V >
//! eve::common_value_t<T, U, V> ellint_rg(T x, U y, V z) noexcept;
//! constexpr eve::common_value_t<T, U, V> ellint_rg(T x, U y, V z) noexcept;
//! }
//! @endcode
//!
Expand All @@ -53,7 +65,7 @@ namespace eve
//! @godbolt{doc/elliptic/regular/ellint_rc.cpp}
//! @}
//================================================================================================
EVE_MAKE_CALLABLE(ellint_rg_, ellint_rg);
inline constexpr auto ellint_rg = functor<ellint_rg_t>;
}

#include <eve/module/elliptic/regular/impl/ellint_rg.hpp>
20 changes: 17 additions & 3 deletions include/eve/module/elliptic/regular/ellint_rj.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,24 @@
//==================================================================================================
#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 ellint_rj_t : elementwise_callable<ellint_rj_t, Options, raw_option>
{
template<eve::floating_ordered_value T0, eve::floating_ordered_value T1
, eve::floating_ordered_value T2, eve::floating_ordered_value T3>
constexpr EVE_FORCEINLINE
eve::common_value_t<T0, T1, T2, T3> operator()(T0 a, T1 b, T2 c, T3 d) const noexcept
{ return EVE_DISPATCH_CALL(a, b, c, d); }

EVE_CALLABLE_OBJECT(ellint_rj_t, ellint_rj_);
};

//================================================================================================
//! @addtogroup elliptic
//! @{
Expand All @@ -34,7 +48,7 @@ namespace eve
//! , eve::floating_ordered_value U
//! , eve::floating_ordered_value V
//! , eve::floating_ordered_value W>
//! eve::common_value_t<T, U, V, W> ellint_rj(T x, U y, V z, W p) noexcept;
//! constexpr eve::common_value_t<T, U, V, W> ellint_rj(T x, U y, V z, W p) noexcept;
//! }
//! @endcode
//!
Expand All @@ -54,7 +68,7 @@ namespace eve
//!
//! @godbolt{doc/elliptic/regular/ellint_rc.cpp}
//! @}
EVE_MAKE_CALLABLE(ellint_rj_, ellint_rj);
inline constexpr auto ellint_rj = functor<ellint_rj_t>;
}

#include <eve/module/elliptic/regular/impl/ellint_rj.hpp>
Loading

0 comments on commit f4b6766

Please sign in to comment.