Registered Member
|
Hi again,
I stumbled over a little issue while writing a plugin. I know where it comes from but have no clue on how to overcome the issue. First, my motivation. Since
gives me a run-time error while
does not, I want to go for the latter. Putting it in my plugin, it requires nested Blocks - actually as I just learned something like Block< NestByValue< Block < .... At the moment, this is not possible because ei_traits of Blocks are not yet known in the MatrixBase. Any ideas? Regards, Hauke
Last edited by Hauke on Wed Apr 08, 2009 9:04 am, edited 1 time in total.
|
Registered Member
|
Ok, I was wrong with my conclusion that the traits are not known.
Actually the problem lies in the implementation of the Block traits. Recursive Blocks are basically not possible at the moment but with the following fix, they can be made possible.
I basically replaced all MatrixType type accesses by the corresponding traits, i.e.
Do you think this fix is valid and could be added to the SVN? Regards, Hauke |
Registered Member
|
Sorry for messing things up like this. In the end I do not really understand what is happening. Actually, the patch should not be required since
should properly unapply the recursion through the typedefs in EIGEN_GENERIC_PUBLIC_INTERFACE. Just to be complete once, I add the code to reproduce the problem. main.cpp
eigen_plugin.h
Regards, Hauke |
Moderator
|
I'm also clueless. Anyway the patch you suggested is harmless so it is fine to apply it.
Also, note that your getRow can be implemented without nesting two block expressions, you can directly write it as a single Block expression: return Block(derived(), row, 0, col, 1, cols()-col); that is probably better for the compiler. |
Registered Member
|
Cool, thanks again for your support and your suggestions for optimization.
I do not know how to attach files to the post - does not seem to be possible - so I add the patch right here.
- Hauke |
Registered Member
|
Thanks, can you send the patch by email, either to the mailing list, or to me or Gael?
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: Bing [Bot], Evergrowing, Google [Bot], rblackwell