mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-01-24 14:45:14 +08:00
Prevent temporaries for reductions.
This commit is contained in:
parent
1a77334d54
commit
d0b4ef81f0
@ -313,10 +313,9 @@ template<typename Func>
|
|||||||
inline typename ei_result_of<Func(typename ei_traits<Derived>::Scalar)>::type
|
inline typename ei_result_of<Func(typename ei_traits<Derived>::Scalar)>::type
|
||||||
DenseBase<Derived>::redux(const Func& func) const
|
DenseBase<Derived>::redux(const Func& func) const
|
||||||
{
|
{
|
||||||
typename Derived::Nested nested(derived());
|
|
||||||
typedef typename ei_cleantype<typename Derived::Nested>::type ThisNested;
|
typedef typename ei_cleantype<typename Derived::Nested>::type ThisNested;
|
||||||
return ei_redux_impl<Func, ThisNested>
|
return ei_redux_impl<Func, ThisNested>
|
||||||
::run(nested, func);
|
::run(derived(), func);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** \returns the minimum of all coefficients of *this
|
/** \returns the minimum of all coefficients of *this
|
||||||
|
Loading…
Reference in New Issue
Block a user