Re: [eigen] min(Arr1,Arr2) is it supposed to work?

[ Thread Index | Date Index | More Archives ]

On 04/04/2011 04:48:56 PM, Gael Guennebaud wrote:
> sorry, I were not very clear. Actually, handling std::min(lhs,rhs)
> where typeof(lhs) != typeof(rhs) and both lhs and rhs are Eigen's 
> type
> is not a problem:
> template<typename Left,typename Right>
> inline const blabla
> min(const Eigen::ArrayBase<Left>& x, const Eigen::ArrayBase<Right>&
> y);
> does the job.
> The problem is support the case where typeof(lhs)==typeof(rhs) 
> because
> the STL already define a generic version for that case, and my
> previous overload is not considered. Likewise, the enable_if trick
> cannot help here (unless I'm overseeing something). I think that the
> only solution would be to have overloads for every Eigen expression
> types, but that's not something we wanna do.

I've always wondered why the functions should live in the std 
Isn't it possible to define a template for min in the namespace Eigen
requiring the user to use Eigen::min (or a using instruction)?


Mail converted by MHonArc 2.6.19+