Re: [eigen] log10 support?

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]


Sure, I can do this. I prefer store a minimum of constants. But if it will be faster, then sure.

Why won't calls to std::log10 be vectorized? No sse instructions?

-Trevor

On 7 June 2010 15:05, Benoit Jacob <jacob.benoit.1@xxxxxxxxx> wrote:
Hi,

log10(x)  =  constant * log(x),  so why not just implement the log10
function as returning an _expression_ "product of constant times the
return type of log" ? Thanks to inlining, that will be just 1
multiplication slower than log() (i.e. only a tiny bit), and will
automatically benefit from log() vectorization!

Your approach is the right one in the general case, it's just that
here we are in a very special case.

Benoit



2010/6/7 Trevor Irons <trevorirons@xxxxxxxxx>:
> This patch adds log10 support to arrays.
>
> I'm still learning Eigen, I build it by grepping all the instances of Log,
> and log that I could find in the source code. It is possible that I missed
> something, but test cases compile and give correct answers. I don't know how
> to add to the unit tests.
>
> Any problems with pushing this?
>
> Thanks,
>
> Trevor
>
>
>





Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/