|Re: [eigen] log10 support?|
[ Thread Index |
| More lists.tuxfamily.org/eigen Archives
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] log10 support?
- From: Trevor Irons <trevorirons@xxxxxxxxx>
- Date: Mon, 7 Jun 2010 15:22:14 -0600
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type; bh=iNxFJYZRGpq7bhML36xbHbR4r2XXikaggnb/RvCYk/Y=; b=q5tAG68BJcYgQ8Jjin5PUekAmcYOQdODebu0i+zjbvPDaZTk/YoHyXTLSupPyqwsyo sZsxDpv3fxGtmJvYUXWs7WWqeoaBXQ1oKEBNX947JfOSgA0Nqdbf98nw8A6X/iIyE3tU CBOhZOTj+XqNtYke/dNBlr1ROFjgAy5v53NcQ=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=iTRE4r1eQyfsWSYzXCNsNEseT4Z7ZEGfqZcWTlslVDLFay/pLeoUuTRDF95t+pzL2c vsgo6/GgRKEYZ0SYRvS+ktnzYejaJ7bvzzDkwQI2NQ1hH0tSd9SvjejYAyjb9PsoEonZ Aw7wnYTRlg4zvPJcpv6EVtPqszDWgwZRUxkmA=
Also, is there any desire to have log10 defined your way in Eigen, for convenience? Or are you just suggesting I do this locally?
On 7 June 2010 15:20, Trevor Irons <trevorirons@xxxxxxxxxx>
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?
On 7 June 2010 15:05, Benoit Jacob <jacob.benoit.1@xxxxxxxxx>
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.
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?