Home | History | Annotate | Download | only in Core

Lines Matching refs:Func

26 template<typename Func, typename Derived>
39 && (functor_traits<Func>::PacketAccess),
55 || (Derived::SizeAtCompileTime!=1 && functor_traits<Func>::Cost == Dynamic)
58 + (Derived::SizeAtCompileTime-1) * functor_traits<Func>::Cost,
76 template<typename Func, typename Derived, int Start, int Length>
85 static EIGEN_STRONG_INLINE Scalar run(const Derived &mat, const Func& func)
87 return func(redux_novec_unroller<Func, Derived, Start, HalfLength>::run(mat,func),
88 redux_novec_unroller<Func, Derived, Start+HalfLength, Length-HalfLength>::run(mat,func));
92 template<typename Func, typename Derived, int Start>
93 struct redux_novec_unroller<Func, Derived, Start, 1>
102 static EIGEN_STRONG_INLINE Scalar run(const Derived &mat, const Func&)
111 template<typename Func, typename Derived, int Start>
112 struct redux_novec_unroller<Func, Derived, Start, 0>
115 static EIGEN_STRONG_INLINE Scalar run(const Derived&, const Func&) { return Scalar(); }
120 template<typename Func, typename Derived, int Start, int Length>
131 static EIGEN_STRONG_INLINE PacketScalar run(const Derived &mat, const Func& func)
133 return func.packetOp(
134 redux_vec_unroller<Func, Derived, Start, HalfLength>::run(mat,func),
135 redux_vec_unroller<Func, Derived, Start+HalfLength, Length-HalfLength>::run(mat,func) );
139 template<typename Func, typename Derived, int Start>
140 struct redux_vec_unroller<Func, Derived, Start, 1>
152 static EIGEN_STRONG_INLINE PacketScalar run(const Derived &mat, const Func&)
162 template<typename Func, typename Derived,
163 int Traversal = redux_traits<Func, Derived>::Traversal,
164 int Unrolling = redux_traits<Func, Derived>::Unrolling
168 template<typename Func, typename Derived>
169 struct redux_impl<Func, Derived, DefaultTraversal, NoUnrolling>
173 static EIGEN_STRONG_INLINE Scalar run(const Derived& mat, const Func& func)
179 res = func(res, mat.coeffByOuterInner(0, i));
182 res = func(res, mat.coeffByOuterInner(i, j));
187 template<typename Func, typename Derived>
188 struct redux_impl<Func,Derived, DefaultTraversal, CompleteUnrolling>
189 : public redux_novec_unroller<Func,Derived, 0, Derived::SizeAtCompileTime>
192 template<typename Func, typename Derived>
193 struct redux_impl<Func, Derived, LinearVectorizedTraversal, NoUnrolling>
199 static Scalar run(const Derived& mat, const Func& func)
222 packet_res0 = func.packetOp(packet_res0, mat.template packet<alignment>(index));
223 packet_res1 = func.packetOp(packet_res1, mat.template packet<alignment>(index+packetSize));
226 packet_res0 = func.packetOp(packet_res0,packet_res1);
228 packet_res0 = func.packetOp(packet_res0, mat.template packet<alignment>(alignedEnd2));
230 res = func.predux(packet_res0);
233 res = func(res,mat.coeff(index));
236 res = func(res,mat.coeff(index));
243 res = func(res,mat.coeff(index));
250 template<typename Func, typename Derived>
251 struct redux_impl<Func, Derived, SliceVectorizedTraversal, NoUnrolling>
257 static Scalar run(const Derived& mat, const Func& func)
272 packet_res = func.packetOp(packet_res, mat.template packetByOuterInner<Unaligned>(j,i));
274 res = func.predux(packet_res);
277 res = func(res, mat.coeffByOuterInner(j,i));
282 res = redux_impl<Func, Derived, DefaultTraversal, NoUnrolling>::run(mat, func);
289 template<typename Func, typename Derived>
290 struct redux_impl<Func, Derived, LinearVectorizedTraversal, CompleteUnrolling>
299 static EIGEN_STRONG_INLINE Scalar run(const Derived& mat, const Func& func)
302 Scalar res = func.predux(redux_vec_unroller<Func, Derived, 0, Size / PacketSize>::run(mat,func));
304 res = func(res,redux_novec_unroller<Func, Derived, VectorizedSize, Size-VectorizedSize>::run(mat,func));
316 /** \returns the result of a full redux operation on the whole matrix or vector using \a func
318 * The template parameter \a BinaryOp is the type of the functor \a func which must be
324 template<typename Func>
325 EIGEN_STRONG_INLINE typename internal::result_of<Func(typename internal::traits<Derived>::Scalar)>::type
326 DenseBase<Derived>::redux(const Func& func) const
329 return internal::redux_impl<Func, ThisNested>
330 ::run(derived(), func);