Registered Member
|
Hello,
I would like to extend Eigen in such a way to support "Frames". A frame is a 7D vector containing a quaternion and a vector3: hence it is a compact representation of an homogeneous matrix (only much less redundant). I can see three approaches in order to define this new eigen type: 1) Create a Frame class outside of the Eigen framework which contains both a quaternion and a Vector3 - This class would not use expression templates - This will work and is easy to put in place but then I loose all the flexibility of Eigen when using class Frame + As it is a "normal" class and not a template a-la Eigen 2) Create a new standalone Frame class with heavy templetization a-la Eigen - This requires to understand the heart of Eigen (I must admit I am far from understanding all the subtleties of Eigen's inner code) - This is heavy to put in place - I am not sure how to integrate this to Eigen 3) Typedef Matrix<float, 7, 1> Frame - Specialize the required templates for new type Frame using EIGEN_MATRIXBASE_PLUGIN + Will this work? -> what will happen when I call a templated method specialized for Frame on a Matrix<float, 7, 1> (not a Frame), will it call the method specialized for Frame? --> of course this is not what I want... - Add the relevant new functions using EIGEN_MATRIXBASE_PLUGIN What would you recomment in my case? Thanks! |
Moderator
|
Expression template for 3D transformations is not very important because 1) the main operation we perform on transformation is to apply it to vector(s), and 2) for small fixed size objects, returning by value is not a problem because the temporaries will be very easily optimized away by the compiler. So I'd not bother much and start with:
and add all the operators you need and make them return by value. |
Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]