Re: [eigen] A template puzzler, or, templated custom scalar types |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] A template puzzler, or, templated custom scalar types
- From: Gael Guennebaud <gael.guennebaud@xxxxxxxxx>
- Date: Fri, 17 Jun 2011 09:40:46 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:from:date :message-id:subject:to:content-type; bh=sK3rTHd0LjarE40MVVPTAbGegVXnqVvB25GEaasKsm4=; b=ZGsVz7ETAOOn7lRmPaIT7/wZ4Ur5eJu+na1TWUKLE3urm3poEv99HuFwPB751I3BcW ntkU+BP/3CUkARmkWmwFaVwAqx+BgWcLOFOfNBIZq7z1uKfj5VAjlpirvj095QhwNt1f z5lVFVEwji2Wr75c4qXzJNpotI0Rj/EpYuoi4=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=xPT1/eAzZddFHiIQIw8hUlxYY3BZ/ddNx1ZFHBJtqctJtgQAOi70MimfyzWGgriOPl VZ/TA29jnesl/6/1jp7Bu6G3p+uNopVob5YWAvyosbIZkgBzTvZuk4pP6N+XrrhpWEDC WYoGbX3xaJ1QpTwh6fIbzhx0OtrTKel6B1kcc=
I guess your are talking about Eigen 2, since in 3.0 we resolved that
issue by moving such functions to NumTraits.
In your case I'm afraid you will have to specialize them for each
configuration of scalar/type that you plan to use.... some macros here
might help.
(in Eigen3 we already have such an autodiff class)
gael
On Fri, Jun 17, 2011 at 1:15 AM, Keir Mierle <mierle@xxxxxxxxx> wrote:
> I have a custom type. It's a small autodiff variable, templated on scalar
> type and size. Everything works great; however, things break down when I
> attempt to use the LU decomposition. The trouble is that the precision() and
> machine_epsilon() functions use template specializations to resolve the
> type, which for some reason, doesn't work.
> Is it possible to use Scalar types that are themselves templated?
> Thanks,
> Keir