10 #ifndef EIGEN_UNARY_FUNCTORS_H 11 #define EIGEN_UNARY_FUNCTORS_H 25 template<
typename Packet>
29 template<
typename Scalar>
45 template<
typename Packet>
49 template<
typename Scalar>
67 template<
typename Scalar>
75 template<typename Score>
82 template<typename Scal>
83 EIGEN_DEVICE_FUNC
EIGEN_STRONG_INLINE const result_type operator() (const Scal&, const result_type&
a)
const {
return a; }
96 template<
typename Packet>
100 template<
typename Scalar>
113 template<
typename Packet>
116 template<
typename Scalar>
134 template<
typename Packet>
138 template<
typename Scalar>
151 template<
typename Scalar,
typename NewType>
155 EIGEN_DEVICE_FUNC
EIGEN_STRONG_INLINE const NewType operator() (const Scalar&
a)
const {
return cast<Scalar, NewType>(
a); }
157 template<
typename Scalar,
typename NewType>
166 template<
typename Scalar>
173 template<
typename Scalar>
175 {
enum { Cost = 0, PacketAccess =
false }; };
182 template<
typename Scalar>
189 template<
typename Scalar>
191 {
enum { Cost = 0, PacketAccess =
false }; };
198 template<
typename Scalar>
205 template<
typename Scalar>
207 {
enum { Cost = 0, PacketAccess =
false }; };
214 template<
typename Scalar>
221 template<
typename Scalar>
223 {
enum { Cost = 0, PacketAccess =
false }; };
233 EIGEN_DEVICE_FUNC inline const Scalar operator() (const Scalar&
a)
const {
return numext::exp(a); }
234 template <
typename Packet>
237 template <
typename Scalar>
242 #ifdef EIGEN_VECTORIZE_FMA 273 EIGEN_DEVICE_FUNC inline const Scalar operator() (const Scalar&
a)
const {
return numext::log(a); }
274 template <
typename Packet>
277 template <
typename Scalar>
284 #ifdef EIGEN_VECTORIZE_FMA 292 :
sizeof(
Scalar)==4 ? 40 : 85)
304 EIGEN_DEVICE_FUNC inline const Scalar operator() (const Scalar&
a)
const {
return numext::log1p(a); }
305 template <
typename Packet>
308 template <
typename Scalar>
324 EIGEN_DEVICE_FUNC inline const Scalar operator() (const Scalar&
a)
const { EIGEN_USING_STD_MATH(
log10)
return log10(a); }
325 template <
typename Packet>
328 template<
typename Scalar>
338 EIGEN_DEVICE_FUNC inline const Scalar operator() (const Scalar&
a)
const {
return numext::sqrt(a); }
339 template <
typename Packet>
342 template <
typename Scalar>
347 Cost = (
sizeof(
Scalar) == 8 ? 28
353 Cost = (
sizeof(Scalar) == 8 ? 28 : 14),
365 EIGEN_DEVICE_FUNC inline const Scalar operator() (const Scalar&
a)
const {
return Scalar(1)/
numext::sqrt(a); }
366 template <
typename Packet>
370 template<
typename Scalar>
384 EIGEN_DEVICE_FUNC inline Scalar operator() (const Scalar&
a)
const {
return numext::cos(a); }
385 template <
typename Packet>
388 template<
typename Scalar>
403 EIGEN_DEVICE_FUNC inline const Scalar operator() (const Scalar&
a)
const {
return numext::sin(a); }
404 template <
typename Packet>
407 template<
typename Scalar>
423 EIGEN_DEVICE_FUNC inline const Scalar operator() (const Scalar&
a)
const {
return numext::tan(a); }
424 template <
typename Packet>
427 template<
typename Scalar>
442 EIGEN_DEVICE_FUNC inline const Scalar operator() (const Scalar&
a)
const {
return numext::acos(a); }
443 template <
typename Packet>
446 template<
typename Scalar>
461 EIGEN_DEVICE_FUNC inline const Scalar operator() (const Scalar&
a)
const {
return numext::asin(a); }
462 template <
typename Packet>
465 template<
typename Scalar>
481 EIGEN_DEVICE_FUNC inline const Scalar operator() (const Scalar&
a)
const {
return numext::atan(a); }
482 template <
typename Packet>
485 template<
typename Scalar>
498 template <
typename Scalar>
501 EIGEN_DEVICE_FUNC inline const Scalar operator()(const Scalar&
a)
const {
return numext::tanh(a); }
502 template <
typename Packet>
506 template <
typename Scalar>
512 #ifdef EIGEN_VECTORIZE_FMA
537 EIGEN_DEVICE_FUNC inline const Scalar operator() (const Scalar&
a)
const {
return numext::sinh(a); }
538 template <
typename Packet>
541 template<
typename Scalar>
556 EIGEN_DEVICE_FUNC inline const Scalar operator() (const Scalar&
a)
const {
return numext::cosh(a); }
557 template <
typename Packet>
560 template<
typename Scalar>
573 template<
typename Scalar>
576 EIGEN_DEVICE_FUNC inline Scalar operator() (const Scalar&
a)
const {
return Scalar(1)/
a; }
577 template<
typename Packet>
581 template<
typename Scalar>
589 template<
typename Scalar>
592 EIGEN_DEVICE_FUNC inline Scalar operator() (const Scalar&
a)
const {
return a*
a; }
593 template<
typename Packet>
597 template<
typename Scalar>
605 template<
typename Scalar>
608 EIGEN_DEVICE_FUNC inline Scalar operator() (const Scalar&
a)
const {
return a*a*
a; }
609 template<
typename Packet>
613 template<
typename Scalar>
624 template <
typename Packet>
627 template<
typename Scalar>
643 template <
typename Packet>
646 template<
typename Scalar>
662 template <
typename Packet>
665 template<
typename Scalar>
683 template<
typename Scalar>
701 template<
typename Scalar>
719 template<
typename Scalar>
737 template<
typename Scalar>
750 template<
typename Scalar>
753 EIGEN_DEVICE_FUNC inline const Scalar operator() (const Scalar&
a)
const 761 template<
typename Scalar>
764 EIGEN_DEVICE_FUNC inline const Scalar operator() (const Scalar&
a)
const 768 if (aa==real_type(0))
770 aa = real_type(1)/aa;
777 template<
typename Scalar>
792 #endif // EIGEN_FUNCTORS_H EIGEN_DEVICE_FUNC Packet packetOp(const Packet &a) const
#define EIGEN_STRONG_INLINE
EIGEN_DEVICE_FUNC const Packet packetOp(const Packet &a) const
const AutoDiffScalar< DerType > & conj(const AutoDiffScalar< DerType > &x)
#define EIGEN_EMPTY_STRUCT_CTOR(X)
EIGEN_DEVICE_FUNC internal::add_const_on_value_type< EIGEN_MATHFUNC_RETVAL(real_ref, Scalar) >::type real_ref(const Scalar &x)
EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet pasin(const Packet &a)
EIGEN_DEVICE_FUNC bool() isfinite(const T &x)
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE T exp(const T &x)
EIGEN_DEVICE_FUNC Packet packetOp(const Packet &a) const
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Packet packetOp(const Packet &a) const
EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet patan(const Packet &a)
NumTraits< Scalar >::Real result_type
NumTraits< Scalar >::Real result_type
EIGEN_DEVICE_FUNC Packet packetOp(const Packet &a) const
NumTraits< Scalar >::Real result_type
Namespace containing all symbols from the Eigen library.
DerType::Scalar imag(const AutoDiffScalar< DerType > &)
NumTraits< Scalar >::Real result_type
EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet psqrt(const Packet &a)
Holds information about the various numeric (i.e. scalar) types allowed by Eigen. ...
EIGEN_DEVICE_FUNC Packet packetOp(const Packet &a) const
EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet ptanh(const Packet &a)
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE T cos(const T &x)
EIGEN_DEVICE_FUNC Packet packetOp(const Packet &a) const
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Packet packetOp(const Packet &a) const
EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet psinh(const Packet &a)
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE T atan(const T &x)
EIGEN_DEVICE_FUNC T() ceil(const T &x)
EIGEN_DEVICE_FUNC const Packet packetOp(const Packet &a) const
EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet pexp(const Packet &a)
EIGEN_DEVICE_FUNC const RoundReturnType round() const
EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet pceil(const Packet &a)
EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet ptan(const Packet &a)
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Packet packetOp(const Packet &a) const
EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet plog1p(const Packet &a)
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE internal::enable_if< NumTraits< T >::IsSigned||NumTraits< T >::IsComplex, typename NumTraits< T >::Real >::type abs(const T &x)
EIGEN_DEVICE_FUNC Packet packetOp(const Packet &a) const
NumTraits< Scalar >::Real result_type
EIGEN_DEVICE_FUNC const Log1pReturnType log1p() const
EIGEN_DEVICE_FUNC Packet parg(const Packet &a)
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE T tanh(const T &x)
EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet pacos(const Packet &a)
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE T tan(const T &x)
EIGEN_DEVICE_FUNC T() floor(const T &x)
EIGEN_DEVICE_FUNC internal::add_const_on_value_type< EIGEN_MATHFUNC_RETVAL(imag_ref, Scalar) >::type imag_ref(const Scalar &x)
EIGEN_DEVICE_FUNC bool() isnan(const T &x)
EIGEN_DEVICE_FUNC bool() isinf(const T &x)
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE T sin(const T &x)
EIGEN_STRONG_INLINE Packet2cf pconj(const Packet2cf &a)
EIGEN_DEVICE_FUNC Packet packetOp(const Packet &a) const
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar operator()(const Scalar &a) const
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Abs2ReturnType abs2() const
NumTraits< Scalar >::Real result_type
EIGEN_DEVICE_FUNC Packet packetOp(const Packet &a) const
EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet prsqrt(const Packet &a)
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Packet packetOp(const Packet &a) const
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const ArgReturnType arg() const
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE T asin(const T &x)
mp::number< mp::cpp_dec_float< 100 >, mp::et_on > Real
EIGEN_DEVICE_FUNC Packet packetOp(const Packet &a) const
EIGEN_DEVICE_FUNC Packet packetOp(const Packet &a) const
EIGEN_STRONG_INLINE Packet2cf pnegate(const Packet2cf &a)
EIGEN_DEVICE_FUNC Packet pdiv(const Packet &a, const Packet &b)
EIGEN_DEVICE_FUNC Packet packetOp(const Packet &a) const
EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet plog10(const Packet &a)
EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet pfloor(const Packet &a)
EIGEN_DEVICE_FUNC Packet packetOp(const Packet &x) const
EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet plog(const Packet &a)
EIGEN_DEVICE_FUNC Packet packetOp(const Packet &a) const
EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet pround(const Packet &a)
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Packet packetOp(const Packet &a) const
EIGEN_DEVICE_FUNC Packet packetOp(const Packet &a) const
EIGEN_DEVICE_FUNC const ImagReturnType imag() const
EIGEN_DEVICE_FUNC const Log10ReturnType log10() const
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE T cosh(const T &x)
EIGEN_DEVICE_FUNC Packet packetOp(const Packet &a) const
NumTraits< Scalar >::Real result_type
EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet pcos(const Packet &a)
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE T sinh(const T &x)
EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet psin(const Packet &a)
EIGEN_DEVICE_FUNC const Packet packetOp(const Packet &a) const
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE T acos(const T &x)
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE T log(const T &x)
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE float sqrt(const float &x)
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy x
const AutoDiffScalar< DerType > & real(const AutoDiffScalar< DerType > &x)
NumTraits< Scalar >::Real result_type
EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet pcosh(const Packet &a)
EIGEN_DEVICE_FUNC Packet pmul(const Packet &a, const Packet &b)
EIGEN_DEVICE_FUNC Packet packetOp(const Packet &a) const
ScalarWithExceptions conj(const ScalarWithExceptions &x)
EIGEN_DEVICE_FUNC Packet packetOp(const Packet &a) const
EIGEN_DEVICE_FUNC Packet packetOp(const Packet &a) const
EIGEN_STRONG_INLINE Packet4f pabs(const Packet4f &a)
NumTraits< Scalar >::Real result_type