10 #ifndef EIGEN_CXX11_TENSOR_TENSOR_FUNCTORS_H 11 #define EIGEN_CXX11_TENSOR_TENSOR_FUNCTORS_H 20 template <
typename Scalar>
26 template <
typename Scalar>
34 template <
typename Scalar>
37 EIGEN_DEVICE_FUNC
inline Scalar
operator() (
const Scalar& a,
const Scalar&
b)
const {
return a %
b; }
39 template <
typename Scalar>
43 template <
typename Scalar>
51 template <
typename Scalar>
54 PacketAccess =
false };
72 const Packet one = pset1<Packet>(T(1));
87 template<
typename Reducer,
typename Device>
99 static const bool IsStateful =
false;
103 *accum = sum_op(*accum, t);
105 template <
typename Packet>
107 (*accum) = padd<Packet>(*accum, p);
114 template <
typename Packet>
121 template <
typename Packet>
125 template <
typename Packet>
128 return sum_op(saccum,
predux(vaccum));
132 template <
typename T,
typename Device>
144 static const bool IsStateful =
true;
151 *accum = sum_op(*accum, t);
154 template <
typename Packet>
156 (*accum) = padd<Packet>(*accum, p);
164 template <
typename Packet>
169 return accum / scalarCount_;
171 template <
typename Packet>
173 return pdiv(vaccum, pset1<Packet>(packetCount_));
175 template <
typename Packet>
186 template <
typename T,
typename Device>
195 template <
typename T,
bool IsMax = true,
bool IsInteger = true>
201 template <
typename T>
207 template <
typename T>
213 template <
typename T>
224 static const bool IsStateful =
false;
227 if (t > *accum) { *accum = t; }
229 template <
typename Packet>
231 (*accum) = pmax<Packet>(*accum, p);
236 template <
typename Packet>
243 template <
typename Packet>
247 template <
typename Packet>
249 return numext::maxi(saccum,
predux_max(vaccum));
253 template <
typename T,
typename Device>
265 static const bool IsStateful =
false;
268 if (t < *accum) { *accum = t; }
270 template <
typename Packet>
272 (*accum) = pmin<Packet>(*accum, p);
277 template <
typename Packet>
284 template <
typename Packet>
288 template <
typename Packet>
290 return numext::mini(saccum,
predux_min(vaccum));
294 template <
typename T,
typename Device>
306 static const bool IsStateful =
false;
310 (*accum) = prod_op(*accum, t);
312 template <
typename Packet>
314 (*accum) = pmul<Packet>(*accum, p);
321 template <
typename Packet>
328 template <
typename Packet>
332 template <
typename Packet>
339 template <
typename T,
typename Device>
350 static const bool PacketAccess =
false;
351 static const bool IsStateful =
false;
354 *accum = *accum && t;
364 template <
typename Device>
374 static const bool PacketAccess =
false;
375 static const bool IsStateful =
false;
378 *accum = *accum || t;
388 template <
typename Device>
400 static const bool PacketAccess =
false;
401 static const bool IsStateful =
false;
404 if (t.second > accum->second) { *accum = t; }
414 template <
typename T,
typename Device>
425 static const bool PacketAccess =
false;
426 static const bool IsStateful =
false;
429 if (t.second < accum->second) { *accum = t; }
439 template <
typename T,
typename Device>
448 template <
typename T,
typename Index,
size_t NumDims>
451 static const bool PacketAccess =
false;
457 for (
size_t i = 0; i < NumDims; ++i) {
458 m_two_sigmas[i] = std_devs[i] * std_devs[i] * 2;
464 for (
size_t i = 0; i < NumDims; ++i) {
465 T offset = coordinates[i] - m_means[i];
466 tmp += offset * offset / m_two_sigmas[i];
476 template <
typename T,
typename Index,
size_t NumDims>
489 #endif // EIGEN_CXX11_TENSOR_TENSOR_FUNCTORS_H
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE T initialize() const
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void reduce(const T &t, T *accum) const
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE T finalize(const T &accum) const
#define EIGEN_STRONG_INLINE
EIGEN_DEVICE_FUNC GaussianGenerator(const array< T, NumDims > &means, const array< T, NumDims > &std_devs)
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar operator()(const Scalar &a, const Scalar &b) const
#define EIGEN_EMPTY_STRUCT_CTOR(X)
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Packet finalizePacket(const Packet &vaccum) const
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void reducePacket(const Packet &p, Packet *accum) const
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE bool initialize() const
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Packet finalizePacket(const Packet &vaccum) const
EIGEN_DEVICE_FUNC const ExpReturnType exp() const
EIGEN_DEVICE_FUNC unpacket_traits< Packet >::type predux_min(const Packet &a)
ROSCONSOLE_DECL void initialize()
EIGEN_DEVICE_FUNC unpacket_traits< Packet >::type predux_max(const Packet &a)
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Packet packetOp(const Packet &x) const
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Packet finalizePacket(const Packet &vaccum) const
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE T bottom_value()
Holds information about the various numeric (i.e. scalar) types allowed by Eigen. ...
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void reduce(bool t, bool *accum) const
EIGEN_DEVICE_FUNC unpacket_traits< Packet >::type predux(const Packet &a)
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE T initialize() const
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE T initialize() const
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE T bottom_value()
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Packet initializePacket() const
array< T, NumDims > m_two_sigmas
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE T initialize() const
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE bool finalize(bool accum) const
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Packet finalizePacket(const Packet &vaccum) const
EIGEN_DEVICE_FUNC Packet padd(const Packet &a, const Packet &b)
EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet pexp(const Packet &a)
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE T initialize() const
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE T finalizeBoth(const T saccum, const Packet &vaccum) const
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE T finalize(const T accum) const
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Packet initializePacket() const
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Packet initializePacket() const
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE T finalizeBoth(const T saccum, const Packet &vaccum) const
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Packet initializePacket() const
EIGEN_DEVICE_FUNC T operator()(const array< Index, NumDims > &coordinates) const
const mpreal fmod(const mpreal &x, const mpreal &y, mp_rnd_t rnd_mode=mpreal::get_default_rnd())
EIGEN_DEVICE_FUNC scalar_mod_op(const Scalar &divisor)
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void reduce(const T t, T *accum) const
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE T initialize() const
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void reduce(const T t, T *accum) const
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE T finalize(const T accum) const
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void reducePacket(const Packet &p, Packet *accum)
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE MeanReducer()
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE T initialize() const
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE T finalizeBoth(const T saccum, const Packet &vaccum) const
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void reduce(bool t, bool *accum) const
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE bool initialize() const
array< T, NumDims > m_means
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE T finalize(const T accum) const
EIGEN_DEFAULT_DENSE_INDEX_TYPE DenseIndex
EIGEN_STRONG_INLINE Packet2cf pnegate(const Packet2cf &a)
EIGEN_DEVICE_FUNC Packet pdiv(const Packet &a, const Packet &b)
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE T finalizeBoth(const T saccum, const Packet &vaccum) const
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE T finalize(const T &accum) const
EIGEN_DEVICE_FUNC unpacket_traits< Packet >::type predux_mul(const Packet &a)
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE T bottom_value()
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void reducePacket(const Packet &p, Packet *accum) const
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE T bottom_value()
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Packet initializePacket() const
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void reduce(const T t, T *accum)
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE T finalize(const T accum) const
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void reduce(const T t, T *accum) const
EIGEN_DEVICE_FUNC Scalar operator()(const Scalar &a) const
EIGEN_DEVICE_FUNC const Scalar & b
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void reduce(const T t, T *accum) const
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void reducePacket(const Packet &p, Packet *accum) const
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE T finalizeBoth(const T saccum, const Packet &vaccum) const
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE bool finalize(bool accum) const
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void reducePacket(const Packet &p, Packet *accum) const
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE T finalize(const T accum) const
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void reduce(const T t, T *accum) const
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Packet finalizePacket(const Packet &vaccum) const