[ Thread Index |
| More lists.tuxfamily.org/eigen Archives
I started using Eigen2 for a research project a few days ago and found
it generally quite impressive. I particularly like the type safety of
fixed-size matrix operations. So, thanks for sharing Eigen2 with the
rest of the world :)
There's one thing I'm having trouble getting my head around though:
What do I need to do to ensure vectorization-compatible alignment of
Eigen datatypes contained in my own classes/structs if I need to
store those in both std::vector and boost::array containers?
I've tried to follow the suggestions from the Eigen2 documentation 
but that doesn't seem to fully cover my use case which roughly boils
down to the following code snippet:
// numerous Eigen::Matrix members. e.g.:
Matrix<double, 4, 4> A;
// various member functions operating on foo
std::vector<foo, Eigen::aligned_allocator<foo> > foo_vector;
// do stuff with foo_vector[i]
boost::array<foo, 20> foo_array;
// do stuff with foo_array[i]
My understanding is that the std::vector variant should be safe unless
resize() is called.
What about boost::array? Given that it's a thin wrapper around a plain
array (see ) is the compiler guaranteed to figure out how to lay
things out in memory correctly?
Thanks in advance for any suggestions.