10 #ifndef EIGEN_NULLARY_FUNCTORS_H 11 #define EIGEN_NULLARY_FUNCTORS_H 17 template<
typename Scalar>
22 template<
typename PacketType>
26 template<
typename Scalar>
33 template<
typename IndexType>
36 template<
typename Scalar>
42 template <
typename Scalar,
typename Packet>
46 m_low(low), m_high(high), m_size1(num_steps==1 ? 1 : num_steps-1), m_step(num_steps==1 ?
Scalar() : (high-low)/
Scalar(num_steps-1)),
47 m_flip(numext::
abs(high)<numext::
abs(low))
50 template<
typename IndexType>
54 return (i==0)? m_low : (m_high -
RealScalar(m_size1-i)*m_step);
56 return (i==m_size1)? m_high : (m_low +
RealScalar(i)*m_step);
59 template<
typename IndexType>
89 template <
typename Scalar,
typename Packet>
95 m_divisor(
convert_index<
Scalar>((high>=low?num_steps:-num_steps)+(high-low))/((numext::
abs(high-low)+1)==0?1:(numext::
abs(high-low)+1))),
96 m_use_divisor(num_steps>1 && (numext::
abs(high-low)+1)<num_steps)
99 template<
typename IndexType>
103 if(m_use_divisor)
return m_low + convert_index<Scalar>(
i)/m_divisor;
104 else return m_low + convert_index<Scalar>(
i)*m_multiplier;
129 template <
typename Scalar,
typename PacketType>
struct linspaced_op 132 : impl((num_steps==1 ? high : low),high,num_steps)
135 template<
typename IndexType>
138 template<
typename Packet,
typename IndexType>
154 #if !( (EIGEN_COMP_MSVC>1600) || (EIGEN_GNUC_AT_LEAST(4,8)) || (EIGEN_COMP_ICC>=1600)) 155 template<
typename Scalar,
typename IndexType>
157 template<
typename Scalar,
typename IndexType>
159 template<
typename Scalar,
typename IndexType>
162 template<
typename Scalar,
typename IndexType>
164 template<
typename Scalar,
typename IndexType>
166 template<
typename Scalar,
typename IndexType>
169 template<
typename Scalar,
typename PacketType,
typename IndexType>
171 template<
typename Scalar,
typename PacketType,
typename IndexType>
173 template<
typename Scalar,
typename PacketType,
typename IndexType>
176 template<
typename Scalar,
typename IndexType>
178 template<
typename Scalar,
typename IndexType>
180 template<
typename Scalar,
typename IndexType>
188 #endif // EIGEN_NULLARY_FUNCTORS_H
linspaced_op_impl(const Scalar &low, const Scalar &high, Index num_steps)
#define EIGEN_STRONG_INLINE
#define EIGEN_EMPTY_STRUCT_CTOR(X)
linspaced_op(const Scalar &low, const Scalar &high, Index num_steps)
EIGEN_STRONG_INLINE Packet4cf pinsertfirst(const Packet4cf &a, std::complex< float > b)
const Scalar m_multiplier
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Packet packetOp(IndexType i) const
Namespace containing all symbols from the Eigen library.
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Packet packetOp(IndexType i) const
Holds information about the various numeric (i.e. scalar) types allowed by Eigen. ...
EIGEN_DEVICE_FUNC IndexDest convert_index(const IndexSrc &idx)
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const PacketType packetOp() const
EIGEN_DEVICE_FUNC Packet padd(const Packet &a, const Packet &b)
cout<< "Here is the matrix m:"<< endl<< m<< endl;Matrix< ptrdiff_t, 3, 1 > res
linspaced_op_impl(const Scalar &low, const Scalar &high, Index num_steps)
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
NumTraits< Scalar >::Real RealScalar
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE scalar_constant_op(const Scalar &other)
const linspaced_op_impl< Scalar, PacketType, NumTraits< Scalar >::IsInteger > impl
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar operator()() const
EIGEN_STRONG_INLINE Packet4cf pinsertlast(const Packet4cf &a, std::complex< float > b)
EIGEN_DEVICE_FUNC Packet pmul(const Packet &a, const Packet &b)
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE scalar_constant_op(const scalar_constant_op &other)