10#ifndef EIGEN_PARTIALREDUX_H
11#define EIGEN_PARTIALREDUX_H
42template<
typename Func,
typename Evaluator>
46 OuterSize = int(Evaluator::IsRowMajor) ? Evaluator::RowsAtCompileTime : Evaluator::ColsAtCompileTime,
49 Unrolling = Cost <= EIGEN_UNROLLING_LIMIT ? CompleteUnrolling : NoUnrolling
55template<
typename PacketType,
typename Func>
57PacketType packetwise_redux_empty_value(
const Func& ) {
63template<
typename PacketType,
typename Scalar>
70template<
typename Func,
typename Evaluator,
71 int Unrolling = packetwise_redux_traits<Func, Evaluator>::Unrolling
76template<
typename Func,
typename Evaluator>
80 typedef typename Evaluator::Scalar Scalar;
82 template<
typename PacketType>
83 EIGEN_DEVICE_FUNC
static EIGEN_STRONG_INLINE
84 PacketType run(
const Evaluator &
eval,
const Func& func,
Index )
94template<
typename Func,
typename Evaluator,
int Start>
97 template<
typename PacketType>
99 static EIGEN_STRONG_INLINE PacketType run(
const Evaluator &,
const Func& f)
106template<
typename Func,
typename Evaluator>
109 typedef typename Evaluator::Scalar Scalar;
110 typedef typename redux_traits<Func, Evaluator>::PacketType PacketScalar;
112 template<
typename PacketType>
114 static PacketType run(
const Evaluator &
eval,
const Func& func,
Index size)
136template<
typename ArgType,
typename MemberOp,
int Direction>
142 typedef typename internal::add_const_on_value_type<ArgTypeNested>::type ConstArgTypeNested;
143 typedef typename internal::remove_all<ArgTypeNested>::type ArgTypeNestedCleaned;
144 typedef typename ArgType::Scalar InputScalar;
145 typedef typename XprType::Scalar Scalar;
147 TraversalSize = Direction==int(
Vertical) ? int(ArgType::RowsAtCompileTime) : int(ArgType::ColsAtCompileTime)
149 typedef typename MemberOp::template Cost<int(TraversalSize)> CostOpType;
152 : TraversalSize==0 ? 1
158 && bool(MemberOp::Vectorizable)
160 && (TraversalSize!=0),
171 : m_arg(
xpr.nestedExpression()), m_functor(
xpr.functor())
173 EIGEN_INTERNAL_CHECK_COST_VALUE(TraversalSize==
Dynamic ?
HugeCost : (TraversalSize==0 ? 1 : int(CostOpType::value)));
174 EIGEN_INTERNAL_CHECK_COST_VALUE(CoeffReadCost);
177 typedef typename XprType::CoeffReturnType CoeffReturnType;
179 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
182 return coeff(Direction==
Vertical ? j : i);
185 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
186 const Scalar coeff(
Index index)
const
188 return m_functor(m_arg.template subVector<
DirectionType(Direction)>(index));
191 template<
int LoadMode,
typename PacketType>
192 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
198 template<
int LoadMode,
typename PacketType>
199 EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC
200 PacketType packet(
Index idx)
const
203 typedef Block<
const ArgTypeNestedCleaned,
204 Direction==
Vertical ? int(ArgType::RowsAtCompileTime) : int(PacketSize),
205 Direction==
Vertical ? int(PacketSize) : int(ArgType::ColsAtCompileTime),
219 return internal::pset1<PacketType>(coeff(idx));
223 typedef typename MemberOp::BinaryOp BinaryOp;
229 ConstArgTypeNested m_arg;
Expression of a fixed-size or dynamic-size block.
Definition Block.h:105
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index outerSize() const
Definition DenseBase.h:223
Base class for all dense matrices, vectors, and expressions.
Definition MatrixBase.h:50
Generic expression of a partially reduxed matrix.
Definition VectorwiseOp.h:58
DirectionType
Enum containing possible values for the Direction parameter of Reverse, PartialReduxExpr and Vectorwi...
Definition Constants.h:261
@ Vertical
For Reverse, all columns are reversed; for PartialReduxExpr and VectorwiseOp, act on columns.
Definition Constants.h:264
const unsigned int PacketAccessBit
Short version: means the expression might be vectorized.
Definition Constants.h:94
const unsigned int LinearAccessBit
Short version: means the expression can be seen as 1D vector.
Definition Constants.h:130
const unsigned int RowMajorBit
for a matrix, this means that the storage order is row-major.
Definition Constants.h:66
Namespace containing all symbols from the Eigen library.
Definition LDLT.h:16
const int HugeCost
This value means that the cost to evaluate an expression coefficient is either very expensive or cann...
Definition Constants.h:44
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition Meta.h:74
const int Dynamic
This value means that a positive quantity (e.g., a size) is not known at compile-time,...
Definition Constants.h:22
Definition XprHelper.h:332
Definition CoreEvaluators.h:111
Definition CoreEvaluators.h:91
Definition XprHelper.h:176
Definition PartialReduxEvaluator.h:73
Definition PartialReduxEvaluator.h:44
Definition ForwardDeclarations.h:17
Definition GenericPacketMath.h:133
Definition PacketMath.h:47