|Re: [eigen] separation declaration -- implementation|
[ Thread Index |
| More lists.tuxfamily.org/eigen Archives
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] separation declaration -- implementation
- From: Benoit Jacob <jacob.benoit.1@xxxxxxxxx>
- Date: Wed, 19 Aug 2009 13:55:03 -0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=UOnmsO/zsyrzQe/YM5Wz7Vxk0B0ITxcaoNnFLpuXGV4=; b=Sg3o5cfXOcHurlKV2elkvCe/63gmE623cUNBGkWR9otjZEDZZGNoyDWiFAit8t6lsT dNZkEf3XxsyZN3hfv6x9hDWf/197sTCKaF6quPVxuvk6IQWBwv07VFOYs6hqA13Tihjt K3kFMCpFnw9wh5pKxp0RhSGoCCOI4+5kjN3ag=
- 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:content-transfer-encoding; b=mrohkA+imOdS/AcfzaPFsQvaqnu2IdHsrOT9zM7/6lIc/Vi3MdFlRpMop3cgIfdJyV bnL0joWujkB8zEhM57RR/OCaRoCN32uzkvm0N9jTPejJJVHniHCUmKSu3eqxc4H3zN/G qks+jDEdIHAI2l+0LZKjjwmet5oRM9HWwUnz8=
All of Eigen is templates.
As always with templated code, all one can do is instantiate some
common specializations, but especially due to expression templates
there are "infinitely many" possible specializations -- every
different expression like "a+b*c" means different specializations.
In Eigen 2.0 we had a (rather unmaintained) concept of instantiating
some heavy templates, like some decomposition algorithms, into a
binary library. that was the EIGEN_BUILD_LIBRARY option to cmake. Now
we're probably not going to keep this.
Instead, if you want to speed up compilation with Eigen, try these things:
1) try precompiler headers.
2) make your own binary library, with only the stuff that you actually
need. For instance if you know that you only use 'float' and that the
only decomposition that you use is 'LU' then you can streamline your
binary library much more than we can upstream.
3) make sure that your code doesn't make more template specializations
than really needed. E.g. try to turn template parameters into runtime
parameters unless really needed, etc.
2009/8/19 Michael Meyer <mjhmeyer@xxxxxxxxx>:
> What do you think of the idea of taking the implementations out of the header files so we can compile eigen into a library and link against it.
> I think it is most elegant to minimize implementations in headers
> by all means possible.
> The main reason for this request is the compile time (in excess of a minute), probably two minutes on my medium fast laptop.
> I am now referring to version 2.0.
> There seemed to be files designed to force the instantiation of templates (if I understand the code correctly).
> Would it not be better not to do this and instantiate only the templates
> you actually need in your project.