|Re: [eigen] Std Vector again|
[ Thread Index |
| More lists.tuxfamily.org/eigen Archives
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] Std Vector again
- From: Patrick Mihelich <patrick.mihelich@xxxxxxxxx>
- Date: Fri, 26 Jun 2009 15:17:51 -0700
- 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; bh=6rOnXnkIKdG6r0IKEUaRTY9NkWYpDIzXUv9FUS8/SLY=; b=leviEe++VV5lUBYlQikqY7hMwkP7JcGnX7+P5KkLYz+UVlV8fXjmEJzlCRKpvg+Nf2 1HfLd4cJnqDoEfG7gspCHGO5BlSWRfWyfyQxPA6OlKKxUCfql8F7dzLCsmh/yB6GmqmI fPM1NKKBnrZ1QxjL5ks+FGzcNOWdyLAAxruGA=
- 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=wYir1/XpQhM3EDX8VY8dOIM4kn4t/m5ImKBvB372TKpemOOPW87MGxyjd22Bv14Upi dUi4XHS+u7HRYfukDm3k1x/61I4egwP0T5axVj4ZVhJXO+ROpPVPVhMIZ4xLCSghtgG5 d14ypeLDx+QyoR74oXlXGUj4ptcpBKtH3zu+Q=
I just took a look at the dev branch version of Eigen/StdVector, and it looks perfectly reasonable - specializing std::vector only when Eigen::aligned_allocator is used, so there's no requirement to include it before <vector>. Are there any known issues with this version?
BTW, it is possible to detect the existence of std::vector::resize(n, t) at compile time and enable the specialization only in that case. That seems more robust than trying to enumerate compiler versions. I can take a crack at that if it sounds useful.
On Fri, Jun 26, 2009 at 2:06 PM, Keir Mierle <mierle@xxxxxxxxx>
We don't use boost, and plan to keep it that way. It's an enormous dependency. It's tangled enough that they have a special utility to extract subsets of boost. I tried it, and the 'subsets' are still large, even when extracting a single header (e.g. tuple or scoped_ptr).
On Fri, Jun 26, 2009 at 12:25 PM, Patrick Mihelich <patrick.mihelich@xxxxxxxxx>
If you are already using Boost, I suggest sidestepping the Eigen/std::vector quandary and instead using the vector implementation in Boost.Interprocess for Eigen types. Although it (currently) lives in Interprocess, it's a fully generic implementation of STL vector that fixes the resize flaw and has some other niceties such as support for move semantics.
Current C++ may not have templated typedefs, but you can get some of the same benefits from a simple meta-program:
typedef boost::interprocess::vector<T, Eigen::aligned_allocator<T> > type;
On Fri, Jun 26, 2009 at 10:37 AM, Benoit Jacob <jacob.benoit.1@xxxxxxxxx>
2009/6/26 Benoit Jacob <jacob.benoit.1@xxxxxxxxx>:
> What you want here is EIGEN_DONT_ALIGN but this option is onlyAnd by the way, you can control that on a per-matrix basis by using e..g.
> available in the development version.
> In Eigen 2.0.3, to disable alignment, you'll have to edit
> Eigen/src/Core/util/Macros.h and at line 44 replace
> #if !defined(__GNUC__) || defined(__i386__) || defined(__x86_64__) ||
> defined(__ppc__) || defined(__ia64__)
> #if 0