Re: [eigen] Std Vector again |

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]

*To*: eigen@xxxxxxxxxxxxxxxxxxx*Subject*: Re: [eigen] Std Vector again*From*: Keir Mierle <mierle@xxxxxxxxx>*Date*: Fri, 26 Jun 2009 14:06:23 -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=kkrY/B6h9yWmdTuwoeAHAprPan2rFYCvs76NmbB2tio=; b=WTJuOuJkBxtgJ12AzRgLU0twEUXwY5nvDb2Q/4sbzZ/dioMW5kvOrZY6kR0xXKsv4l pg+7Gj1x4EFpGPD+MOFNho2gzMSqyiEFN3wB9gbjiTwNcZCMhuFeTKEJeGsPPkkKXud3 saSFQ0J1sTihhHLzhZfPsy3EcwFEtX5ut9f+8=*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=H/qur2pLdH3fRpgOrV/KCxgug2CLiZR7bWzFoffwLCFoko0chh+sflTfNsDeU5c1nm 3eQ1k2/EinVnwSahUgddLuktAzrtcheCpYsPjL1Y2BxWkTw1uOl9RS9igxN2MvCe3jiq Ojhh6+VxO7a4uLVOZe082Q4F172uqtDIJre+E=

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).

Keir

On Fri, Jun 26, 2009 at 12:25 PM, Patrick Mihelich <patrick.mihelich@xxxxxxxxx> wrote:

Keir,

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:

#include <boost/interprocess/containers/vector..hpp>

template<typename T>

struct AlignedVector

{

typedef boost::interprocess::vector<T, Eigen::aligned_allocator<T> > type;

};

AlignedVector<Vector4f>::type my_vec;

Cheers,

PatrickOn Fri, Jun 26, 2009 at 10:37 AM, Benoit Jacob <jacob.benoit.1@xxxxxxxxx> wrote:

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__)

>

> by

>

> #if 0

Eigen::Matrix<float,4,1,Eigen::DontAlign>

instead of

Eigen::Vector4f

Cheers,

Benoit

**Follow-Ups**:**Re: [eigen] Std Vector again***From:*Patrick Mihelich

**References**:**[eigen] Std Vector again***From:*Keir Mierle

**Re: [eigen] Std Vector again***From:*Benoit Jacob

**Re: [eigen] Std Vector again***From:*Rene Wagner

**Re: [eigen] Std Vector again***From:*Benoit Jacob

**Re: [eigen] Std Vector again***From:*Benoit Jacob

**Re: [eigen] Std Vector again***From:*Patrick Mihelich

**Messages sorted by:**[ date | thread ]- Prev by Date:
**Re: [eigen] Std Vector again** - Next by Date:
**Re: [eigen] Std Vector again** - Previous by thread:
**Re: [eigen] Std Vector again** - Next by thread:
**Re: [eigen] Std Vector again**

Mail converted by MHonArc 2.6.19+ | http://listengine.tuxfamily.org/ |