Skip to content

Commit

Permalink
Move special to new functor style
Browse files Browse the repository at this point in the history
  • Loading branch information
jtlap authored Jan 12, 2024
1 parent 7a81414 commit c8b49dd
Show file tree
Hide file tree
Showing 66 changed files with 2,127 additions and 2,099 deletions.
96 changes: 0 additions & 96 deletions include/eve/module/special/pedantic/impl/lrising_factorial.hpp

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#include <eve/module/core.hpp>
#include <eve/module/math.hpp>
#include <eve/module/special/pedantic/lrising_factorial.hpp>
#include <eve/module/special/regular/lrising_factorial.hpp>
#include <eve/module/special/regular/signgam.hpp>

namespace eve::detail
Expand Down
10 changes: 0 additions & 10 deletions include/eve/module/special/pedantic/lrising_factorial.hpp

This file was deleted.

1 change: 0 additions & 1 deletion include/eve/module/special/pedantic/special.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,4 @@
//==================================================================================================
#pragma once

#include <eve/module/special/pedantic/lrising_factorial.hpp>
#include <eve/module/special/pedantic/rising_factorial.hpp>
16 changes: 14 additions & 2 deletions include/eve/module/special/regular/beta.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,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 beta_t : elementwise_callable<beta_t, Options>
{
template<eve::floating_ordered_value T0, eve::floating_ordered_value T1>
EVE_FORCEINLINE
eve::common_value_t<T0, T1> operator()(T0 a, T1 b) const noexcept { return EVE_DISPATCH_CALL(a, b); }

EVE_CALLABLE_OBJECT(beta_t, beta_);
};

//================================================================================================
//! @addtogroup special
//! @{
Expand Down Expand Up @@ -45,7 +57,7 @@ namespace eve
//!
//! @}
//================================================================================================
EVE_MAKE_CALLABLE(beta_, beta);
inline constexpr auto beta = functor<beta_t>;
}

#include <eve/module/special/regular/impl/beta.hpp>
25 changes: 19 additions & 6 deletions include/eve/module/special/regular/betainc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,28 @@
//==================================================================================================
#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 betainc_t : elementwise_callable<betainc_t, Options>
{
template<eve::floating_ordered_value T0, eve::floating_ordered_value T1, eve::floating_ordered_value T2>
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(betainc_t, betainc_);
};

//================================================================================================
//! @addtogroup special
//! @{
//! @var betainc
//! @brief Computes the beta incomplete function. \f$\displaystyle \mbox{I}_s(x,y) =
//! @var betaincinc
//! @brief Computes the betainc incomplete function. \f$\displaystyle \mbox{I}_s(x,y) =
//! \frac{1}{\mbox{B}(x,y)}\int_0^s t^{x-1}(1-t)^{y-1}\mbox{d}t\f$
//!
//! **Defined in header**
Expand Down Expand Up @@ -44,14 +57,14 @@ namespace eve
//!
//! **Return value**
//!
//! The value of the incomplete beta function is returned.
//! The value of the incomplete betainc function is returned.
//!
//! @groupheader{Example}
//!
//! @godbolt{doc/special/regular/betainc.cpp}
//! @godbolt{doc/special/regular/betaincinc.cpp}
//! @}
//================================================================================================
EVE_MAKE_CALLABLE(betainc_, betainc);
inline constexpr auto betainc = functor<betainc_t>;
}

#include <eve/module/special/regular/impl/betainc.hpp>
17 changes: 15 additions & 2 deletions include/eve/module/special/regular/betainc_inv.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 betainc_inv_t : elementwise_callable<betainc_inv_t, Options>
{
template<eve::floating_ordered_value T0, eve::floating_ordered_value T1, eve::floating_ordered_value T2>
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(betainc_inv_t, betainc_inv_);
};

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


#include <eve/module/special/regular/impl/betainc_inv.hpp>
15 changes: 13 additions & 2 deletions include/eve/module/special/regular/dawson.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 dawson_t : elementwise_callable<dawson_t, Options>
{
template<eve::floating_ordered_value T>
EVE_FORCEINLINE T operator()(T v) const noexcept { return EVE_DISPATCH_CALL(v); }

EVE_CALLABLE_OBJECT(dawson_t, dawson_);
};

//================================================================================================
//! @addtogroup special
//! @{
Expand Down Expand Up @@ -47,7 +58,7 @@ namespace eve
//! @godbolt{doc/special/regular/dawson.cpp}
//! @}
//================================================================================================
EVE_MAKE_CALLABLE(dawson_, dawson);
inline constexpr auto dawson = functor<dawson_t>;
}

#include <eve/module/special/regular/impl/dawson.hpp>
16 changes: 14 additions & 2 deletions include/eve/module/special/regular/digamma.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 digamma_t : elementwise_callable<digamma_t, Options>
{
template<eve::floating_ordered_value T>
EVE_FORCEINLINE T operator()(T v) const { return EVE_DISPATCH_CALL(v); }

EVE_CALLABLE_OBJECT(digamma_t, digamma_);
};

//================================================================================================
//! @addtogroup special
//! @{
Expand Down Expand Up @@ -47,7 +58,8 @@ namespace eve
//!
//! @}
//================================================================================================
EVE_MAKE_CALLABLE(digamma_, digamma);
inline constexpr auto digamma = functor<digamma_t>;
}


#include <eve/module/special/regular/impl/digamma.hpp>
17 changes: 15 additions & 2 deletions include/eve/module/special/regular/double_factorial.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +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 double_factorial_t : elementwise_callable<double_factorial_t, Options>
{
template<eve::unsigned_value T>
EVE_FORCEINLINE
as_wide_as_t<double, T >
operator()(T v) const noexcept { return EVE_DISPATCH_CALL(v); }

EVE_CALLABLE_OBJECT(double_factorial_t, double_factorial_);
};

//================================================================================================
//! @addtogroup special
//! @{
Expand Down Expand Up @@ -49,7 +62,7 @@ namespace eve
//! @godbolt{doc/special/regular/double_factorial.cpp}
//! @}
//================================================================================================
EVE_MAKE_CALLABLE(double_factorial_, double_factorial);
inline constexpr auto double_factorial = functor<double_factorial_t>;
}

#include <eve/module/special/regular/impl/double_factorial.hpp>
15 changes: 13 additions & 2 deletions include/eve/module/special/regular/erf.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 erf_t : elementwise_callable<erf_t, Options>
{
template<eve::floating_ordered_value T>
EVE_FORCEINLINE T operator()(T v) const { return EVE_DISPATCH_CALL(v); }

EVE_CALLABLE_OBJECT(erf_t, erf_);
};

//================================================================================================
//! @addtogroup special
//! @{
Expand Down Expand Up @@ -52,7 +63,7 @@ namespace eve
//!
//! @}
//================================================================================================
EVE_MAKE_CALLABLE(erf_, erf);
inline constexpr auto erf = functor<erf_t>;
}

#include <eve/module/special/regular/impl/erf.hpp>
Loading

0 comments on commit c8b49dd

Please sign in to comment.