10#ifndef EIGEN_NULLARY_FUNCTORS_H
11#define EIGEN_NULLARY_FUNCTORS_H
17template<
typename Scalar>
22 template<
typename PacketType>
26template<
typename Scalar>
33 template<
typename IndexType>
36template<
typename Scalar>
42template <
typename Scalar>
48 m_low(low), m_high(high), m_size1(num_steps==1 ? 1 : num_steps-1), m_step(num_steps==1 ? Scalar() : Scalar((high-low)/
RealScalar(num_steps-1))),
49 m_flip(numext::
abs(high)<numext::
abs(low))
52 template<
typename IndexType>
55 return (i==0)? m_low : Scalar(m_high -
RealScalar(m_size1-i)*m_step);
57 return (i==m_size1)? m_high : Scalar(m_low +
RealScalar(i)*m_step);
60 template<
typename Packet,
typename IndexType>
67 Packet
pi = plset<Packet>(Scalar(i-m_size1));
68 Packet res =
padd(pset1<Packet>(m_high),
pmul(pset1<Packet>(m_step),
pi));
70 Packet mask =
pcmp_lt(pset1<Packet>(0), plset<Packet>(0));
71 return pselect<Packet>(mask, res, pset1<Packet>(m_low));
75 Packet
pi = plset<Packet>(Scalar(i));
76 Packet res =
padd(pset1<Packet>(m_low),
pmul(pset1<Packet>(m_step),
pi));
79 return pselect<Packet>(mask, res, pset1<Packet>(m_high));
90template <
typename Scalar>
95 m_multiplier((high-low)/
convert_index<Scalar>(num_steps<=1 ? 1 : num_steps-1)),
96 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))),
97 m_use_divisor(num_steps>1 && (numext::
abs(high-low)+1)<num_steps)
100 template<
typename IndexType>
104 if(m_use_divisor)
return m_low + convert_index<Scalar>(i)/m_divisor;
105 else return m_low + convert_index<Scalar>(i)*m_multiplier;
133 :
impl((num_steps==1 ? high : low),high,num_steps)
136 template<
typename IndexType>
139 template<
typename Packet,
typename IndexType>
155#if !( (EIGEN_COMP_MSVC>1600) || (EIGEN_GNUC_AT_LEAST(4,8)) || (EIGEN_COMP_ICC>=1600))
156template<
typename Scalar,
typename IndexType>
158template<
typename Scalar,
typename IndexType>
160template<
typename Scalar,
typename IndexType>
163template<
typename Scalar,
typename IndexType>
165template<
typename Scalar,
typename IndexType>
167template<
typename Scalar,
typename IndexType>
170template<
typename Scalar,
typename IndexType>
172template<
typename Scalar,
typename IndexType>
174template<
typename Scalar,
typename IndexType>
177template<
typename Scalar,
typename IndexType>
179template<
typename Scalar,
typename IndexType>
181template<
typename Scalar,
typename IndexType>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ColXpr col(Index i)
This is the const version of col().
Definition: BlockMethods.h:1097
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE RowXpr row(Index i)
This is the const version of row(). */.
Definition: BlockMethods.h:1118
internal::enable_if< internal::valid_indexed_view_overload< RowIndices, ColIndices >::value &&internal::traits< typenameEIGEN_INDEXED_VIEW_METHOD_TYPE< RowIndices, ColIndices >::type >::ReturnAsIndexedView, typenameEIGEN_INDEXED_VIEW_METHOD_TYPE< RowIndices, ColIndices >::type >::type operator()(const RowIndices &rowIndices, const ColIndices &colIndices) EIGEN_INDEXED_VIEW_METHOD_CONST
Definition: IndexedViewMethods.h:73
#define EIGEN_PREDICT_TRUE(x)
Definition: Macros.h:1332
#define EIGEN_DEVICE_FUNC
Definition: Macros.h:986
#define EIGEN_STRONG_INLINE
Definition: Macros.h:927
#define EIGEN_EMPTY_STRUCT_CTOR(X)
Definition: XprHelper.h:22
UnitType abs(const UnitType x) noexcept
Compute absolute value.
Definition: math.h:721
EIGEN_DEVICE_FUNC Packet padd(const Packet &a, const Packet &b)
Definition: GenericPacketMath.h:215
EIGEN_DEVICE_FUNC IndexDest convert_index(const IndexSrc &idx)
Definition: XprHelper.h:31
EIGEN_STRONG_INLINE Packet8f pcmp_lt(const Packet8f &a, const Packet8f &b)
Definition: PacketMath.h:346
EIGEN_DEVICE_FUNC Packet pmul(const Packet &a, const Packet &b)
Definition: GenericPacketMath.h:237
Namespace containing all symbols from the Eigen library.
Definition: Core:141
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:74
Definition: Eigen_Colamd.h:50
static constexpr const unit_t< PI > pi(1)
Ratio of a circle's circumference to its diameter.
Holds information about the various numeric (i.e.
Definition: NumTraits.h:233
Definition: NullaryFunctors.h:151
@ ret
Definition: NullaryFunctors.h:151
Definition: XprHelper.h:176
@ PacketAccess
Definition: XprHelper.h:180
@ Cost
Definition: XprHelper.h:179
@ IsRepeatable
Definition: XprHelper.h:181
NumTraits< Scalar >::Real RealScalar
Definition: NullaryFunctors.h:45
const Scalar m_step
Definition: NullaryFunctors.h:86
const Scalar m_low
Definition: NullaryFunctors.h:83
EIGEN_DEVICE_FUNC linspaced_op_impl(const Scalar &low, const Scalar &high, Index num_steps)
Definition: NullaryFunctors.h:47
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Packet packetOp(IndexType i) const
Definition: NullaryFunctors.h:61
const bool m_flip
Definition: NullaryFunctors.h:87
const Index m_size1
Definition: NullaryFunctors.h:85
const Scalar m_high
Definition: NullaryFunctors.h:84
const Scalar m_multiplier
Definition: NullaryFunctors.h:109
const Scalar m_divisor
Definition: NullaryFunctors.h:110
EIGEN_DEVICE_FUNC linspaced_op_impl(const Scalar &low, const Scalar &high, Index num_steps)
Definition: NullaryFunctors.h:93
const bool m_use_divisor
Definition: NullaryFunctors.h:111
const Scalar m_low
Definition: NullaryFunctors.h:108
Definition: NullaryFunctors.h:40
Definition: NullaryFunctors.h:131
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Packet packetOp(IndexType i) const
Definition: NullaryFunctors.h:140
EIGEN_DEVICE_FUNC linspaced_op(const Scalar &low, const Scalar &high, Index num_steps)
Definition: NullaryFunctors.h:132
const linspaced_op_impl< Scalar, NumTraits< Scalar >::IsInteger > impl
Definition: NullaryFunctors.h:144
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar operator()(IndexType i) const
Definition: NullaryFunctors.h:137
Definition: GenericPacketMath.h:107
Definition: NullaryFunctors.h:18
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar operator()() const
Definition: NullaryFunctors.h:21
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const PacketType packetOp() const
Definition: NullaryFunctors.h:23
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE scalar_constant_op(const Scalar &other)
Definition: NullaryFunctors.h:20
const Scalar m_other
Definition: NullaryFunctors.h:24
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE scalar_constant_op(const scalar_constant_op &other)
Definition: NullaryFunctors.h:19
Definition: NullaryFunctors.h:31
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar operator()(IndexType row, IndexType col) const
Definition: NullaryFunctors.h:34
Definition: GenericPacketMath.h:133