|Re: [eigen] log10 support?|
[ Thread Index |
| More lists.tuxfamily.org/eigen Archives
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] log10 support?
- From: Benoit Jacob <jacob.benoit.1@xxxxxxxxx>
- Date: Mon, 7 Jun 2010 17:05:01 -0400
- 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=iL1lqgOTLqt5zTQL2tzHn7y4GqSFLEy1T93DmbKZviU=; b=sBkYMtBeAVR/GiRbw5s3twanLhjRVcGq+6Bf+shwLZQX523UN4QF6lG/FAI/5jzZhS SvSx2wVpbCPE1N624EGGT6zaPZFYFYrCqGa2FKRrgZcfyOt+JqcbA4gJJlMZYap70k6O KuD3lZBc7Jjy+V6MRyzkbE4T89xt2lXleoTJo=
- 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=cSk2mHpxKfz/wdXJ1FpByaropw4/u3eF0lQy3QwwwcofdVCU+ckYRdTdIcmEZyUirf FRux6ibf5lPpUMPC5Il7EcAEfMDsAf/VbY86e8KUrTOvEaZgxLW33H7aKodv2gs9iSDu RHgCj9AWk3DEZQZfdHTSuP7wNd33L3Sr0jq/M=
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?