Registered Member
|
I have some legacy code that I would like to speed up/simplify using Eigen. However, I'm not sure how native C arrays should interact with Eigen's vector classes.
For example, if I have a function where the native C arrays are passed in I have to memcpy the arrays into the Eigen objects:
The memcpy's are killing any performance gain I'm getting out of Eigen-- and the legacy code is to big to rip out all of the C arrays. Is it possible to simply wrap a VectorXf around a pre-existing C array without having to memcpy it? Thanks, aaron |
Registered Member
|
Map is your friend here.
http://eigen.tuxfamily.org/dox/classEigen_1_1Map.html
Join us on Eigen's IRC channel: #eigen on irc.freenode.net
Have a serious interest in Eigen? Then join the mailing list! |
Registered Member
|
Ah, that does it-- thanks. RTFM I guess-- though 'map' is not the name I would have guessed. (I was looking for a special constructor.)
By the way, it seems that "USING_PART_OF_NAMESPACE_EIGEN" is not enough for Map-- "using namespace Eigen" must be used in order for it to work. |
Registered Member
|
yes, i know thats confusing, that's why we're removing "USING_PART_OF_NAMESPACE_EIGEN" .
Join us on Eigen's IRC channel: #eigen on irc.freenode.net
Have a serious interest in Eigen? Then join the mailing list! |
Registered users: abc72656, Bing [Bot], daret, Google [Bot], Sogou [Bot], Yahoo [Bot]