Registered Member
|
I have a class that inherits from Matrix. We'll call it "MyVectorType," which is a specialization of a vector that has certain, specific behaviors. I have followed the instructions
(http://eigen.tuxfamily.org/dox/TopicCustomizing_InheritingMatrix.html) and that works. However, now I would like to create a Map<MyVectorType> so that I can use an external memory block as a MyVectorType. This is a disaster. Numerous compiler errors are generated complaining about various undefined things. For instance:
I could go on, but the basic question is, what is necessary to make a Matrix-derived class that can be used in Map? To prevent the detour, yes, I'm really sure that I don't want to modify all of the matrices and vectors by using EIGEN_MATRIXBASE_PLUGIN. A minimalist example follows:
|
Moderator
|
This cannot work as Map<MyVectorType> cannot magically inherits the "special" behavior of MyVectorType. Moreover, please note that if vec is a MyVectorType, then "2*vec" will be a simple dense matrix expression without any of the "special" behavior. I don't know what's your goal here, but if you only want to support Map<MyVectorType> then you can specialize Map for MyVectorType, make it inherit Map<Matrix> and implement your special functions there (probably using a common internal free-function to factorize the code).
|
Registered users: Bing [Bot], Google [Bot], Sogou [Bot]