Skip to content
Snippets Groups Projects
Verified Commit 9a2af18e authored by Justin Carpentier's avatar Justin Carpentier
Browse files

core: add and expose printEigenVersion

parent 7945405b
No related branches found
No related tags found
No related merge requests found
......@@ -18,6 +18,14 @@ namespace eigenpy {
///
std::string EIGENPY_DLLAPI printVersion(const std::string& delimiter = ".");
///
/// \brief Returns the current version of Eigen3 as a string using
/// the following standard:
/// EIGEN_MINOR_VERSION.EIGEN_MINOR_VERSION.EIGEN_PATCH_VERSION
///
std::string EIGENPY_DLLAPI
printEigenVersion(const std::string& delimiter = ".");
///
/// \brief Checks if the current version of EigenPy is at least the version
/// provided
......
/*
* Copyright 2014-2019, CNRS
* Copyright 2018-2022, INRIA
* Copyright 2018-2023, INRIA
*/
#include <boost/python/scope.hpp>
......@@ -22,6 +22,7 @@ BOOST_PYTHON_MODULE(eigenpy_pywrap) {
enableEigenPy();
bp::scope().attr("__version__") = eigenpy::printVersion();
bp::scope().attr("__eigen_version__") = eigenpy::printEigenVersion();
bp::scope().attr("__raw_version__") = bp::str(EIGENPY_VERSION);
bp::def("checkVersionAtLeast", &eigenpy::checkVersionAtLeast,
bp::args("major_version", "minor_version", "patch_version"),
......
//
// Copyright (c) 2019 INRIA
// Copyright (c) 2019-2023 INRIA
//
#include "eigenpy/version.hpp"
#include "eigenpy/config.hpp"
#include <sstream>
#include "eigenpy/config.hpp"
#include <Eigen/Core>
namespace eigenpy {
......@@ -17,6 +17,13 @@ std::string printVersion(const std::string& delimiter) {
return oss.str();
}
std::string printEigenVersion(const std::string& delimiter) {
std::ostringstream oss;
oss << EIGEN_MAJOR_VERSION << delimiter << EIGEN_MINOR_VERSION << delimiter
<< EIGEN_MINOR_VERSION;
return oss.str();
}
bool checkVersionAtLeast(unsigned int major_version, unsigned int minor_version,
unsigned int patch_version) {
return EIGENPY_VERSION_AT_LEAST(major_version, minor_version, patch_version);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment