mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-01-30 17:40:05 +08:00
Converting ad-hoc inline keyword to EIGEN_STRONG_INLINE MACRO.
This commit is contained in:
parent
edf46bd7a2
commit
9e219bb3d3
@ -112,7 +112,7 @@ class Tensor : public TensorBase<Tensor<Scalar_, NumIndices_, Options_, IndexTyp
|
||||
|
||||
#if EIGEN_HAS_VARIADIC_TEMPLATES
|
||||
template<typename... IndexTypes>
|
||||
EIGEN_DEVICE_FUNC inline const Scalar& coeff(Index firstIndex, Index secondIndex, IndexTypes... otherIndices) const
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar& coeff(Index firstIndex, Index secondIndex, IndexTypes... otherIndices) const
|
||||
{
|
||||
// The number of indices used to access a tensor coefficient must be equal to the rank of the tensor.
|
||||
EIGEN_STATIC_ASSERT(sizeof...(otherIndices) + 2 == NumIndices, YOU_MADE_A_PROGRAMMING_MISTAKE)
|
||||
|
@ -41,7 +41,7 @@ template<typename Index, std::size_t NumIndices, std::size_t n, bool RowMajor>
|
||||
struct fixed_size_tensor_index_linearization_helper
|
||||
{
|
||||
template <typename Dimensions> EIGEN_DEVICE_FUNC
|
||||
static inline Index run(array<Index, NumIndices> const& indices,
|
||||
static EIGEN_STRONG_INLINE Index run(array<Index, NumIndices> const& indices,
|
||||
const Dimensions& dimensions)
|
||||
{
|
||||
return array_get<RowMajor ? n - 1 : (NumIndices - n)>(indices) +
|
||||
@ -54,7 +54,7 @@ template<typename Index, std::size_t NumIndices, bool RowMajor>
|
||||
struct fixed_size_tensor_index_linearization_helper<Index, NumIndices, 0, RowMajor>
|
||||
{
|
||||
template <typename Dimensions> EIGEN_DEVICE_FUNC
|
||||
static inline Index run(array<Index, NumIndices> const&, const Dimensions&)
|
||||
static EIGEN_STRONG_INLINE Index run(array<Index, NumIndices> const&, const Dimensions&)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@ -64,7 +64,7 @@ template<typename Index, std::size_t n>
|
||||
struct fixed_size_tensor_index_extraction_helper
|
||||
{
|
||||
template <typename Dimensions> EIGEN_DEVICE_FUNC
|
||||
static inline Index run(const Index index,
|
||||
static EIGEN_STRONG_INLINE Index run(const Index index,
|
||||
const Dimensions& dimensions)
|
||||
{
|
||||
const Index mult = (index == n-1) ? 1 : 0;
|
||||
@ -77,7 +77,7 @@ template<typename Index>
|
||||
struct fixed_size_tensor_index_extraction_helper<Index, 0>
|
||||
{
|
||||
template <typename Dimensions> EIGEN_DEVICE_FUNC
|
||||
static inline Index run(const Index,
|
||||
static EIGEN_STRONG_INLINE Index run(const Index,
|
||||
const Dimensions&)
|
||||
{
|
||||
return 0;
|
||||
@ -421,20 +421,20 @@ template <std::size_t n, std::size_t V1, std::size_t V2, std::size_t V3, std::si
|
||||
|
||||
template <typename Dims1, typename Dims2, size_t n, size_t m>
|
||||
struct sizes_match_below_dim {
|
||||
static EIGEN_DEVICE_FUNC inline bool run(Dims1&, Dims2&) {
|
||||
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE bool run(Dims1&, Dims2&) {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
template <typename Dims1, typename Dims2, size_t n>
|
||||
struct sizes_match_below_dim<Dims1, Dims2, n, n> {
|
||||
static EIGEN_DEVICE_FUNC inline bool run(Dims1& dims1, Dims2& dims2) {
|
||||
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE bool run(Dims1& dims1, Dims2& dims2) {
|
||||
return (array_get<n-1>(dims1) == array_get<n-1>(dims2)) &
|
||||
sizes_match_below_dim<Dims1, Dims2, n-1, n-1>::run(dims1, dims2);
|
||||
}
|
||||
};
|
||||
template <typename Dims1, typename Dims2>
|
||||
struct sizes_match_below_dim<Dims1, Dims2, 0, 0> {
|
||||
static EIGEN_DEVICE_FUNC inline bool run(Dims1&, Dims2&) {
|
||||
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE bool run(Dims1&, Dims2&) {
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
@ -39,7 +39,7 @@ class TensorExecutor {
|
||||
using StorageIndex = typename Expression::Index;
|
||||
|
||||
EIGEN_DEVICE_FUNC
|
||||
static inline void run(const Expression& expr,
|
||||
static EIGEN_STRONG_INLINE void run(const Expression& expr,
|
||||
const Device& device = Device()) {
|
||||
TensorEvaluator<Expression, Device> evaluator(expr, device);
|
||||
const bool needs_assign = evaluator.evalSubExprsIfNeeded(NULL);
|
||||
@ -63,7 +63,7 @@ class TensorExecutor<Expression, DefaultDevice, /*Vectorizable*/ true,
|
||||
using StorageIndex = typename Expression::Index;
|
||||
|
||||
EIGEN_DEVICE_FUNC
|
||||
static inline void run(const Expression& expr,
|
||||
static EIGEN_STRONG_INLINE void run(const Expression& expr,
|
||||
const DefaultDevice& device = DefaultDevice()) {
|
||||
TensorEvaluator<Expression, DefaultDevice> evaluator(expr, device);
|
||||
const bool needs_assign = evaluator.evalSubExprsIfNeeded(NULL);
|
||||
@ -111,7 +111,7 @@ class TensorExecutor<Expression, DefaultDevice, Vectorizable,
|
||||
static const int NumDims = traits<Expression>::NumDimensions;
|
||||
|
||||
EIGEN_DEVICE_FUNC
|
||||
static inline void run(const Expression& expr,
|
||||
static EIGEN_STRONG_INLINE void run(const Expression& expr,
|
||||
const DefaultDevice& device = DefaultDevice()) {
|
||||
using TensorBlock =
|
||||
TensorBlock<ScalarNoConst, StorageIndex, NumDims, Evaluator::Layout>;
|
||||
@ -223,7 +223,7 @@ class TensorExecutor<Expression, ThreadPoolDevice, Vectorizable, Tileable> {
|
||||
public:
|
||||
using StorageIndex = typename Expression::Index;
|
||||
|
||||
static inline void run(const Expression& expr,
|
||||
static EIGEN_STRONG_INLINE void run(const Expression& expr,
|
||||
const ThreadPoolDevice& device) {
|
||||
typedef TensorEvaluator<Expression, ThreadPoolDevice> Evaluator;
|
||||
typedef EvalRange<Evaluator, StorageIndex, Vectorizable> EvalRange;
|
||||
@ -257,7 +257,7 @@ class TensorExecutor<Expression, ThreadPoolDevice, Vectorizable, /*Tileable*/ tr
|
||||
|
||||
static const int NumDims = traits<Expression>::NumDimensions;
|
||||
|
||||
static inline void run(const Expression& expr,
|
||||
static EIGEN_STRONG_INLINE void run(const Expression& expr,
|
||||
const ThreadPoolDevice& device) {
|
||||
using TensorBlock =
|
||||
TensorBlock<ScalarNoConst, StorageIndex, NumDims, Evaluator::Layout>;
|
||||
@ -376,7 +376,7 @@ EigenMetaKernel(Evaluator eval, StorageIndex size) {
|
||||
|
||||
/*static*/
|
||||
template <typename Expression, bool Vectorizable, bool Tileable>
|
||||
inline void TensorExecutor<Expression, GpuDevice, Vectorizable, Tileable>::run(
|
||||
EIGEN_STRONG_INLINE void TensorExecutor<Expression, GpuDevice, Vectorizable, Tileable>::run(
|
||||
const Expression& expr, const GpuDevice& device) {
|
||||
TensorEvaluator<Expression, GpuDevice> evaluator(expr, device);
|
||||
const bool needs_assign = evaluator.evalSubExprsIfNeeded(NULL);
|
||||
@ -405,7 +405,7 @@ inline void TensorExecutor<Expression, GpuDevice, Vectorizable, Tileable>::run(
|
||||
template <typename Expression, bool Vectorizable>
|
||||
class TensorExecutor<Expression, SyclDevice, Vectorizable> {
|
||||
public:
|
||||
static inline void run(const Expression &expr, const SyclDevice &device) {
|
||||
static EIGEN_STRONG_INLINE void run(const Expression &expr, const SyclDevice &device) {
|
||||
// call TensorSYCL module
|
||||
TensorSycl::run(expr, device);
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ namespace internal {
|
||||
template <typename Scalar>
|
||||
struct scalar_mod_op {
|
||||
EIGEN_DEVICE_FUNC scalar_mod_op(const Scalar& divisor) : m_divisor(divisor) {}
|
||||
EIGEN_DEVICE_FUNC inline Scalar operator() (const Scalar& a) const { return a % m_divisor; }
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar operator() (const Scalar& a) const { return a % m_divisor; }
|
||||
const Scalar m_divisor;
|
||||
};
|
||||
template <typename Scalar>
|
||||
@ -34,7 +34,7 @@ struct functor_traits<scalar_mod_op<Scalar> >
|
||||
template <typename Scalar>
|
||||
struct scalar_mod2_op {
|
||||
EIGEN_EMPTY_STRUCT_CTOR(scalar_mod2_op)
|
||||
EIGEN_DEVICE_FUNC inline Scalar operator() (const Scalar& a, const Scalar& b) const { return a % b; }
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar operator() (const Scalar& a, const Scalar& b) const { return a % b; }
|
||||
};
|
||||
template <typename Scalar>
|
||||
struct functor_traits<scalar_mod2_op<Scalar> >
|
||||
|
@ -75,10 +75,10 @@ template<DenseIndex n> struct NumTraits<type2index<n> >
|
||||
MulCost = 1
|
||||
};
|
||||
|
||||
EIGEN_DEVICE_FUNC static inline Real epsilon() { return 0; }
|
||||
EIGEN_DEVICE_FUNC static inline Real dummy_precision() { return 0; }
|
||||
EIGEN_DEVICE_FUNC static inline Real highest() { return n; }
|
||||
EIGEN_DEVICE_FUNC static inline Real lowest() { return n; }
|
||||
EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE Real epsilon() { return 0; }
|
||||
EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE Real dummy_precision() { return 0; }
|
||||
EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE Real highest() { return n; }
|
||||
EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE Real lowest() { return n; }
|
||||
};
|
||||
|
||||
namespace internal {
|
||||
|
@ -104,9 +104,9 @@ template<> struct h_skip_helper_type<0>
|
||||
template<int n>
|
||||
struct h_skip {
|
||||
template<typename T, T... ii>
|
||||
constexpr static inline typename h_skip_helper_numeric<T, n, ii...>::type helper(numeric_list<T, ii...>) { return typename h_skip_helper_numeric<T, n, ii...>::type(); }
|
||||
constexpr static EIGEN_STRONG_INLINE typename h_skip_helper_numeric<T, n, ii...>::type helper(numeric_list<T, ii...>) { return typename h_skip_helper_numeric<T, n, ii...>::type(); }
|
||||
template<typename... tt>
|
||||
constexpr static inline typename h_skip_helper_type<n, tt...>::type helper(type_list<tt...>) { return typename h_skip_helper_type<n, tt...>::type(); }
|
||||
constexpr static EIGEN_STRONG_INLINE typename h_skip_helper_type<n, tt...>::type helper(type_list<tt...>) { return typename h_skip_helper_type<n, tt...>::type(); }
|
||||
};
|
||||
|
||||
template<int n, typename a> struct skip { typedef decltype(h_skip<n>::helper(a())) type; };
|
||||
@ -268,7 +268,7 @@ template<
|
||||
typename Reducer
|
||||
> struct reduce<Reducer>
|
||||
{
|
||||
EIGEN_DEVICE_FUNC constexpr static inline int run() { return Reducer::Identity; }
|
||||
EIGEN_DEVICE_FUNC constexpr static EIGEN_STRONG_INLINE int run() { return Reducer::Identity; }
|
||||
};
|
||||
|
||||
template<
|
||||
@ -276,7 +276,7 @@ template<
|
||||
typename A
|
||||
> struct reduce<Reducer, A>
|
||||
{
|
||||
EIGEN_DEVICE_FUNC constexpr static inline A run(A a) { return a; }
|
||||
EIGEN_DEVICE_FUNC constexpr static EIGEN_STRONG_INLINE A run(A a) { return a; }
|
||||
};
|
||||
|
||||
template<
|
||||
@ -285,7 +285,7 @@ template<
|
||||
typename... Ts
|
||||
> struct reduce<Reducer, A, Ts...>
|
||||
{
|
||||
EIGEN_DEVICE_FUNC constexpr static inline auto run(A a, Ts... ts) -> decltype(Reducer::run(a, reduce<Reducer, Ts...>::run(ts...))) {
|
||||
EIGEN_DEVICE_FUNC constexpr static EIGEN_STRONG_INLINE auto run(A a, Ts... ts) -> decltype(Reducer::run(a, reduce<Reducer, Ts...>::run(ts...))) {
|
||||
return Reducer::run(a, reduce<Reducer, Ts...>::run(ts...));
|
||||
}
|
||||
};
|
||||
@ -293,29 +293,29 @@ template<
|
||||
/* generic binary operations */
|
||||
|
||||
struct sum_op {
|
||||
template<typename A, typename B> EIGEN_DEVICE_FUNC constexpr static inline auto run(A a, B b) -> decltype(a + b) { return a + b; }
|
||||
template<typename A, typename B> EIGEN_DEVICE_FUNC constexpr static EIGEN_STRONG_INLINE auto run(A a, B b) -> decltype(a + b) { return a + b; }
|
||||
static constexpr int Identity = 0;
|
||||
};
|
||||
struct product_op {
|
||||
template<typename A, typename B> EIGEN_DEVICE_FUNC constexpr static inline auto run(A a, B b) -> decltype(a * b) { return a * b; }
|
||||
template<typename A, typename B> EIGEN_DEVICE_FUNC constexpr static EIGEN_STRONG_INLINE auto run(A a, B b) -> decltype(a * b) { return a * b; }
|
||||
static constexpr int Identity = 1;
|
||||
};
|
||||
|
||||
struct logical_and_op { template<typename A, typename B> constexpr static inline auto run(A a, B b) -> decltype(a && b) { return a && b; } };
|
||||
struct logical_or_op { template<typename A, typename B> constexpr static inline auto run(A a, B b) -> decltype(a || b) { return a || b; } };
|
||||
struct logical_and_op { template<typename A, typename B> constexpr static EIGEN_STRONG_INLINE auto run(A a, B b) -> decltype(a && b) { return a && b; } };
|
||||
struct logical_or_op { template<typename A, typename B> constexpr static EIGEN_STRONG_INLINE auto run(A a, B b) -> decltype(a || b) { return a || b; } };
|
||||
|
||||
struct equal_op { template<typename A, typename B> constexpr static inline auto run(A a, B b) -> decltype(a == b) { return a == b; } };
|
||||
struct not_equal_op { template<typename A, typename B> constexpr static inline auto run(A a, B b) -> decltype(a != b) { return a != b; } };
|
||||
struct lesser_op { template<typename A, typename B> constexpr static inline auto run(A a, B b) -> decltype(a < b) { return a < b; } };
|
||||
struct lesser_equal_op { template<typename A, typename B> constexpr static inline auto run(A a, B b) -> decltype(a <= b) { return a <= b; } };
|
||||
struct greater_op { template<typename A, typename B> constexpr static inline auto run(A a, B b) -> decltype(a > b) { return a > b; } };
|
||||
struct greater_equal_op { template<typename A, typename B> constexpr static inline auto run(A a, B b) -> decltype(a >= b) { return a >= b; } };
|
||||
struct equal_op { template<typename A, typename B> constexpr static EIGEN_STRONG_INLINE auto run(A a, B b) -> decltype(a == b) { return a == b; } };
|
||||
struct not_equal_op { template<typename A, typename B> constexpr static EIGEN_STRONG_INLINE auto run(A a, B b) -> decltype(a != b) { return a != b; } };
|
||||
struct lesser_op { template<typename A, typename B> constexpr static EIGEN_STRONG_INLINE auto run(A a, B b) -> decltype(a < b) { return a < b; } };
|
||||
struct lesser_equal_op { template<typename A, typename B> constexpr static EIGEN_STRONG_INLINE auto run(A a, B b) -> decltype(a <= b) { return a <= b; } };
|
||||
struct greater_op { template<typename A, typename B> constexpr static EIGEN_STRONG_INLINE auto run(A a, B b) -> decltype(a > b) { return a > b; } };
|
||||
struct greater_equal_op { template<typename A, typename B> constexpr static EIGEN_STRONG_INLINE auto run(A a, B b) -> decltype(a >= b) { return a >= b; } };
|
||||
|
||||
/* generic unary operations */
|
||||
|
||||
struct not_op { template<typename A> constexpr static inline auto run(A a) -> decltype(!a) { return !a; } };
|
||||
struct negation_op { template<typename A> constexpr static inline auto run(A a) -> decltype(-a) { return -a; } };
|
||||
struct greater_equal_zero_op { template<typename A> constexpr static inline auto run(A a) -> decltype(a >= 0) { return a >= 0; } };
|
||||
struct not_op { template<typename A> constexpr static EIGEN_STRONG_INLINE auto run(A a) -> decltype(!a) { return !a; } };
|
||||
struct negation_op { template<typename A> constexpr static EIGEN_STRONG_INLINE auto run(A a) -> decltype(-a) { return -a; } };
|
||||
struct greater_equal_zero_op { template<typename A> constexpr static EIGEN_STRONG_INLINE auto run(A a) -> decltype(a >= 0) { return a >= 0; } };
|
||||
|
||||
|
||||
/* reductions for lists */
|
||||
@ -324,13 +324,13 @@ struct greater_equal_zero_op { template<typename A> constexpr static inline auto
|
||||
// together in front... (13.0 doesn't work with array_prod/array_reduce/... anyway, but 13.1
|
||||
// does...
|
||||
template<typename... Ts>
|
||||
EIGEN_DEVICE_FUNC constexpr inline decltype(reduce<product_op, Ts...>::run((*((Ts*)0))...)) arg_prod(Ts... ts)
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE decltype(reduce<product_op, Ts...>::run((*((Ts*)0))...)) arg_prod(Ts... ts)
|
||||
{
|
||||
return reduce<product_op, Ts...>::run(ts...);
|
||||
}
|
||||
|
||||
template<typename... Ts>
|
||||
constexpr inline decltype(reduce<sum_op, Ts...>::run((*((Ts*)0))...)) arg_sum(Ts... ts)
|
||||
constexpr EIGEN_STRONG_INLINE decltype(reduce<sum_op, Ts...>::run((*((Ts*)0))...)) arg_sum(Ts... ts)
|
||||
{
|
||||
return reduce<sum_op, Ts...>::run(ts...);
|
||||
}
|
||||
@ -338,13 +338,13 @@ constexpr inline decltype(reduce<sum_op, Ts...>::run((*((Ts*)0))...)) arg_sum(Ts
|
||||
/* reverse arrays */
|
||||
|
||||
template<typename Array, int... n>
|
||||
constexpr inline Array h_array_reverse(Array arr, numeric_list<int, n...>)
|
||||
constexpr EIGEN_STRONG_INLINE Array h_array_reverse(Array arr, numeric_list<int, n...>)
|
||||
{
|
||||
return {{array_get<sizeof...(n) - n - 1>(arr)...}};
|
||||
}
|
||||
|
||||
template<typename T, std::size_t N>
|
||||
constexpr inline array<T, N> array_reverse(array<T, N> arr)
|
||||
constexpr EIGEN_STRONG_INLINE array<T, N> array_reverse(array<T, N> arr)
|
||||
{
|
||||
return h_array_reverse(arr, typename gen_numeric_list<int, N>::type());
|
||||
}
|
||||
@ -359,7 +359,7 @@ constexpr inline array<T, N> array_reverse(array<T, N> arr)
|
||||
// an infinite loop)
|
||||
template<typename Reducer, typename T, std::size_t N, std::size_t n = N - 1>
|
||||
struct h_array_reduce {
|
||||
EIGEN_DEVICE_FUNC constexpr static inline auto run(array<T, N> arr, T identity) -> decltype(Reducer::run(h_array_reduce<Reducer, T, N, n - 1>::run(arr, identity), array_get<n>(arr)))
|
||||
EIGEN_DEVICE_FUNC constexpr static EIGEN_STRONG_INLINE auto run(array<T, N> arr, T identity) -> decltype(Reducer::run(h_array_reduce<Reducer, T, N, n - 1>::run(arr, identity), array_get<n>(arr)))
|
||||
{
|
||||
return Reducer::run(h_array_reduce<Reducer, T, N, n - 1>::run(arr, identity), array_get<n>(arr));
|
||||
}
|
||||
@ -368,7 +368,7 @@ struct h_array_reduce {
|
||||
template<typename Reducer, typename T, std::size_t N>
|
||||
struct h_array_reduce<Reducer, T, N, 0>
|
||||
{
|
||||
EIGEN_DEVICE_FUNC constexpr static inline T run(const array<T, N>& arr, T)
|
||||
EIGEN_DEVICE_FUNC constexpr static EIGEN_STRONG_INLINE T run(const array<T, N>& arr, T)
|
||||
{
|
||||
return array_get<0>(arr);
|
||||
}
|
||||
@ -377,14 +377,14 @@ struct h_array_reduce<Reducer, T, N, 0>
|
||||
template<typename Reducer, typename T>
|
||||
struct h_array_reduce<Reducer, T, 0>
|
||||
{
|
||||
EIGEN_DEVICE_FUNC constexpr static inline T run(const array<T, 0>&, T identity)
|
||||
EIGEN_DEVICE_FUNC constexpr static EIGEN_STRONG_INLINE T run(const array<T, 0>&, T identity)
|
||||
{
|
||||
return identity;
|
||||
}
|
||||
};
|
||||
|
||||
template<typename Reducer, typename T, std::size_t N>
|
||||
EIGEN_DEVICE_FUNC constexpr inline auto array_reduce(const array<T, N>& arr, T identity) -> decltype(h_array_reduce<Reducer, T, N>::run(arr, identity))
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE auto array_reduce(const array<T, N>& arr, T identity) -> decltype(h_array_reduce<Reducer, T, N>::run(arr, identity))
|
||||
{
|
||||
return h_array_reduce<Reducer, T, N>::run(arr, identity);
|
||||
}
|
||||
@ -392,13 +392,13 @@ EIGEN_DEVICE_FUNC constexpr inline auto array_reduce(const array<T, N>& arr, T i
|
||||
/* standard array reductions */
|
||||
|
||||
template<typename T, std::size_t N>
|
||||
EIGEN_DEVICE_FUNC constexpr inline auto array_sum(const array<T, N>& arr) -> decltype(array_reduce<sum_op, T, N>(arr, static_cast<T>(0)))
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE auto array_sum(const array<T, N>& arr) -> decltype(array_reduce<sum_op, T, N>(arr, static_cast<T>(0)))
|
||||
{
|
||||
return array_reduce<sum_op, T, N>(arr, static_cast<T>(0));
|
||||
}
|
||||
|
||||
template<typename T, std::size_t N>
|
||||
EIGEN_DEVICE_FUNC constexpr inline auto array_prod(const array<T, N>& arr) -> decltype(array_reduce<product_op, T, N>(arr, static_cast<T>(1)))
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE auto array_prod(const array<T, N>& arr) -> decltype(array_reduce<product_op, T, N>(arr, static_cast<T>(1)))
|
||||
{
|
||||
return array_reduce<product_op, T, N>(arr, static_cast<T>(1));
|
||||
}
|
||||
@ -414,13 +414,13 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE t array_prod(const std::vector<t>& a) {
|
||||
/* zip an array */
|
||||
|
||||
template<typename Op, typename A, typename B, std::size_t N, int... n>
|
||||
constexpr inline array<decltype(Op::run(A(), B())),N> h_array_zip(array<A, N> a, array<B, N> b, numeric_list<int, n...>)
|
||||
constexpr EIGEN_STRONG_INLINE array<decltype(Op::run(A(), B())),N> h_array_zip(array<A, N> a, array<B, N> b, numeric_list<int, n...>)
|
||||
{
|
||||
return array<decltype(Op::run(A(), B())),N>{{ Op::run(array_get<n>(a), array_get<n>(b))... }};
|
||||
}
|
||||
|
||||
template<typename Op, typename A, typename B, std::size_t N>
|
||||
constexpr inline array<decltype(Op::run(A(), B())),N> array_zip(array<A, N> a, array<B, N> b)
|
||||
constexpr EIGEN_STRONG_INLINE array<decltype(Op::run(A(), B())),N> array_zip(array<A, N> a, array<B, N> b)
|
||||
{
|
||||
return h_array_zip<Op>(a, b, typename gen_numeric_list<int, N>::type());
|
||||
}
|
||||
@ -428,13 +428,13 @@ constexpr inline array<decltype(Op::run(A(), B())),N> array_zip(array<A, N> a, a
|
||||
/* zip an array and reduce the result */
|
||||
|
||||
template<typename Reducer, typename Op, typename A, typename B, std::size_t N, int... n>
|
||||
constexpr inline auto h_array_zip_and_reduce(array<A, N> a, array<B, N> b, numeric_list<int, n...>) -> decltype(reduce<Reducer, typename id_numeric<int,n,decltype(Op::run(A(), B()))>::type...>::run(Op::run(array_get<n>(a), array_get<n>(b))...))
|
||||
constexpr EIGEN_STRONG_INLINE auto h_array_zip_and_reduce(array<A, N> a, array<B, N> b, numeric_list<int, n...>) -> decltype(reduce<Reducer, typename id_numeric<int,n,decltype(Op::run(A(), B()))>::type...>::run(Op::run(array_get<n>(a), array_get<n>(b))...))
|
||||
{
|
||||
return reduce<Reducer, typename id_numeric<int,n,decltype(Op::run(A(), B()))>::type...>::run(Op::run(array_get<n>(a), array_get<n>(b))...);
|
||||
}
|
||||
|
||||
template<typename Reducer, typename Op, typename A, typename B, std::size_t N>
|
||||
constexpr inline auto array_zip_and_reduce(array<A, N> a, array<B, N> b) -> decltype(h_array_zip_and_reduce<Reducer, Op, A, B, N>(a, b, typename gen_numeric_list<int, N>::type()))
|
||||
constexpr EIGEN_STRONG_INLINE auto array_zip_and_reduce(array<A, N> a, array<B, N> b) -> decltype(h_array_zip_and_reduce<Reducer, Op, A, B, N>(a, b, typename gen_numeric_list<int, N>::type()))
|
||||
{
|
||||
return h_array_zip_and_reduce<Reducer, Op, A, B, N>(a, b, typename gen_numeric_list<int, N>::type());
|
||||
}
|
||||
@ -442,13 +442,13 @@ constexpr inline auto array_zip_and_reduce(array<A, N> a, array<B, N> b) -> decl
|
||||
/* apply stuff to an array */
|
||||
|
||||
template<typename Op, typename A, std::size_t N, int... n>
|
||||
constexpr inline array<decltype(Op::run(A())),N> h_array_apply(array<A, N> a, numeric_list<int, n...>)
|
||||
constexpr EIGEN_STRONG_INLINE array<decltype(Op::run(A())),N> h_array_apply(array<A, N> a, numeric_list<int, n...>)
|
||||
{
|
||||
return array<decltype(Op::run(A())),N>{{ Op::run(array_get<n>(a))... }};
|
||||
}
|
||||
|
||||
template<typename Op, typename A, std::size_t N>
|
||||
constexpr inline array<decltype(Op::run(A())),N> array_apply(array<A, N> a)
|
||||
constexpr EIGEN_STRONG_INLINE array<decltype(Op::run(A())),N> array_apply(array<A, N> a)
|
||||
{
|
||||
return h_array_apply<Op>(a, typename gen_numeric_list<int, N>::type());
|
||||
}
|
||||
@ -456,13 +456,13 @@ constexpr inline array<decltype(Op::run(A())),N> array_apply(array<A, N> a)
|
||||
/* apply stuff to an array and reduce */
|
||||
|
||||
template<typename Reducer, typename Op, typename A, std::size_t N, int... n>
|
||||
constexpr inline auto h_array_apply_and_reduce(array<A, N> arr, numeric_list<int, n...>) -> decltype(reduce<Reducer, typename id_numeric<int,n,decltype(Op::run(A()))>::type...>::run(Op::run(array_get<n>(arr))...))
|
||||
constexpr EIGEN_STRONG_INLINE auto h_array_apply_and_reduce(array<A, N> arr, numeric_list<int, n...>) -> decltype(reduce<Reducer, typename id_numeric<int,n,decltype(Op::run(A()))>::type...>::run(Op::run(array_get<n>(arr))...))
|
||||
{
|
||||
return reduce<Reducer, typename id_numeric<int,n,decltype(Op::run(A()))>::type...>::run(Op::run(array_get<n>(arr))...);
|
||||
}
|
||||
|
||||
template<typename Reducer, typename Op, typename A, std::size_t N>
|
||||
constexpr inline auto array_apply_and_reduce(array<A, N> a) -> decltype(h_array_apply_and_reduce<Reducer, Op, A, N>(a, typename gen_numeric_list<int, N>::type()))
|
||||
constexpr EIGEN_STRONG_INLINE auto array_apply_and_reduce(array<A, N> a) -> decltype(h_array_apply_and_reduce<Reducer, Op, A, N>(a, typename gen_numeric_list<int, N>::type()))
|
||||
{
|
||||
return h_array_apply_and_reduce<Reducer, Op, A, N>(a, typename gen_numeric_list<int, N>::type());
|
||||
}
|
||||
@ -476,7 +476,7 @@ template<int n>
|
||||
struct h_repeat
|
||||
{
|
||||
template<typename t, int... ii>
|
||||
constexpr static inline array<t, n> run(t v, numeric_list<int, ii...>)
|
||||
constexpr static EIGEN_STRONG_INLINE array<t, n> run(t v, numeric_list<int, ii...>)
|
||||
{
|
||||
return {{ typename id_numeric<int, ii, t>::type(v)... }};
|
||||
}
|
||||
|
@ -24,7 +24,7 @@ namespace Eigen {
|
||||
* \sa Eigen::igammac(), Eigen::lgamma()
|
||||
*/
|
||||
template<typename Derived,typename ExponentDerived>
|
||||
inline const Eigen::CwiseBinaryOp<Eigen::internal::scalar_igamma_op<typename Derived::Scalar>, const Derived, const ExponentDerived>
|
||||
EIGEN_STRONG_INLINE const Eigen::CwiseBinaryOp<Eigen::internal::scalar_igamma_op<typename Derived::Scalar>, const Derived, const ExponentDerived>
|
||||
igamma(const Eigen::ArrayBase<Derived>& a, const Eigen::ArrayBase<ExponentDerived>& x)
|
||||
{
|
||||
return Eigen::CwiseBinaryOp<Eigen::internal::scalar_igamma_op<typename Derived::Scalar>, const Derived, const ExponentDerived>(
|
||||
@ -47,7 +47,7 @@ igamma(const Eigen::ArrayBase<Derived>& a, const Eigen::ArrayBase<ExponentDerive
|
||||
* \sa Eigen::igamma(), Eigen::lgamma()
|
||||
*/
|
||||
template <typename Derived, typename ExponentDerived>
|
||||
inline const Eigen::CwiseBinaryOp<Eigen::internal::scalar_igamma_der_a_op<typename Derived::Scalar>, const Derived, const ExponentDerived>
|
||||
EIGEN_STRONG_INLINE const Eigen::CwiseBinaryOp<Eigen::internal::scalar_igamma_der_a_op<typename Derived::Scalar>, const Derived, const ExponentDerived>
|
||||
igamma_der_a(const Eigen::ArrayBase<Derived>& a, const Eigen::ArrayBase<ExponentDerived>& x) {
|
||||
return Eigen::CwiseBinaryOp<Eigen::internal::scalar_igamma_der_a_op<typename Derived::Scalar>, const Derived, const ExponentDerived>(
|
||||
a.derived(),
|
||||
@ -68,7 +68,7 @@ igamma_der_a(const Eigen::ArrayBase<Derived>& a, const Eigen::ArrayBase<Exponent
|
||||
* \sa Eigen::igamma(), Eigen::lgamma()
|
||||
*/
|
||||
template <typename AlphaDerived, typename SampleDerived>
|
||||
inline const Eigen::CwiseBinaryOp<Eigen::internal::scalar_gamma_sample_der_alpha_op<typename AlphaDerived::Scalar>, const AlphaDerived, const SampleDerived>
|
||||
EIGEN_STRONG_INLINE const Eigen::CwiseBinaryOp<Eigen::internal::scalar_gamma_sample_der_alpha_op<typename AlphaDerived::Scalar>, const AlphaDerived, const SampleDerived>
|
||||
gamma_sample_der_alpha(const Eigen::ArrayBase<AlphaDerived>& alpha, const Eigen::ArrayBase<SampleDerived>& sample) {
|
||||
return Eigen::CwiseBinaryOp<Eigen::internal::scalar_gamma_sample_der_alpha_op<typename AlphaDerived::Scalar>, const AlphaDerived, const SampleDerived>(
|
||||
alpha.derived(),
|
||||
@ -86,7 +86,7 @@ gamma_sample_der_alpha(const Eigen::ArrayBase<AlphaDerived>& alpha, const Eigen:
|
||||
* \sa Eigen::igamma(), Eigen::lgamma()
|
||||
*/
|
||||
template<typename Derived,typename ExponentDerived>
|
||||
inline const Eigen::CwiseBinaryOp<Eigen::internal::scalar_igammac_op<typename Derived::Scalar>, const Derived, const ExponentDerived>
|
||||
EIGEN_STRONG_INLINE const Eigen::CwiseBinaryOp<Eigen::internal::scalar_igammac_op<typename Derived::Scalar>, const Derived, const ExponentDerived>
|
||||
igammac(const Eigen::ArrayBase<Derived>& a, const Eigen::ArrayBase<ExponentDerived>& x)
|
||||
{
|
||||
return Eigen::CwiseBinaryOp<Eigen::internal::scalar_igammac_op<typename Derived::Scalar>, const Derived, const ExponentDerived>(
|
||||
@ -108,7 +108,7 @@ igammac(const Eigen::ArrayBase<Derived>& a, const Eigen::ArrayBase<ExponentDeriv
|
||||
// * \warning Be careful with the order of the parameters: x.polygamma(n) is equivalent to polygamma(n,x)
|
||||
// * \sa ArrayBase::polygamma()
|
||||
template<typename DerivedN,typename DerivedX>
|
||||
inline const Eigen::CwiseBinaryOp<Eigen::internal::scalar_polygamma_op<typename DerivedX::Scalar>, const DerivedN, const DerivedX>
|
||||
EIGEN_STRONG_INLINE const Eigen::CwiseBinaryOp<Eigen::internal::scalar_polygamma_op<typename DerivedX::Scalar>, const DerivedN, const DerivedX>
|
||||
polygamma(const Eigen::ArrayBase<DerivedN>& n, const Eigen::ArrayBase<DerivedX>& x)
|
||||
{
|
||||
return Eigen::CwiseBinaryOp<Eigen::internal::scalar_polygamma_op<typename DerivedX::Scalar>, const DerivedN, const DerivedX>(
|
||||
@ -128,7 +128,7 @@ polygamma(const Eigen::ArrayBase<DerivedN>& n, const Eigen::ArrayBase<DerivedX>&
|
||||
* \sa Eigen::betainc(), Eigen::lgamma()
|
||||
*/
|
||||
template<typename ArgADerived, typename ArgBDerived, typename ArgXDerived>
|
||||
inline const Eigen::CwiseTernaryOp<Eigen::internal::scalar_betainc_op<typename ArgXDerived::Scalar>, const ArgADerived, const ArgBDerived, const ArgXDerived>
|
||||
EIGEN_STRONG_INLINE const Eigen::CwiseTernaryOp<Eigen::internal::scalar_betainc_op<typename ArgXDerived::Scalar>, const ArgADerived, const ArgBDerived, const ArgXDerived>
|
||||
betainc(const Eigen::ArrayBase<ArgADerived>& a, const Eigen::ArrayBase<ArgBDerived>& b, const Eigen::ArrayBase<ArgXDerived>& x)
|
||||
{
|
||||
return Eigen::CwiseTernaryOp<Eigen::internal::scalar_betainc_op<typename ArgXDerived::Scalar>, const ArgADerived, const ArgBDerived, const ArgXDerived>(
|
||||
@ -152,7 +152,7 @@ betainc(const Eigen::ArrayBase<ArgADerived>& a, const Eigen::ArrayBase<ArgBDeriv
|
||||
* \sa ArrayBase::zeta()
|
||||
*/
|
||||
template<typename DerivedX,typename DerivedQ>
|
||||
inline const Eigen::CwiseBinaryOp<Eigen::internal::scalar_zeta_op<typename DerivedX::Scalar>, const DerivedX, const DerivedQ>
|
||||
EIGEN_STRONG_INLINE const Eigen::CwiseBinaryOp<Eigen::internal::scalar_zeta_op<typename DerivedX::Scalar>, const DerivedX, const DerivedQ>
|
||||
zeta(const Eigen::ArrayBase<DerivedX>& x, const Eigen::ArrayBase<DerivedQ>& q)
|
||||
{
|
||||
return Eigen::CwiseBinaryOp<Eigen::internal::scalar_zeta_op<typename DerivedX::Scalar>, const DerivedX, const DerivedQ>(
|
||||
@ -176,7 +176,7 @@ zeta(const Eigen::ArrayBase<DerivedX>& x, const Eigen::ArrayBase<DerivedQ>& q)
|
||||
* \sa ArrayBase::i0e()
|
||||
*/
|
||||
template <typename Derived>
|
||||
inline const Eigen::CwiseUnaryOp<
|
||||
EIGEN_STRONG_INLINE const Eigen::CwiseUnaryOp<
|
||||
Eigen::internal::scalar_i0e_op<typename Derived::Scalar>, const Derived>
|
||||
i0e(const Eigen::ArrayBase<Derived>& x) {
|
||||
return Eigen::CwiseUnaryOp<
|
||||
@ -199,7 +199,7 @@ i0e(const Eigen::ArrayBase<Derived>& x) {
|
||||
* \sa ArrayBase::i1e()
|
||||
*/
|
||||
template <typename Derived>
|
||||
inline const Eigen::CwiseUnaryOp<
|
||||
EIGEN_STRONG_INLINE const Eigen::CwiseUnaryOp<
|
||||
Eigen::internal::scalar_i1e_op<typename Derived::Scalar>, const Derived>
|
||||
i1e(const Eigen::ArrayBase<Derived>& x) {
|
||||
return Eigen::CwiseUnaryOp<
|
||||
|
@ -155,11 +155,11 @@ struct functor_traits<scalar_betainc_op<Scalar> > {
|
||||
*/
|
||||
template<typename Scalar> struct scalar_lgamma_op {
|
||||
EIGEN_EMPTY_STRUCT_CTOR(scalar_lgamma_op)
|
||||
EIGEN_DEVICE_FUNC inline const Scalar operator() (const Scalar& a) const {
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar operator() (const Scalar& a) const {
|
||||
using numext::lgamma; return lgamma(a);
|
||||
}
|
||||
typedef typename packet_traits<Scalar>::type Packet;
|
||||
EIGEN_DEVICE_FUNC inline Packet packetOp(const Packet& a) const { return internal::plgamma(a); }
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Packet packetOp(const Packet& a) const { return internal::plgamma(a); }
|
||||
};
|
||||
template<typename Scalar>
|
||||
struct functor_traits<scalar_lgamma_op<Scalar> >
|
||||
@ -177,11 +177,11 @@ struct functor_traits<scalar_lgamma_op<Scalar> >
|
||||
*/
|
||||
template<typename Scalar> struct scalar_digamma_op {
|
||||
EIGEN_EMPTY_STRUCT_CTOR(scalar_digamma_op)
|
||||
EIGEN_DEVICE_FUNC inline const Scalar operator() (const Scalar& a) const {
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar operator() (const Scalar& a) const {
|
||||
using numext::digamma; return digamma(a);
|
||||
}
|
||||
typedef typename packet_traits<Scalar>::type Packet;
|
||||
EIGEN_DEVICE_FUNC inline Packet packetOp(const Packet& a) const { return internal::pdigamma(a); }
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Packet packetOp(const Packet& a) const { return internal::pdigamma(a); }
|
||||
};
|
||||
template<typename Scalar>
|
||||
struct functor_traits<scalar_digamma_op<Scalar> >
|
||||
@ -199,11 +199,11 @@ struct functor_traits<scalar_digamma_op<Scalar> >
|
||||
*/
|
||||
template<typename Scalar> struct scalar_zeta_op {
|
||||
EIGEN_EMPTY_STRUCT_CTOR(scalar_zeta_op)
|
||||
EIGEN_DEVICE_FUNC inline const Scalar operator() (const Scalar& x, const Scalar& q) const {
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar operator() (const Scalar& x, const Scalar& q) const {
|
||||
using numext::zeta; return zeta(x, q);
|
||||
}
|
||||
typedef typename packet_traits<Scalar>::type Packet;
|
||||
EIGEN_DEVICE_FUNC inline Packet packetOp(const Packet& x, const Packet& q) const { return internal::pzeta(x, q); }
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Packet packetOp(const Packet& x, const Packet& q) const { return internal::pzeta(x, q); }
|
||||
};
|
||||
template<typename Scalar>
|
||||
struct functor_traits<scalar_zeta_op<Scalar> >
|
||||
@ -221,11 +221,11 @@ struct functor_traits<scalar_zeta_op<Scalar> >
|
||||
*/
|
||||
template<typename Scalar> struct scalar_polygamma_op {
|
||||
EIGEN_EMPTY_STRUCT_CTOR(scalar_polygamma_op)
|
||||
EIGEN_DEVICE_FUNC inline const Scalar operator() (const Scalar& n, const Scalar& x) const {
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar operator() (const Scalar& n, const Scalar& x) const {
|
||||
using numext::polygamma; return polygamma(n, x);
|
||||
}
|
||||
typedef typename packet_traits<Scalar>::type Packet;
|
||||
EIGEN_DEVICE_FUNC inline Packet packetOp(const Packet& n, const Packet& x) const { return internal::ppolygamma(n, x); }
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Packet packetOp(const Packet& n, const Packet& x) const { return internal::ppolygamma(n, x); }
|
||||
};
|
||||
template<typename Scalar>
|
||||
struct functor_traits<scalar_polygamma_op<Scalar> >
|
||||
@ -244,11 +244,11 @@ struct functor_traits<scalar_polygamma_op<Scalar> >
|
||||
*/
|
||||
template<typename Scalar> struct scalar_erf_op {
|
||||
EIGEN_EMPTY_STRUCT_CTOR(scalar_erf_op)
|
||||
EIGEN_DEVICE_FUNC inline const Scalar operator() (const Scalar& a) const {
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar operator() (const Scalar& a) const {
|
||||
using numext::erf; return erf(a);
|
||||
}
|
||||
typedef typename packet_traits<Scalar>::type Packet;
|
||||
EIGEN_DEVICE_FUNC inline Packet packetOp(const Packet& a) const { return internal::perf(a); }
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Packet packetOp(const Packet& a) const { return internal::perf(a); }
|
||||
};
|
||||
template<typename Scalar>
|
||||
struct functor_traits<scalar_erf_op<Scalar> >
|
||||
@ -267,11 +267,11 @@ struct functor_traits<scalar_erf_op<Scalar> >
|
||||
*/
|
||||
template<typename Scalar> struct scalar_erfc_op {
|
||||
EIGEN_EMPTY_STRUCT_CTOR(scalar_erfc_op)
|
||||
EIGEN_DEVICE_FUNC inline const Scalar operator() (const Scalar& a) const {
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar operator() (const Scalar& a) const {
|
||||
using numext::erfc; return erfc(a);
|
||||
}
|
||||
typedef typename packet_traits<Scalar>::type Packet;
|
||||
EIGEN_DEVICE_FUNC inline Packet packetOp(const Packet& a) const { return internal::perfc(a); }
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Packet packetOp(const Packet& a) const { return internal::perfc(a); }
|
||||
};
|
||||
template<typename Scalar>
|
||||
struct functor_traits<scalar_erfc_op<Scalar> >
|
||||
@ -291,12 +291,12 @@ struct functor_traits<scalar_erfc_op<Scalar> >
|
||||
template <typename Scalar>
|
||||
struct scalar_i0e_op {
|
||||
EIGEN_EMPTY_STRUCT_CTOR(scalar_i0e_op)
|
||||
EIGEN_DEVICE_FUNC inline const Scalar operator()(const Scalar& x) const {
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar operator()(const Scalar& x) const {
|
||||
using numext::i0e;
|
||||
return i0e(x);
|
||||
}
|
||||
typedef typename packet_traits<Scalar>::type Packet;
|
||||
EIGEN_DEVICE_FUNC inline Packet packetOp(const Packet& x) const {
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Packet packetOp(const Packet& x) const {
|
||||
return internal::pi0e(x);
|
||||
}
|
||||
};
|
||||
@ -318,12 +318,12 @@ struct functor_traits<scalar_i0e_op<Scalar> > {
|
||||
template <typename Scalar>
|
||||
struct scalar_i1e_op {
|
||||
EIGEN_EMPTY_STRUCT_CTOR(scalar_i1e_op)
|
||||
EIGEN_DEVICE_FUNC inline const Scalar operator()(const Scalar& x) const {
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar operator()(const Scalar& x) const {
|
||||
using numext::i1e;
|
||||
return i1e(x);
|
||||
}
|
||||
typedef typename packet_traits<Scalar>::type Packet;
|
||||
EIGEN_DEVICE_FUNC inline Packet packetOp(const Packet& x) const {
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Packet packetOp(const Packet& x) const {
|
||||
return internal::pi1e(x);
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user