How to check the version number of Eigen C++ template library?

ぐ巨炮叔叔 提交于 2019-12-21 03:16:08

问题


I added several different versions of Eigen to default including directory of Visual C++. But I got collapse problem when using LDLT (Cholesky decomposition) for some of the testing numerical examples.

So I want to determine which version is actually active when debugging the code.

Is there any function which can indicate the current active Eigen version number?


回答1:


This answer is only a summary from the comments above:

  • At compile-time you have EIGEN_WORLD_VERSION, EIGEN_MAJOR_VERSION and EIGEN_MINOR_VERSION, you can easily embed this information in your application.

  • 3.1.91 sounds like a beta version of 3.2.

  • The version number macros are defined in Macros.h located at \Eigen\src\Core\util\.




回答2:


In order to check the version number of Eigen C++ template library, just type

dpkg -p libeigen3-dev

in the terminal. Or just type

pkg-config --modversion eigen3

you will get the Eigen version.




回答3:


Although it is not the goal of the OP, people finding this question may be interested in checking if the version is equal to are newer than a specific release for compatibility reasons with different versions of Eigen. This can be done more easily using the EIGEN_VERSION_AT_LEAST(x, y, z) macro as follows:

#if EIGEN_VERSION_AT_LEAST(3,3,0)
    // Implementation for Eigen 3.3.0 and newer
#else
    // Implementation for older Eigen versions
#endif 

This macro is also defined in Eigen/src/Core/util/Macros.h and uses EIGEN_WORLD_VERSION, EIGEN_MAJOR_VERSION and EIGEN_MINOR_VERSION internally.



来源:https://stackoverflow.com/questions/21497064/how-to-check-the-version-number-of-eigen-c-template-library

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!