10 #ifndef EIGEN_NULLARY_FUNCTORS_H
11 #define EIGEN_NULLARY_FUNCTORS_H
14 #include "../InternalHeaderCheck.h"
20 template <
typename Scalar>
24 template <
typename PacketType>
26 return internal::pset1<PacketType>(
m_other);
30 template <
typename Scalar>
39 template <
typename Scalar>
43 template <
typename PacketType>
45 return internal::pzero<PacketType>(
PacketType());
48 template <
typename Scalar>
51 template <
typename Scalar>
53 template <
typename IndexType>
58 template <
typename Scalar>
63 template <
typename Scalar,
bool IsInteger>
66 template <
typename Scalar>
73 m_size1(num_steps == 1 ? 1 : num_steps - 1),
75 m_flip(numext::
abs(high) < numext::
abs(low)) {}
77 template <
typename IndexType>
85 template <
typename Packet,
typename IndexType>
94 return pselect<Packet>(mask,
res, pset1<Packet>(m_low));
100 return pselect<Packet>(mask,
res, pset1<Packet>(m_high));
111 template <
typename Scalar>
117 ((numext::
abs(high - low) + 1) == 0 ? 1 : (numext::
abs(high - low) + 1))),
118 m_use_divisor(num_steps > 1 && (numext::
abs(high - low) + 1) < num_steps) {}
120 template <
typename IndexType>
123 return m_low + convert_index<Scalar>(
i) / m_divisor;
125 return m_low + convert_index<Scalar>(
i) * m_multiplier;
139 template <
typename Scalar>
141 template <
typename Scalar>
151 template <
typename Scalar>
154 :
impl((num_steps == 1 ? high : low), high, num_steps) {}
156 template <
typename IndexType>
161 template <
typename Packet,
typename IndexType>
163 return impl.template packetOp<Packet>(
i);
171 template <
typename Scalar>
176 template <
typename IndexType>
180 template <
typename Packet,
typename IndexType>
185 const Packet cst_offset =
pmadd(cst_lin0, cst_step, cst_start);
188 return pmadd(i_packet, cst_step, cst_offset);
194 template <
typename Scalar>
208 template <
typename Functor>
215 #if !(EIGEN_COMP_MSVC || EIGEN_COMP_GNUC || (EIGEN_COMP_ICC >= 1600))
216 template <
typename Scalar,
typename IndexType>
220 template <
typename Scalar,
typename IndexType>
224 template <
typename Scalar,
typename IndexType>
229 template <
typename Scalar,
typename IndexType>
233 template <
typename Scalar,
typename IndexType>
237 template <
typename Scalar,
typename IndexType>
242 template <
typename Scalar,
typename IndexType>
246 template <
typename Scalar,
typename IndexType>
250 template <
typename Scalar,
typename IndexType>
255 template <
typename Scalar,
typename IndexType>
259 template <
typename Scalar,
typename IndexType>
263 template <
typename Scalar,
typename IndexType>
AnnoyingScalar abs(const AnnoyingScalar &x)
Definition: AnnoyingScalar.h:135
int i
Definition: BiCGSTAB_step_by_step.cpp:9
#define EIGEN_PREDICT_TRUE(x)
Definition: Macros.h:1180
#define EIGEN_DEVICE_FUNC
Definition: Macros.h:892
#define EIGEN_STRONG_INLINE
Definition: Macros.h:834
cout<< "Here is the matrix m:"<< endl<< m<< endl;Matrix< ptrdiff_t, 3, 1 > res
Definition: PartialRedux_count.cpp:3
SCALAR Scalar
Definition: bench_gemm.cpp:45
NumTraits< Scalar >::Real RealScalar
Definition: bench_gemm.cpp:46
EIGEN_DEVICE_FUNC Packet padd(const Packet &a, const Packet &b)
Definition: GenericPacketMath.h:318
EIGEN_DEVICE_FUNC IndexDest convert_index(const IndexSrc &idx)
Definition: XprHelper.h:63
EIGEN_STRONG_INLINE Packet4i pcmp_lt(const Packet4i &a, const Packet4i &b)
Definition: AltiVec/PacketMath.h:1341
EIGEN_STRONG_INLINE Packet4f pmadd(const Packet4f &a, const Packet4f &b, const Packet4f &c)
Definition: AltiVec/PacketMath.h:1218
EIGEN_STRONG_INLINE Packet4cf pmul(const Packet4cf &a, const Packet4cf &b)
Definition: AVX/Complex.h:88
Namespace containing all symbols from the Eigen library.
Definition: bench_norm.cpp:70
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:83
const Mdouble pi
Definition: ExtendedMath.h:23
Definition: Eigen_Colamd.h:49
void start(const unsigned &i)
(Re-)start i-th timer
Definition: oomph_utilities.cc:243
Holds information about the various numeric (i.e. scalar) types allowed by Eigen.
Definition: NumTraits.h:217
Definition: TensorMeta.h:47
Definition: NullaryFunctors.h:172
NumTraits< Scalar >::Real RealScalar
Definition: NullaryFunctors.h:173
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Packet packetOp(IndexType i) const
Definition: NullaryFunctors.h:181
const Scalar m_step
Definition: NullaryFunctors.h:191
const Scalar m_start
Definition: NullaryFunctors.h:190
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar operator()(IndexType i) const
Definition: NullaryFunctors.h:177
EIGEN_DEVICE_FUNC equalspaced_op(const Scalar &start, const Scalar &step)
Definition: NullaryFunctors.h:175
Definition: NullaryFunctors.h:209
@ ret
Definition: NullaryFunctors.h:210
Definition: XprHelper.h:205
@ PacketAccess
Definition: XprHelper.h:206
@ Cost
Definition: XprHelper.h:206
@ IsRepeatable
Definition: XprHelper.h:206
@ value
Definition: Meta.h:456
@ value
Definition: Meta.h:437
@ value
Definition: Meta.h:446
NumTraits< Scalar >::Real RealScalar
Definition: NullaryFunctors.h:68
const Scalar m_step
Definition: NullaryFunctors.h:107
const Scalar m_low
Definition: NullaryFunctors.h:104
EIGEN_DEVICE_FUNC linspaced_op_impl(const Scalar &low, const Scalar &high, Index num_steps)
Definition: NullaryFunctors.h:70
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Packet packetOp(IndexType i) const
Definition: NullaryFunctors.h:86
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar operator()(IndexType i) const
Definition: NullaryFunctors.h:78
const bool m_flip
Definition: NullaryFunctors.h:108
const Index m_size1
Definition: NullaryFunctors.h:106
const Scalar m_high
Definition: NullaryFunctors.h:105
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar operator()(IndexType i) const
Definition: NullaryFunctors.h:121
const Scalar m_multiplier
Definition: NullaryFunctors.h:129
const Scalar m_divisor
Definition: NullaryFunctors.h:130
EIGEN_DEVICE_FUNC linspaced_op_impl(const Scalar &low, const Scalar &high, Index num_steps)
Definition: NullaryFunctors.h:113
const bool m_use_divisor
Definition: NullaryFunctors.h:131
const Scalar m_low
Definition: NullaryFunctors.h:128
Definition: NullaryFunctors.h:64
Definition: NullaryFunctors.h:152
const linspaced_op_impl< Scalar, NumTraits< Scalar >::IsInteger > impl
Definition: NullaryFunctors.h:168
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Packet packetOp(IndexType i) const
Definition: NullaryFunctors.h:162
EIGEN_DEVICE_FUNC linspaced_op(const Scalar &low, const Scalar &high, Index num_steps)
Definition: NullaryFunctors.h:153
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar operator()(IndexType i) const
Definition: NullaryFunctors.h:157
Definition: GenericPacketMath.h:108
Definition: NullaryFunctors.h:21
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar operator()() const
Definition: NullaryFunctors.h:23
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const PacketType packetOp() const
Definition: NullaryFunctors.h:25
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE scalar_constant_op(const Scalar &other)
Definition: NullaryFunctors.h:22
const Scalar m_other
Definition: NullaryFunctors.h:28
Definition: NullaryFunctors.h:52
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar operator()(IndexType row, IndexType col) const
Definition: NullaryFunctors.h:54
Definition: NullaryFunctors.h:40
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE scalar_zero_op()=default
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar operator()() const
Definition: NullaryFunctors.h:42
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const PacketType packetOp() const
Definition: NullaryFunctors.h:44
Definition: GenericPacketMath.h:134
Definition: ZVector/PacketMath.h:50