Registered Member
|
Hi,
I am trying to view data in Eigen containers via debugger visulaizers. I use this for UBLAS containers:
I tried to get something similar for Eigen working but no luck as I am still getting used to C++. Could you please help me setting up the MSVS debugger visualizer file for Eigen? Thanks! |
Registered Member
|
The file eigen/debug/msvc/eigen.natvis that was added a few days ago to the development branch may be helpful. I think you can find it on the web at https://bitbucket.org/eigen/eigen/src/d ... gen.natvis .
|
Registered Member
|
This is great. I am able to visualize most Eigen containers with this. Thanks!
However, I am an R user struggling with C++; I can't seem to use the examples to write a visualizer for Map<VectorXd> or Map<MatrixXd>. Possible to get some help setting those up. Regards. |
Registered Member
|
Here you go
For most types, it is quite easy. First, you have to define the type name. This is a little bit funny because you have to write your template declaractions with '<' and '>' instead of actual angle brackets. Each free template parameter is represented by an asterisk and can be accessed via $Ti, where i is the ith asterisk. Every symbol you can write in the 'Watch' window of the MSVC IDE while debugging can be expanded and renamed through the visualizers. Once you declare a Map named 'm', you can access 'm.m_rows.m_value' in the debug window. In the example above, I just named it [size]. The ArrayItems section expands the pointer m_data for all rows. If you want more fancy stuff like conditional names, etc. please take a closer look at the example code I pushed a few days ago. This link (http://code.msdn.microsoft.com/windowsdesktop/Writing-type-visualizers-2eae77a2) was helpful too though not everything is yet well documented. HTH, Hauke |
Registered Member
|
Thanks for a very good explanation. Tried it and it works great. Being able to visualize data is definitely making debugging really simple.
And as an aside, writing C++ code with Eigen is remarkably straightforward and almost proving easier than R. So much numerical firepower, yet code that is entirely natural to read/write. Thank you creators and community for an awesome product. |
Registered users: Bing [Bot], Google [Bot], Sogou [Bot], Yahoo [Bot]