10 #ifndef EIGEN_BINARY_FUNCTORS_H 11 #define EIGEN_BINARY_FUNCTORS_H 19 template<
typename Arg1,
typename Arg2>
31 template<
typename LhsScalar,
typename RhsScalar>
35 #ifndef EIGEN_SCALAR_BINARY_OP_PLUGIN 39 EIGEN_SCALAR_BINARY_OP_PLUGIN
42 EIGEN_DEVICE_FUNC
EIGEN_STRONG_INLINE const result_type operator() (
const LhsScalar& a,
const RhsScalar&
b)
const {
return a +
b; }
43 template<
typename Packet>
46 template<
typename Packet>
50 template<
typename LhsScalar,
typename RhsScalar>
75 template<
typename LhsScalar,
typename RhsScalar>
79 #ifndef EIGEN_SCALAR_BINARY_OP_PLUGIN 83 EIGEN_SCALAR_BINARY_OP_PLUGIN
86 EIGEN_DEVICE_FUNC
EIGEN_STRONG_INLINE const result_type operator() (
const LhsScalar& a,
const RhsScalar&
b)
const {
return a *
b; }
87 template<
typename Packet>
90 template<
typename Packet>
94 template<
typename LhsScalar,
typename RhsScalar>
108 template<
typename LhsScalar,
typename RhsScalar>
119 EIGEN_DEVICE_FUNC
EIGEN_STRONG_INLINE const result_type operator() (const LhsScalar& a, const RhsScalar&
b)
const 122 template<
typename Packet>
126 template<
typename LhsScalar,
typename RhsScalar>
139 template<
typename LhsScalar,
typename RhsScalar>
144 EIGEN_DEVICE_FUNC
EIGEN_STRONG_INLINE const result_type operator() (const LhsScalar& a, const RhsScalar&
b)
const {
return numext::mini(a, b); }
145 template<
typename Packet>
148 template<
typename Packet>
152 template<
typename LhsScalar,
typename RhsScalar>
165 template<
typename LhsScalar,
typename RhsScalar>
170 EIGEN_DEVICE_FUNC
EIGEN_STRONG_INLINE const result_type operator() (const LhsScalar& a, const RhsScalar&
b)
const {
return numext::maxi(a, b); }
171 template<
typename Packet>
174 template<
typename Packet>
178 template<
typename LhsScalar,
typename RhsScalar>
190 template<
typename LhsScalar,
typename RhsScalar, ComparisonName cmp>
struct scalar_cmp_op;
192 template<
typename LhsScalar,
typename RhsScalar, ComparisonName cmp>
200 template<ComparisonName Cmp,
typename LhsScalar,
typename RhsScalar>
206 template<
typename LhsScalar,
typename RhsScalar>
213 template<
typename LhsScalar,
typename RhsScalar>
220 template<
typename LhsScalar,
typename RhsScalar>
227 template<
typename LhsScalar,
typename RhsScalar>
234 template<
typename LhsScalar,
typename RhsScalar>
241 template<
typename LhsScalar,
typename RhsScalar>
246 EIGEN_DEVICE_FUNC
EIGEN_STRONG_INLINE bool operator()(const LhsScalar& a, const RhsScalar&
b)
const {
return !(a<=b || b<=a);}
248 template<
typename LhsScalar,
typename RhsScalar>
262 template<
typename Scalar>
269 EIGEN_USING_STD_MATH(
sqrt)
281 return p *
sqrt(Scalar(1) + qp*qp);
284 template<
typename Scalar>
298 template<
typename Scalar,
typename Exponent>
302 #ifndef EIGEN_SCALAR_BINARY_OP_PLUGIN 306 typedef Scalar LhsScalar;
307 typedef Exponent RhsScalar;
308 EIGEN_SCALAR_BINARY_OP_PLUGIN
312 inline result_type operator() (
const Scalar& a,
const Exponent&
b)
const {
return numext::pow(a, b); }
314 template<
typename Scalar,
typename Exponent>
328 template<
typename LhsScalar,
typename RhsScalar>
332 #ifndef EIGEN_SCALAR_BINARY_OP_PLUGIN 336 EIGEN_SCALAR_BINARY_OP_PLUGIN
339 EIGEN_DEVICE_FUNC
EIGEN_STRONG_INLINE const result_type operator() (
const LhsScalar& a,
const RhsScalar&
b)
const {
return a -
b; }
340 template<
typename Packet>
344 template<
typename LhsScalar,
typename RhsScalar>
357 template<
typename LhsScalar,
typename RhsScalar>
361 #ifndef EIGEN_SCALAR_BINARY_OP_PLUGIN 365 EIGEN_SCALAR_BINARY_OP_PLUGIN
368 EIGEN_DEVICE_FUNC
EIGEN_STRONG_INLINE const result_type operator() (
const LhsScalar& a,
const RhsScalar&
b)
const {
return a /
b; }
369 template<
typename Packet>
373 template<
typename LhsScalar,
typename RhsScalar>
448 EIGEN_DEVICE_FUNC
EIGEN_STRONG_INLINE const result_type operator() (
const second_argument_type&
b)
const {
return BinaryOp::operator()(m_value,b); }
450 template<
typename Packet>
452 {
return BinaryOp::packetOp(internal::pset1<Packet>(m_value), b); }
465 bind2nd_op(
const second_argument_type &val) : m_value(val) {}
467 EIGEN_DEVICE_FUNC
EIGEN_STRONG_INLINE const result_type operator() (
const first_argument_type& a)
const {
return BinaryOp::operator()(a,m_value); }
469 template<
typename Packet>
471 {
return BinaryOp::packetOp(a,internal::pset1<Packet>(m_value)); }
482 #endif // EIGEN_BINARY_FUNCTORS_H
ScalarBinaryOpTraits< LhsScalar, RhsScalar, scalar_sum_op >::ReturnType result_type
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const result_type predux(const Packet &a) const
BinaryOp::result_type result_type
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC half pow(const half &a, const half &b)
#define EIGEN_STRONG_INLINE
#define EIGEN_EMPTY_STRUCT_CTOR(X)
ScalarBinaryOpTraits< LhsScalar, RhsScalar, scalar_min_op >::ReturnType result_type
BinaryOp::first_argument_type first_argument_type
BinaryOp::first_argument_type first_argument_type
scalar_quotient_op< LhsScalar, RhsScalar >::result_type result_type
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Packet packetOp(const Packet &a, const Packet &b) const
ScalarBinaryOpTraits< LhsScalar, RhsScalar, scalar_max_op >::ReturnType result_type
EIGEN_DEVICE_FUNC unpacket_traits< Packet >::type predux_min(const Packet &a)
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Packet packetOp(const Packet &a, const Packet &b) const
BinaryOp::second_argument_type second_argument_type
EIGEN_DEVICE_FUNC unpacket_traits< Packet >::type predux_max(const Packet &a)
EIGEN_DEVICE_FUNC const SqrtReturnType sqrt() const
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Packet packetOp(const Packet &a, const Packet &b) const
Holds information about the various numeric (i.e. scalar) types allowed by Eigen. ...
EIGEN_DEVICE_FUNC unpacket_traits< Packet >::type predux(const Packet &a)
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Packet packetOp(const Packet &b) const
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Packet packetOp(const Packet &a, const Packet &b) const
ScalarBinaryOpTraits< Scalar, Exponent, scalar_pow_op >::ReturnType result_type
BinaryOp::result_type result_type
BinaryOp::second_argument_type second_argument_type
EIGEN_DEVICE_FUNC Packet padd(const Packet &a, const Packet &b)
EIGEN_DEVICE_FUNC Packet pmin(const Packet &a, const Packet &b)
ScalarBinaryOpTraits< LhsScalar, RhsScalar, scalar_product_op >::ReturnType result_type
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const result_type predux(const Packet &a) const
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Packet packetOp(const Packet &a, const Packet &b) const
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Packet packetOp(const Packet &a, const Packet &b) const
first_argument_type m_value
ScalarBinaryOpTraits< LhsScalar, RhsScalar, scalar_quotient_op >::ReturnType result_type
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const result_type predux(const Packet &a) const
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const result_type predux(const Packet &a) const
EIGEN_DEPRECATED scalar_sum_op()
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Packet packetOp(const Packet &a, const Packet &b) const
EIGEN_DEVICE_FUNC Packet pdiv(const Packet &a, const Packet &b)
bind1st_op(const first_argument_type &val)
second_argument_type m_value
ScalarBinaryOpTraits< LhsScalar, RhsScalar, scalar_conj_product_op >::ReturnType result_type
EIGEN_DEVICE_FUNC unpacket_traits< Packet >::type predux_mul(const Packet &a)
EIGEN_DEVICE_FUNC Packet psub(const Packet &a, const Packet &b)
Determines whether the given binary operation of two numeric types is allowed and what the scalar ret...
Arg2 second_argument_type
bind2nd_op(const second_argument_type &val)
ScalarBinaryOpTraits< LhsScalar, RhsScalar, scalar_difference_op >::ReturnType result_type
EIGEN_DEVICE_FUNC const Scalar & b
EIGEN_DEVICE_FUNC Packet pmul(const Packet &a, const Packet &b)
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Packet packetOp(const Packet &a) const
EIGEN_DEVICE_FUNC Packet pmax(const Packet &a, const Packet &b)