Skip to content
Snippets Groups Projects
Commit 412720a5 authored by Justin Carpentier's avatar Justin Carpentier
Browse files

Fix compatibility with Eigen 3.0.5

parent aacde161
Branches
Tags v1.4.0
No related merge requests found
...@@ -85,6 +85,7 @@ namespace eigenpy ...@@ -85,6 +85,7 @@ namespace eigenpy
} }
}; };
#if EIGEN_VERSION_AT_LEAST(3,2,0)
template<typename MatType> template<typename MatType>
struct EigenObjectAllocator< eigenpy::Ref<MatType> > struct EigenObjectAllocator< eigenpy::Ref<MatType> >
{ {
...@@ -101,6 +102,7 @@ namespace eigenpy ...@@ -101,6 +102,7 @@ namespace eigenpy
MapNumpy<MatType>::map(pyArray) = mat; MapNumpy<MatType>::map(pyArray) = mat;
} }
}; };
#endif
/* --- TO PYTHON -------------------------------------------------------------- */ /* --- TO PYTHON -------------------------------------------------------------- */
template<typename MatType> template<typename MatType>
......
...@@ -19,12 +19,20 @@ ...@@ -19,12 +19,20 @@
#include "eigenpy/fwd.hpp" #include "eigenpy/fwd.hpp"
#include "eigenpy/deprecated.hh" #include "eigenpy/deprecated.hh"
#if EIGEN_VERSION_AT_LEAST(3,2,0)
#include "eigenpy/ref.hpp" #include "eigenpy/ref.hpp"
#define ENABLE_SPECIFIC_MATRIX_TYPE(TYPE) \ #define ENABLE_SPECIFIC_MATRIX_TYPE(TYPE) \
enableEigenPySpecific<TYPE>(); \ enableEigenPySpecific<TYPE>(); \
enableEigenPySpecific< eigenpy::Ref<TYPE> >(); enableEigenPySpecific< eigenpy::Ref<TYPE> >();
#else
#define ENABLE_SPECIFIC_MATRIX_TYPE(TYPE) \
enableEigenPySpecific<TYPE>();
#endif
namespace eigenpy namespace eigenpy
{ {
/* Enable Eigen-Numpy serialization for a set of standard MatrixBase instance. */ /* Enable Eigen-Numpy serialization for a set of standard MatrixBase instance. */
......
/* /*
* Copyright 2017, Justin Carpentier, LAAS-CNRS * Copyright 2017-2018, Justin Carpentier, LAAS-CNRS
* *
* This file is part of eigenpy. * This file is part of eigenpy.
* eigenpy is free software: you can redistribute it and/or * eigenpy is free software: you can redistribute it and/or
...@@ -14,12 +14,16 @@ ...@@ -14,12 +14,16 @@
* with eigenpy. If not, see <http://www.gnu.org/licenses/>. * with eigenpy. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include <Eigen/Core>
#if EIGEN_VERSION_AT_LEAST(3,2,0)
#include "eigenpy/solvers/preconditioners.hpp" #include "eigenpy/solvers/preconditioners.hpp"
#include "eigenpy/solvers/BasicPreconditioners.hpp" #include "eigenpy/solvers/BasicPreconditioners.hpp"
//#include "eigenpy/solvers/BFGSPreconditioners.hpp" //#include "eigenpy/solvers/BFGSPreconditioners.hpp"
namespace eigenpy namespace eigenpy
{ {
void exposePreconditioners() void exposePreconditioners()
{ {
using namespace Eigen; using namespace Eigen;
...@@ -32,4 +36,8 @@ namespace eigenpy ...@@ -32,4 +36,8 @@ namespace eigenpy
// LimitedBFGSPreconditionerBaseVisitor< LimitedBFGSPreconditioner<double,Eigen::Dynamic,Eigen::Upper|Eigen::Lower> >::expose("LimitedBFGSPreconditioner"); // LimitedBFGSPreconditionerBaseVisitor< LimitedBFGSPreconditioner<double,Eigen::Dynamic,Eigen::Upper|Eigen::Lower> >::expose("LimitedBFGSPreconditioner");
} }
} // namespace eigenpy } // namespace eigenpy
#endif
/* /*
* Copyright 2017, Justin Carpentier, LAAS-CNRS * Copyright 2017-2018, Justin Carpentier, LAAS-CNRS
* *
* This file is part of eigenpy. * This file is part of eigenpy.
* eigenpy is free software: you can redistribute it and/or * eigenpy is free software: you can redistribute it and/or
...@@ -14,6 +14,10 @@ ...@@ -14,6 +14,10 @@
* with eigenpy. If not, see <http://www.gnu.org/licenses/>. * with eigenpy. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include <Eigen/Core>
#if EIGEN_VERSION_AT_LEAST(3,2,0)
#include "eigenpy/solvers/solvers.hpp" #include "eigenpy/solvers/solvers.hpp"
#include "eigenpy/solvers/ConjugateGradient.hpp" #include "eigenpy/solvers/ConjugateGradient.hpp"
...@@ -43,3 +47,6 @@ namespace eigenpy ...@@ -43,3 +47,6 @@ namespace eigenpy
; ;
} }
} // namespace eigenpy } // namespace eigenpy
#endif
...@@ -40,5 +40,7 @@ ADD_CUSTOM_TARGET(check COMMAND ${CMAKE_CTEST_COMMAND}) ...@@ -40,5 +40,7 @@ ADD_CUSTOM_TARGET(check COMMAND ${CMAKE_CTEST_COMMAND})
ADD_LIB_UNIT_TEST(matrix "eigen3") ADD_LIB_UNIT_TEST(matrix "eigen3")
ADD_LIB_UNIT_TEST(geometry "eigen3") ADD_LIB_UNIT_TEST(geometry "eigen3")
ADD_LIB_UNIT_TEST(ref "eigen3") IF(NOT ${EIGEN3_VERSION} VERSION_LESS "3.2.0")
ADD_LIB_UNIT_TEST(ref "eigen3")
ENDIF()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment