10 #ifndef EIGEN_FUNCTORS_H 11 #define EIGEN_FUNCTORS_H 26 EIGEN_STRONG_INLINE const Scalar operator() (const Scalar& a, const Scalar& b)
const {
return a + b; }
27 template<
typename Packet>
30 template<
typename Packet>
34 template<
typename Scalar>
54 EIGEN_STRONG_INLINE const result_type operator() (const LhsScalar& a, const RhsScalar& b)
const {
return a * b; }
55 template<
typename Packet>
58 template<
typename Packet>
62 template<
typename LhsScalar,
typename RhsScalar>
87 template<
typename Packet>
91 template<
typename LhsScalar,
typename RhsScalar>
106 EIGEN_STRONG_INLINE const Scalar operator() (const Scalar& a, const Scalar& b)
const {
using std::min;
return (min)(a, b); }
107 template<
typename Packet>
110 template<
typename Packet>
114 template<
typename Scalar>
129 EIGEN_STRONG_INLINE const Scalar operator() (const Scalar& a, const Scalar& b)
const {
using std::max;
return (max)(a, b); }
130 template<
typename Packet>
133 template<
typename Packet>
137 template<
typename Scalar>
158 Scalar p = (max)(_x, _y);
159 Scalar q = (min)(_x, _y);
161 return p *
sqrt(Scalar(1) + qp*qp);
164 template<
typename Scalar>
174 inline Scalar operator() (const Scalar& a, const OtherScalar& b)
const {
return numext::pow(a, b); }
176 template<
typename Scalar,
typename OtherScalar>
191 template<
typename Packet>
195 template<
typename Scalar>
215 EIGEN_STRONG_INLINE const result_type operator() (const LhsScalar& a, const RhsScalar& b)
const {
return a / b; }
216 template<
typename Packet>
220 template<
typename LhsScalar,
typename RhsScalar>
272 template<
typename Packet>
276 template<
typename Scalar>
292 template<
typename Packet>
296 template<
typename Scalar>
314 template<
typename Packet>
318 template<
typename Scalar>
330 template<
typename Packet>
333 template<
typename Scalar>
347 template<
typename Scalar,
typename NewType>
353 template<
typename Scalar,
typename NewType>
362 template<
typename Scalar>
368 template<
typename Scalar>
370 {
enum { Cost = 0, PacketAccess =
false }; };
377 template<
typename Scalar>
383 template<
typename Scalar>
385 {
enum { Cost = 0, PacketAccess =
false }; };
392 template<
typename Scalar>
398 template<
typename Scalar>
400 {
enum { Cost = 0, PacketAccess =
false }; };
407 template<
typename Scalar>
413 template<
typename Scalar>
415 {
enum { Cost = 0, PacketAccess =
false }; };
429 template<
typename Scalar>
445 template<
typename Scalar>
462 template<
typename Scalar>
473 template<
typename Scalar>
477 template<
typename Scalar1,
typename Scalar2>
485 template<
typename Scalar1,
typename Scalar2>
497 template<
typename Scalar>
508 template<
typename Scalar>
514 template<
typename Scalar>
519 template<
typename Index>
521 template<
typename Index>
525 template<
typename Scalar>
532 template<
typename Index>
535 template<
typename Scalar>
549 template <
typename Scalar>
555 m_low(low), m_step(step),
559 template<
typename Index>
562 m_base =
padd(m_base, pset1<Packet>(m_step));
563 return m_low+Scalar(i)*m_step;
566 template<
typename Index>
578 template <
typename Scalar>
584 m_low(low), m_step(step),
585 m_lowPacket(
pset1<Packet>(m_low)), m_stepPacket(
pset1<Packet>(m_step)), m_interPacket(
plset<Scalar>(0)) {}
587 template<
typename Index>
590 template<
typename Index>
606 template <
typename Scalar,
bool RandomAccess = true>
struct linspaced_op;
609 template <
typename Scalar,
bool RandomAccess>
struct linspaced_op 612 linspaced_op(
const Scalar& low,
const Scalar& high,
DenseIndex num_steps) : impl((num_steps==1 ? high : low), (num_steps==1 ? Scalar() : (high-low)/(num_steps-1))) {}
614 template<
typename Index>
619 template<
typename Index>
623 return impl(col + row);
626 template<
typename Index>
631 template<
typename Index>
635 return impl.packetOp(col + row);
666 template<
typename Scalar>
672 inline Scalar
operator() (
const Scalar& a)
const {
return a + m_other; }
673 inline const Packet
packetOp(
const Packet& a)
const 677 template<
typename Scalar>
691 template<
typename Scalar>
709 template<
typename Scalar>
728 template<
typename Scalar>
748 template<
typename Scalar>
767 template<
typename Scalar>
786 template<
typename Scalar>
799 template<
typename Scalar>
807 template<
typename Scalar>
815 template<
typename Scalar>
818 inline Scalar
operator() (
const Scalar& a)
const {
return m_other / a; }
819 template<
typename Packet>
820 inline const Packet
packetOp(
const Packet& a)
const 829 template<
typename Scalar>
832 inline Scalar operator() (const Scalar& a)
const {
return Scalar(1)/a; }
833 template<
typename Packet>
834 inline const Packet
packetOp(
const Packet& a)
const 837 template<
typename Scalar>
845 template<
typename Scalar>
848 inline Scalar operator() (const Scalar& a)
const {
return a*a; }
849 template<
typename Packet>
850 inline const Packet
packetOp(
const Packet& a)
const 853 template<
typename Scalar>
861 template<
typename Scalar>
864 inline Scalar operator() (const Scalar& a)
const {
return a*a*a; }
865 template<
typename Packet>
866 inline const Packet
packetOp(
const Packet& a)
const 869 template<
typename Scalar>
897 {
enum { Cost = 1, PacketAccess =
false }; };
901 {
enum { Cost = 1, PacketAccess =
false }; };
905 {
enum { Cost = 1, PacketAccess =
false }; };
909 {
enum { Cost = 1, PacketAccess =
false }; };
913 {
enum { Cost = 1, PacketAccess =
false }; };
917 {
enum { Cost = 1, PacketAccess =
false }; };
921 {
enum { Cost = 1, PacketAccess =
false }; };
925 {
enum { Cost = 1, PacketAccess =
false }; };
929 {
enum { Cost = 1, PacketAccess =
false }; };
947 #ifdef EIGEN_STDEXT_SUPPORT 949 template<
typename T0,
typename T1>
951 {
enum { Cost = 0, PacketAccess =
false }; };
953 template<
typename T0,
typename T1>
955 {
enum { Cost = 0, PacketAccess =
false }; };
957 template<
typename T0,
typename T1>
959 {
enum { Cost = 0, PacketAccess =
false }; };
961 template<
typename T0,
typename T1>
963 {
enum { Cost = 0, PacketAccess =
false }; };
965 template<
typename T0,
typename T1>
969 template<
typename T0,
typename T1,
typename T2>
973 #endif // EIGEN_STDEXT_SUPPORT 977 #ifdef EIGEN_FUNCTORS_PLUGIN 978 #include EIGEN_FUNCTORS_PLUGIN 985 #endif // EIGEN_FUNCTORS_H Packet packetOp(const Packet &a) const
const Packet packetOp(const Packet &a) const
EIGEN_STRONG_INLINE scalar_quotient1_op(const scalar_quotient1_op &other)
packet_traits< Scalar >::type Packet
EIGEN_STRONG_INLINE const Packet packetOp(const Packet &a, const Packet &b) const
internal::add_const_on_value_type< EIGEN_MATHFUNC_RETVAL(imag_ref, Scalar) >::type imag_ref(const Scalar &x)
USING_NAMESPACE_ACADO IntermediateState sin(const Expression &arg)
const AutoDiffScalar< DerType > & conj(const AutoDiffScalar< DerType > &x)
unpacket_traits< Packet >::type predux_min(const Packet &a)
#define EIGEN_EMPTY_STRUCT_CTOR(X)
linspaced_op(const Scalar &low, const Scalar &high, DenseIndex num_steps)
EIGEN_STRONG_INLINE const Packet packetOp(const Packet &a) const
IntermediateState sqrt(const Expression &arg)
unpacket_traits< Packet >::type predux_mul(const Packet &a)
#define EIGEN_STRONG_INLINE
EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet pasin(const Packet &a)
const Packet m_stepPacket
Packet packetOp(const Packet &a) const
packet_traits< Scalar >::type Packet
EIGEN_STRONG_INLINE const Packet packetOp(const Packet &a, const Packet &b) const
EIGEN_STRONG_INLINE const Scalar predux(const Packet &a) const
EIGEN_STRONG_INLINE const Packet packetOp(const Packet &a) const
linspaced_op_impl(const Scalar &low, const Scalar &step)
scalar_pow_op(const scalar_pow_op &other)
NumTraits< Scalar >::Real result_type
const linspaced_op_impl< Scalar, RandomAccess > impl
NumTraits< Scalar >::Real result_type
iterative scaling algorithm to equilibrate rows and column norms in matrices
IntermediateState asin(const Expression &arg)
IntermediateState pow(const Expression &arg1, const Expression &arg2)
NumTraits< Scalar >::Real result_type
Packet packetOp(const Packet &a) const
EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet psqrt(const Packet &a)
Holds information about the various numeric (i.e. scalar) types allowed by Eigen. ...
IntermediateState tan(const Expression &arg)
EIGEN_STRONG_INLINE const Packet packetOp(const Packet &a, const Packet &b) const
const Packet m_interPacket
EIGEN_STRONG_INLINE const Packet packetOp(const Packet &a) const
EIGEN_STRONG_INLINE const CwiseUnaryOp< internal::scalar_abs2_op< Scalar >, const Derived > abs2() const
const ImagReturnType imag() const
packet_traits< Scalar >::type Packet
EIGEN_STRONG_INLINE scalar_quotient1_op(const Scalar &other)
Packet packetOp(const Packet &a) const
linspaced_op_impl(const Scalar &low, const Scalar &step)
scalar_product_traits< LhsScalar, RhsScalar >::ReturnType result_type
const Packet packetOp(const Packet &a) const
Packet pmax(const Packet &a, const Packet &b)
IntermediateState cos(const Expression &arg)
const Packet packetOp(const Packet &a) const
EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet pexp(const Packet &a)
EIGEN_STRONG_INLINE const CwiseUnaryOp< internal::scalar_abs_op< Scalar >, const Derived > abs() const
RealReturnType real() const
EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet ptan(const Packet &a)
packet_traits< Scalar >::type Packet
const Packet packetOp(const Packet &a) const
EIGEN_STRONG_INLINE const Packet packetOp(const Packet &a, const Packet &b) const
EIGEN_STRONG_INLINE const result_type predux(const Packet &a) const
EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet pacos(const Packet &a)
Packet psub(const Packet &a, const Packet &b)
IntermediateState acos(const Expression &arg)
Packet pmin(const Packet &a, const Packet &b)
Packet packetOp(const Packet &a) const
const Packet m_packetStep
unpacket_traits< Packet >::type predux(const Packet &a)
add_const_on_value_type< typename NumTraits< Scalar >::Nested >::type m_other
const Packet packetOp(const Packet &a) const
packet_traits< Scalar >::type Packet
scalar_product_traits< LhsScalar, RhsScalar >::ReturnType result_type
packet_traits< Scalar >::type Packet
EIGEN_STRONG_INLINE Packet2cf pconj(const Packet2cf &a)
EIGEN_STRONG_INLINE const Packet packetOp(const Packet &a) const
EIGEN_STRONG_INLINE const Scalar predux(const Packet &a) const
EIGEN_STRONG_INLINE const Packet packetOp(Index, Index=0) const
EIGEN_STRONG_INLINE const Packet packetOp(const Packet &a) const
packet_traits< Scalar >::type Packet
EIGEN_STRONG_INLINE scalar_multiple_op(const Scalar &other)
EIGEN_DEFAULT_DENSE_INDEX_TYPE DenseIndex
Packet pdiv(const Packet &a, const Packet &b)
unpacket_traits< Packet >::type predux_max(const Packet &a)
add_const_on_value_type< typename NumTraits< Scalar2 >::Nested >::type m_other
scalar_add_op(const Scalar &other)
EIGEN_STRONG_INLINE Packet2cf pnegate(const Packet2cf &a)
EIGEN_STRONG_INLINE const Packet packetOp(Index i) const
EIGEN_STRONG_INLINE scalar_constant_op(const Scalar &other)
EIGEN_STRONG_INLINE const Packet packetOp(Index row, Index col) const
scalar_pow_op(const Scalar &exponent)
packet_traits< Scalar >::type Packet
packet_traits< Scalar >::type Packet
EIGEN_STRONG_INLINE const Packet packetOp(const Packet &a, const Packet &b) const
EIGEN_STRONG_INLINE scalar_multiple_op(const scalar_multiple_op &other)
scalar_product_traits< LhsScalar, RhsScalar >::ReturnType result_type
EIGEN_STRONG_INLINE scalar_multiple2_op(const Scalar2 &other)
EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet plog(const Packet &a)
packet_traits< Scalar >::type Packet
Packet pset1(const typename unpacket_traits< Packet >::type &a)
Packet pmul(const Packet &a, const Packet &b)
packet_traits< Scalar >::type Packet
packet_traits< Scalar >::type Packet
EIGEN_STRONG_INLINE const Packet packetOp(const Packet &a, const Packet &b) const
NumTraits< Scalar >::Real result_type
EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet pcos(const Packet &a)
IntermediateState exp(const Expression &arg)
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 psin(const Packet &a)
add_const_on_value_type< typename NumTraits< Scalar >::Nested >::type m_other
Packet packetOp(const Packet &a) const
EIGEN_STRONG_INLINE const Packet packetOp(const Packet &a) const
EIGEN_STRONG_INLINE const Packet packetOp(const Packet &a, const Packet &b) const
scalar_inverse_mult_op(const Scalar &other)
EIGEN_STRONG_INLINE const Packet packetOp(Index i) const
Packet packetOp(const Packet &a) const
EIGEN_STRONG_INLINE const Scalar operator()(const Scalar &a, const Scalar &b) const
NumTraits< Scalar >::Real result_type
packet_traits< Scalar >::type Packet
packet_traits< Scalar >::type Packet
EIGEN_STRONG_INLINE scalar_constant_op(const scalar_constant_op &other)
EIGEN_STRONG_INLINE const Scalar predux(const Packet &a) const
EIGEN_STRONG_INLINE scalar_multiple2_op(const scalar_multiple2_op &other)
scalar_add_op(const scalar_add_op &other)
Packet padd(const Packet &a, const Packet &b)
packet_traits< Scalar >::type plset(const Scalar &a)
EIGEN_STRONG_INLINE const Packet packetOp(Index) const
Packet packetOp(const Packet &a) const
packet_traits< Scalar >::type Packet
EIGEN_STRONG_INLINE Packet4f pabs(const Packet4f &a)
IntermediateState log(const Expression &arg)
scalar_product_traits< Scalar1, Scalar2 >::ReturnType result_type
NumTraits< Scalar >::Real result_type