[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] Alignment
- From: Benoit Jacob <jacob.benoit.1@xxxxxxxxx>
- Date: Sun, 22 Feb 2009 16:04:42 +0100
- 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=mmXDyXnJLOIjHKXT9IgcYer7NGmgsnk2kgy8fZ9c9so=; b=ieu91aBYqNDMT81m8Loi9jdE1v+pPLH4H8RnEkjJtkFElxngefDSJBTat7EcQcZICT c22/WAX5j77j34FZGVqMAWz6bZH8a+4H+21uy3VSEvyzbibMuq3t3k2mT0XVnMJNQt/0 mQrqA1P6ajwboX31XBeMnKlP6NDNM0Y0m+PkI=
- 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=NDS4AKRBQO35s/OhhqKKxW4c1huyZaU1smXRkAg2mVHGKfyOHJKm9q5qu/eg8HI1K4 FUk7+tX3vLAuq6QM3f9IzOM/yvTd+OY5FLaKz+aplbxARkANq9lpT/8Wts1G2/3M03Ul Up9OJuAC+JCtmLc+SyiFGuk+2leErDiC93rzk=
Hi,
Are you using 2.0, or trunk?
We know about the std::vector::resize() problem.
We made a fix,
http://eigen.tuxfamily.org/dox/StlContainers.html
basically you just #include<Eigen/StdVector> and then you're able to
do std::vector<Eigen::Vector2d>.
However, in Eigen 2.0 our fix doesn't support the case of
std::vector<T> with T a custom class having an Eigen member.
Gael fixed that in trunk but that isn't backported to 2.0 (big change;
Gael: of course it's your choice whether this is backportable).
So can you try with trunk and see if it makes std::vector work for
you? (do #include<Eigen/StdVector>).
> My understanding is that the std::vector variant should be safe unless
> resize() is called.
Indeed, but that's quite an incomfortable assumption, that's why we
went further and made Eigen/StdVector.
> What about boost::array? Given that it's a thin wrapper around a plain
> array (see [1]) is the compiler guaranteed to figure out how to lay
> things out in memory correctly?
If boost::array<T> honors T::operator new[] then I'd say it should
work fine, because EIGEN_MAKE_ALIGNED_OPERATOR_NEW overloads also this
form to make it return aligned pointers, and the EIGEN_ALIGN_128 on
Eigen's internal fixed-size arrays should also be honored.
Cheers,
Benoit